go-packages: start factoring out repetitive patterns

This commit is contained in:
Dan Peebles 2015-07-29 04:55:57 +00:00
parent 5c896e5511
commit ac7a6e04c2

View file

@ -6,38 +6,34 @@
let
isGo13 = go.meta.branch == "1.3";
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; {
inherit go buildGoPackage;
## OFFICIAL GO PACKAGES
crypto = buildGoPackage rec {
rev = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
name = "crypto-${stdenv.lib.strings.substring 0 7 rev}";
goPackagePath = "golang.org/x/crypto";
goPackageAliases = [ "code.google.com/p/go.crypto" ];
crypto = buildFromGitHub {
rev = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
disabled = isGo13;
src = fetchFromGitHub {
inherit rev;
owner = "golang";
repo = "crypto";
sha256 = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
};
owner = "golang";
repo = "crypto";
sha256 = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
goPackagePath = "golang.org/x/crypto";
goPackageAliases = [ "code.google.com/p/go.crypto" ];
};
glog = buildGoPackage rec {
rev = "44145f04b68cf362d9c4df2182967c2275eaefed";
name = "glog-${stdenv.lib.strings.substring 0 7 rev}";
goPackagePath = "github.com/golang/glog";
src = fetchFromGitHub {
inherit rev;
owner = "golang";
repo = "glog";
sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
};
glog = buildFromGitHub {
rev = "44145f04b68cf362d9c4df2182967c2275eaefed";
owner = "golang";
repo = "glog";
sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
};
image = buildGoPackage rec {