02cf88bb76
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, callPackage }:
|
|
|
|
buildGoModule rec {
|
|
pname = "micro";
|
|
version = "2.0.11";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "zyedidia";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-3Rppi8UcAc4zdXOd81Y+sb5Psezx2TQsNw73WdPVMgE=";
|
|
};
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
subPackages = [ "cmd/micro" ];
|
|
|
|
vendorSha256 = "sha256-/bWIn5joZOTOtuAbljOc0NgBfjrFkbFZih+cPNHnS9w=";
|
|
|
|
ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [
|
|
"-s"
|
|
"-w"
|
|
"-X ${t}/util.Version=${version}"
|
|
"-X ${t}/util.CommitHash=${src.rev}"
|
|
];
|
|
|
|
postInstall = ''
|
|
installManPage assets/packaging/micro.1
|
|
install -Dt $out/share/applications assets/packaging/micro.desktop
|
|
'';
|
|
|
|
passthru.tests.expect = callPackage ./test-with-expect.nix {};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://micro-editor.github.io";
|
|
description = "Modern and intuitive terminal-based text editor";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
};
|
|
}
|