Add tinyalsa package for android.
authorDaniel G <giri@nwrk.biz>
Thu, 31 Jan 2019 22:09:20 +0000 (23:09 +0100)
committerDaniel G <giri@nwrk.biz>
Thu, 31 Jan 2019 22:09:20 +0000 (23:09 +0100)
_template/packages/tinyalsa1.0.2/.gitignore [new file with mode: 0644]
_template/packages/tinyalsa1.0.2/Makefile [new file with mode: 0644]
_template/packages/tinyalsa1.0.2/tinyalsa-1.0.2.zip [new file with mode: 0644]

diff --git a/_template/packages/tinyalsa1.0.2/.gitignore b/_template/packages/tinyalsa1.0.2/.gitignore
new file mode 100644 (file)
index 0000000..6db796c
--- /dev/null
@@ -0,0 +1,7 @@
+# Ignore everything
+/*
+
+# But not these files...
+!.gitignore
+!tinyalsa-1.0.2.zip
+!Makefile
\ No newline at end of file
diff --git a/_template/packages/tinyalsa1.0.2/Makefile b/_template/packages/tinyalsa1.0.2/Makefile
new file mode 100644 (file)
index 0000000..8c321ee
--- /dev/null
@@ -0,0 +1,38 @@
+############################################################################
+# Workfile: Makefile
+# Author: Daniel Giritzer, S1810567004 (daniel@giritzer.eu)
+# Date: 03.12.2018
+# Description: Universal Makefile for Unix based Operating Systems
+# For Linux please use libao of your distribution!
+############################################################################
+WORKDIR = $(shell pwd)
+
+# Add android ndk toolchain
+ANDROID_NDK_HOME=/usr/lib/android-ndk
+export PATH := $(ANDROID_NDK_HOME)/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:$(PATH)
+
+all: unpack android_arm
+
+.PHONY: unpack
+unpack:
+       unzip -o tinyalsa-1.0.2.zip
+
+
+.PHONY: android_arm
+android_arm:
+       cd $(WORKDIR)/tinyalsa-1.0.2; \
+       export CFLAGS='--sysroot=$(ANDROID_NDK_HOME)/platforms/android-23/arch-arm'; \
+       sed -i -e 's/export CROSS_COMPILE =/export CROSS_COMPILE = arm-linux-androideabi-/g' Makefile; \
+       sed -i -e 's/CROSS_COMPILE =/CROSS_COMPILE = arm-linux-androideabi-/g' src/Makefile; \
+       cd $(WORKDIR)/tinyalsa-1.0.2/src; \
+       make -j4 -i
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       mv $(WORKDIR)/tinyalsa-1.0.2/include/tinyalsa $(WORKDIR)/../../include/alsa
+       mv $(WORKDIR)/tinyalsa-1.0.2/include/sound $(WORKDIR)/../../include/sound
+       cp -rf $(WORKDIR)/tinyalsa-1.0.2/src/*.a $(WORKDIR)/../../lib/android_arm
+
+
+.PHONY: clean
+clean:
+       rm -rf $(WORKDIR)/tinyalsa-1.0.2
diff --git a/_template/packages/tinyalsa1.0.2/tinyalsa-1.0.2.zip b/_template/packages/tinyalsa1.0.2/tinyalsa-1.0.2.zip
new file mode 100644 (file)
index 0000000..4322efb
Binary files /dev/null and b/_template/packages/tinyalsa1.0.2/tinyalsa-1.0.2.zip differ