Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: de7594095362
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bfa24c12a5b7
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 22, 2018

  1. meson: allow dirs outside of prefix

    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.
    jtojnar committed Mar 22, 2018
    Copy the full SHA
    fe73013 View commit details
  2. Copy the full SHA
    bfa24c1 View commit details
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
@@ -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.
9 changes: 9 additions & 0 deletions pkgs/development/tools/build-managers/meson/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,15 @@ mesonConfigurePhase() {
crossMesonFlags="--cross-file=@crossFile@/cross-file.conf"
fi

# See multiple-outputs.sh and meson’s coredata.py
mesonFlags="\
--libdir=${!outputLib}/lib --libexecdir=${!outputLib}/libexec \
--bindir=${!outputBin}/bin --sbindir=${!outputBin}/sbin \
--includedir=${!outputInclude}/include \
--mandir=${!outputMan}/share/man --infodir=${!outputInfo}/share/info \
--localedir=${!outputLib}/share/locale \
$mesonFlags"

mesonFlags="${crossMesonFlags+$crossMesonFlags }--buildtype=${mesonBuildType:-release} $mesonFlags"

echo "meson flags: $mesonFlags ${mesonFlagsArray[@]}"