Browse Source

Fix meson patch (fixes #2051)

android-5
Fredrik Fornwall 7 years ago
parent
commit
490a9b18c4
  1. 9
      build-package.sh
  2. 52
      scripts/meson-android.patch

9
build-package.sh

@ -111,16 +111,19 @@ termux_setup_ninja() {
termux_setup_meson() { termux_setup_meson() {
termux_setup_ninja termux_setup_ninja
local MESON_VERSION=0.44.0 local MESON_VERSION=0.44.0
local MESON_FOLDER=$TERMUX_COMMON_CACHEDIR/meson-$MESON_VERSION local MESON_FOLDER=$TERMUX_COMMON_CACHEDIR/meson-$MESON_VERSION-v1
if [ ! -d "$MESON_FOLDER" ]; then if [ ! -d "$MESON_FOLDER" ]; then
local MESON_TAR_NAME=meson-$MESON_VERSION.tar.gz local MESON_TAR_NAME=meson-$MESON_VERSION.tar.gz
local MESON_TAR_FILE=$TERMUX_PKG_TMPDIR/$MESON_TAR_NAME local MESON_TAR_FILE=$TERMUX_PKG_TMPDIR/$MESON_TAR_NAME
local MESON_TMP_FOLDER=$TERMUX_PKG_TMPDIR/meson-$MESON_VERSION
termux_download \ termux_download \
https://github.com/mesonbuild/meson/releases/download/$MESON_VERSION/meson-$MESON_VERSION.tar.gz \ https://github.com/mesonbuild/meson/releases/download/$MESON_VERSION/meson-$MESON_VERSION.tar.gz \
$MESON_TAR_FILE \ $MESON_TAR_FILE \
50f9b12b77272ef6ab064d26b7e06667f07fa9f931e6a20942bba2216ba4281b 50f9b12b77272ef6ab064d26b7e06667f07fa9f931e6a20942bba2216ba4281b
tar xf "$MESON_TAR_FILE" -C "$TERMUX_COMMON_CACHEDIR" tar xf "$MESON_TAR_FILE" -C "$TERMUX_PKG_TMPDIR"
(cd $MESON_FOLDER && patch -p1 < $TERMUX_SCRIPTDIR/scripts/meson-android.patch) cd $MESON_TMP_FOLDER
patch -p1 < $TERMUX_SCRIPTDIR/scripts/meson-android.patch
mv $MESON_TMP_FOLDER $MESON_FOLDER
fi fi
TERMUX_MESON="$MESON_FOLDER/meson.py" TERMUX_MESON="$MESON_FOLDER/meson.py"
TERMUX_MESON_CROSSFILE=$TERMUX_COMMON_CACHEDIR/meson-crossfile-$TERMUX_ARCH-v2.txt TERMUX_MESON_CROSSFILE=$TERMUX_COMMON_CACHEDIR/meson-crossfile-$TERMUX_ARCH-v2.txt

52
scripts/meson-android.patch

@ -1,6 +1,6 @@
diff -u -r ../meson-0.44.0/mesonbuild/build.py ./mesonbuild/build.py diff -u -r /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/build.py ./mesonbuild/build.py
--- ../meson-0.44.0/mesonbuild/build.py 2018-01-14 21:22:09.965589742 +0000 --- /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/build.py 2017-12-10 14:37:19.000000000 +0100
+++ ./mesonbuild/build.py 2018-01-14 21:22:24.605417600 +0000 +++ ./mesonbuild/build.py 2018-01-21 20:32:18.294784968 +0100
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
from .mesonlib import File, MesonException, listify, extract_as_list from .mesonlib import File, MesonException, listify, extract_as_list
from .mesonlib import typeslistify, stringlistify, classify_unity_sources from .mesonlib import typeslistify, stringlistify, classify_unity_sources
@ -64,30 +64,9 @@ diff -u -r ../meson-0.44.0/mesonbuild/build.py ./mesonbuild/build.py
# Visual Studio module-definitions file # Visual Studio module-definitions file
if 'vs_module_defs' in kwargs: if 'vs_module_defs' in kwargs:
path = kwargs['vs_module_defs'] path = kwargs['vs_module_defs']
diff -u -r ../meson-0.44.0/mesonbuild/environment.py ./mesonbuild/environment.py diff -u -r /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/mesonlib.py ./mesonbuild/mesonlib.py
--- ../meson-0.44.0/mesonbuild/environment.py 2017-11-26 23:37:45.000000000 +0000 --- /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/mesonlib.py 2017-12-10 14:37:19.000000000 +0100
+++ ./mesonbuild/environment.py 2018-01-14 21:19:33.339431007 +0000 +++ ./mesonbuild/mesonlib.py 2018-01-21 20:33:57.597610548 +0100
@@ -76,6 +76,17 @@
'd': 'DFLAGS',
'vala': 'VALAFLAGS'}
+def for_android(is_cross, env):
+ """
+ Host machine is Android?
+
+ Note: 'host' is the machine on which compiled binaries will run
+ """
+ if not is_cross:
+ return mesonlib.is_android()
+ elif env.cross_info.has_host():
+ return env.cross_info.config['host_machine']['system'] == 'android'
+ return False
def find_coverage_tools():
gcovr_exe = 'gcovr'
diff -u -r ../meson-0.44.0/mesonbuild/mesonlib.py ./mesonbuild/mesonlib.py
--- ../meson-0.44.0/mesonbuild/mesonlib.py 2017-12-10 13:37:19.000000000 +0000
+++ ./mesonbuild/mesonlib.py 2018-01-14 21:19:33.339431007 +0000
@@ -245,6 +245,12 @@ @@ -245,6 +245,12 @@
def is_haiku(): def is_haiku():
return platform.system().lower() == 'haiku' return platform.system().lower() == 'haiku'
@ -101,3 +80,22 @@ diff -u -r ../meson-0.44.0/mesonbuild/mesonlib.py ./mesonbuild/mesonlib.py
def is_windows(): def is_windows():
platname = platform.system().lower() platname = platform.system().lower()
return platname == 'windows' or 'mingw' in platname return platname == 'windows' or 'mingw' in platname
@@ -268,6 +274,18 @@
return env.cross_info.config['host_machine']['system'] == 'windows'
return False
+def for_android(is_cross, env):
+ """
+ Host machine is Android?
+
+ Note: 'host' is the machine on which compiled binaries will run
+ """
+ if not is_cross:
+ return mesonlib.is_android()
+ elif env.cross_info.has_host():
+ return env.cross_info.config['host_machine']['system'] == 'android'
+ return False
+
def for_cygwin(is_cross, env):
"""
Host machine is cygwin?

Loading…
Cancel
Save