diff options
author | Justin Bedo <cu@cua0.org> | 2019-06-04 18:53:09 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2019-06-04 18:53:09 +1000 |
commit | a7b06b941b30feaf8b3b0e0ad1bc986d58d9f9ac (patch) | |
tree | be27b68d6a2f233baf03e5d4cad024648ec67a71 | |
parent | b714521422af63a910ff660dcc019cbaeb6a5d17 (diff) |
strip: handle non-buildCommand based stages
-rw-r--r-- | default.nix | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/default.nix b/default.nix index 15b8d87..450118d 100644 --- a/default.nix +++ b/default.nix @@ -77,8 +77,8 @@ let lib = nixpkgs.lib // { types = types; shard = callBionix ./lib/shard.nix {};}; stage = x@{ name, stripStorePaths ? true, multicore ? false, ... }: (if stripStorePaths then strip else x: x) (nixpkgs.stdenvNoCC.mkDerivation (x // {name = "bionix-" + name; inherit multicore;})); - strip = drv: drv.overrideAttrs (attrs: { - buildCommand = attrs.buildCommand + '' + strip = drv: let + stripCommand = '' function rewrite { sed -i 's|/nix/store/[^-]*|/nix/store/00000000000000000000000000000000|g' $1 @@ -96,7 +96,12 @@ let rewriteOutput $o done ''; - }); + in drv.overrideAttrs (attrs: + if attrs ? buildCommand then + {buildCommand = attrs.buildCommand + stripCommand;} + else + { fixupPhase = (if attrs ? fixupPhase then attrs.fixupPhase else "") + stripCommand; } + ); # splitting/joining splitFile = file: drv: stage { |