Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildGoModule, 4 callPackage, 5 fetchFromGitHub, 6 installShellFiles, 7 stdenv, 8 # Deprecated options 9 # Remove them as soon as possible 10 withXclip ? null, 11 withWlClipboard ? null, 12 withWlclip ? null, 13}: 14 15let 16 self = buildGoModule { 17 pname = "micro"; 18 version = "2.0.14"; 19 20 src = fetchFromGitHub { 21 owner = "zyedidia"; 22 repo = "micro"; 23 rev = "v${self.version}"; 24 hash = "sha256-avLVl6mn0xKgIy0BNnPZ8ypQhn8Ivj7gTgWbebDSjt0="; 25 }; 26 27 vendorHash = "sha256-ePhObvm3m/nT+7IyT0W6K+y+9UNkfd2kYjle2ffAd9Y="; 28 29 nativeBuildInputs = [ installShellFiles ]; 30 31 outputs = [ 32 "out" 33 "man" 34 ]; 35 36 subPackages = [ "cmd/micro" ]; 37 38 ldflags = 39 let 40 t = "github.com/zyedidia/micro/v2/internal"; 41 in 42 [ 43 "-s" 44 "-w" 45 "-X ${t}/util.Version=${self.version}" 46 "-X ${t}/util.CommitHash=${self.src.rev}" 47 ]; 48 49 strictDeps = true; 50 51 preBuild = '' 52 GOOS= GOARCH= go generate ./runtime 53 ''; 54 55 postInstall = '' 56 installManPage assets/packaging/micro.1 57 install -Dm444 assets/packaging/micro.desktop $out/share/applications/micro.desktop 58 install -Dm644 assets/micro-logo-mark.svg $out/share/icons/hicolor/scalable/apps/micro.svg 59 ''; 60 61 passthru = { 62 tests = lib.packagesFromDirectoryRecursive { 63 inherit callPackage; 64 directory = ./tests; 65 }; 66 wrapper = callPackage ./wrapper.nix { micro = self; }; 67 }; 68 69 meta = { 70 homepage = "https://micro-editor.github.io"; 71 changelog = "https://github.com/zyedidia/micro/releases/"; 72 description = "Modern and intuitive terminal-based text editor"; 73 longDescription = '' 74 micro is a terminal-based text editor that aims to be easy to use and 75 intuitive, while also taking advantage of the capabilities of modern 76 terminals. 77 78 As its name indicates, micro aims to be somewhat of a successor to the 79 nano editor by being easy to install and use. It strives to be enjoyable 80 as a full-time editor for people who prefer to work in a terminal, or 81 those who regularly edit files over SSH. 82 ''; 83 license = lib.licenses.mit; 84 mainProgram = "micro"; 85 maintainers = with lib.maintainers; [ 86 pbsds 87 ]; 88 }; 89 }; 90in 91lib.warnIf (withXclip != null || withWlClipboard != null || withWlclip != null) '' 92 The options `withXclip`, `withWlClipboard`, `withWlclip` were removed. If 93 you are seeking for clipboard support, please consider the following 94 packages: 95 - `micro-with-wl-clipboard` 96 - `micro-with-xclip` 97 - `micro-full` 98'' self