about summary refs log tree commit diff
path: root/pkgs/applications/editors/orbiton
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@disroot.org>2023-04-09 19:52:14 +0400
committerNikolay Korotkiy <sikmir@disroot.org>2023-04-09 20:44:48 +0400
commitb96d7b5eadbd507def3d49492265b886309cbb12 (patch)
tree67253ea7038f4e1c5499f8f86b0f482308efe302 /pkgs/applications/editors/orbiton
parent6b2b317f70a73b09df240a212a0feccb60f21195 (diff)
o: rename to orbiton
Diffstat (limited to 'pkgs/applications/editors/orbiton')
-rw-r--r--pkgs/applications/editors/orbiton/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/applications/editors/orbiton/default.nix b/pkgs/applications/editors/orbiton/default.nix
new file mode 100644
index 0000000000000..ec8eb24073c21
--- /dev/null
+++ b/pkgs/applications/editors/orbiton/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper, pkg-config
+, withGui ? true, vte
+}:
+
+buildGoModule rec {
+  pname = "orbiton";
+  version = "2.60.5";
+
+  src = fetchFromGitHub {
+    owner = "xyproto";
+    repo = "orbiton";
+    rev = "v${version}";
+    hash = "sha256-gCE4mrZXLFteZKUPDsAc1hS1I/WTns9I9oZE5bAF7fU=";
+  };
+
+  vendorHash = null;
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace "-Wl,--as-needed" ""
+
+    # Requires impure pbcopy and pbpaste
+    substituteInPlace v2/pbcopy_test.go \
+      --replace TestPBcopy SkipTestPBcopy
+  '';
+
+  nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
+
+  buildInputs = lib.optional withGui vte;
+
+  preBuild = "cd v2";
+
+  postInstall = ''
+    cd ..
+    installManPage o.1
+    mv $out/bin/{orbiton,o}
+  '' + lib.optionalString withGui ''
+    make install-gui PREFIX=$out
+    wrapProgram $out/bin/og --prefix PATH : $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Config-free text editor and IDE limited to VT100";
+    homepage = "https://github.com/xyproto/orbiton";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ sikmir ];
+    mainProgram = "o";
+  };
+}