2021-02-27 02:43:34 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gettext
|
|
|
|
, help2man
|
|
|
|
, pkg-config
|
|
|
|
, texinfo
|
|
|
|
, makeWrapper
|
|
|
|
, boehmgc
|
|
|
|
, readline
|
|
|
|
, guiSupport ? false, tcl, tcllib, tk
|
|
|
|
, miSupport ? true, json_c
|
|
|
|
, nbdSupport ? true, libnbd
|
|
|
|
, textStylingSupport ? true
|
|
|
|
, dejagnu
|
|
|
|
}:
|
|
|
|
|
2021-02-27 13:10:30 +01:00
|
|
|
let
|
|
|
|
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
|
|
|
in stdenv.mkDerivation rec {
|
2021-02-27 02:43:34 +01:00
|
|
|
pname = "poke";
|
|
|
|
version = "1.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
|
|
|
|
hash = "sha256-3pMLhwDAdys8LNDQyjX1D9PXe9+CxiUetRa0noyiWwo=";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
help2man
|
|
|
|
pkg-config
|
|
|
|
texinfo
|
|
|
|
] ++ lib.optional guiSupport makeWrapper;
|
|
|
|
|
2021-02-27 13:10:30 +01:00
|
|
|
buildInputs = [ boehmgc readline ]
|
2021-02-27 02:43:34 +01:00
|
|
|
++ lib.optional guiSupport tk
|
|
|
|
++ lib.optional miSupport json_c
|
|
|
|
++ lib.optional nbdSupport libnbd
|
2021-02-27 13:10:30 +01:00
|
|
|
++ lib.optional textStylingSupport gettext
|
|
|
|
++ lib.optional (!isCross) dejagnu;
|
2021-02-27 02:43:34 +01:00
|
|
|
|
|
|
|
configureFlags = lib.optionals guiSupport [
|
|
|
|
"--with-tcl=${tcl}/lib"
|
|
|
|
"--with-tk=${tk}/lib"
|
|
|
|
"--with-tkinclude=${tk.dev}/include"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-27 13:10:30 +01:00
|
|
|
doCheck = !isCross;
|
|
|
|
checkInputs = lib.optionals (!isCross) [ dejagnu ];
|
2021-02-27 02:43:34 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# TODO: Enable guiSupport by default once it's more than just a stub
|