diff --git a/build-package.sh b/build-package.sh index dce89e2c5..3fb03dd9d 100755 --- a/build-package.sh +++ b/build-package.sh @@ -110,7 +110,7 @@ termux_setup_ninja() { # Utility function to setup a current meson build system. termux_setup_meson() { termux_setup_ninja - local MESON_VERSION=0.44.0 + local MESON_VERSION=0.45.1 local MESON_FOLDER=$TERMUX_COMMON_CACHEDIR/meson-$MESON_VERSION-v1 if [ ! -d "$MESON_FOLDER" ]; then local MESON_TAR_NAME=meson-$MESON_VERSION.tar.gz @@ -119,10 +119,8 @@ termux_setup_meson() { termux_download \ https://github.com/mesonbuild/meson/releases/download/$MESON_VERSION/meson-$MESON_VERSION.tar.gz \ $MESON_TAR_FILE \ - 50f9b12b77272ef6ab064d26b7e06667f07fa9f931e6a20942bba2216ba4281b + 4d0bb0dbb1bb556cb7a4092fdfea3d6e76606bd739a4bc97481c2d7bc6200afb tar xf "$MESON_TAR_FILE" -C "$TERMUX_PKG_TMPDIR" - cd $MESON_TMP_FOLDER - patch -p1 < $TERMUX_SCRIPTDIR/scripts/meson-android.patch mv $MESON_TMP_FOLDER $MESON_FOLDER fi TERMUX_MESON="$MESON_FOLDER/meson.py" diff --git a/scripts/meson-android.patch b/scripts/meson-android.patch deleted file mode 100644 index 71ff5d439..000000000 --- a/scripts/meson-android.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff -u -r /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/build.py ./mesonbuild/build.py ---- /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-21 20:32:18.294784968 +0100 -@@ -22,7 +22,7 @@ - from .mesonlib import File, MesonException, listify, extract_as_list - from .mesonlib import typeslistify, stringlistify, classify_unity_sources - from .mesonlib import get_filenames_templates_dict, substitute_values --from .mesonlib import for_windows, for_darwin, for_cygwin -+from .mesonlib import for_windows, for_darwin, for_cygwin, for_android - from .compilers import is_object, clike_langs, sort_clike, lang_suffixes - - known_basic_kwargs = {'install': True, -@@ -1278,6 +1278,7 @@ - if not hasattr(self, 'suffix'): - self.suffix = None - self.basic_filename_tpl = '{0.prefix}{0.name}.{0.suffix}' -+ self.is_cross = is_cross - self.determine_filenames(is_cross, environment) - - def determine_filenames(self, is_cross, env): -@@ -1380,25 +1381,26 @@ - - def process_kwargs(self, kwargs, environment): - super().process_kwargs(kwargs, environment) -- # Shared library version -- if 'version' in kwargs: -- self.ltversion = kwargs['version'] -- if not isinstance(self.ltversion, str): -- raise InvalidArguments('Shared library version needs to be a string, not ' + type(self.ltversion).__name__) -- if not re.fullmatch(r'[0-9]+(\.[0-9]+){0,2}', self.ltversion): -- raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion)) -- # Try to extract/deduce the soversion -- if 'soversion' in kwargs: -- self.soversion = kwargs['soversion'] -- if isinstance(self.soversion, int): -- self.soversion = str(self.soversion) -- if not isinstance(self.soversion, str): -- raise InvalidArguments('Shared library soversion is not a string or integer.') -- elif self.ltversion: -- # library version is defined, get the soversion from that -- # We replicate what Autotools does here and take the first -- # number of the version by default. -- self.soversion = self.ltversion.split('.')[0] -+ if not for_android(self.is_cross, environment): -+ # Shared library version -+ if 'version' in kwargs: -+ self.ltversion = kwargs['version'] -+ if not isinstance(self.ltversion, str): -+ raise InvalidArguments('Shared library version needs to be a string, not ' + type(self.ltversion).__name__) -+ if not re.fullmatch(r'[0-9]+(\.[0-9]+){0,2}', self.ltversion): -+ raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion)) -+ # Try to extract/deduce the soversion -+ if 'soversion' in kwargs: -+ self.soversion = kwargs['soversion'] -+ if isinstance(self.soversion, int): -+ self.soversion = str(self.soversion) -+ if not isinstance(self.soversion, str): -+ raise InvalidArguments('Shared library soversion is not a string or integer.') -+ elif self.ltversion: -+ # library version is defined, get the soversion from that -+ # We replicate what Autotools does here and take the first -+ # number of the version by default. -+ self.soversion = self.ltversion.split('.')[0] - # Visual Studio module-definitions file - if 'vs_module_defs' in kwargs: - path = kwargs['vs_module_defs'] -diff -u -r /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/mesonlib.py ./mesonbuild/mesonlib.py ---- /home/fornwall/.termux-build/json-glib/tmp/meson-0.44.0/mesonbuild/mesonlib.py 2017-12-10 14:37:19.000000000 +0100 -+++ ./mesonbuild/mesonlib.py 2018-01-21 20:33:57.597610548 +0100 -@@ -245,6 +245,12 @@ - def is_haiku(): - return platform.system().lower() == 'haiku' - -+def is_android(): -+ import sysconfig -+ # Taken from Lib/test/support/__init__.py of the python source: -+ _ANDROID_API_LEVEL = sysconfig.get_config_var('ANDROID_API_LEVEL') -+ return _ANDROID_API_LEVEL is not None and _ANDROID_API_LEVEL > 0 -+ - def is_windows(): - platname = platform.system().lower() - 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?