lf: 11 -> 12

And switch to buildGoModule.
This commit is contained in:
Michael Weiss 2019-04-21 11:44:34 +02:00
parent 9960ff9c83
commit 97d35b251b
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83
2 changed files with 6 additions and 29 deletions

View file

@ -1,29 +1,26 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ buildGoModule, fetchFromGitHub, lib }:
buildGoPackage rec {
buildGoModule rec {
name = "lf-${version}";
version = "11";
version = "12";
src = fetchFromGitHub {
owner = "gokcehan";
repo = "lf";
rev = "r${version}";
sha256 = "13622sx6xmbm8gf38dn8y8mkfnlbpamg4hmzsy9jnzg4h8qbjm6b";
sha256 = "1pjydnwlc6mrnwz13s13c91nvjvb1ibwl944ppg8xq8dcy9b2cs4";
};
goPackagePath = "github.com/gokcehan/lf";
goDeps = ./deps.nix;
modSha256 = "14fvn8yjm9cnpsmzgxw2dypr3h8h36mxrbk7zma42w8rsp46jpz7";
# TODO: Setting buildFlags probably isn't working properly. I've tried a few
# variants, e.g.:
# - buildFlags = "-ldflags \"-s -w -X 'main.gVersion=${version}'\"";
# - buildFlags = "-ldflags \\\"-X ${goPackagePath}/main.gVersion=${version}\\\"";
# Override the build phase (to set buildFlags):
buildPhase = ''
runHook preBuild
runHook renameImports
cd go/src/${goPackagePath}
go install -ldflags="-s -w -X main.gVersion=r${version}"
runHook postBuild
'';
@ -32,7 +29,7 @@ buildGoPackage rec {
install -D --mode=444 lf.1 $out/share/man/man1/lf.1
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "A terminal file manager written in Go and heavily inspired by ranger";
longDescription = ''
lf (as in "list files") is a terminal file manager written in Go. It is

View file

@ -1,20 +0,0 @@
[
{
goPackagePath = "github.com/nsf/termbox-go";
fetch = {
type = "git";
url = "https://github.com/nsf/termbox-go";
rev = "02980233997d87bbda048393d47b4d453f7a398d"; # master
sha256 = "1zxysi00bk7bv5ka6vn9dnzk5q9wjp0252cm3v6l2hbrcx7405zw";
};
}
{
goPackagePath = "github.com/mattn/go-runewidth";
fetch = {
type = "git";
url = "https://github.com/mattn/go-runewidth";
rev = "3ee7d812e62a0804a7d0a324e0249ca2db3476d3"; # v0.0.4
sha256 = "00b3ssm7wiqln3k54z2wcnxr3k3c7m1ybyhb9h8ixzbzspld0qzs";
};
}
]