nixpkgs/pkgs/applications/editors/poke/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

117 lines
2.9 KiB
Nix
Raw Normal View History

2021-02-27 01:43:34 +00:00
{ lib
, stdenv
, fetchurl
, autoreconfHook
2021-02-27 01:43:34 +00:00
, gettext
, help2man
, pkg-config
, texinfo
, boehmgc
, readline
, guiSupport ? false, makeWrapper, tcl, tcllib, tk
2021-02-27 01:43:34 +00:00
, miSupport ? true, json_c
, nbdSupport ? !stdenv.isDarwin, libnbd
2021-02-27 01:43:34 +00:00
, textStylingSupport ? true
, dejagnu
# update script only
, writeScript
2021-02-27 01:43:34 +00:00
}:
2021-02-27 12:10:30 +00:00
let
isCross = stdenv.hostPlatform != stdenv.buildPlatform;
in stdenv.mkDerivation rec {
2021-02-27 01:43:34 +00:00
pname = "poke";
2022-07-26 08:31:56 +00:00
version = "2.4";
2021-02-27 01:43:34 +00:00
src = fetchurl {
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
2022-07-26 08:31:56 +00:00
sha256 = "sha256-hB4oWRfGc4zpgqaTDjDr6t7PsGVaedkYTxb4dqn+bkc=";
2021-02-27 01:43:34 +00:00
};
2022-07-26 14:49:49 +00:00
outputs = [ "out" "dev" "info" "lib" ]
# help2man can't cross compile because it runs `poke --help` to
# generate the man page
++ lib.optional (!isCross) "man";
2021-12-03 05:13:08 +00:00
2021-02-27 01:43:34 +00:00
postPatch = ''
patchShebangs .
'';
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
2021-02-27 01:43:34 +00:00
gettext
pkg-config
texinfo
2022-07-26 14:49:49 +00:00
] ++ lib.optionals (!isCross) [
help2man
2022-07-26 13:59:00 +00:00
] ++ lib.optionals guiSupport [
makeWrapper
tcl.tclPackageHook
];
2021-02-27 01:43:34 +00:00
2021-02-27 12:10:30 +00:00
buildInputs = [ boehmgc readline ]
2022-07-26 13:59:00 +00:00
++ lib.optionals guiSupport [ tcl tcllib tk ]
2021-02-27 01:43:34 +00:00
++ lib.optional miSupport json_c
++ lib.optional nbdSupport libnbd
2021-02-27 12:10:30 +00:00
++ lib.optional textStylingSupport gettext
++ lib.optional (!isCross) dejagnu;
2021-02-27 01:43:34 +00:00
2021-12-03 05:13:08 +00:00
configureFlags = [
2022-07-26 12:21:13 +00:00
# libpoke depends on $datadir/poke, so we specify the datadir in
# $lib, and later move anything else it doesn't depend on to $out
2021-12-03 05:13:08 +00:00
"--datadir=${placeholder "lib"}/share"
] ++ lib.optionals guiSupport [
2022-07-26 13:59:00 +00:00
"--enable-gui"
2021-02-27 01:43:34 +00:00
"--with-tcl=${tcl}/lib"
"--with-tk=${tk}/lib"
"--with-tkinclude=${tk.dev}/include"
];
enableParallelBuilding = true;
2021-02-27 12:10:30 +00:00
doCheck = !isCross;
checkInputs = lib.optionals (!isCross) [ dejagnu ];
2021-02-27 01:43:34 +00:00
2021-12-03 05:13:08 +00:00
postInstall = ''
moveToOutput share/emacs "$out"
2022-07-26 12:21:13 +00:00
moveToOutput share/vim "$out"
2021-12-03 05:13:08 +00:00
'';
postFixup = lib.optionalString guiSupport ''
wrapProgram "$out/bin/poke-gui" \
--prefix TCLLIBPATH ' ' "$TCLLIBPATH"
# Prevent tclPackageHook from auto-wrapping all binaries, we only
# need to wrap poke-gui
unset TCLLIBPATH
'';
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-02-27 01:43:34 +00:00
meta = with lib; {
description = "Interactive, extensible editor for binary data";
homepage = "http://www.jemarch.net/poke";
poke: mark aarch64-darwin as a bad platform Jitter fails to compile on aarch64-darwin: Undefined symbols for architecture arm64: "_jitter_print_context_kind_destroy", referenced from: _jitter_print_libtextstyle_finalize in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_jitter_print_context_kind_make_trivial", referenced from: _jitter_print_libtextstyle_initialize in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_jitter_print_context_make", referenced from: _jitter_print_context_make_libtextstyle in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) (maybe you meant: _jitter_print_context_make_libtextstyle) "_ostream_flush", referenced from: _jitter_print_context_libtextstyle_flush in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_ostream_write_mem", referenced from: _jitter_print_context_libtextstyle_print_chars in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_styled_ostream_begin_use_class", referenced from: _jitter_print_context_libtextstyle_begin_decoration in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_styled_ostream_end_use_class", referenced from: _jitter_print_context_libtextstyle_end_decoration in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) "_styled_ostream_set_hyperlink", referenced from: _jitter_print_context_libtextstyle_begin_decoration in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) _jitter_print_context_libtextstyle_end_decoration in libjitter-libtextstyle.a(jitter-print-libtextstyle.o) ld: symbol(s) not found for architecture arm64
2022-07-26 15:04:00 +00:00
changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${version}";
2021-02-27 01:43:34 +00:00
license = licenses.gpl3Plus;
maintainers = with maintainers; [ AndersonTorres kira-bruneau ];
2021-02-27 01:43:34 +00:00
platforms = platforms.unix;
};
}
# TODO: Enable guiSupport by default once it's more than just a stub