aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-08-24 16:15:29 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-24 16:16:44 +0200
commitc0575ce526689a738faee92446e85398db9637ca (patch)
tree1b6f0b645d678177f3ffcb9377c2a5a35434a31d /testing
parent4cc004f1af71175b04fc537ac13dbe3f5a9d018e (diff)
downloadaports-c0575ce526689a738faee92446e85398db9637ca.tar.bz2
aports-c0575ce526689a738faee92446e85398db9637ca.tar.xz
testing/android-tools: build emulators
Diffstat (limited to 'testing')
-rw-r--r--testing/android-tools/APKBUILD43
-rw-r--r--testing/android-tools/qemu-musl-native64.patch120
2 files changed, 157 insertions, 6 deletions
diff --git a/testing/android-tools/APKBUILD b/testing/android-tools/APKBUILD
index ef82ad9676..a3517441a0 100644
--- a/testing/android-tools/APKBUILD
+++ b/testing/android-tools/APKBUILD
@@ -18,8 +18,12 @@ source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-core-$_realver.tar.
http://dev.alpinelinux.org/archive/$pkgname/$pkgname-libselinux-$_realver.tar.gz
http://dev.alpinelinux.org/archive/$pkgname/$pkgname-f2fs-tools-$_realver.tar.gz
http://dev.alpinelinux.org/archive/$pkgname/$pkgname-sdk-$_realver.tar.gz
+ http://dev.alpinelinux.org/archive/$pkgname/$pkgname-qemu-$_realver.tar.gz
- Makefile"
+ Makefile
+
+ qemu-musl-native64.patch
+ "
_giturl="https://android.googlesource.com/platform"
_gittag="android-$_realver"
@@ -28,7 +32,7 @@ snapshot() {
mkdir -p "$srcdir" && cd "$srcdir"
local r=
- for r in system/core system/extras external/libselinux external/f2fs-tools sdk; do
+ for r in system/core system/extras external/libselinux external/f2fs-tools sdk external/qemu; do
local n="${r##*/}.git"
local f=$pkgname-"${r##*/}"
@@ -47,15 +51,36 @@ prepare() {
cd "$srcdir"
sed -e 's/f2fs_sparse_file = NULL/f2fs_sparse_file = 0/g' \
-i extras/f2fs_utils/f2fs_utils.c || return 1
+
+ cd "$srcdir"/qemu
+ patch -p1 -i "$srcdir"/qemu-musl-native64.patch || return 1
}
build() {
make -C "$srcdir"
+
+ cd "$srcdir"/qemu
+ _bits=32
+ case "$CARCH" in
+ x86_64) _bits=64;;
+ esac
+ USE_CCACHE=0 \
+ ./android-configure.sh --ignore-audio \
+ --gles-dir=../sdk/emulator/opengl \
+ --no-tests \
+ --no-strip \
+ || return 1
+ make objs/emulator \
+ objs/emulator$_bits-x86 \
+ objs/emulator$_bits-arm \
+ || return 1
+
}
package() {
make DESTDIR="$pkgdir" \
- -C "$srcdir" install
+ -C "$srcdir" install || return 1
+ install "$srcdir"/qemu/objs/emulator* "$pkgdir"/usr/bin/
}
md5sums="872508bf26b5e3cb04aa73d4ba558d9d android-tools-core-5.1.1_r13.tar.gz
@@ -63,16 +88,22 @@ c1451c39af87f6e59330f222f69e143f android-tools-extras-5.1.1_r13.tar.gz
e6eb1bb16898e4ef2000f0dab4e921bd android-tools-libselinux-5.1.1_r13.tar.gz
9087604b3553d1e6f5070f72b9299ec5 android-tools-f2fs-tools-5.1.1_r13.tar.gz
0c538db4ae36aa390ac79cab95b7f809 android-tools-sdk-5.1.1_r13.tar.gz
-19d59c9442ed7c1882dafa652f815e79 Makefile"
+70f246cfa59f0f23cc04cb9b5ae220d4 android-tools-qemu-5.1.1_r13.tar.gz
+19d59c9442ed7c1882dafa652f815e79 Makefile
+ff6851515388a1c35c563f530c0ddeb6 qemu-musl-native64.patch"
sha256sums="d3ce45dafe5d5388ad6092186753c5482993a81995fb44ffb24bbe756f996c9e android-tools-core-5.1.1_r13.tar.gz
08487b9009067dba2ccd436330873350b9a556fe0a19bd191468e145f99fd14c android-tools-extras-5.1.1_r13.tar.gz
d010434fe8dffe7e7bd649c3b071fd21676b17b861457055637451d3fdb418bb android-tools-libselinux-5.1.1_r13.tar.gz
f9a4c9747bbebbdde5b712e9aac644d8af2b1c8ab2ef340c22824c3e64fa3f49 android-tools-f2fs-tools-5.1.1_r13.tar.gz
839ad231559e09ce3e95472ab2fcb009f331d24a7c2ee5acbd54333085c49604 android-tools-sdk-5.1.1_r13.tar.gz
-d8b2fca4acf93525ba70779651f8b5ceddf4955299c80c4842cfe05a7facc4d8 Makefile"
+858c2fb9b414025ba0eb2f7144273557df91303e6b7cc3a7a00ddbce0499cafb android-tools-qemu-5.1.1_r13.tar.gz
+d8b2fca4acf93525ba70779651f8b5ceddf4955299c80c4842cfe05a7facc4d8 Makefile
+1d82e9784945f2efa12aa4b103968eb541388998ac1086aa10b9346cb964b8b3 qemu-musl-native64.patch"
sha512sums="46081c68fb9907ac454ffbb6d9c783eec31a112b9a87d0fd77f6b5cba3b1b6ccc1f9c05b05699d0fe3f6fb82e71900ecf5b4813fdae393f02ff518c5a7500ad6 android-tools-core-5.1.1_r13.tar.gz
318a8ea0dc9b956d329405eb807d61972579ea04ec1692ea0b1c7f273339a14353f52f15b4f5f5e61357fee1cf010ddee116ef8b6428a76de8c4adbba23900a1 android-tools-extras-5.1.1_r13.tar.gz
2f301ebbe079eff510df3312b6d63bdd6e456c0e418f6a94a6718f5560f94c402851dcf5edfda71315570fd6a8fcd6306d8c640a74ee36efb39e73318e8d570f android-tools-libselinux-5.1.1_r13.tar.gz
9bc54d777f4ead1878e389932f1b60027b146a6a1afa78f187e20dd473826b8a02dbadaced87ef3f764941712f99c81e8113cc6e5cb1f0e7975c7af747d7c3aa android-tools-f2fs-tools-5.1.1_r13.tar.gz
5e9c0c2a5e6e5d0255813722a1d9db0eb9350a21942c03071cd925c193df9cae46bb9a657e4f6a29ebc86dacc1c5d10784bca1d1d842ebf3b3c8310d378c2ef2 android-tools-sdk-5.1.1_r13.tar.gz
-0868206cbfb60b57a134354b541de93ec3bbef51d87e3b4bda7ecd01a6e94ef3f5bc323c49a6fb6eb2560beec8744c2cabd969ec968bc2b774a1b64f291f5d05 Makefile"
+6c04937b67fa6ecd42f58c368364550d625900a7c052fb5b523099db29a793d08a25d82881b45a73a38326586226d7850ff6bf5d32d35cd56a1b6ad1f88fdefc android-tools-qemu-5.1.1_r13.tar.gz
+0868206cbfb60b57a134354b541de93ec3bbef51d87e3b4bda7ecd01a6e94ef3f5bc323c49a6fb6eb2560beec8744c2cabd969ec968bc2b774a1b64f291f5d05 Makefile
+36cffb12dfb659ff78dc42b2affa3af866b1ce21d3449730463bf744df3129d412cfa548626f376b0c091a911317e88aa5bbe89732b28c03202854f98f1d1624 qemu-musl-native64.patch"
diff --git a/testing/android-tools/qemu-musl-native64.patch b/testing/android-tools/qemu-musl-native64.patch
new file mode 100644
index 0000000000..1733281cd1
--- /dev/null
+++ b/testing/android-tools/qemu-musl-native64.patch
@@ -0,0 +1,120 @@
+diff --git a/Makefile.android b/Makefile.android
+index 600be7c..4ca77b8 100644
+--- a/Makefile.android
++++ b/Makefile.android
+@@ -236,7 +236,7 @@ start-emulator-library = \
+ $(eval LOCAL_NO_DEFAULT_COMPILER_FLAGS := true) \
+ $(eval LOCAL_MODULE := $1) \
+ $(eval LOCAL_MODULE_CLASS := STATIC_LIBRARIES) \
+- $(eval LOCAL_MODULE_BITS := 32)
++ $(eval LOCAL_MODULE_BITS := 64)
+
+ start-emulator64-library = \
+ $(call start-emulator-library, $1) \
+@@ -286,11 +286,9 @@ LOCAL_LDLIBS := \
+
+ # Ensure only one of -m32 or -m64 is being used and place it first.
+ LOCAL_CFLAGS := \
+- -m$$(LOCAL_MODULE_BITS) \
+ $$(filter-out -m32 -m64, $$(LOCAL_CFLAGS))
+
+ LOCAL_LDFLAGS := \
+- -m$$(LOCAL_MODULE_BITS) \
+ $$(filter-out -m32 -m64, $$(LOCAL_LDFLAGS))
+
+ endef
+@@ -399,7 +397,7 @@ endif
+
+ $(call end-emulator-program)
+
+-include $(LOCAL_PATH)/Makefile.tests
++#include $(LOCAL_PATH)/Makefile.tests
+
+ ##############################################################################
+ ##############################################################################
+diff --git a/Makefile.target b/Makefile.target
+index e68de28..cb14321 100644
+--- a/Makefile.target
++++ b/Makefile.target
+@@ -164,7 +164,8 @@ common_LOCAL_SRC_FILES += \
+ ##############################################################################
+ # CPU-specific emulation.
+ #
+-common_LOCAL_CFLAGS += -fno-PIC -fomit-frame-pointer -Wno-sign-compare
++#common_LOCAL_CFLAGS += -fno-PIC -fomit-frame-pointer -Wno-sign-compare
++common_LOCAL_CFLAGS += -fomit-frame-pointer -Wno-sign-compare
+
+ ifeq ($(HOST_ARCH),ppc)
+ common_LOCAL_CFLAGS += -D__powerpc__
+diff --git a/android-configure.sh b/android-configure.sh
+index 42fe51d..a248c97 100755
+--- a/android-configure.sh
++++ b/android-configure.sh
+@@ -143,7 +143,7 @@ fi
+
+ # By default, generate 32-bit binaries, the Makefile have targets that
+ # generate 64-bit ones by using -m64 on the command-line.
+-force_32bit_binaries
++#force_32bit_binaries
+
+ case $OS in
+ linux-*)
+diff --git a/android/config/linux-x86_64/SDL_config.h b/android/config/linux-x86_64/SDL_config.h
+index 529beb0..ba3dbed 100644
+--- a/android/config/linux-x86_64/SDL_config.h
++++ b/android/config/linux-x86_64/SDL_config.h
+@@ -105,7 +105,7 @@
+
+ /* Enable various threading systems */
+ #define SDL_THREAD_PTHREAD 1
+-#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
++#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
+
+ /* Enable various timer systems */
+ #define SDL_TIMER_UNIX 1
+diff --git a/android/emulation/CpuAccelerator.cpp b/android/emulation/CpuAccelerator.cpp
+index be0175e..d79ba99 100644
+--- a/android/emulation/CpuAccelerator.cpp
++++ b/android/emulation/CpuAccelerator.cpp
+@@ -74,6 +74,15 @@ GlobalState gGlobals = { false, false, CPU_ACCELERATOR_NONE, { '\0' } };
+ /////////////////////////////////////////////////////////////////////////
+
+ #if HAVE_KVM
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++ typeof (exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == ((typeof (exp)) -1) && errno == EINTR); \
++ _rc; })
++#endif
++
+
+ #include <linux/kvm.h>
+
+diff --git a/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h b/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h
+index f9c7df3..56ce2c8 100644
+--- a/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h
++++ b/distrib/sdl-1.2.15/src/video/x11/SDL_x11sym.h
+@@ -175,7 +175,7 @@ SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return)
+ */
+ #ifdef LONG64
+ SDL_X11_MODULE(IO_32BIT)
+-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
++//SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
+ #endif
+
+diff --git a/target-i386/kvm-gs-restore.c b/target-i386/kvm-gs-restore.c
+index 2ca6ab6..04db82e 100644
+--- a/target-i386/kvm-gs-restore.c
++++ b/target-i386/kvm-gs-restore.c
+@@ -35,7 +35,7 @@ static void check_and_restore_gs(void)
+ struct sigact_status
+ {
+ unsigned int sigaction:1;
+- __sighandler_t old_handler;
++ sighandler_t old_handler;
+ void (*old_sigaction) (int, siginfo_t *, void *);
+ };
+ static struct sigact_status o_sigact[SIGUNUSED];