From 09859c306a2721aefb9a6f6f53cb15f67f03efe8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 17 Jun 2022 22:23:45 +0200 Subject: [PATCH] - meson: move target to package dir --- make/host-tools.mk | 24 --------------- package/meson/meson.mk | 30 +++++++++++++++++++ ...tic-libs-when-default-library-static.patch | 10 ++++--- ...dencies-base.py-add-pkg_config_stati.patch | 26 ++++++++-------- 4 files changed, 50 insertions(+), 40 deletions(-) create mode 100644 package/meson/meson.mk diff --git a/make/host-tools.mk b/make/host-tools.mk index 197b172c..d815283a 100644 --- a/make/host-tools.mk +++ b/make/host-tools.mk @@ -34,30 +34,6 @@ $(PKG_CONFIG): $(PKG_CONFIG_DEPENDENCIES) | $(HOST_DIR) # ----------------------------------------------------------------------------- -HOST_MESON_VERSION = 0.56.0 -HOST_MESON_DIR = meson-$(HOST_MESON_VERSION) -HOST_MESON_SOURCE = meson-$(HOST_MESON_VERSION).tar.gz -HOST_MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(HOST_MESON_VERSION) - -$(DL_DIR)/$(HOST_MESON_SOURCE): - $(download) $(HOST_MESON_SITE)/$(HOST_MESON_SOURCE) - -HOST_MESON_DEPENDENCIES = host-ninja host-python3 host-python3-setuptools - -HOST_MESON = $(HOST_DIR)/bin/meson - -host-meson: $(HOST_MESON_DEPENDENCIES) $(DL_DIR)/$(HOST_MESON_SOURCE) | $(HOST_DIR) - $(REMOVE)/$(HOST_MESON_DIR) - $(UNTAR)/$(HOST_MESON_SOURCE) - $(call APPLY_PATCHES,$(PKG_PATCHES_DIR)) - $(CHDIR)/$(HOST_MESON_DIR); \ - $(HOST_PYTHON_BUILD); \ - $(HOST_PYTHON_INSTALL) - $(REMOVE)/$(HOST_MESON_DIR) - $(TOUCH) - -# ----------------------------------------------------------------------------- - # helper target to create ccache links ifndef CCACHE diff --git a/package/meson/meson.mk b/package/meson/meson.mk new file mode 100644 index 00000000..4ff7be25 --- /dev/null +++ b/package/meson/meson.mk @@ -0,0 +1,30 @@ +################################################################################ +# +# meson +# +################################################################################ + +MESON_VERSION = 0.62.2 +MESON_DIR = meson-$(MESON_VERSION) +MESON_SOURCE = meson-$(MESON_VERSION).tar.gz +MESON_SITE = https://github.com/mesonbuild/meson/releases/download/$(MESON_VERSION) + +# ----------------------------------------------------------------------------- + +HOST_MESON_VERSION = $(MESON_VERSION) +HOST_MESON_DIR = $(MESON_DIR) +HOST_MESON_SOURCE = $(MESON_SOURCE) +HOST_MESON_SITE = $(MESON_SITE) + +HOST_MESON_DEPENDENCIES = host-ninja host-python3 host-python-setuptools + +HOST_MESON = $(HOST_DIR)/bin/meson + +# Avoid interpreter shebang longer than 128 chars +define HOST_MESON_SET_INTERPRETER + $(SED) '1s:.*:#!/usr/bin/env python3:' $(HOST_DIR)/bin/meson +endef +HOST_MESON_HOST_FINALIZE_HOOKS += HOST_MESON_SET_INTERPRETER + +host-meson: | $(HOST_DIR) + $(call host-python3-package) diff --git a/package/meson/patches/0001-Prefer-ext-static-libs-when-default-library-static.patch b/package/meson/patches/0001-Prefer-ext-static-libs-when-default-library-static.patch index 26399158..9cedcd09 100644 --- a/package/meson/patches/0001-Prefer-ext-static-libs-when-default-library-static.patch +++ b/package/meson/patches/0001-Prefer-ext-static-libs-when-default-library-static.patch @@ -1,4 +1,4 @@ -From ea85465e608178080c3b4d51af9765a8c7c0dae3 Mon Sep 17 00:00:00 2001 +From c1359a49b61016031287d62f44a363cb76242c91 Mon Sep 17 00:00:00 2001 From: Matt Weber Date: Sat, 26 Oct 2019 09:17:29 -0500 Subject: [PATCH] Prefer ext static libs when --default-library=static @@ -22,19 +22,21 @@ http://autobuild.buildroot.net/results/db1740b4777f436324218c52bc7b08e5c21b667d/ http://autobuild.buildroot.net/results/c17/c17bbb12d9deadd64a441b36e324cfbbe8aba5be/ Signed-off-by: Matthew Weber +[Updated for 0.57.1 - get_builtin_option() vs. get_option(OptionKey())] +Signed-off-by: Peter Seiderer --- mesonbuild/compilers/mixins/clike.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py -index 47e97d261..729c98acc 100644 +index 09ad837b1..b7f6b9f22 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py -@@ -940,6 +940,9 @@ class CLikeCompiler: +@@ -978,6 +978,9 @@ class CLikeCompiler(Compiler): elif env.machines[self.for_machine].is_cygwin(): shlibext = ['dll', 'dll.a'] prefixes = ['cyg'] + prefixes -+ elif env.coredata.get_builtin_option('default_library') == 'static': ++ elif env.coredata.get_option(OptionKey('default_library')) == 'static': + # Linux/BSDs + shlibext = ['a'] else: diff --git a/package/meson/patches/0002-mesonbuild-dependencies-base.py-add-pkg_config_stati.patch b/package/meson/patches/0002-mesonbuild-dependencies-base.py-add-pkg_config_stati.patch index eda17cad..8e15d321 100644 --- a/package/meson/patches/0002-mesonbuild-dependencies-base.py-add-pkg_config_stati.patch +++ b/package/meson/patches/0002-mesonbuild-dependencies-base.py-add-pkg_config_stati.patch @@ -1,4 +1,4 @@ -From 8622d37587169c1e4a4206a9462868ede057f0e8 Mon Sep 17 00:00:00 2001 +From 3d6a2db2270346236dd6247e0648ea0c949ba468 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sat, 15 Feb 2020 15:13:59 +0100 Subject: [PATCH] mesonbuild/dependencies/base.py: add pkg_config_static @@ -18,24 +18,26 @@ Fixes: Signed-off-by: Fabrice Fontaine [Romain: Fix if condition, pkg_config_static is a string not a boolean] Signed-off-by: Romain Naour +[Rebased on 0.57.1] +Signed-off-by: Peter Seiderer --- - mesonbuild/dependencies/base.py | 3 ++- + mesonbuild/dependencies/pkgconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py -index 23701da95..83e51626d 100644 ---- a/mesonbuild/dependencies/base.py -+++ b/mesonbuild/dependencies/base.py -@@ -849,7 +849,8 @@ class PkgConfigDependency(ExternalDependency): - def _set_libs(self): +diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py +index 1e8d9132e..d902ba215 100644 +--- a/mesonbuild/dependencies/pkgconfig.py ++++ b/mesonbuild/dependencies/pkgconfig.py +@@ -338,7 +338,8 @@ class PkgConfigDependency(ExternalDependency): env = None - libcmd = [self.name, '--libs'] + libcmd = ['--libs'] + - if self.static: + if self.static or \ -+ (self.env.properties[self.for_machine].get('pkg_config_static', None) == 'true'): ++ (self.env.properties[self.for_machine].get('pkg_config_static', None) == 'true'): libcmd.append('--static') - # Force pkg-config to output -L fields even if they are system - # paths so we can do manual searching with cc.find_library() later. + + libcmd.append(self.name) -- 2.25.1