go-packages: start factoring out repetitive patterns
This commit is contained in:
parent
5c896e5511
commit
ac7a6e04c2
1 changed files with 19 additions and 23 deletions
|
@ -6,38 +6,34 @@
|
||||||
let
|
let
|
||||||
isGo13 = go.meta.branch == "1.3";
|
isGo13 = go.meta.branch == "1.3";
|
||||||
isGo14 = go.meta.branch == "1.4";
|
isGo14 = go.meta.branch == "1.4";
|
||||||
|
|
||||||
|
buildFromGitHub = { rev, owner, repo, sha256, name ? repo, goPackagePath ? "github.com/${owner}/${repo}", ... }@args: buildGoPackage (args // {
|
||||||
|
inherit goPackagePath;
|
||||||
|
name = "${name}-${stdenv.lib.strings.substring 0 7 rev}";
|
||||||
|
src = fetchFromGitHub { inherit rev owner repo sha256; };
|
||||||
|
});
|
||||||
|
|
||||||
self = _self // overrides; _self = with self; {
|
self = _self // overrides; _self = with self; {
|
||||||
|
|
||||||
inherit go buildGoPackage;
|
inherit go buildGoPackage;
|
||||||
|
|
||||||
## OFFICIAL GO PACKAGES
|
## OFFICIAL GO PACKAGES
|
||||||
|
|
||||||
crypto = buildGoPackage rec {
|
crypto = buildFromGitHub {
|
||||||
rev = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
|
rev = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
|
||||||
name = "crypto-${stdenv.lib.strings.substring 0 7 rev}";
|
|
||||||
goPackagePath = "golang.org/x/crypto";
|
|
||||||
goPackageAliases = [ "code.google.com/p/go.crypto" ];
|
|
||||||
disabled = isGo13;
|
disabled = isGo13;
|
||||||
|
owner = "golang";
|
||||||
src = fetchFromGitHub {
|
repo = "crypto";
|
||||||
inherit rev;
|
sha256 = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
|
||||||
owner = "golang";
|
goPackagePath = "golang.org/x/crypto";
|
||||||
repo = "crypto";
|
goPackageAliases = [ "code.google.com/p/go.crypto" ];
|
||||||
sha256 = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
glog = buildGoPackage rec {
|
glog = buildFromGitHub {
|
||||||
rev = "44145f04b68cf362d9c4df2182967c2275eaefed";
|
rev = "44145f04b68cf362d9c4df2182967c2275eaefed";
|
||||||
name = "glog-${stdenv.lib.strings.substring 0 7 rev}";
|
owner = "golang";
|
||||||
goPackagePath = "github.com/golang/glog";
|
repo = "glog";
|
||||||
|
sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
|
||||||
src = fetchFromGitHub {
|
|
||||||
inherit rev;
|
|
||||||
owner = "golang";
|
|
||||||
repo = "glog";
|
|
||||||
sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
image = buildGoPackage rec {
|
image = buildGoPackage rec {
|
||||||
|
|
Loading…
Reference in a new issue