nixpkgs/pkgs/applications/editors/micro/default.nix

41 lines
939 B
Nix
Raw Normal View History

2020-06-22 15:13:19 +02:00
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles }:
2018-01-06 20:49:58 +01:00
2020-06-22 15:13:19 +02:00
buildGoPackage rec {
pname = "micro";
2020-06-19 18:53:34 +02:00
version = "2.0.5";
2018-01-06 20:49:58 +01:00
goPackagePath = "github.com/zyedidia/micro";
src = fetchFromGitHub {
owner = "zyedidia";
2020-06-19 18:53:34 +02:00
repo = pname;
2018-01-06 20:49:58 +01:00
rev = "v${version}";
2020-06-19 18:53:34 +02:00
sha256 = "12fyyax1mr0n82s5yhmk90iyyzbh32rppkkpj37c25pal73czdhc";
2018-01-06 20:49:58 +01:00
fetchSubmodules = true;
};
2020-06-22 15:13:19 +02:00
nativeBuildInputs = [ installShellFiles ];
2018-01-06 20:49:58 +01:00
subPackages = [ "cmd/micro" ];
2020-06-19 18:53:34 +02:00
buildFlagsArray = let t = "${goPackagePath}/internal/util"; in ''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.CommitHash=${src.rev}
'';
2020-04-18 19:26:43 +02:00
goDeps = ./deps.nix;
2018-01-06 20:49:58 +01:00
2020-06-22 15:13:19 +02:00
postInstall = ''
installManPage $src/assets/packaging/micro.1
'';
2018-01-06 20:49:58 +01:00
meta = with stdenv.lib; {
homepage = "https://micro-editor.github.io";
2018-01-06 20:49:58 +01:00
description = "Modern and intuitive terminal-based text editor";
license = licenses.mit;
maintainers = with maintainers; [ dtzWill ];
};
}