go2nix: extracted from goPackages

This commit is contained in:
Kamil Chmielewski 2016-06-05 16:41:51 +02:00
parent 5d3f8fec7c
commit fc88548b5d
5 changed files with 80 additions and 20 deletions

View File

@ -1258,5 +1258,41 @@
"rev": "ea925a0a47d225b2ca7f9932b01d2ed4f3ec74f6",
"sha256": "15wqjpkfzsxnaxbz6y4r91hw6812g3sc4ipagxw1bya9klbnkdc9"
}
},
{
"goPackagePath": "github.com/alecthomas/template",
"fetch": {
"type": "git",
"url": "https://github.com/alecthomas/template",
"rev": "14fd436dd20c3cc65242a9f396b61bfc8a3926fc",
"sha256": "19rzvvcgvr1z2wz9xpqsmlm8syizbpxjp5zbzgakvrqlajpbjvx2"
}
},
{
"goPackagePath": "github.com/alecthomas/units",
"fetch": {
"type": "git",
"url": "https://github.com/alecthomas/units",
"rev": "2efee857e7cfd4f3d0138cc3cbb1b4966962b93a",
"sha256": "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl"
}
},
{
"goPackagePath": "gopkg.in/alecthomas/kingpin.v2",
"fetch": {
"type": "git",
"url": "https://gopkg.in/alecthomas/kingpin.v2",
"rev": "21551c2a6259a8145110ca80a36e25c9d7624032",
"sha256": "1zhpqc4qxsw9lc1b4dwk5r42k9r702ihzrabs3mnsphvm9jx4l59"
}
},
{
"goPackagePath": "github.com/Masterminds/vcs",
"fetch": {
"type": "git",
"url": "https://github.com/Masterminds/vcs",
"rev": "9c0db6583837118d5df7c2ae38ab1c194e434b35",
"sha256": "0590ww2av4407y7zy3bcmnr8i74fv00k9zzcxcpjxivl6qszna0d"
}
}
]

View File

@ -0,0 +1,32 @@
# This file was generated by go2nix.
{ stdenv, lib, goPackages, go-bindata, goimports, nix-prefetch-git, git, makeWrapper,
fetchgit, fetchhg, fetchbzr, fetchsvn }:
with goPackages;
buildGoPackage rec {
name = "go2nix-${version}";
version = "20160307-${stdenv.lib.strings.substring 0 7 rev}";
rev = "4c552dadd855e3694ed3499feb46dca9cd855f60";
goPackagePath = "github.com/kamilchm/go2nix";
src = fetchgit {
inherit rev;
url = "https://github.com/kamilchm/go2nix";
sha256 = "1pwnm1vrjxvgl17pk9n1k5chmhgwxkrwp2s1bzi64xf12anibj63";
};
goDeps = ./deps.json;
buildInputs = [ go-bindata goimports makeWrapper ];
preBuild = ''go generate ./...'';
postInstall = ''
wrapProgram $bin/bin/go2nix \
--prefix PATH : ${nix-prefetch-git}/bin \
--prefix PATH : ${git}/bin
'';
allowGoReference = true;
}

View File

@ -0,0 +1,11 @@
[
{
"include": "../../libs.json",
"packages": [
"github.com/alecthomas/template",
"github.com/alecthomas/units",
"gopkg.in/alecthomas/kingpin.v2",
"github.com/Masterminds/vcs"
]
}
]

View File

@ -9628,7 +9628,7 @@ in
goPackages = go16Packages;
go2nix = goPackages.go2nix.bin // { outputs = [ "bin" ]; };
go2nix = callPackage ../development/tools/go2nix { };
### DEVELOPMENT / LISP MODULES

View File

@ -3241,25 +3241,6 @@ let
goPackageAliases = [ "gopkg.in/alecthomas/kingpin.v2" ];
};
go2nix = buildFromGitHub rec {
rev = "4c552dadd855e3694ed3499feb46dca9cd855f60";
owner = "kamilchm";
repo = "go2nix";
sha256 = "1pwnm1vrjxvgl17pk9n1k5chmhgwxkrwp2s1bzi64xf12anibj63";
buildInputs = [ pkgs.makeWrapper go-bindata.bin tools.bin vcs go-spew gls go-difflib assertions goconvey testify kingpin ];
preBuild = ''go generate ./...'';
postInstall = ''
wrapProgram $bin/bin/go2nix \
--prefix PATH : ${pkgs.nix-prefetch-git}/bin \
--prefix PATH : ${pkgs.git}/bin
'';
allowGoReference = true;
};
godotenv = buildFromGitHub rec {
rev = "4ed13390c0acd2ff4e371e64d8b97c8954138243";
version = "2015-09-07";