2022-03-30 09:31:56 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, callPackage }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "micro";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "2.0.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zyedidia";
|
2020-06-15 15:56:04 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-3Rppi8UcAc4zdXOd81Y+sb5Psezx2TQsNw73WdPVMgE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "cmd/micro" ];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
vendorSha256 = "sha256-/bWIn5joZOTOtuAbljOc0NgBfjrFkbFZih+cPNHnS9w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
ldflags = let t = "github.com/zyedidia/micro/v2/internal"; in [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X ${t}/util.Version=${version}"
|
|
|
|
"-X ${t}/util.CommitHash=${src.rev}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
preBuild = ''
|
|
|
|
go generate ./runtime
|
|
|
|
'';
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
postInstall = ''
|
2020-11-03 02:18:15 +00:00
|
|
|
installManPage assets/packaging/micro.1
|
|
|
|
install -Dt $out/share/applications assets/packaging/micro.desktop
|
2022-08-21 13:32:41 +00:00
|
|
|
install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg
|
2020-06-15 15:56:04 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
passthru.tests.expect = callPackage ./test-with-expect.nix {};
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://micro-editor.github.io";
|
|
|
|
description = "Modern and intuitive terminal-based text editor";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
|
|
};
|
|
|
|
}
|