From 63ebd5954f01c259d2a4b4dfb90e4ddcd1694fed Mon Sep 17 00:00:00 2001 From: Andrew Sun Date: Sun, 26 Aug 2018 01:33:16 -0400 Subject: [PATCH] meson: udpate to 0.47.2 (#4312) --- ...on-Windows-when-executing-gtkdoc-sca.patch | 71 ------------------- ...allation-only-try-to-find-python-wit.patch | 40 ----------- mingw-w64-meson/PKGBUILD | 30 ++++---- mingw-w64-meson/test.patch | 13 ++++ 4 files changed, 25 insertions(+), 129 deletions(-) delete mode 100644 mingw-w64-meson/0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch delete mode 100644 mingw-w64-meson/0001-python.find_installation-only-try-to-find-python-wit.patch create mode 100644 mingw-w64-meson/test.patch diff --git a/mingw-w64-meson/0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch b/mingw-w64-meson/0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch deleted file mode 100644 index bd547c3b92..0000000000 --- a/mingw-w64-meson/0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch +++ /dev/null @@ -1,71 +0,0 @@ -From ffa283e5fd2713d2defbefe38b7f9ea75f12655b Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sat, 4 Aug 2018 10:04:10 +0200 -Subject: [PATCH] gtkdoc: set PATH on Windows when executing gtkdoc-scangobj. - Fixes #3307 - -The code was adding the library paths to LD_LIBRARY_PATH, but that -doesn't work on Windows where they need to be added to PATH instead. - -Move the environ handling into gtkdoc_run_check() and add paths to PATH -instead of LD_LIBRARY_PATH when on Windows. - -This fixes the gtk-doc build for glib on Windows -(in case glib isn't installed already) ---- - mesonbuild/scripts/gtkdochelper.py | 23 +++++++++++++++-------- - 1 file changed, 15 insertions(+), 8 deletions(-) - -diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py -index 371d95d6..bf3d9f6a 100644 ---- a/mesonbuild/scripts/gtkdochelper.py -+++ b/mesonbuild/scripts/gtkdochelper.py -@@ -17,7 +17,7 @@ import subprocess - import shlex - import shutil - import argparse --from ..mesonlib import MesonException, Popen_safe -+from ..mesonlib import MesonException, Popen_safe, is_windows - from . import destdir_join - - parser = argparse.ArgumentParser() -@@ -47,10 +47,20 @@ parser.add_argument('--mode', dest='mode', default='') - parser.add_argument('--installdir', dest='install_dir') - parser.add_argument('--run', dest='run', default='') - --def gtkdoc_run_check(cmd, cwd, library_path=None): -+def gtkdoc_run_check(cmd, cwd, library_paths=None): -+ if library_paths is None: -+ library_paths = [] -+ - env = dict(os.environ) -- if library_path: -- env['LD_LIBRARY_PATH'] = library_path -+ if is_windows(): -+ if 'PATH' in env: -+ library_paths.extend(env['PATH'].split(os.pathsep)) -+ env['PATH'] = os.pathsep.join(library_paths) -+ else: -+ if 'LD_LIBRARY_PATH' in env: -+ library_paths.extend(env['LD_LIBRARY_PATH'].split(os.pathsep)) -+ env['LD_LIBRARY_PATH'] = os.pathsep.join(library_paths) -+ - # Put stderr into stdout since we want to print it out anyway. - # This preserves the order of messages. - p, out = Popen_safe(cmd, cwd=cwd, env=env, stderr=subprocess.STDOUT)[0:2] -@@ -137,11 +147,8 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, - for ldflag in shlex.split(ldflags): - if ldflag.startswith('-Wl,-rpath,'): - library_paths.append(ldflag[11:]) -- if 'LD_LIBRARY_PATH' in os.environ: -- library_paths.append(os.environ['LD_LIBRARY_PATH']) -- library_path = ':'.join(library_paths) - -- gtkdoc_run_check(scanobjs_cmd, build_root, library_path) -+ gtkdoc_run_check(scanobjs_cmd, build_root, library_paths) - - # Make docbook files - if mode == 'auto': --- -2.18.0 - diff --git a/mingw-w64-meson/0001-python.find_installation-only-try-to-find-python-wit.patch b/mingw-w64-meson/0001-python.find_installation-only-try-to-find-python-wit.patch deleted file mode 100644 index d2a2548cdb..0000000000 --- a/mingw-w64-meson/0001-python.find_installation-only-try-to-find-python-wit.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 6b9fdfe67b88f37310e7455997ef2664bf88e58f Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Thu, 19 Jul 2018 09:15:30 +0200 -Subject: [PATCH 08/20] python.find_installation: only try to find python with - the py launcher if it isn't in PATH - -Meson tries to find the interpreter path through the "py" launcher on Windows in all -cases which breaks if meson is run under MSYS2 and an official CPython is installed as well. -MSYS2 Python doesn't install a py launcher which results in meson finding the system one instead -even though python2/python3 is in PATH. - -Always check if the interpreter name is in PATH before falling back to checking the py launcher. ---- - mesonbuild/modules/python.py | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py -index 9a90fe96..1195d8a9 100644 ---- a/mesonbuild/modules/python.py -+++ b/mesonbuild/modules/python.py -@@ -470,11 +470,14 @@ class PythonModule(ExtensionModule): - mlog.log("Using meson's python {}".format(mesonlib.python_command)) - python = ExternalProgram('python3', mesonlib.python_command, silent=True) - else: -- if mesonlib.is_windows(): -+ python = ExternalProgram(name_or_path, silent = True) -+ -+ if not python.found() and mesonlib.is_windows(): - pythonpath = self._get_win_pythonpath(name_or_path) - if pythonpath is not None: - name_or_path = pythonpath -- python = ExternalProgram(name_or_path, silent = True) -+ python = ExternalProgram(name_or_path, silent = True) -+ - # Last ditch effort, python2 or python3 can be named python - # on various platforms, let's not give up just yet, if an executable - # named python is available and has a compatible version, let's use --- -2.18.0 - diff --git a/mingw-w64-meson/PKGBUILD b/mingw-w64-meson/PKGBUILD index f1f7fd315b..a20bdc5be2 100644 --- a/mingw-w64-meson/PKGBUILD +++ b/mingw-w64-meson/PKGBUILD @@ -3,8 +3,8 @@ _realname=meson pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=0.47.1 -pkgrel=3 +pkgver=0.47.2 +pkgrel=1 pkgdesc="High-productivity build system (mingw-w64)" arch=('any') url="http://mesonbuild.com/" @@ -12,22 +12,18 @@ license=("Apache 2") options=('strip' 'staticlibs') depends=("${MINGW_PACKAGE_PREFIX}-python3" "${MINGW_PACKAGE_PREFIX}-ninja") -source=(https://github.com/mesonbuild/${_realname}/releases/download/${pkgver}/${_realname}-${pkgver}.tar.gz +source=("https://github.com/mesonbuild/${_realname}/releases/download/${pkgver}/${_realname}-${pkgver}.tar.gz" 'color-term.patch' '0001-Install-scripts-without-.py-extension.patch' '0002-Default-to-sys.prefix-as-the-default-prefix.patch' '0003-Strip-the-prefix-from-all-paths-when-installing-with.patch' - '0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch' - '0001-python.find_installation-only-try-to-find-python-wit.patch' - ) -sha256sums=('d673de79f7bab064190a5ea06140eaa8415efb386d0121ba549f6d66c555ada6' + 'test.patch') +sha256sums=('92d8afd921751261e36151643464efd3394162f69efbe8cd53e0a66b1cf395eb' 'edec6de6f5fa60f0737fdb25a3ac276a0187a6f961544289e5472bcb4194e954' '2c3fbb9d3f367d97e7262dc2991a2ef36eb06a7af08227b9e525049471d968c5' '4ef1e6fb0e9bd927b4646e416631b8a0a9aece763d259dbba58168bcba93f673' '2093c617cf3146a4cea601e7c73400d8ec5fd52ac5cf642c4f5af2d6493b1cb1' - '3ef4159951e0b4e6fa0434b7203437c3c535893af43e3c45838524ba5d953b6b' - '37aeb73747343d0a4c9ca872ae510e1fac653bf63ba9668229c5dfe0525d9b10' - ) + '512ca8fb13d81387da878458bae89638354fcb8a423dbbf3cd2ec7e43feff503') prepare() { cd "${srcdir}/${_realname}-${pkgver}" @@ -37,22 +33,20 @@ prepare() { patch -Np1 -i "${srcdir}"/0001-Install-scripts-without-.py-extension.patch patch -Np1 -i "${srcdir}"/0002-Default-to-sys.prefix-as-the-default-prefix.patch patch -Np1 -i "${srcdir}"/0003-Strip-the-prefix-from-all-paths-when-installing-with.patch - - # https://github.com/mesonbuild/meson/issues/3307 - patch -Np1 -i "${srcdir}"/0001-gtkdoc-set-PATH-on-Windows-when-executing-gtkdoc-sca.patch - - # https://github.com/mesonbuild/meson/pull/3910 - patch -Np1 -i "${srcdir}"/0001-python.find_installation-only-try-to-find-python-wit.patch + + # https://github.com/mesonbuild/meson/issues/4083 + patch -Np1 -i "${srcdir}"/test.patch } build() { - cd "${srcdir}/${_realname}-${pkgver}" + [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} + cp -rf "${srcdir}"/${_realname}-${pkgver}/. "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} ${MINGW_PREFIX}/bin/python3 setup.py build } package() { - cd "${srcdir}/${_realname}-${pkgver}" + cd "${srcdir}"/build-${CARCH} MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ ${MINGW_PREFIX}/bin/python3 setup.py \ diff --git a/mingw-w64-meson/test.patch b/mingw-w64-meson/test.patch new file mode 100644 index 0000000000..d820626565 --- /dev/null +++ b/mingw-w64-meson/test.patch @@ -0,0 +1,13 @@ +diff --git i/run_unittests.py w/run_unittests.py +index 28264606..7c267e17 100755 +--- i/run_unittests.py ++++ w/run_unittests.py +@@ -3441,7 +3441,7 @@ class LinuxlikeTests(BasePlatformTests): + break + self.assertIsInstance(docbook_target, dict) + ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0] +- self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + ifile) ++ self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile)) + + def test_build_rpath(self): + if is_cygwin():