mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-23 09:04:37 +03:00
feat(rust): update crane builder
This commit is contained in:
parent
3681e0d5f5
commit
4b1ef01a87
@ -42,11 +42,11 @@
|
||||
"crane": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1661875961,
|
||||
"narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=",
|
||||
"lastModified": 1670284777,
|
||||
"narHash": "sha256-JF0pc0s4z/X+Iy+lNHOwUQ8I5bz+q7uX4HrKTNIEj24=",
|
||||
"owner": "ipetkov",
|
||||
"repo": "crane",
|
||||
"rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24",
|
||||
"rev": "2243fb9c872de25cb564a02d324ea6a5b9853052",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
12
flake.nix
12
flake.nix
@ -114,12 +114,12 @@
|
||||
"lib/mkCargoDerivation.nix"
|
||||
"lib/mkDummySrc.nix"
|
||||
"lib/writeTOML.nix"
|
||||
"pkgs/cargoHelperFunctions.sh"
|
||||
"pkgs/configureCargoCommonVarsHook.sh"
|
||||
"pkgs/configureCargoVendoredDepsHook.sh"
|
||||
"pkgs/installFromCargoBuildLogHook.sh"
|
||||
"pkgs/inheritCargoArtifactsHook.sh"
|
||||
"pkgs/installCargoArtifactsHook.sh"
|
||||
"lib/setupHooks/cargoHelperFunctionsHook.sh"
|
||||
"lib/setupHooks/configureCargoCommonVarsHook.sh"
|
||||
"lib/setupHooks/configureCargoVendoredDepsHook.sh"
|
||||
"lib/setupHooks/installFromCargoBuildLogHook.sh"
|
||||
"lib/setupHooks/inheritCargoArtifactsHook.sh"
|
||||
"lib/setupHooks/installCargoArtifactsHook.sh"
|
||||
"LICENSE"
|
||||
];
|
||||
devshell = [
|
||||
|
22
src/modules/externals/implementation.nix
vendored
22
src/modules/externals/implementation.nix
vendored
@ -14,7 +14,7 @@ in {
|
||||
makeHook = attrs: name:
|
||||
pkgs.makeSetupHook
|
||||
({inherit name;} // attrs)
|
||||
"${externalSources.crane}/pkgs/${name}.sh";
|
||||
"${externalSources.crane}/lib/setupHooks/${name}.sh";
|
||||
genHooks = names: attrs: l.genAttrs names (makeHook attrs);
|
||||
in
|
||||
{
|
||||
@ -23,9 +23,10 @@ in {
|
||||
}: rec {
|
||||
otherHooks =
|
||||
genHooks [
|
||||
"cargoHelperFunctions"
|
||||
"cargoHelperFunctionsHook"
|
||||
"configureCargoCommonVarsHook"
|
||||
"configureCargoVendoredDepsHook"
|
||||
"removeReferencesToVendoredSourcesHook"
|
||||
]
|
||||
{};
|
||||
installHooks =
|
||||
@ -63,7 +64,7 @@ in {
|
||||
|
||||
mkCargoDerivation = importLibFile "mkCargoDerivation" {
|
||||
cargo = cargoHostTarget;
|
||||
inherit (pkgs) stdenv lib;
|
||||
inherit (pkgs) stdenv zstd;
|
||||
inherit
|
||||
(installHooks)
|
||||
inheritCargoArtifactsHook
|
||||
@ -73,8 +74,9 @@ in {
|
||||
(otherHooks)
|
||||
configureCargoCommonVarsHook
|
||||
configureCargoVendoredDepsHook
|
||||
cargoHelperFunctionsHook
|
||||
;
|
||||
cargoHelperFunctionsHook = otherHooks.cargoHelperFunctions;
|
||||
inherit crateNameFromCargoToml vendorCargoDeps;
|
||||
};
|
||||
buildDepsOnly = importLibFile "buildDepsOnly" {
|
||||
inherit
|
||||
@ -84,18 +86,16 @@ in {
|
||||
mkDummySrc
|
||||
;
|
||||
};
|
||||
cargoBuild = importLibFile "cargoBuild" {
|
||||
buildPackage = importLibFile "buildPackage" {
|
||||
inherit (pkgs) lib jq;
|
||||
inherit (installLogHook) installFromCargoBuildLogHook;
|
||||
inherit
|
||||
mkCargoDerivation
|
||||
buildDepsOnly
|
||||
crateNameFromCargoToml
|
||||
vendorCargoDeps
|
||||
mkCargoDerivation
|
||||
;
|
||||
};
|
||||
buildPackage = importLibFile "buildPackage" {
|
||||
inherit (pkgs) removeReferencesTo lib;
|
||||
inherit (installLogHook) installFromCargoBuildLogHook;
|
||||
inherit cargoBuild;
|
||||
inherit (otherHooks) removeReferencesToVendoredSourcesHook;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -57,9 +57,6 @@
|
||||
src = utils.getRootSource pname version;
|
||||
cargoVendorDir = "./nix-vendor";
|
||||
|
||||
# this is needed because remove-references-to doesn't work on non nix-store paths
|
||||
doNotRemoveReferencesToVendorDir = true;
|
||||
|
||||
postUnpack = ''
|
||||
export CARGO_HOME=$(pwd)/.cargo_home
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user