ghq: Migrate to buildGoModule, ensure go 1.13 compatibility

This commit is contained in:
Roman Volosatovs 2019-09-05 19:40:13 +02:00
parent 944e76eb78
commit ddbf8bd82e
No known key found for this signature in database
GPG Key ID: 2660C5FDCEBE6F87
2 changed files with 12 additions and 144 deletions

@ -1,11 +1,9 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, fetchpatch }:
buildGoPackage rec {
buildGoModule rec {
pname = "ghq";
version = "0.12.6";
goPackagePath = "github.com/motemen/ghq";
src = fetchFromGitHub {
owner = "motemen";
repo = "ghq";
@ -13,7 +11,7 @@ buildGoPackage rec {
sha256 = "14rm7fvphr7r9x0ys10vhzjwhfhhscgr574n1i1z4lzw551lrnp4";
};
goDeps = ./deps.nix;
modSha256 = "1y2v8ir7kc2avgri06nagfyaxqr3xrg4g5pxl9rwzq9dyzm6ci5z";
buildFlagsArray = ''
-ldflags=
@ -21,9 +19,17 @@ buildGoPackage rec {
'';
postInstall = ''
install -m 444 -D ${src}/zsh/_ghq $bin/share/zsh/site-functions/_ghq
install -m 444 -D ${src}/zsh/_ghq $out/share/zsh/site-functions/_ghq
'';
patches = [
(fetchpatch {
# remove once the commit lands in a release.
url = "https://github.com/motemen/ghq/commit/38ac89e60e60182b5870108f9753c9fe8d00e4a6.patch";
sha256 = "1z8yvzmka3sh44my6jnwc39p8zs7mczxgvwc9z0pkqk4vgvaj8gj";
})
];
meta = {
description = "Remote repository management made easy";
homepage = https://github.com/motemen/ghq;

@ -1,138 +0,0 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "github.com/Songmu/gitconfig";
fetch = {
type = "git";
url = "https://github.com/Songmu/gitconfig";
rev = "v0.0.2";
sha256 = "0w1xd1mzxzwh755l6lgpn6psjp959kvx89l39zhc8lag9jh7rc44";
};
}
{
goPackagePath = "github.com/daviddengcn/go-colortext";
fetch = {
type = "git";
url = "https://github.com/daviddengcn/go-colortext";
rev = "186a3d44e920";
sha256 = "18piv4zzcb8abbc7fllz9p6rd4zhsy1gc6iygym381caggmmgxgk";
};
}
{
goPackagePath = "github.com/golangplus/bytes";
fetch = {
type = "git";
url = "https://github.com/golangplus/bytes";
rev = "45c989fe5450";
sha256 = "1fpwg1idakpbvkmk8j8yyhv9g7mhr9c922kvff6kj4br4k05zyzr";
};
}
{
goPackagePath = "github.com/golangplus/fmt";
fetch = {
type = "git";
url = "https://github.com/golangplus/fmt";
rev = "2a5d6d7d2995";
sha256 = "1242q05qnawhv0klzy1pbq63q8jxkms5hc7421992hzq2m40k5yn";
};
}
{
goPackagePath = "github.com/golangplus/testing";
fetch = {
type = "git";
url = "https://github.com/golangplus/testing";
rev = "af21d9c3145e";
sha256 = "1g83sjvcavqbh92vyirc48mrqd18yfci08zya0hrgk840cr94czc";
};
}
{
goPackagePath = "github.com/motemen/go-colorine";
fetch = {
type = "git";
url = "https://github.com/motemen/go-colorine";
rev = "45d19169413a";
sha256 = "1mdy6q0926s1frj027nlzlvm2qssmkpjis7ic3l2smajkzh07118";
};
}
{
goPackagePath = "github.com/urfave/cli";
fetch = {
type = "git";
url = "https://github.com/urfave/cli";
rev = "v1.20.0";
sha256 = "0y6f4sbzkiiwrxbl15biivj8c7qwxnvm3zl2dd3mw4wzg4x10ygj";
};
}
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "c2843e01d9a2";
sha256 = "01xgxbj5r79nmisdvpq48zfy8pzaaj90bn6ngd4nf33j9ar1dp8r";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "3ec191127204";
sha256 = "0zzhbkw3065dp1jscp7q8dxw3mkwj95ixnrr8j7c47skis0m11i3";
};
}
{
goPackagePath = "golang.org/x/sync";
fetch = {
type = "git";
url = "https://go.googlesource.com/sync";
rev = "112230192c58";
sha256 = "05i2k43j2d0llq768hg5pf3hb2yhfzp9la1w5wp0rsnnzblr0lfn";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "d0b11bdaac8a";
sha256 = "18yfsmw622l7gc5sqriv5qmck6903vvhivpzp8i3xfy3z33dybdl";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "v0.3.0";
sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19";
};
}
{
goPackagePath = "golang.org/x/xerrors";
fetch = {
type = "git";
url = "https://go.googlesource.com/xerrors";
rev = "3ee3066db522";
sha256 = "12xyaa116bq9zy25fwk7zzi83v8aab9lm91pqg0c3jrfkjdbr255";
};
}
{
goPackagePath = "gopkg.in/check.v1";
fetch = {
type = "git";
url = "https://gopkg.in/check.v1";
rev = "20d25e280405";
sha256 = "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np";
};
}
{
goPackagePath = "gopkg.in/yaml.v2";
fetch = {
type = "git";
url = "https://gopkg.in/yaml.v2";
rev = "v2.2.2";
sha256 = "01wj12jzsdqlnidpyjssmj0r4yavlqy7dwrg7adqd8dicjc4ncsa";
};
}
]