10 nbdSupport ? !stdenv.hostPlatform.isDarwin,
12 textStylingSupport ? true,
21 isCross = stdenv.hostPlatform != stdenv.buildPlatform;
23 stdenv.mkDerivation (finalAttrs: {
28 url = "mirror://gnu/poke/poke-${finalAttrs.version}.tar.gz";
29 hash = "sha256-iq825h42elMUDqQOJVnp7FEud5xCvuNOesJLNLoRm94=";
39 # help2man can't cross compile because it runs `poke --help` to
40 # generate the man page
41 ++ lib.optional (!isCross) "man";
54 ++ lib.optionals (!isCross) [
63 ++ lib.optional nbdSupport libnbd
64 ++ lib.optional textStylingSupport gettext
65 ++ lib.optional finalAttrs.finalPackage.doCheck dejagnu;
68 # libpoke depends on $datadir/poke, so we specify the datadir in
69 # $lib, and later move anything else it doesn't depend on to $out
70 "--datadir=${placeholder "lib"}/share"
73 enableParallelBuilding = true;
76 nativeCheckInputs = [ dejagnu ];
79 moveToOutput share/emacs "$out"
80 moveToOutput share/vim "$out"
84 updateScript = writeScript "update-poke" ''
85 #!/usr/bin/env nix-shell
86 #!nix-shell -i bash -p curl pcre common-updater-scripts
90 # Expect the text in format of '<a href="...">poke 2.0</a>'
91 new_version="$(curl -s https://www.jemarch.net/poke |
92 pcregrep -o1 '>poke ([0-9.]+)</a>')"
93 update-source-version poke "$new_version"
98 description = "Interactive, extensible editor for binary data";
99 homepage = "http://www.jemarch.net/poke";
100 changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${finalAttrs.version}";
101 license = lib.licenses.gpl3Plus;
102 maintainers = with lib.maintainers; [ kira-bruneau ];
103 platforms = lib.platforms.unix;
104 hydraPlatforms = lib.platforms.linux; # build hangs on Darwin platforms, needs investigation