Skip to content

Commit

Permalink
meson: allow dirs outside of prefix
Browse files Browse the repository at this point in the history
Upstream insists on not allowing bindir and other dir options
outside of prefix for some reason:

mesonbuild/meson#2561

We remove the check so multiple outputs can work sanely.
  • Loading branch information
jtojnar committed Mar 17, 2018
1 parent b69ca72 commit 99a184d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -266,18 +266,13 @@
'''
if option.endswith('dir') and os.path.isabs(value) and \
option not in builtin_dir_noprefix_options:
- # Value must be a subdir of the prefix
# commonpath will always return a path in the native format, so we
# must use pathlib.PurePath to do the same conversion before
# comparing.
- if commonpath([value, prefix]) != str(PurePath(prefix)):
- m = 'The value of the {!r} option is {!r} which must be a ' \
- 'subdir of the prefix {!r}.\nNote that if you pass a ' \
- 'relative path, it is assumed to be a subdir of prefix.'
- raise MesonException(m.format(option, value, prefix))
- # Convert path to be relative to prefix
- skip = len(prefix) + 1
- value = value[skip:]
+ if commonpath([value, prefix]) == str(PurePath(prefix)):
+ # Convert path to be relative to prefix
+ skip = len(prefix) + 1
+ value = value[skip:]
return value

def init_builtins(self, options):
6 changes: 6 additions & 0 deletions pkgs/development/tools/build-managers/meson/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ in python3Packages.buildPythonApplication rec {
'';

patches = [
# Upstream insists on not allowing bindir and other dir options
# outside of prefix for some reason:
# https://github.com/mesonbuild/meson/issues/2561
# We remove the check so multiple outputs can work sanely.
./allow-dirs-outside-of-prefix.patch

# Unlike libtool, vanilla Meson does not pass any information
# about the path library will be installed to to g-ir-scanner,
# breaking the GIR when path other than ${!outputLib}/lib is used.
Expand Down

0 comments on commit 99a184d

Please sign in to comment.