Added allegro package which tries to use debian android SDK.
authorDaniel G <giri@nwrk.biz>
Tue, 22 Jan 2019 17:28:01 +0000 (18:28 +0100)
committerDaniel G <giri@nwrk.biz>
Tue, 22 Jan 2019 17:28:01 +0000 (18:28 +0100)
_template/packages/allegro/.gitignore [new file with mode: 0644]
_template/packages/allegro/Makefile [new file with mode: 0644]
_template/packages/allegro/allegro-5.2.4.0.tar.gz [new file with mode: 0644]
_template/packages/allegro/setenv.sh [new file with mode: 0755]

diff --git a/_template/packages/allegro/.gitignore b/_template/packages/allegro/.gitignore
new file mode 100644 (file)
index 0000000..206bc80
--- /dev/null
@@ -0,0 +1,8 @@
+# Ignore everything
+*
+
+# But not these files...
+!.gitignore
+!allegro-5.2.4.0.tar.gz
+!Makefile
+!setenv.sh
\ No newline at end of file
diff --git a/_template/packages/allegro/Makefile b/_template/packages/allegro/Makefile
new file mode 100644 (file)
index 0000000..a94d9f6
--- /dev/null
@@ -0,0 +1,36 @@
+############################################################################
+# Workfile: Makefile
+# Author: Daniel Giritzer, S1810567004 (daniel@giritzer.eu)
+# Date: 03.12.2018
+# Description: Universal Makefile for Unix based Operating Systems
+############################################################################
+WORKDIR = $(shell pwd)
+
+all: unpack android_arm
+
+.PHONY: unpack
+unpack:
+       tar xvzf allegro-5.2.4.0.tar.gz
+       find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e '/compileSdkVersion.*/a buildToolsVersion "24.0.0"' {} \;
+       find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e 's/compileSdkVersion.*/compileSdkVersion 23/g' {} \;
+       find $(WORKDIR)/allegro-5.2.4.0 -name build.gradle -exec sed -i -e 's/targetSdkVersion.*/targetSdkVersion 23/g' {} \;
+       sed -i -e 's/classpath "com.android.tools.build:gradle:.*/classpath "com.android.tools.build:gradle:debian"/g' $(WORKDIR)/allegro-5.2.4.0/android/gradle_project/build.gradle
+       sed -i -e '/google()/a maven { url "file:\/\/\/usr\/share\/maven-repo" }' $(WORKDIR)/allegro-5.2.4.0/android/gradle_project/build.gradle
+
+.PHONY: android_arm
+android_arm:
+       cd $(WORKDIR)/allegro-5.2.4.0; \
+       set -e; \
+       . $(WORKDIR)/setenv.sh && \
+       mkdir -p ./buildandroid; \
+       cd ./buildandroid; \
+       cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-android.cmake -DCMAKE_BUILD_TYPE=Debug -DANDROID_TARGET=android-15 -DARM_TARGETS=armeabi-v7a; \
+       make -j4
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/sndfile.h $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/libsndfile-1.0.28/src/.libs/libsndfile.a $(WORKDIR)/../../lib/android_arm
+
+.PHONY: clean
+clean:
+       rm -rf allegro-5.2.4.0
diff --git a/_template/packages/allegro/allegro-5.2.4.0.tar.gz b/_template/packages/allegro/allegro-5.2.4.0.tar.gz
new file mode 100644 (file)
index 0000000..bff5046
Binary files /dev/null and b/_template/packages/allegro/allegro-5.2.4.0.tar.gz differ
diff --git a/_template/packages/allegro/setenv.sh b/_template/packages/allegro/setenv.sh
new file mode 100755 (executable)
index 0000000..096d92f
--- /dev/null
@@ -0,0 +1,8 @@
+WORKDIR=$(pwd)
+git clone https://github.com/mherod/android-sdk-licenses.git
+sudo cp -a $WORKDIR/android-sdk-licenses/*-license /usr/lib/android-sdk/licenses
+/usr/lib/android-ndk/build/tools/make_standalone_toolchain.py --api=15 --install-dir=$WORKDIR/android_toolchain --arch=arm
+export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
+export ANDROID_HOME=/usr/lib/android-sdk/
+export ANDROID_NDK_HOME=/usr/lib/android-ndk/
+export ANDROID_NDK_TOOLCHAIN_ROOT=$WORKDIR/android_toolchain/