mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
meson: 1.5.2 -> 1.6.0
This commit is contained in:
parent
968e5b2ab2
commit
52dc9272a1
@ -1,87 +0,0 @@
|
||||
From a6fb2c165cda4bbf315424c96165ec9cc7052363 Mon Sep 17 00:00:00 2001
|
||||
From: Randy Eckenrode <randy@largeandhighquality.com>
|
||||
Date: Wed, 3 Apr 2024 17:35:56 -0400
|
||||
Subject: [PATCH] dependencies: find extraframeworks on case-sensitive
|
||||
filesystems
|
||||
|
||||
Fixes a test failure on case-sensitive filesystems when a CMake
|
||||
dependency is turned into an Apple framework.
|
||||
---
|
||||
mesonbuild/dependencies/framework.py | 9 +++++++--
|
||||
test cases/osx/11 case sensitive apfs/meson.build | 5 +++++
|
||||
test cases/osx/11 case sensitive apfs/prog.c | 3 +++
|
||||
test cases/osx/11 case sensitive apfs/test.json | 5 +++++
|
||||
4 files changed, 20 insertions(+), 2 deletions(-)
|
||||
create mode 100644 test cases/osx/11 case sensitive apfs/meson.build
|
||||
create mode 100644 test cases/osx/11 case sensitive apfs/prog.c
|
||||
create mode 100644 test cases/osx/11 case sensitive apfs/test.json
|
||||
|
||||
diff --git a/mesonbuild/dependencies/framework.py b/mesonbuild/dependencies/framework.py
|
||||
index 3c880c7430af..1fbd628235ba 100644
|
||||
--- a/mesonbuild/dependencies/framework.py
|
||||
+++ b/mesonbuild/dependencies/framework.py
|
||||
@@ -47,6 +47,7 @@ def detect(self, name: str, paths: T.List[str]) -> None:
|
||||
framework_path = self._get_framework_path(p, name)
|
||||
if framework_path is None:
|
||||
continue
|
||||
+ framework_name = framework_path.stem
|
||||
# We want to prefer the specified paths (in order) over the system
|
||||
# paths since these are "extra" frameworks.
|
||||
# For example, Python2's framework is in /System/Library/Frameworks and
|
||||
@@ -54,11 +55,15 @@ def detect(self, name: str, paths: T.List[str]) -> None:
|
||||
# Python.framework. We need to know for sure that the framework was
|
||||
# found in the path we expect.
|
||||
allow_system = p in self.system_framework_paths
|
||||
- args = self.clib_compiler.find_framework(name, self.env, [p], allow_system)
|
||||
+ args = self.clib_compiler.find_framework(framework_name, self.env, [p], allow_system)
|
||||
if args is None:
|
||||
continue
|
||||
self.link_args = args
|
||||
self.framework_path = framework_path.as_posix()
|
||||
+ # The search is done case-insensitively, so the found name may differ
|
||||
+ # from the one that was requested. Setting the name ensures the correct
|
||||
+ # one is used when linking on case-sensitive filesystems.
|
||||
+ self.name = framework_name
|
||||
self.compile_args = ['-F' + self.framework_path]
|
||||
# We need to also add -I includes to the framework because all
|
||||
# cross-platform projects such as OpenGL, Python, Qt, GStreamer,
|
||||
@@ -74,7 +79,7 @@ def _get_framework_path(self, path: str, name: str) -> T.Optional[Path]:
|
||||
p = Path(path)
|
||||
lname = name.lower()
|
||||
for d in p.glob('*.framework/'):
|
||||
- if lname == d.name.rsplit('.', 1)[0].lower():
|
||||
+ if lname == d.stem.lower():
|
||||
return d
|
||||
return None
|
||||
|
||||
diff --git a/test cases/osx/11 case sensitive apfs/meson.build b/test cases/osx/11 case sensitive apfs/meson.build
|
||||
new file mode 100644
|
||||
index 000000000000..dd566b185f28
|
||||
--- /dev/null
|
||||
+++ b/test cases/osx/11 case sensitive apfs/meson.build
|
||||
@@ -0,0 +1,5 @@
|
||||
+project('case-sensitive APFS with extra frameworks test', 'c')
|
||||
+
|
||||
+dep = dependency('FoUnDaTiOn')
|
||||
+
|
||||
+exe = executable('prog', 'prog.c', install : true, dependencies: dep)
|
||||
diff --git a/test cases/osx/11 case sensitive apfs/prog.c b/test cases/osx/11 case sensitive apfs/prog.c
|
||||
new file mode 100644
|
||||
index 000000000000..9b6bdc2ec2f0
|
||||
--- /dev/null
|
||||
+++ b/test cases/osx/11 case sensitive apfs/prog.c
|
||||
@@ -0,0 +1,3 @@
|
||||
+int main(void) {
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/test cases/osx/11 case sensitive apfs/test.json b/test cases/osx/11 case sensitive apfs/test.json
|
||||
new file mode 100644
|
||||
index 000000000000..a883714eaa27
|
||||
--- /dev/null
|
||||
+++ b/test cases/osx/11 case sensitive apfs/test.json
|
||||
@@ -0,0 +1,5 @@
|
||||
+{
|
||||
+ "installed": [
|
||||
+ {"type": "file", "file": "usr/bin/prog"}
|
||||
+ ]
|
||||
+}
|
@ -1,15 +1,16 @@
|
||||
diff -ur a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
|
||||
--- a/mesonbuild/modules/pkgconfig.py 2024-05-17 17:52:30.880877000 -0700
|
||||
+++ b/mesonbuild/modules/pkgconfig.py 2024-05-17 17:53:10.901068000 -0700
|
||||
@@ -693,10 +693,7 @@
|
||||
diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py
|
||||
index 1bdf82931..db165ea12 100644
|
||||
--- a/mesonbuild/modules/pkgconfig.py
|
||||
+++ b/mesonbuild/modules/pkgconfig.py
|
||||
@@ -701,10 +701,7 @@ class PkgConfigModule(NewExtensionModule):
|
||||
pcfile = filebase + '.pc'
|
||||
pkgroot = pkgroot_name = kwargs['install_dir'] or default_install_dir
|
||||
if pkgroot is None:
|
||||
- if mesonlib.is_freebsd():
|
||||
- pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(mesonlib.OptionKey('prefix'))), 'libdata', 'pkgconfig')
|
||||
- pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(OptionKey('prefix'))), 'libdata', 'pkgconfig')
|
||||
- pkgroot_name = os.path.join('{prefix}', 'libdata', 'pkgconfig')
|
||||
- elif mesonlib.is_haiku():
|
||||
+ if mesonlib.is_haiku():
|
||||
pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(mesonlib.OptionKey('prefix'))), 'develop', 'lib', 'pkgconfig')
|
||||
pkgroot = os.path.join(_as_str(state.environment.coredata.get_option(OptionKey('prefix'))), 'develop', 'lib', 'pkgconfig')
|
||||
pkgroot_name = os.path.join('{prefix}', 'develop', 'lib', 'pkgconfig')
|
||||
else:
|
||||
|
@ -13,7 +13,6 @@
|
||||
, python3
|
||||
, substituteAll
|
||||
, zlib
|
||||
, fetchpatch
|
||||
}:
|
||||
|
||||
let
|
||||
@ -21,13 +20,13 @@ let
|
||||
in
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "meson";
|
||||
version = "1.5.2";
|
||||
version = "1.6.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mesonbuild";
|
||||
repo = "meson";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-cesMepnD3fHX2CwnSQ3c5TE9kPSa0FkCVVVZDgXwo8M=";
|
||||
hash = "sha256-st0dbb+GfF0KEyF+Qn/PIE2462ZrrXy8YcnrulHTI8M=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@ -74,24 +73,6 @@ python3.pkgs.buildPythonApplication rec {
|
||||
|
||||
# This edge case is explicitly part of meson but is wrong for nix
|
||||
./007-freebsd-pkgconfig-path.patch
|
||||
|
||||
(fetchpatch {
|
||||
name = "tests-skip-framework-recasting-if-CMake-unavailable.patch";
|
||||
url = "https://github.com/mesonbuild/meson/commit/8a8a3a0578fd8d5a8720a7a706f6f3b99e857f9c.patch";
|
||||
hash = "sha256-XkwNQ5eg/fVekhsFg/V2/S2LbIVGz3H0wsSFlUT3ZZE=";
|
||||
})
|
||||
|
||||
# Fix extraframework lookup on case-sensitive APFS.
|
||||
# https://github.com/mesonbuild/meson/pull/13038
|
||||
./007-case-sensitive-fs.patch
|
||||
|
||||
# Fix meson's detection for zig's linker
|
||||
# https://github.com/mesonbuild/meson/pull/12293
|
||||
(fetchpatch {
|
||||
name = "linker-support-zig-cc.patch";
|
||||
url = "https://github.com/mesonbuild/meson/pull/12293/commits/2baae244c995794d9addfe6ed924dfa72f01be82.patch";
|
||||
hash = "sha256-dDOmSRBKl/gs7I3kmLXIyQk3zsOdlaYov72pPSel4+I=";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals (python3.pythonOlder "3.9") [
|
||||
@ -129,7 +110,7 @@ python3.pkgs.buildPythonApplication rec {
|
||||
patchShebangs 'test cases'
|
||||
substituteInPlace \
|
||||
'test cases/native/8 external program shebang parsing/script.int.in' \
|
||||
'test cases/common/273 customtarget exe for test/generate.py' \
|
||||
'test cases/common/274 customtarget exe for test/generate.py' \
|
||||
--replace /usr/bin/env ${coreutils}/bin/env
|
||||
''
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user