Added nanox compatible allegro library.
authorDaniel G <giri@nwrk.biz>
Sun, 27 Jan 2019 03:38:46 +0000 (04:38 +0100)
committerDaniel G <giri@nwrk.biz>
Sun, 27 Jan 2019 03:38:46 +0000 (04:38 +0100)
_template/packages/allegro5.1.13/.gitignore [new file with mode: 0644]
_template/packages/allegro5.1.13/Makefile [new file with mode: 0644]
_template/packages/allegro5.1.13/allegro-5.1.13.1.tar.gz [new file with mode: 0644]
_template/packages/allegro5.1.13/setenv.sh [new file with mode: 0755]

diff --git a/_template/packages/allegro5.1.13/.gitignore b/_template/packages/allegro5.1.13/.gitignore
new file mode 100644 (file)
index 0000000..7ec1593
--- /dev/null
@@ -0,0 +1,8 @@
+# Ignore everything
+*
+
+# But not these files...
+!.gitignore
+!allegro-5.1.13.1.tar.gz
+!Makefile
+!setenv.sh
\ No newline at end of file
diff --git a/_template/packages/allegro5.1.13/Makefile b/_template/packages/allegro5.1.13/Makefile
new file mode 100644 (file)
index 0000000..759e37c
--- /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.1.13.1.tar.gz
+       sed -i -e 's/if(NOT ANDROID_TOOL)/if(ANDROID_TOOL)/g' $(WORKDIR)/allegro-5.1.13.1/cmake/AndroidApp.cmake
+
+.PHONY: android_arm
+android_arm:
+       cd $(WORKDIR)/allegro-5.1.13.1; \
+       set -e; \
+       . $(WORKDIR)/setenv.sh && \
+       mkdir -p ./buildandroid; \
+       cd ./buildandroid; \
+       cmake ..  -DANDROID_NDK_TOOLCHAIN_ROOT=../android_toolchain -DWANT_ANDROID=on -DCMAKE_BUILD_TYPE=Release -DANDROID_TARGET=android-23 -DARM_TARGETS=armeabi-v7a -DSHARED=false -DWANT_MONOLITH=ON -DWANT_EXAMPLES=false -DWANT_DEMO=false  -DWANT_TESTS=false; \
+       make -j4 -i 
+       mkdir -p $(WORKDIR)/../../include
+       mkdir -p $(WORKDIR)/../../lib/android_arm
+       mkdir -p $(WORKDIR)/../../lib/android_arm/liballeg
+       cp -rf $(WORKDIR)/allegro-5.1.13.1/include/* $(WORKDIR)/../../include
+       cp -rf $(WORKDIR)/allegro-5.1.13.1/android/allegro_activity/src/* $(WORKDIR)/../../lib/android_arm/liballeg
+       cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/include/* $(WORKDIR)/../../include
+       rename "s/_monolith-static//g" $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.a
+       cp -rf $(WORKDIR)/allegro-5.1.13.1/buildandroid/lib/*.a $(WORKDIR)/../../lib/android_arm
+
+.PHONY: clean
+clean:
+       rm -rf allegro-5.1.13.1
diff --git a/_template/packages/allegro5.1.13/allegro-5.1.13.1.tar.gz b/_template/packages/allegro5.1.13/allegro-5.1.13.1.tar.gz
new file mode 100644 (file)
index 0000000..f76ce62
Binary files /dev/null and b/_template/packages/allegro5.1.13/allegro-5.1.13.1.tar.gz differ
diff --git a/_template/packages/allegro5.1.13/setenv.sh b/_template/packages/allegro5.1.13/setenv.sh
new file mode 100755 (executable)
index 0000000..ba0aa86
--- /dev/null
@@ -0,0 +1,15 @@
+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=23 --install-dir=$WORKDIR/android_toolchain --stl=stlport --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_SDK_HOME=/usr/lib/android-sdk/
+export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
+export ANDROID_NDK_TOOLCHAIN_ROOT=$WORKDIR/android_toolchain/
+
+# expand path
+export PATH=$PATH:$ANDROID_NDK_HOME
+export PATH=$PATH:$ANDROID_SDK_HOME/tools
+export PATH=$PATH:$ANDROID_NDK_TOOLCHAIN_ROOT/bin