mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
Fix build on Nix 2.19+
Nix 2.19 introduced a change [0] that broke how we compile our libnixstore
bindings, which requires adding an additional include directory when
we compile them.
[0]: b461cac21a
This commit is contained in:
parent
8e64f8ba45
commit
657db64e51
4 changed files with 15 additions and 0 deletions
|
@ -24,6 +24,9 @@ fn build_bridge() {
|
||||||
.flag("nix/config.h")
|
.flag("nix/config.h")
|
||||||
.flag("-idirafter")
|
.flag("-idirafter")
|
||||||
.flag(hacky_include.path().to_str().unwrap())
|
.flag(hacky_include.path().to_str().unwrap())
|
||||||
|
// In Nix 2.19+, nix/args/root.hh depends on being able to #include "root.hh" (which is in its parent directory), for some reason
|
||||||
|
.flag("-I")
|
||||||
|
.flag(concat!(env!("NIX_INCLUDE_PATH"), "/nix"))
|
||||||
.compile("nixbinding");
|
.compile("nixbinding");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=src/nix_store/bindings");
|
println!("cargo:rerun-if-changed=src/nix_store/bindings");
|
||||||
|
|
|
@ -62,6 +62,9 @@ let
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "attic";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
|
|
||||||
# See comment in `attic-tests`
|
# See comment in `attic-tests`
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
@ -136,6 +139,9 @@ let
|
||||||
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
|
checkPhaseCargoCommand = "cargoWithProfile test --no-run --message-format=json >cargo-test.json";
|
||||||
doInstallCargoArtifacts = false;
|
doInstallCargoArtifacts = false;
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,9 @@
|
||||||
NIX_PATH = "nixpkgs=${pkgs.path}";
|
NIX_PATH = "nixpkgs=${pkgs.path}";
|
||||||
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
|
RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library";
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev pkgs.nix}/include";
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "dev";
|
ATTIC_DISTRIBUTOR = "dev";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,9 @@ in rustPlatform.buildRustPackage rec {
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "attic";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
|
# See comment in `attic/build.rs`
|
||||||
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
|
|
||||||
# Recursive Nix is not stable yet
|
# Recursive Nix is not stable yet
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue