diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2018-03-05 06:57:38 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2018-03-22 07:33:49 +0100 |
commit | fe73013e7d4ad81ccbf9fb30829e227664453fdc (patch) | |
tree | 8cf9132c71bff26365203f0db9b6fa5892009794 /pkgs/development/tools/build-managers | |
parent | de7594095362b653650cb3f096e6e3ec745e0f9e (diff) | |
download | nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar.gz nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar.bz2 nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar.lz nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar.xz nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.tar.zst nixlib-fe73013e7d4ad81ccbf9fb30829e227664453fdc.zip |
meson: allow dirs outside of prefix
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.
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r-- | pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch | 25 | ||||
-rw-r--r-- | pkgs/development/tools/build-managers/meson/default.nix | 6 |
2 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch new file mode 100644 index 000000000000..b44289d74f54 --- /dev/null +++ b/pkgs/development/tools/build-managers/meson/allow-dirs-outside-of-prefix.patch @@ -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): diff --git a/pkgs/development/tools/build-managers/meson/default.nix b/pkgs/development/tools/build-managers/meson/default.nix index 23b6f7226a16..47e574236329 100644 --- a/pkgs/development/tools/build-managers/meson/default.nix +++ b/pkgs/development/tools/build-managers/meson/default.nix @@ -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. |