-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #94 - crateOverrides is not an argument to buildRustCrate
instead we need to override defaultCrateOverrides of buildRustCrate.
- Loading branch information
Showing
7 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
sample_projects/bin_with_git_submodule_dep/default-with-customBuildRustCrate.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ pkgs ? import ../../nixpkgs.nix { config = {}; } | ||
, generatedCargoNix ? ./Cargo.nix | ||
}: | ||
|
||
let | ||
customBuildRustCrate = pkgs.buildRustCrate.override { | ||
defaultCrateOverrides = pkgs.defaultCrateOverrides // { | ||
librocksdb-sys = attrs: with pkgs; { | ||
src = attrs.src + "/librocksdb-sys"; | ||
buildInputs = [ clang rocksdb ]; | ||
LIBCLANG_PATH = "${clang.cc.lib}/lib"; | ||
ROCKSDB_LIB_DIR = "${rocksdb}/lib/"; | ||
}; | ||
}; | ||
}; | ||
basePackage = pkgs.callPackage generatedCargoNix { buildRustCrate = customBuildRustCrate; }; | ||
submodulePackage = basePackage.rootCrate.build; | ||
in | ||
submodulePackage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters