diff options
Diffstat (limited to 'package.nix')
-rw-r--r-- | package.nix | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/package.nix b/package.nix index f37e177dd..8bba81e38 100644 --- a/package.nix +++ b/package.nix @@ -288,6 +288,11 @@ stdenv.mkDerivation (finalAttrs: { env = { BOOST_INCLUDEDIR = "${lib.getDev boost}/include"; BOOST_LIBRARYDIR = "${lib.getLib boost}/lib"; + + # Meson allows referencing a /usr/share/cargo/registry shaped thing for subproject sources. + # Turns out the Nix-generated Cargo dependencies are named the same as they + # would be in a Cargo registry cache. + MESON_PACKAGE_CACHE_DIR = finalAttrs.cargoDeps; }; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; }; @@ -313,17 +318,6 @@ stdenv.mkDerivation (finalAttrs: { install_name_tool -change ${boost}/lib/libboost_system.dylib $out/lib/libboost_system.dylib $out/lib/libboost_thread.dylib '' + '' - # Copy the Cargo dependencies to where Meson expects them to be, so we - # can seamlessly use Meson's subproject wraps, but just do the download - # ahead of time. Luckily for us, importCargoLock-downloaded crates use - # the exact naming scheme Meson expects! - # The directory from importCargoLock does contain a lockfile, which we - # don't need, but all the crate directories start with a word character, - # then have a hyphen, and then a sequence of digits or periods for the - # version. - find "$cargoDeps" -type l -regex '.*/\w.+-[0-9.]+$' -exec \ - ln -sv "{}" "$PWD/subprojects/" ";" - # Fix up /usr/bin/env shebangs relied on by the build patchShebangs --build tests/ doc/manual/ ''; |