about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/poke/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/poke/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/editors/poke/default.nix75
1 files changed, 75 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/editors/poke/default.nix b/nixpkgs/pkgs/applications/editors/poke/default.nix
new file mode 100644
index 000000000000..47b9677e314c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/editors/poke/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchurl
+, gettext
+, help2man
+, pkg-config
+, texinfo
+, makeWrapper
+, boehmgc
+, readline
+, guiSupport ? false, tcl, tcllib, tk
+, miSupport ? true, json_c
+, nbdSupport ? !stdenv.isDarwin, libnbd
+, textStylingSupport ? true
+, dejagnu
+}:
+
+let
+  isCross = stdenv.hostPlatform != stdenv.buildPlatform;
+in stdenv.mkDerivation rec {
+  pname = "poke";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
+    hash = "sha256-zWjfY8dBtBYLEsvqAvJ8RxWCeUZuNEOTDSU1pFLAatY=";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    gettext
+    help2man
+    pkg-config
+    texinfo
+  ] ++ lib.optional guiSupport makeWrapper;
+
+  buildInputs = [ boehmgc readline ]
+  ++ lib.optional guiSupport tk
+  ++ lib.optional miSupport json_c
+  ++ lib.optional nbdSupport libnbd
+  ++ lib.optional textStylingSupport gettext
+  ++ lib.optional (!isCross) dejagnu;
+
+  configureFlags = lib.optionals guiSupport [
+    "--with-tcl=${tcl}/lib"
+    "--with-tk=${tk}/lib"
+    "--with-tkinclude=${tk.dev}/include"
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = !isCross;
+  checkInputs = lib.optionals (!isCross) [ dejagnu ];
+
+  postFixup = lib.optionalString guiSupport ''
+    wrapProgram "$out/bin/poke-gui" \
+      --prefix TCLLIBPATH ' ' ${tcllib}/lib/tcllib${tcllib.version}
+  '';
+
+  meta = with lib; {
+    description = "Interactive, extensible editor for binary data";
+    homepage = "http://www.jemarch.net/poke";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres metadark ];
+    platforms = platforms.unix;
+    changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${version}";
+  };
+}
+
+# TODO: Enable guiSupport by default once it's more than just a stub