tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
meson: rename patches
Anderson Torres
2 years ago
1a3bec02
9cf584eb
+65
-47
7 changed files
expand all
collapse all
unified
split
pkgs
by-name
me
meson
001-fix-rpath.patch
002-clear-old-rpath.patch
003-more-env-vars.patch
004-gir-fallback-path.patch
005-boost-Do-not-add-system-paths-on-nix.patch
006-disable-bitcode.patch
package.nix
pkgs/by-name/me/meson/boost-Do-not-add-system-paths-on-nix.patch
pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch
pkgs/by-name/me/meson/clear-old-rpath.patch
pkgs/by-name/me/meson/002-clear-old-rpath.patch
pkgs/by-name/me/meson/disable-bitcode.patch
pkgs/by-name/me/meson/006-disable-bitcode.patch
pkgs/by-name/me/meson/fix-rpath.patch
pkgs/by-name/me/meson/001-fix-rpath.patch
pkgs/by-name/me/meson/gir-fallback-path.patch
pkgs/by-name/me/meson/004-gir-fallback-path.patch
pkgs/by-name/me/meson/more-env-vars.patch
pkgs/by-name/me/meson/003-more-env-vars.patch
+65
-47
pkgs/by-name/me/meson/package.nix
···
28
28
};
29
29
30
30
patches = [
31
31
-
# Meson is currently inspecting fewer variables than autoconf does, which
32
32
-
# makes it harder for us to use setup hooks, etc. Taken from
33
33
-
# https://github.com/mesonbuild/meson/pull/6827
34
34
-
./more-env-vars.patch
35
35
-
36
36
-
# Unlike libtool, vanilla Meson does not pass any information
37
37
-
# about the path library will be installed to to g-ir-scanner,
38
38
-
# breaking the GIR when path other than ${!outputLib}/lib is used.
39
39
-
# We patch Meson to add a --fallback-library-path argument with
40
40
-
# library install_dir to g-ir-scanner.
41
41
-
./gir-fallback-path.patch
42
42
-
43
43
-
# In common distributions, RPATH is only needed for internal libraries so
31
31
+
# In typical distributions, RPATH is only needed for internal libraries so
44
32
# meson removes everything else. With Nix, the locations of libraries
45
33
# are not as predictable, therefore we need to keep them in the RPATH.
46
34
# At the moment we are keeping the paths starting with /nix/store.
47
35
# https://github.com/NixOS/nixpkgs/issues/31222#issuecomment-365811634
48
36
(substituteAll {
49
49
-
src = ./fix-rpath.patch;
37
37
+
src = ./001-fix-rpath.patch;
50
38
inherit (builtins) storeDir;
51
39
})
52
40
···
56
44
# But this can cause much bigger problem for Nix as it can produce
57
45
# cut-in-half-by-\0 store path references.
58
46
# Let’s just clear the whole rpath and hope for the best.
59
59
-
./clear-old-rpath.patch
47
47
+
./002-clear-old-rpath.patch
48
48
+
49
49
+
# Meson is currently inspecting fewer variables than autoconf does, which
50
50
+
# makes it harder for us to use setup hooks, etc.
51
51
+
# https://github.com/mesonbuild/meson/pull/6827
52
52
+
./003-more-env-vars.patch
53
53
+
54
54
+
# Unlike libtool, vanilla Meson does not pass any information about the path
55
55
+
# library will be installed to to g-ir-scanner, breaking the GIR when path
56
56
+
# other than ${!outputLib}/lib is used.
57
57
+
# We patch Meson to add a --fallback-library-path argument with library
58
58
+
# install_dir to g-ir-scanner.
59
59
+
./004-gir-fallback-path.patch
60
60
61
61
# Patch out default boost search paths to avoid impure builds on
62
62
# unsandboxed non-NixOS builds, see:
63
63
# https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774
64
64
-
./boost-Do-not-add-system-paths-on-nix.patch
64
64
+
./005-boost-Do-not-add-system-paths-on-nix.patch
65
65
66
66
# Nixpkgs cctools does not have bitcode support.
67
67
-
./disable-bitcode.patch
67
67
+
./006-disable-bitcode.patch
68
68
69
69
# Fix passing multiple --define-variable arguments to pkg-config.
70
70
# https://github.com/mesonbuild/meson/pull/10670
71
71
(fetchpatch {
72
72
url = "https://github.com/mesonbuild/meson/commit/d5252c5d4cf1c1931fef0c1c98dd66c000891d21.patch";
73
73
-
sha256 = "GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw=";
73
73
+
hash = "sha256-GiUNVul1N5Fl8mfqM7vA/r1FdKqImiDYLXMVDt77gvw=";
74
74
excludes = [
75
75
"docs/yaml/objects/dep.yaml"
76
76
];
77
77
})
78
78
];
79
79
80
80
-
setupHook = ./setup-hook.sh;
80
80
+
buildInputs = lib.optionals (python3.pythonOlder "3.9") [
81
81
+
libxcrypt
82
82
+
];
81
83
82
82
-
nativeCheckInputs = [ ninja pkg-config ];
83
83
-
checkInputs = [ zlib ]
84
84
-
++ lib.optionals stdenv.isDarwin [ Foundation OpenGL AppKit Cocoa ];
85
85
-
checkPhase = ''
86
86
-
runHook preCheck
84
84
+
nativeBuildInputs = [ installShellFiles ];
87
85
88
88
-
patchShebangs 'test cases'
89
89
-
substituteInPlace 'test cases/native/8 external program shebang parsing/script.int.in' \
90
90
-
--replace /usr/bin/env ${coreutils}/bin/env
86
86
+
nativeCheckInputs = [
87
87
+
ninja
88
88
+
pkg-config
89
89
+
];
90
90
+
91
91
+
checkInputs = [
92
92
+
zlib
93
93
+
]
94
94
+
++ lib.optionals stdenv.isDarwin [
95
95
+
AppKit
96
96
+
Cocoa
97
97
+
Foundation
98
98
+
OpenGL
99
99
+
];
100
100
+
101
101
+
checkPhase = lib.concatStringsSep "\n" ([
102
102
+
"runHook preCheck"
103
103
+
''
104
104
+
patchShebangs 'test cases'
105
105
+
substituteInPlace \
106
106
+
'test cases/native/8 external program shebang parsing/script.int.in' \
107
107
+
--replace /usr/bin/env ${coreutils}/bin/env
108
108
+
''
109
109
+
]
110
110
+
# Remove problematic tests
111
111
+
++ (builtins.map (f: ''rm -vr "${f}";'') [
91
112
# requires git, creating cyclic dependency
92
92
-
rm -r 'test cases/common/66 vcstag'
113
113
+
''test cases/common/66 vcstag''
93
114
# requires glib, creating cyclic dependency
94
94
-
rm -r 'test cases/linuxlike/6 subdir include order'
95
95
-
rm -r 'test cases/linuxlike/9 compiler checks with dependencies'
115
115
+
''test cases/linuxlike/6 subdir include order''
116
116
+
''test cases/linuxlike/9 compiler checks with dependencies''
96
117
# requires static zlib, see #66461
97
97
-
rm -r 'test cases/linuxlike/14 static dynamic linkage'
118
118
+
''test cases/linuxlike/14 static dynamic linkage''
98
119
# Nixpkgs cctools does not have bitcode support.
99
99
-
rm -r 'test cases/osx/7 bitcode'
100
100
-
HOME="$TMPDIR" python ./run_project_tests.py
120
120
+
''test cases/osx/7 bitcode''
121
121
+
])
122
122
+
++ [
123
123
+
''HOME="$TMPDIR" python ./run_project_tests.py''
124
124
+
"runHook postCheck"
125
125
+
]);
101
126
102
102
-
runHook postCheck
127
127
+
postInstall = ''
128
128
+
installShellCompletion --zsh data/shell-completions/zsh/_meson
129
129
+
installShellCompletion --bash data/shell-completions/bash/meson
103
130
'';
104
131
105
132
postFixup = ''
···
117
144
--replace "python3 -c " "${python3.interpreter} -c "
118
145
'';
119
146
120
120
-
buildInputs = lib.optionals (python3.pythonOlder "3.9") [
121
121
-
libxcrypt
122
122
-
];
123
123
-
124
124
-
nativeBuildInputs = [ installShellFiles ];
125
125
-
126
126
-
postInstall = ''
127
127
-
installShellCompletion --zsh data/shell-completions/zsh/_meson
128
128
-
installShellCompletion --bash data/shell-completions/bash/meson
129
129
-
'';
147
147
+
setupHook = ./setup-hook.sh;
130
148
131
131
-
meta = with lib; {
149
149
+
meta = {
132
150
homepage = "https://mesonbuild.com";
133
151
description = "An open source, fast and friendly build system made in Python";
134
152
longDescription = ''
···
140
158
second spent waiting for the build system to actually start compiling
141
159
code.
142
160
'';
143
143
-
license = licenses.asl20;
144
144
-
maintainers = with maintainers; [ mbe AndersonTorres ];
161
161
+
license = lib.licenses.asl20;
162
162
+
maintainers = with lib.maintainers; [ AndersonTorres ];
145
163
inherit (python3.meta) platforms;
146
164
};
147
165
}