2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gettext
|
|
|
|
, help2man
|
|
|
|
, pkg-config
|
|
|
|
, texinfo
|
|
|
|
, makeWrapper
|
|
|
|
, boehmgc
|
|
|
|
, readline
|
|
|
|
, guiSupport ? false, tcl, tcllib, tk
|
|
|
|
, miSupport ? true, json_c
|
2021-03-23 19:22:30 +00:00
|
|
|
, nbdSupport ? !stdenv.isDarwin, libnbd
|
2021-03-09 03:18:52 +00:00
|
|
|
, textStylingSupport ? true
|
|
|
|
, dejagnu
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
# update script only
|
|
|
|
, writeScript
|
2021-03-09 03:18:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "poke";
|
2022-04-03 18:54:34 +00:00
|
|
|
version = "2.2";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
|
2022-04-03 18:54:34 +00:00
|
|
|
sha256 = "sha256-xF6k5xpRohhTZzhcAc65dZbsW3EDOGm+xKYLHLciWQM=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
outputs = [ "out" "dev" "info" "lib" "man" ];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
help2man
|
|
|
|
pkg-config
|
|
|
|
texinfo
|
|
|
|
] ++ lib.optional guiSupport makeWrapper;
|
|
|
|
|
|
|
|
buildInputs = [ boehmgc readline ]
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optionals guiSupport [ tk tcl.tclPackageHook tcllib ]
|
2021-03-09 03:18:52 +00:00
|
|
|
++ lib.optional miSupport json_c
|
|
|
|
++ lib.optional nbdSupport libnbd
|
|
|
|
++ lib.optional textStylingSupport gettext
|
|
|
|
++ lib.optional (!isCross) dejagnu;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--datadir=${placeholder "lib"}/share"
|
|
|
|
] ++ lib.optionals guiSupport [
|
2021-03-09 03:18:52 +00:00
|
|
|
"--with-tcl=${tcl}/lib"
|
|
|
|
"--with-tk=${tk}/lib"
|
|
|
|
"--with-tkinclude=${tk.dev}/include"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = !isCross;
|
|
|
|
checkInputs = lib.optionals (!isCross) [ dejagnu ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput share/emacs "$out"
|
|
|
|
'';
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = writeScript "update-poke" ''
|
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -i bash -p curl pcre common-updater-scripts
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
# Expect the text in format of '<a href="...">poke 2.0</a>'
|
|
|
|
new_version="$(curl -s https://www.jemarch.net/poke |
|
|
|
|
pcregrep -o1 '>poke ([0-9.]+)</a>')"
|
|
|
|
update-source-version ${pname} "$new_version"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Interactive, extensible editor for binary data";
|
|
|
|
homepage = "http://www.jemarch.net/poke";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres kira-bruneau ];
|
2021-03-09 03:18:52 +00:00
|
|
|
platforms = platforms.unix;
|
2021-04-05 15:23:46 +00:00
|
|
|
changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
# TODO: Enable guiSupport by default once it's more than just a stub
|