2022-02-27 15:55:03 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, callPackage }:
|
2018-01-06 19:49:58 +00:00
|
|
|
|
2020-10-07 05:20:00 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "micro";
|
2022-08-01 09:03:41 +01:00
|
|
|
version = "2.0.11";
|
2018-01-06 19:49:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zyedidia";
|
2020-06-19 17:53:34 +01:00
|
|
|
repo = pname;
|
2018-01-06 19:49:58 +00:00
|
|
|
rev = "v${version}";
|
2022-08-01 09:03:41 +01:00
|
|
|
sha256 = "sha256-3Rppi8UcAc4zdXOd81Y+sb5Psezx2TQsNw73WdPVMgE=";
|
2018-01-06 19:49:58 +00:00
|
|
|
};
|
|
|
|
|
2020-06-22 14:13:19 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2018-01-06 19:49:58 +00:00
|
|
|
subPackages = [ "cmd/micro" ];
|
|
|
|
|
2022-08-01 09:03:41 +01:00
|
|
|
vendorSha256 = "sha256-/bWIn5joZOTOtuAbljOc0NgBfjrFkbFZih+cPNHnS9w=";
|
2020-04-18 18:26:43 +01:00
|
|
|
|
2022-08-01 09:03:41 +01:00
|
|
|
ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X ${t}/util.Version=${version}"
|
|
|
|
"-X ${t}/util.CommitHash=${src.rev}"
|
|
|
|
];
|
2018-01-06 19:49:58 +00:00
|
|
|
|
2022-08-16 00:26:46 +01:00
|
|
|
preBuild = ''
|
|
|
|
go generate ./runtime
|
|
|
|
'';
|
|
|
|
|
2020-06-22 14:13:19 +01:00
|
|
|
postInstall = ''
|
2020-10-07 05:20:00 +01:00
|
|
|
installManPage assets/packaging/micro.1
|
|
|
|
install -Dt $out/share/applications assets/packaging/micro.desktop
|
2022-08-07 15:47:03 +01:00
|
|
|
install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg
|
2020-06-22 14:13:19 +01:00
|
|
|
'';
|
|
|
|
|
2022-02-27 15:55:03 +00:00
|
|
|
passthru.tests.expect = callPackage ./test-with-expect.nix {};
|
|
|
|
|
2020-10-07 05:20:00 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://micro-editor.github.io";
|
2018-01-06 19:49:58 +00:00
|
|
|
description = "Modern and intuitive terminal-based text editor";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
|
|
};
|
|
|
|
}
|