Fix allegro 32Bit/64Bit build
authorDaniel G <giri@nwrk.biz>
Sat, 26 Jan 2019 11:41:07 +0000 (12:41 +0100)
committerDaniel G <giri@nwrk.biz>
Sat, 26 Jan 2019 11:41:07 +0000 (12:41 +0100)
_template/packages/allegro5/.gitignore [new file with mode: 0644]
_template/packages/allegro5/Makefile [new file with mode: 0644]
_template/packages/allegro5/allegro-5.2.4.0.tar.gz [new file with mode: 0644]
_template/packages/allegro5/setenv.sh [new file with mode: 0755]
_template/packages/allegro5/setenv64.sh [new file with mode: 0755]

diff --git a/_template/packages/allegro5/.gitignore b/_template/packages/allegro5/.gitignore
new file mode 100644 (file)
index 0000000..71e2983
--- /dev/null
@@ -0,0 +1,9 @@
+# Ignore everything
+*
+
+# But not these files...
+!.gitignore
+!allegro-5.2.4.0.tar.gz
+!Makefile
+!setenv.sh
+!setenv64.sh
\ No newline at end of file
diff --git a/_template/packages/allegro5/Makefile b/_template/packages/allegro5/Makefile
new file mode 100644 (file)
index 0000000..729c1fe
--- /dev/null
@@ -0,0 +1,54 @@
+############################################################################
+# 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 android_arm64
+
+.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 "25.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:2.3.3"/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=Release -DANDROID_TARGET=android-15 -DARM_TARGETS=armeabi-v7a -DSHARED=false -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
+       make -j6
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/include/* $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid/include/* $(WORKDIR)/../../include
+       rename "s/-static//g" $(WORKDIR)/allegro-5.2.4.0/buildandroid/lib/*.a
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid/lib/*.a $(WORKDIR)/../../lib/android_arm
+
+.PHONY: android_arm64
+android_arm64:
+       cd $(WORKDIR)/allegro-5.2.4.0; \
+       set -e; \
+       . $(WORKDIR)/setenv64.sh && \
+       mkdir -p ./buildandroid64; \
+       cd ./buildandroid64; \
+       cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-android.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_TARGET=android-21 -DARM_TARGETS=arm64-v8a -DSHARED=false  -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
+       make -j6
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm64
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/include/* $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid64/include/* $(WORKDIR)/../../include
+       rename "s/-static//g" $(WORKDIR)/allegro-5.2.4.0/buildandroid64/lib/*.a
+       cp -rf $(WORKDIR)/allegro-5.2.4.0/buildandroid64/lib/*.a $(WORKDIR)/../../lib/android_arm64
+
+.PHONY: clean
+clean:
+       rm -rf allegro-5.2.4.0
diff --git a/_template/packages/allegro5/allegro-5.2.4.0.tar.gz b/_template/packages/allegro5/allegro-5.2.4.0.tar.gz
new file mode 100644 (file)
index 0000000..bff5046
Binary files /dev/null and b/_template/packages/allegro5/allegro-5.2.4.0.tar.gz differ
diff --git a/_template/packages/allegro5/setenv.sh b/_template/packages/allegro5/setenv.sh
new file mode 100755 (executable)
index 0000000..1333ca4
--- /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/
diff --git a/_template/packages/allegro5/setenv64.sh b/_template/packages/allegro5/setenv64.sh
new file mode 100755 (executable)
index 0000000..bccd770
--- /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=21 --install-dir=$WORKDIR/android_toolchain64 --arch=arm64
+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_toolchain64/