Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
meson: use wrapper program instead of bypassing it
meson persists its own full path (argv[0]) to the build.ninja file, which then
runs it without the PYTHONPATH which the meson wrapper program sets up.

To make this work, we need to make meson write the full path to its *wrapper
program* into build.ninja.
  • Loading branch information
stapelberg committed May 2, 2020
1 parent cefded2 commit f45ee9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkgs/meson/build.textproto
@@ -1,6 +1,6 @@
source: "https://github.com/mesonbuild/meson/releases/download/0.54.1/meson-0.54.1.tar.gz"
hash: "2f76fb4572762be13ee479292610091b4509af5788bcceb391fe222bcd0296dc"
version: "0.54.1-5"
version: "0.54.1-7"

writable_sourcedir: true
in_tree_build: true
Expand All @@ -9,6 +9,8 @@ cherry_pick: "genmarshal.patch"
# https://github.com/NixOS/nixpkgs/blob/257aff801079890e2c5ed3fa5b8e5f818f611fad/pkgs/development/tools/build-managers/meson/fix-rpath.patch
cherry_pick: "rpath.patch"

cherry_pick: "launcher.patch"

pythonbuilder: {}

runtime_dep: "ninja"
Expand Down
11 changes: 11 additions & 0 deletions pkgs/meson/launcher.patch
@@ -0,0 +1,11 @@
--- old/mesonbuild/mesonmain.py 2020-05-02 22:37:55.035436359 +0200
+++ new/mesonbuild/mesonmain.py 2020-05-02 22:38:28.588262968 +0200
@@ -225,6 +225,7 @@
launcher = sys.executable
else:
launcher = os.path.realpath(sys.argv[0])
+ launcher = '/ro/meson-amd64-0.54.1-7/bin/meson'
return run(sys.argv[1:], launcher)

if __name__ == '__main__':
Binary files /dev/null and new/mesonbuild/mesonmain.py~ differ

0 comments on commit f45ee9a

Please sign in to comment.