Skip to content

Commit

Permalink
re-apply patch
Browse files Browse the repository at this point in the history
nix-community#123

Signed-off-by: Anthony Rabbito <[email protected]>
  • Loading branch information
anthr76 committed Nov 5, 2024
1 parent a5428f7 commit 3139ab5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ let
, goPackagePath
, version
, go
, previousSources
}:
let
packageName = "${baseNameOf goPackagePath}_${version}";
in
if hasAttr packageName previousSources then previousSources.${packageName}
else
stdenvNoCC.mkDerivation {
name = "${baseNameOf goPackagePath}_${version}";
name = packageName;
builder = ./fetch.sh;
inherit goPackagePath version;
nativeBuildInputs = [
Expand All @@ -74,6 +80,7 @@ let
, defaultPackage ? ""
, goMod
, pwd
, previousSources
}:
let
localReplaceCommands =
Expand All @@ -96,6 +103,7 @@ let
goPackagePath = meta.replaced or goPackagePath;
inherit (meta) version hash;
inherit go;
inherit previousSources;
})
modulesStruct.mod;
in
Expand Down Expand Up @@ -228,6 +236,9 @@ let
, tags ? [ ]
, ldflags ? [ ]


, sources ? {}

, ...
}@attrs:
let
Expand All @@ -246,6 +257,7 @@ let

vendorEnv = mkVendorEnv {
inherit go modulesStruct defaultPackage goMod pwd;
previousSources = sources;
};

pname = attrs.pname or baseNameOf defaultPackage;
Expand All @@ -259,7 +271,7 @@ let
src = vendorEnv.passthru.sources.${defaultPackage};
} // optionalAttrs (hasAttr "subPackages" modulesStruct) {
subPackages = modulesStruct.subPackages;
} // attrs // {
} // removeAttrs attrs [ "sources" ] // {
nativeBuildInputs = [ rsync go ] ++ nativeBuildInputs;

inherit (go) GOOS GOARCH;
Expand Down

0 comments on commit 3139ab5

Please sign in to comment.