buildGoPackage: also support pname
Following python-modules and stdenv.mkDerivation. Hopefully zero rebuilds. Motivation: https://github.com/NixOS/nixpkgs/pull/52409
This commit is contained in:
parent
b0ccd8be8e
commit
b4593b4629
@ -1,7 +1,10 @@
|
||||
{ go, govers, lib, fetchgit, fetchhg, fetchbzr, rsync
|
||||
, removeReferencesTo, fetchFromGitHub, stdenv }:
|
||||
|
||||
{ name, buildInputs ? [], nativeBuildInputs ? [], passthru ? {}, preFixup ? ""
|
||||
{ buildInputs ? []
|
||||
, nativeBuildInputs ? []
|
||||
, passthru ? {}
|
||||
, preFixup ? ""
|
||||
, shellHook ? ""
|
||||
|
||||
# We want parallel builds by default
|
||||
@ -34,7 +37,6 @@
|
||||
|
||||
, meta ? {}, ... } @ args':
|
||||
|
||||
if disabled then throw "${name} not supported for go ${go.meta.branch}" else
|
||||
|
||||
with builtins;
|
||||
|
||||
@ -72,12 +74,9 @@ let
|
||||
|
||||
goPath = if goDeps != null then importGodeps { depsFile = goDeps; } ++ extraSrcs
|
||||
else extraSrcs;
|
||||
in
|
||||
|
||||
go.stdenv.mkDerivation (
|
||||
package = go.stdenv.mkDerivation (
|
||||
(builtins.removeAttrs args [ "goPackageAliases" "disabled" ]) // {
|
||||
|
||||
inherit name;
|
||||
nativeBuildInputs = [ removeReferencesTo go ]
|
||||
++ (lib.optional (!dontRenameImports) govers) ++ nativeBuildInputs;
|
||||
buildInputs = buildInputs;
|
||||
@ -238,4 +237,8 @@ go.stdenv.mkDerivation (
|
||||
maintainers = (meta.maintainers or []) ++
|
||||
[ lib.maintainers.ehmry lib.maintainers.lethalman ];
|
||||
};
|
||||
})
|
||||
});
|
||||
in if disabled then
|
||||
throw "${package.name} not supported for go ${go.meta.branch}"
|
||||
else
|
||||
package
|
||||
|
Loading…
x
Reference in New Issue
Block a user