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";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.0.12";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-L8yJE3rjNcx+1gawQ8urZcFfoQdO20E67mJQjWaVwVo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-h00s+xqepj+odKAgf54s35xMnnj3gtx5LWDOYFx5GY0=";
|
|
|
|
|
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
|
|
|
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
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.tests.expect = callPackage ./test-with-expect.nix { };
|
2022-03-30 09:31:56 +00:00
|
|
|
|
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 ];
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "micro";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|