9 , nbdSupport ? !stdenv.hostPlatform.isDarwin, libnbd
10 , textStylingSupport ? true, gettext
18 isCross = stdenv.hostPlatform != stdenv.buildPlatform;
20 stdenv.mkDerivation (finalAttrs: {
25 url = "mirror://gnu/poke/poke-${finalAttrs.version}.tar.gz";
26 hash = "sha256-iq825h42elMUDqQOJVnp7FEud5xCvuNOesJLNLoRm94=";
29 outputs = [ "out" "dev" "info" "lib" ]
30 # help2man can't cross compile because it runs `poke --help` to
31 # generate the man page
32 ++ lib.optional (!isCross) "man";
43 ] ++ lib.optionals (!isCross) [
47 buildInputs = [ boehmgc readline ]
48 ++ lib.optional nbdSupport libnbd
49 ++ lib.optional textStylingSupport gettext
50 ++ lib.optional finalAttrs.finalPackage.doCheck dejagnu;
53 # libpoke depends on $datadir/poke, so we specify the datadir in
54 # $lib, and later move anything else it doesn't depend on to $out
55 "--datadir=${placeholder "lib"}/share"
58 enableParallelBuilding = true;
61 nativeCheckInputs = [ dejagnu ];
64 moveToOutput share/emacs "$out"
65 moveToOutput share/vim "$out"
69 updateScript = writeScript "update-poke" ''
70 #!/usr/bin/env nix-shell
71 #!nix-shell -i bash -p curl pcre common-updater-scripts
75 # Expect the text in format of '<a href="...">poke 2.0</a>'
76 new_version="$(curl -s https://www.jemarch.net/poke |
77 pcregrep -o1 '>poke ([0-9.]+)</a>')"
78 update-source-version poke "$new_version"
83 description = "Interactive, extensible editor for binary data";
84 homepage = "http://www.jemarch.net/poke";
85 changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${finalAttrs.version}";
86 license = lib.licenses.gpl3Plus;
87 maintainers = with lib.maintainers; [ AndersonTorres kira-bruneau ];
88 platforms = lib.platforms.unix;
89 broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;