Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2019 19:17:20 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r514187 - in head/devel/meson: . files
Message-ID:  <201910091917.x99JHKBn076487@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Oct  9 19:17:20 2019
New Revision: 514187
URL: https://svnweb.freebsd.org/changeset/ports/514187

Log:
  devel/meson: update to 0.52.0
  
  - Update patches [1]
  - Connect tests to the framework
  
  Changes:	https://mesonbuild.com/Release-notes-for-0-52-0.html
  Changes:	https://github.com/mesonbuild/meson/compare/0.51.2...0.52.0
  PR:		241105
  Submitted by:	Ting-Wei Lan [1]
  Exp-run by:	antoine

Added:
  head/devel/meson/files/patch-run__unittests.py   (contents, props changed)
Modified:
  head/devel/meson/Makefile   (contents, props changed)
  head/devel/meson/distinfo   (contents, props changed)
  head/devel/meson/files/patch-mesonbuild_dependencies_base.py   (contents, props changed)

Modified: head/devel/meson/Makefile
==============================================================================
--- head/devel/meson/Makefile	Wed Oct  9 19:17:17 2019	(r514186)
+++ head/devel/meson/Makefile	Wed Oct  9 19:17:20 2019	(r514187)
@@ -2,13 +2,10 @@
 # $FreeBSD$
 
 PORTNAME=	meson
-PORTVERSION=	0.51.2
+PORTVERSION=	0.52.0
 CATEGORIES=	devel python
 MASTER_SITES=	https://github.com/mesonbuild/${PORTNAME}/releases/download/${PORTVERSION}/
 
-PATCH_SITES=	https://github.com/mesonbuild/${PORTNAME}/commit/
-PATCHFILES+=	efea48788ab2.patch:-p1
-
 MAINTAINER=	gnome@FreeBSD.org
 COMMENT=	High performance build system
 
@@ -16,9 +13,24 @@ LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/COPYING
 
 RUN_DEPENDS=	ninja:devel/ninja
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR}
 
-USES=		python:3.5+
+USES=		python:3.5+ shebangfix
 USE_PYTHON=	autoplist distutils noflavors
+SHEBANG_FILES=	mesonbuild/cmake/data/run_ctgt.py
 NO_ARCH=	yes
+
+# https://github.com/mesonbuild/meson/issues/6016
+TEST_ENV=	${MAKE_ENV:NCC=*:NCXX=*}
+
+# Hide from regular build to avoid accidental dependency on symlinks
+.if make(test)
+# helper_create_binary_wrapper, test_python_module, test cases/*.py
+BINARY_ALIAS+=	python3=${PYTHON_CMD:T} python=${PYTHON_CMD:T}
+do-test: create-binary-alias # force if run late
+.endif
+
+do-test:
+	@(cd ${TEST_WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} ${WRKSRC}/run_unittests.py)
 
 .include <bsd.port.mk>

Modified: head/devel/meson/distinfo
==============================================================================
--- head/devel/meson/distinfo	Wed Oct  9 19:17:17 2019	(r514186)
+++ head/devel/meson/distinfo	Wed Oct  9 19:17:20 2019	(r514187)
@@ -1,5 +1,3 @@
-TIMESTAMP = 1566836953
-SHA256 (meson-0.51.2.tar.gz) = 23688f0fc90be623d98e80e1defeea92bbb7103bf9336a5f5b9865d36e892d76
-SIZE (meson-0.51.2.tar.gz) = 1453251
-SHA256 (efea48788ab2.patch) = eee556fb0cd6cbba5756bbfb508412081743cd813dd10d1b9cbc419769281d39
-SIZE (efea48788ab2.patch) = 953
+TIMESTAMP = 1570381541
+SHA256 (meson-0.52.0.tar.gz) = d60f75f0dedcc4fd249dbc7519d6f3ce6df490033d276ef1cf27453ef4938d32
+SIZE (meson-0.52.0.tar.gz) = 1507110

Modified: head/devel/meson/files/patch-mesonbuild_dependencies_base.py
==============================================================================
--- head/devel/meson/files/patch-mesonbuild_dependencies_base.py	Wed Oct  9 19:17:17 2019	(r514186)
+++ head/devel/meson/files/patch-mesonbuild_dependencies_base.py	Wed Oct  9 19:17:20 2019	(r514187)
@@ -52,31 +52,9 @@ users, without depending on the unreliable part of pkg
 
 Fixes https://github.com/mesonbuild/meson/issues/4271.
 
---- mesonbuild/dependencies/base.py.orig
+--- mesonbuild/dependencies/base.py.orig	2019-10-06 17:01:35 UTC
 +++ mesonbuild/dependencies/base.py
