meson: fix non-default Python sandboxed builds with py-cython Since Meson is not Python versioned, but Cython is, we previously ended up with a situation where builds of Cython-using packages would fail. Instead of the Makefile kludge where it would simply force the default Python version associated with Cython, use a different hack that will search for all (presently) possible versions. This is not an ideal solution, but is being committed to fix build breakage in the lead up to branching pkgsrc 2023Q3. Other solutions would be to go back to Python versioned Meson, or getting Meson to handle multi-Python environments more cleanly.diff -r1.56 -r1.57 pkgsrc/devel/meson/Makefile
(gutteridge)
@@ -1,52 +1,42 @@ | @@ -1,52 +1,42 @@ | |||
1 | # $NetBSD: Makefile,v 1.56 2023/09/21 01:44:06 gutteridge Exp $ | 1 | # $NetBSD: Makefile,v 1.57 2023/09/24 18:54:06 gutteridge Exp $ | |
2 | 2 | |||
3 | DISTNAME= meson-1.2.1 | 3 | DISTNAME= meson-1.2.1 | |
4 | PKGREVISION= 2 | 4 | PKGREVISION= 3 | |
5 | CATEGORIES= devel python | 5 | CATEGORIES= devel python | |
6 | MASTER_SITES= ${MASTER_SITE_PYPI:=m/meson/} | 6 | MASTER_SITES= ${MASTER_SITE_PYPI:=m/meson/} | |
7 | 7 | |||
8 | MAINTAINER= pkgsrc-users@NetBSD.org | 8 | MAINTAINER= pkgsrc-users@NetBSD.org | |
9 | HOMEPAGE= https://mesonbuild.com/ | 9 | HOMEPAGE= https://mesonbuild.com/ | |
10 | COMMENT= Open source build system meant to be fast and user friendly | 10 | COMMENT= Open source build system meant to be fast and user friendly | |
11 | LICENSE= apache-2.0 | 11 | LICENSE= apache-2.0 | |
12 | 12 | |||
13 | CONFLICTS= ${PYPKGPREFIX}-meson-[0-9]* | 13 | CONFLICTS= ${PYPKGPREFIX}-meson-[0-9]* | |
14 | SUPERSEDES= ${PYPKGPREFIX}-meson-[0-9]* | 14 | SUPERSEDES= ${PYPKGPREFIX}-meson-[0-9]* | |
15 | 15 | |||
16 | DEPENDS+= ninja-build>=1.7:../../devel/ninja-build | 16 | DEPENDS+= ninja-build>=1.7:../../devel/ninja-build | |
17 | 17 | |||
18 | PYTHON_VERSIONS_INCOMPATIBLE= 27 | 18 | PYTHON_VERSIONS_INCOMPATIBLE= 27 | |
19 | 19 | |||
20 | USE_PKG_RESOURCES= yes | 20 | USE_PKG_RESOURCES= yes | |
21 | 21 | |||
22 | USE_LANGUAGES= c c++ # c++ for tests | 22 | USE_LANGUAGES= c c++ # c++ for tests | |
23 | 23 | |||
24 | SUBST_CLASSES+= man | 24 | SUBST_CLASSES+= man | |
25 | SUBST_SED.man+= -e "s,share/man,${PKGMANDIR}," | 25 | SUBST_SED.man+= -e "s,share/man,${PKGMANDIR}," | |
26 | SUBST_FILES.man+= setup.py | 26 | SUBST_FILES.man+= setup.py | |
27 | SUBST_STAGE.man= pre-configure | 27 | SUBST_STAGE.man= pre-configure | |
28 | SUBST_MESSAGE.man= Fixing man page installation path. | 28 | SUBST_MESSAGE.man= Fixing man page installation path. | |
29 | 29 | |||
30 | # XXX this isn't an entirely correct approach, as this package is not | |||
31 | # Python-versioned, while py-cython is. This means in bulk builds, any | |||
32 | # Python packages that use meson and cython will fail with a mismatch | |||
33 | # for non-default Python versions, e.g., py-pandas and py-scipy. | |||
34 | SUBST_CLASSES+= cython | |||
35 | SUBST_STAGE.cython= pre-configure | |||
36 | SUBST_MESSAGE.cython= Fixing cython binary name. | |||
37 | SUBST_FILES.cython= mesonbuild/compilers/detect.py | |||
38 | SUBST_SED.cython= -e "s,'cython3','cython-${PYVERSSUFFIX}'," | |||
39 | ||||
40 | REPLACE_PYTHON+= ghwt.py | 30 | REPLACE_PYTHON+= ghwt.py | |
41 | REPLACE_PYTHON+= meson.py | 31 | REPLACE_PYTHON+= meson.py | |
42 | REPLACE_PYTHON+= mesonbuild/rewriter.py | 32 | REPLACE_PYTHON+= mesonbuild/rewriter.py | |
43 | REPLACE_PYTHON+= mesonbuild/cmake/data/run_ctgt.py | 33 | REPLACE_PYTHON+= mesonbuild/cmake/data/run_ctgt.py | |
44 | REPLACE_PYTHON+= run_*.py | 34 | REPLACE_PYTHON+= run_*.py | |
45 | REPLACE_PYTHON+= test\ cases/*/*/*.py | 35 | REPLACE_PYTHON+= test\ cases/*/*/*.py | |
46 | REPLACE_PYTHON+= test\ cases/*/*/*/*.py | 36 | REPLACE_PYTHON+= test\ cases/*/*/*/*.py | |
47 | REPLACE_PYTHON+= test\ cases/*/*/*/*/*.py | 37 | REPLACE_PYTHON+= test\ cases/*/*/*/*/*.py | |
48 | REPLACE_PYTHON+= test\ cases/common/14\ configure\ file/test.py.in | 38 | REPLACE_PYTHON+= test\ cases/common/14\ configure\ file/test.py.in | |
49 | REPLACE_PYTHON+= test\ cases/common/187\ find\ override/subdir/gencodegen.py.in | 39 | REPLACE_PYTHON+= test\ cases/common/187\ find\ override/subdir/gencodegen.py.in | |
50 | REPLACE_PYTHON+= test\ cases/common/54\ run\ target/configure.in | 40 | REPLACE_PYTHON+= test\ cases/common/54\ run\ target/configure.in | |
51 | REPLACE_PYTHON+= test\ cases/windows/8\ find\ program/test-script | 41 | REPLACE_PYTHON+= test\ cases/windows/8\ find\ program/test-script | |
52 | REPLACE_PYTHON+= tools/*.py | 42 | REPLACE_PYTHON+= tools/*.py |
@@ -1,11 +1,11 @@ | @@ -1,11 +1,11 @@ | |||
1 | $NetBSD: distinfo,v 1.49 2023/08/08 21:34:11 adam Exp $ | 1 | $NetBSD: distinfo,v 1.50 2023/09/24 18:54:06 gutteridge Exp $ | |
2 | 2 | |||
3 | BLAKE2s (meson-1.2.1.tar.gz) = cb57477f193d3151058dc9cbaae4c1e8bdf7c7efd21a241360bad4e1860f9d67 | 3 | BLAKE2s (meson-1.2.1.tar.gz) = cb57477f193d3151058dc9cbaae4c1e8bdf7c7efd21a241360bad4e1860f9d67 | |
4 | SHA512 (meson-1.2.1.tar.gz) = 6221a14a6046aaba2c6eb601a9a5b928308bbd9da813ccec16b8f7578296b27d741e30e9343723770c3c7825c86b53193b41b9672dd17468d06d3b8d743bf52e | 4 | SHA512 (meson-1.2.1.tar.gz) = 6221a14a6046aaba2c6eb601a9a5b928308bbd9da813ccec16b8f7578296b27d741e30e9343723770c3c7825c86b53193b41b9672dd17468d06d3b8d743bf52e | |
5 | Size (meson-1.2.1.tar.gz) = 2182126 bytes | 5 | Size (meson-1.2.1.tar.gz) = 2182126 bytes | |
6 | SHA1 (patch-mesonbuild_compilers_detect.py) = 44b3a70a127824808c8a05226a546988c6a1339f | 6 | SHA1 (patch-mesonbuild_compilers_detect.py) = 378283e53e61e93af15dbf0b0fb9e9bda198fd82 | |
7 | SHA1 (patch-mesonbuild_compilers_mixins_gnu.py) = 34c2f6f215d5aed1d6c422187f733d0d488ebb4f | 7 | SHA1 (patch-mesonbuild_compilers_mixins_gnu.py) = 34c2f6f215d5aed1d6c422187f733d0d488ebb4f | |
8 | SHA1 (patch-mesonbuild_dependencies_dev.py) = 2165f1ee4ad5d9689eb2fb7e94841503336070b9 | 8 | SHA1 (patch-mesonbuild_dependencies_dev.py) = 2165f1ee4ad5d9689eb2fb7e94841503336070b9 | |
9 | SHA1 (patch-mesonbuild_linkers_linkers.py) = 4ca793f71aac2119f94464bb2beb83ed3da3e9a0 | 9 | SHA1 (patch-mesonbuild_linkers_linkers.py) = 4ca793f71aac2119f94464bb2beb83ed3da3e9a0 | |
10 | SHA1 (patch-mesonbuild_modules_pkgconfig.py) = 9ff9b4d5106b9db26850ad7592fe0bddb89dd043 | 10 | SHA1 (patch-mesonbuild_modules_pkgconfig.py) = 9ff9b4d5106b9db26850ad7592fe0bddb89dd043 | |
11 | SHA1 (patch-mesonbuild_scripts_depfixer.py) = 0abd3326f7872e4d53006ff3de5716007c8f22b7 | 11 | SHA1 (patch-mesonbuild_scripts_depfixer.py) = 0abd3326f7872e4d53006ff3de5716007c8f22b7 |
@@ -1,34 +1,45 @@ | @@ -1,34 +1,45 @@ | |||
1 | $NetBSD: patch-mesonbuild_compilers_detect.py,v 1.3 2022/08/15 08:19:39 adam Exp $ | 1 | $NetBSD: patch-mesonbuild_compilers_detect.py,v 1.4 2023/09/24 18:54:06 gutteridge Exp $ | |
2 | 2 | |||
3 | Specify c++ language when making CXX parse standard input. | 3 | Specify c++ language when making CXX parse standard input. | |
4 | Fixes problem where graphics/MesaLib fails to build due to: | 4 | Fixes problem where graphics/MesaLib fails to build due to: | |
5 | 5 | |||
6 | > clang++ -std=c++14 -dM -E - | 6 | > clang++ -std=c++14 -dM -E - | |
7 | > error: invalid argument '-std=c++14' not allowed with 'C' | 7 | > error: invalid argument '-std=c++14' not allowed with 'C' | |
8 | 8 | |||
9 | --- mesonbuild/compilers/detect.py.orig 2022-08-13 08:48:46.000000000 +0000 | 9 | Also account for multiple versions of cython in pkgsrc. | |
10 | ||||
11 | --- mesonbuild/compilers/detect.py.orig 2023-07-21 20:36:13.000000000 +0000 | |||
10 | +++ mesonbuild/compilers/detect.py | 12 | +++ mesonbuild/compilers/detect.py | |
11 | @@ -1231,7 +1231,10 @@ def _get_gnu_compiler_defines(compiler: | 13 | @@ -80,7 +80,7 @@ defaults['cuda'] = ['nvcc'] | |
14 | defaults['rust'] = ['rustc'] | |||
15 | defaults['swift'] = ['swiftc'] | |||
16 | defaults['vala'] = ['valac'] | |||
17 | -defaults['cython'] = ['cython', 'cython3'] # Official name is cython, but Debian renamed it to cython3. | |||
18 | +defaults['cython'] = ['cython', 'cython-3.11', 'cython-3.10', 'cython-3.9', 'cython-3.8'] # Handle pkgsrc multi-versions. | |||
19 | defaults['static_linker'] = ['ar', 'gar'] | |||
20 | defaults['strip'] = ['strip'] | |||
21 | defaults['vs_static_linker'] = ['lib'] | |||
22 | @@ -1318,7 +1318,10 @@ def _get_gnu_compiler_defines(compiler: | |||
12 | """ | 23 | """ | |
13 | # Arguments to output compiler pre-processor defines to stdout | 24 | # Arguments to output compiler pre-processor defines to stdout | |
14 | # gcc, g++, and gfortran all support these arguments | 25 | # gcc, g++, and gfortran all support these arguments | |
15 | - args = compiler + ['-E', '-dM', '-'] | 26 | - args = compiler + ['-E', '-dM', '-'] | |
16 | + args = compiler + ['-E', '-dM'] | 27 | + args = compiler + ['-E', '-dM'] | |
17 | + if compiler[0].endswith('++'): | 28 | + if compiler[0].endswith('++'): | |
18 | + args += ['-x', 'c++'] | 29 | + args += ['-x', 'c++'] | |
19 | + args += ['-'] | 30 | + args += ['-'] | |
20 | mlog.debug(f'Running command: {join_args(args)}') | 31 | mlog.debug(f'Running command: {join_args(args)}') | |
21 | p, output, error = Popen_safe(args, write='', stdin=subprocess.PIPE) | 32 | p, output, error = Popen_safe(args, write='', stdin=subprocess.PIPE) | |
22 | if p.returncode != 0: | 33 | if p.returncode != 0: | |
23 | @@ -1258,7 +1261,10 @@ def _get_clang_compiler_defines(compiler | 34 | @@ -1345,7 +1348,10 @@ def _get_clang_compiler_defines(compiler | |
24 | """ | 35 | """ | |
25 | Get the list of Clang pre-processor defines | 36 | Get the list of Clang pre-processor defines | |
26 | """ | 37 | """ | |
27 | - args = compiler + ['-E', '-dM', '-'] | 38 | - args = compiler + ['-E', '-dM', '-'] | |
28 | + args = compiler + ['-E', '-dM'] | 39 | + args = compiler + ['-E', '-dM'] | |
29 | + if compiler[0].endswith('++'): | 40 | + if compiler[0].endswith('++'): | |
30 | + args += ['-x', 'c++'] | 41 | + args += ['-x', 'c++'] | |
31 | + args += ['-'] | 42 | + args += ['-'] | |
32 | mlog.debug(f'Running command: {join_args(args)}') | 43 | mlog.debug(f'Running command: {join_args(args)}') | |
33 | p, output, error = Popen_safe(args, write='', stdin=subprocess.PIPE) | 44 | p, output, error = Popen_safe(args, write='', stdin=subprocess.PIPE) | |
34 | if p.returncode != 0: | 45 | if p.returncode != 0: |