summary refs log tree commit diff
path: root/pkgs/tools/misc/dvtm
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/dvtm')
-rw-r--r--pkgs/tools/misc/dvtm/default.nix20
-rw-r--r--pkgs/tools/misc/dvtm/dvtm.nix29
-rw-r--r--pkgs/tools/misc/dvtm/unstable.nix30
3 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/tools/misc/dvtm/default.nix b/pkgs/tools/misc/dvtm/default.nix
new file mode 100644
index 00000000000..ea5a051c62b
--- /dev/null
+++ b/pkgs/tools/misc/dvtm/default.nix
@@ -0,0 +1,20 @@
+{callPackage, fetchurl}:
+callPackage ./dvtm.nix rec {
+  pname = "dvtm";
+  version = "0.15";
+
+  src = fetchurl {
+    url = "https://www.brain-dump.org/projects/dvtm/dvtm-${version}.tar.gz";
+    sha256 = "0475w514b7i3gxk6khy8pfj2gx9l7lv2pwacmq92zn1abv01a84g";
+  };
+
+  patches = [
+    # https://github.com/martanne/dvtm/pull/69
+    # Use self-pipe instead of signal blocking fixes issues on darwin.
+    (fetchurl {
+      url = "https://github.com/martanne/dvtm/commit/1f1ed664d64603f3f1ce1388571227dc723901b2.patch";
+      sha256 = "1cby8x3ckvhzqa8yxlfrwzgm8wk7yz84kr9psdjr7xwpnca1cqrd";
+    })
+  ];
+}
+
diff --git a/pkgs/tools/misc/dvtm/dvtm.nix b/pkgs/tools/misc/dvtm/dvtm.nix
new file mode 100644
index 00000000000..feb9c7a92f8
--- /dev/null
+++ b/pkgs/tools/misc/dvtm/dvtm.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, ncurses, customConfig ? null, pname, version, src, patches ? [] }:
+stdenv.mkDerivation {
+
+  inherit pname version src patches;
+
+  CFLAGS = lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE";
+
+  postPatch = lib.optionalString (customConfig != null) ''
+    cp ${builtins.toFile "config.h" customConfig} ./config.h
+  '';
+
+  nativeBuildInputs = [ ncurses ];
+  buildInputs = [ ncurses ];
+
+  prePatch = ''
+    substituteInPlace Makefile \
+      --replace /usr/share/terminfo $out/share/terminfo
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Dynamic virtual terminal manager";
+    homepage = "http://www.brain-dump.org/projects/dvtm";
+    license = licenses.mit;
+    maintainers = [ maintainers.vrthra ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/tools/misc/dvtm/unstable.nix b/pkgs/tools/misc/dvtm/unstable.nix
new file mode 100644
index 00000000000..65e62be0749
--- /dev/null
+++ b/pkgs/tools/misc/dvtm/unstable.nix
@@ -0,0 +1,30 @@
+{callPackage, fetchFromGitHub, fetchpatch}:
+callPackage ./dvtm.nix {
+  pname = "dvtm-unstable";
+  version = "2018-03-31";
+
+  src = fetchFromGitHub {
+    owner = "martanne";
+    repo = "dvtm";
+    rev = "311a8c0c28296f8f87fb63349e0f3254c7481e14";
+    sha256 = "0pyxjkaxh8n97kccnmd3p98vi9h8mcfy5lswzqiplsxmxxmlbpx2";
+  };
+
+  patches = [
+    # https://github.com/martanne/dvtm/pull/69
+    # Use self-pipe instead of signal blocking fixes issues on darwin.
+    (fetchpatch {
+      name = "use-self-pipe-fix-darwin";
+      url = "https://github.com/martanne/dvtm/commit/1f1ed664d64603f3f1ce1388571227dc723901b2.patch";
+      sha256 = "14j3kks7b1v6qq12442v1da3h7khp02rp0vi0qrz0rfgkg1zilpb";
+    })
+
+    # https://github.com/martanne/dvtm/pull/86
+    # Fix buffer corruption when title is updated
+    (fetchpatch {
+      name = "fix-buffer-corruption-on-title-update";
+      url = "https://github.com/martanne/dvtm/commit/be6c3f8f615daeab214d484e6fff22e19631a0d1.patch";
+      sha256 = "1wdrl3sg815lhs22fwbc4w5dn4ifpdgl7v1kqfnhg752av4im7h7";
+    })
+  ];
+}