diff --git a/devel/meson/Makefile b/devel/meson/Makefile new file mode 100644 index 00000000..7cff7735 --- /dev/null +++ b/devel/meson/Makefile @@ -0,0 +1,16 @@ +# Created by: Ting-Wei Lan + +PORTNAME= meson +PORTVERSION= 0.58.1 +CATEGORIES= devel python +MASTER_SITES= https://github.com/mesonbuild/${PORTNAME}/releases/download/${PORTVERSION}/ + +MAINTAINER= desktop@FreeBSD.org +COMMENT= High performance build system + +USES= ninja python:3.6+ shebangfix +USE_PYTHON= autoplist distutils noflavors +SHEBANG_FILES= mesonbuild/rewriter.py mesonbuild/scripts/cmake_run_ctgt.py +NO_ARCH= yes + +.include diff --git a/devel/meson/distinfo b/devel/meson/distinfo new file mode 100644 index 00000000..583e5bcb --- /dev/null +++ b/devel/meson/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1623087375 +SHA256 (meson-0.58.1.tar.gz) = 3144a3da662fcf79f1e5602fa929f2821cba4eba28c2c923fe0a7d3e3db04d5d +SIZE (meson-0.58.1.tar.gz) = 1896205 diff --git a/devel/meson/files/patch-mesonbuild_backend_backends.py b/devel/meson/files/patch-mesonbuild_backend_backends.py new file mode 100644 index 00000000..4adb3d82 --- /dev/null +++ b/devel/meson/files/patch-mesonbuild_backend_backends.py @@ -0,0 +1,40 @@ +https://github.com/mesonbuild/meson/pull/4324 + +From 068f0b3bc7becab6762ada45ecdd5dc601ee2473 Mon Sep 17 00:00:00 2001 +From: Ting-Wei Lan +Date: Thu, 4 Oct 2018 23:03:30 +0800 +Subject: [PATCH] backends: Use raw_link_args to check for the need of RPATH + +Function rpaths_for_bundled_shared_libraries assumes it needs RPATH when +linking arguments of an external dependency has exactly one argument and +the only argument is an absolute path to a library file. This was mostly +fine because almost all .pc files use a -L -l pair instead of the full +path of the library, which means pkg-config dependencies almost always +have at least two arguments. However, there are patches landed in the +meson 0.47 cycle which convert -L -l pair returned by pkg-config to the +absolute path of library. If the output of pkg-config includes exactly +one -L argument and one -l argument, it will be converted to exactly one +absolute path by meson and rpaths_for_bundled_shared_libraries will +assume it needs RPATH. Since meson passes both -rpath and -rpath-link to +the linker and -rpath-link has precedence over LD_LIBRARY_PATH, it +changes the search order of dependent libraries in an unexpected way and +it causes a lot of linking troubles in JHBuild environments on FreeBSD. + +To make the method behave like the old way of using -L -l pairs and +avoid library path order problems, we use raw_link_args instead of +link_args here. raw_link_args stores the unmodified output of pkg-config +and it is much less likely to accidentally match the rule currently used +by the method. + +Works around https://github.com/mesonbuild/meson/issues/4270. +--- mesonbuild/backend/backends.py.orig 2018-09-22 13:22:03 UTC ++++ mesonbuild/backend/backends.py +@@ -371,7 +371,7 @@ class Backend: + for dep in target.external_deps: + if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)): + continue +- la = dep.link_args ++ la = dep.get_link_args(raw=True) + if len(la) != 1 or not os.path.isabs(la[0]): + continue + # The only link argument is an absolute path to a library file. diff --git a/devel/meson/files/patch-run__unittests.py b/devel/meson/files/patch-run__unittests.py new file mode 100644 index 00000000..d1866651 --- /dev/null +++ b/devel/meson/files/patch-run__unittests.py @@ -0,0 +1,13 @@ +https://github.com/mesonbuild/meson/pull/4324 + +--- run_unittests.py.orig 2021-05-02 09:37:39 UTC ++++ run_unittests.py +@@ -7840,7 +7840,7 @@ class LinuxlikeTests(BasePlatformTests): + # Test that installed libraries works + self.new_builddir() + self.prefix = oldprefix +- meson_args = [f'-Dc_link_args=-L{libdir}', ++ meson_args = [f'-Dc_link_args=-L{libdir} -Wl,-rpath,{libdir}', + '--fatal-meson-warnings'] + testdir = os.path.join(self.unit_test_dir, '67 static link') + env = {'PKG_CONFIG_LIBDIR': os.path.join(libdir, 'pkgconfig')} diff --git a/devel/meson/files/patch-setup.py b/devel/meson/files/patch-setup.py new file mode 100644 index 00000000..28d9c4c1 --- /dev/null +++ b/devel/meson/files/patch-setup.py @@ -0,0 +1,11 @@ +--- setup.py.orig 2018-09-22 13:22:03 UTC ++++ setup.py +@@ -38,7 +38,7 @@ packages = ['mesonbuild', + data_files = [] + if sys.platform != 'win32': + # Only useful on UNIX-like systems +- data_files = [('share/man/man1', ['man/meson.1']), ++ data_files = [('man/man1', ['man/meson.1']), + ('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])] + + if __name__ == '__main__': diff --git a/devel/meson/files/patch-x-mesonbuild-modules-pkgconfig.py b/devel/meson/files/patch-x-mesonbuild-modules-pkgconfig.py new file mode 100644 index 00000000..f7e1ed9d --- /dev/null +++ b/devel/meson/files/patch-x-mesonbuild-modules-pkgconfig.py @@ -0,0 +1,11 @@ +--- ./mesonbuild/modules/pkgconfig.py.orig 2021-06-07 19:35:31.000000000 +0200 ++++ ./mesonbuild/modules/pkgconfig.py 2021-07-29 14:56:28.019384000 +0200 +@@ -540,7 +540,7 @@ + pkgroot = kwargs.get('install_dir', default_install_dir) + if pkgroot is None: + if mesonlib.is_freebsd(): +- pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('prefix')), 'libdata', 'pkgconfig') ++ pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('prefix')), 'lib', 'pkgconfig') + else: + pkgroot = os.path.join(state.environment.coredata.get_option(mesonlib.OptionKey('libdir')), 'pkgconfig') + if not isinstance(pkgroot, str): diff --git a/devel/meson/pkg-descr b/devel/meson/pkg-descr new file mode 100644 index 00000000..a2fad5c9 --- /dev/null +++ b/devel/meson/pkg-descr @@ -0,0 +1,9 @@ +Meson is a cross-platform build system designed to be both as fast and as +user friendly as possible. It supports many languages and compilers, including +GCC, Clang and Visual Studio. Its build definitions are written in a simple +non-turing complete DSL. The main design point of Meson is that every moment +a developer spends writing or debugging build definitions is a second wasted. +So is every second spent waiting for the build system to actually start +compiling code. + +WWW: https://mesonbuild.com/