-@@ -706,6 +706,21 @@ def _set_cargs(self):
-                                       (self.name, out))
-         self.compile_args = self._convert_mingw_paths(shlex.split(out))
- 
-+    def _sort_libpaths(self, libpaths, refpaths):
-+        if len(refpaths) == 0:
-+            return list(libpaths)
-+
-+        def key_func(libpath):
-+            common_lengths = []
-+            for refpath in refpaths:
-+                common_path = os.path.commonpath([libpath, refpath])
-+                common_lengths.append(len(common_path))
-+            max_length = max(common_lengths)
-+            max_index = common_lengths.index(max_length)
-+            reversed_max_length = len(refpaths[max_index]) - max_length
-+            return (max_index, reversed_max_length)
-+        return sorted(libpaths, key=key_func)
-+
-     def _search_libs(self, out, out_raw):
-         '''
-         @out: PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs
-@@ -741,6 +756,22 @@ def _search_libs(self, out, out_raw):
+@@ -784,6 +784,22 @@ class PkgConfigDependency(ExternalDependency):
                      # Resolve the path as a compiler in the build directory would
                      path = os.path.join(self.env.get_build_dir(), path)
                  prefix_libpaths.add(path)
@@ -95,7 +73,38 @@ Fixes https://github.com/mesonbuild/meson/issues/4271.
 +        else:
 +            pkg_config_path = []
 +        pkg_config_path = self._convert_mingw_paths(pkg_config_path)
-+        prefix_libpaths = self._sort_libpaths(prefix_libpaths, pkg_config_path)
++        prefix_libpaths = sort_libpaths(prefix_libpaths, pkg_config_path)
          system_libpaths = OrderedSet()
-         full_args = self._convert_mingw_paths(shlex.split(out))
+         full_args = self._convert_mingw_paths(self._split_args(out))
          for arg in full_args:
+@@ -2284,6 +2300,30 @@ def _build_external_dependency_list(name, env: Environ
+                                                 False, None, env, None, kwargs))
+ 
+     return candidates
++
++
++def sort_libpaths(libpaths: List[str], refpaths: List[str]) -> List[str]:
++    """Sort <libpaths> according to <refpaths>
++
++    It is intended to be used to sort -L flags returned by pkg-config.
++    Pkg-config returns flags in random order which cannot be relied on.
++    """
++    if len(refpaths) == 0:
++        return list(libpaths)
++
++    def key_func(libpath):
++        common_lengths = []
++        for refpath in refpaths:
++            try:
++                common_path = os.path.commonpath([libpath, refpath])
++            except ValueError:
++                common_path = ''
++            common_lengths.append(len(common_path))
++        max_length = max(common_lengths)
++        max_index = common_lengths.index(max_length)
++        reversed_max_length = len(refpaths[max_index]) - max_length
++        return (max_index, reversed_max_length)
++    return sorted(libpaths, key=key_func)
+ 
+ 
+ def strip_system_libdirs(environment, for_machine: MachineChoice, link_args):

Added: head/devel/meson/files/patch-run__unittests.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/meson/files/patch-run__unittests.py	Wed Oct  9 19:17:20 2019	(r514187)
@@ -0,0 +1,66 @@
+https://github.com/mesonbuild/meson/pull/4324
+https://github.com/mesonbuild/meson/pull/4325
+https://github.com/mesonbuild/meson/pull/6007
+
+--- run_unittests.py.orig	2019-10-06 17:01:35 UTC
++++ run_unittests.py
+@@ -57,6 +57,7 @@ from mesonbuild.mesonlib import (
+ from mesonbuild.environment import detect_ninja
+ from mesonbuild.mesonlib import MesonException, EnvironmentException
+ from mesonbuild.dependencies import PkgConfigDependency, ExternalProgram
++import mesonbuild.dependencies.base
+ from mesonbuild.build import Target
+ import mesonbuild.modules.pkgconfig
+ 
+@@ -1164,7 +1165,26 @@ class InternalTests(unittest.TestCase):
+             deps = d.get_all_dependencies(target)
+             self.assertEqual(deps, expdeps)
+ 
++    def test_sort_libpaths(self):
++        sort_libpaths = mesonbuild.dependencies.base.sort_libpaths
++        self.assertEqual(sort_libpaths(
++            ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'],
++            ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']),
++            ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'])
++        self.assertEqual(sort_libpaths(
++            ['/usr/local/lib', '/home/mesonuser/.local/lib', '/usr/lib'],
++            ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']),
++            ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'])
++        self.assertEqual(sort_libpaths(
++            ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'],
++            ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/lib/pkgconfig']),
++            ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'])
++        self.assertEqual(sort_libpaths(
++            ['/usr/lib', '/usr/local/lib', '/home/mesonuser/.local/lib'],
++            ['/home/mesonuser/.local/lib/pkgconfig', '/usr/local/libdata/pkgconfig']),
++            ['/home/mesonuser/.local/lib', '/usr/local/lib', '/usr/lib'])
+ 
++
+ @unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release')
+ class DataTests(unittest.TestCase):
+ 
+@@ -5643,6 +5664,7 @@ class LinuxlikeTests(BasePlatformTests):
+                 # Assert that
+                 self.assertEqual(len(line.split(lib)), 2, msg=(lib, line))
+ 
++    @skipIfNoPkgconfig
+     def test_noncross_options(self):
+         # C_std defined in project options must be in effect also when native compiling.
+         testdir = os.path.join(self.unit_test_dir, '51 noncross options')
+@@ -5665,6 +5687,7 @@ c = ['{0}']
+         # TODO should someday be explicit about build platform only here
+         self.init(testdir, override_envvars=env)
+ 
++    @skipIfNoPkgconfig
+     def test_static_link(self):
+         if is_cygwin():
+             raise unittest.SkipTest("Cygwin doesn't support LD_LIBRARY_PATH.")
+@@ -5680,7 +5703,7 @@ c = ['{0}']
+         # Test that installed libraries works
+         self.new_builddir()
+         self.prefix = oldprefix
+-        meson_args = ['-Dc_link_args=-L{}'.format(libdir),
++        meson_args = ['-Dc_link_args=-L{} -Wl,-rpath,{}'.format(libdir, libdir),
+                       '--fatal-meson-warnings']
+         testdir = os.path.join(self.unit_test_dir, '69 static link')
+         env = {'PKG_CONFIG_LIBDIR': os.path.join(libdir, 'pkgconfig')}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910091917.x99JHKBn076487>