Merge pull request #123 from winterqt/fix-build-on-newer-nix
Fix build on Nix 2.19+
This commit is contained in:
commit
4dbdbee457
|
@ -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");
|
||||||
|
|
14
crane.nix
14
crane.nix
|
@ -62,10 +62,8 @@ let
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "attic";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
# See comment in `attic/build.rs`
|
||||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# See comment in `attic-tests`
|
# See comment in `attic-tests`
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
@ -135,17 +133,15 @@ let
|
||||||
|
|
||||||
nativeBuildInputs = nativeBuildInputs ++ [ jq ];
|
nativeBuildInputs = nativeBuildInputs ++ [ jq ];
|
||||||
|
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
|
||||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
|
||||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
||||||
};
|
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
buildPhaseCargoCommand = "";
|
buildPhaseCargoCommand = "";
|
||||||
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
|
||||||
|
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -53,11 +53,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702539185,
|
"lastModified": 1711401922,
|
||||||
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
|
"narHash": "sha256-QoQqXoj8ClGo0sqD/qWKFWezgEwUL0SUh37/vY2jNhc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
|
"rev": "07262b18b97000d16a4bdb003418bd2fb067a932",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -69,11 +69,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702780907,
|
"lastModified": 1711460390,
|
||||||
"narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=",
|
"narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f",
|
"rev": "44733514b72e732bd49f5511bd0203dea9b9a434",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -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,10 +49,8 @@ in rustPlatform.buildRustPackage rec {
|
||||||
|
|
||||||
ATTIC_DISTRIBUTOR = "attic";
|
ATTIC_DISTRIBUTOR = "attic";
|
||||||
|
|
||||||
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205
|
# See comment in `attic/build.rs`
|
||||||
env = lib.optionalAttrs stdenv.cc.isClang {
|
NIX_INCLUDE_PATH = "${lib.getDev nix}/include";
|
||||||
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Recursive Nix is not stable yet
|
# Recursive Nix is not stable yet
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
Loading…
Reference in a new issue