From 78aa8bdf18ab9dada06d5e6007a93553c5a64053 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Tue, 26 Jul 2022 08:31:56 +0000 Subject: [PATCH 1/6] poke: 2.3 -> 2.4 (cherry picked from commit 6810e93f132ad45a3e3501c8eec0f5978bcad82e) --- pkgs/applications/editors/poke/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index 77466cfdbea8..9e3f5f415029 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -22,11 +22,11 @@ let isCross = stdenv.hostPlatform != stdenv.buildPlatform; in stdenv.mkDerivation rec { pname = "poke"; - version = "2.3"; + version = "2.4"; src = fetchurl { url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz"; - sha256 = "sha256-NpDPERbafLOp7GtPcAPiU+JotRAhKiiP04qv7Q68x2Y="; + sha256 = "sha256-hB4oWRfGc4zpgqaTDjDr6t7PsGVaedkYTxb4dqn+bkc="; }; outputs = [ "out" "dev" "info" "lib" "man" ]; From 539569b7c077cecc7592a253e0e6d3305b516886 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 08:21:13 -0400 Subject: [PATCH 2/6] poke: move share/vim from $lib to $out (cherry picked from commit 45f46d31a65d9788e8b9225bf08dbe66dbb388f9) --- pkgs/applications/editors/poke/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index 9e3f5f415029..cf85c0b591b2 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -52,6 +52,8 @@ in stdenv.mkDerivation rec { ++ lib.optional (!isCross) dejagnu; configureFlags = [ + # libpoke depends on $datadir/poke, so we specify the datadir in + # $lib, and later move anything else it doesn't depend on to $out "--datadir=${placeholder "lib"}/share" ] ++ lib.optionals guiSupport [ "--with-tcl=${tcl}/lib" @@ -66,6 +68,7 @@ in stdenv.mkDerivation rec { postInstall = '' moveToOutput share/emacs "$out" + moveToOutput share/vim "$out" ''; passthru = { From 574c988455d4941a56e9d881f6bce9c9c59c9686 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 09:59:00 -0400 Subject: [PATCH 3/6] poke: fix guiSupport (cherry picked from commit c027d1a8f254a981a312575e650e2af9d8ad3885) --- pkgs/applications/editors/poke/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index cf85c0b591b2..d8f2dcf1ffcd 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -42,10 +42,13 @@ in stdenv.mkDerivation rec { help2man pkg-config texinfo - ] ++ lib.optional guiSupport makeWrapper; + ] ++ lib.optionals guiSupport [ + makeWrapper + tcl.tclPackageHook + ]; buildInputs = [ boehmgc readline ] - ++ lib.optionals guiSupport [ tk tcl.tclPackageHook tcllib ] + ++ lib.optionals guiSupport [ tcl tcllib tk ] ++ lib.optional miSupport json_c ++ lib.optional nbdSupport libnbd ++ lib.optional textStylingSupport gettext @@ -56,6 +59,7 @@ in stdenv.mkDerivation rec { # $lib, and later move anything else it doesn't depend on to $out "--datadir=${placeholder "lib"}/share" ] ++ lib.optionals guiSupport [ + "--enable-gui" "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" "--with-tkinclude=${tk.dev}/include" From 31d811d1b595b105757f99001d67e480d2bf64f1 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 08:22:32 -0400 Subject: [PATCH 4/6] poke: only wrap poke-gui with TCLLIBPATH (cherry picked from commit c8438227293eb0f2c0f1bf8ea48198620dc3a0d5) --- pkgs/applications/editors/poke/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index d8f2dcf1ffcd..1bfd690dd24f 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -5,10 +5,9 @@ , help2man , pkg-config , texinfo -, makeWrapper , boehmgc , readline -, guiSupport ? false, tcl, tcllib, tk +, guiSupport ? false, makeWrapper, tcl, tcllib, tk , miSupport ? true, json_c , nbdSupport ? !stdenv.isDarwin, libnbd , textStylingSupport ? true @@ -75,6 +74,15 @@ in stdenv.mkDerivation rec { moveToOutput share/vim "$out" ''; + 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 From f40c8a1739897c22296535c0012738d32a3b4420 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 10:49:49 -0400 Subject: [PATCH 5/6] poke: fix cross-compilation (cherry picked from commit c360ada54cb23b754a445f112d4158704202f891) --- pkgs/applications/editors/poke/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index 1bfd690dd24f..9bfc142b7d78 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -28,7 +28,10 @@ in stdenv.mkDerivation rec { sha256 = "sha256-hB4oWRfGc4zpgqaTDjDr6t7PsGVaedkYTxb4dqn+bkc="; }; - outputs = [ "out" "dev" "info" "lib" "man" ]; + outputs = [ "out" "dev" "info" "lib" ] + # help2man can't cross compile because it runs `poke --help` to + # generate the man page + ++ lib.optional (!isCross) "man"; postPatch = '' patchShebangs . @@ -38,9 +41,10 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ gettext - help2man pkg-config texinfo + ] ++ lib.optionals (!isCross) [ + help2man ] ++ lib.optionals guiSupport [ makeWrapper tcl.tclPackageHook From 11fc4a7fc121eea52761c7527e7c54fd4fe6774f Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 11:04:00 -0400 Subject: [PATCH 6/6] 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 (cherry picked from commit 9f5b96a9e13b6e934448c576a7a525be70e0ad69) --- pkgs/applications/editors/poke/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index 9bfc142b7d78..df20645a33e1 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -104,10 +104,11 @@ in stdenv.mkDerivation rec { meta = with lib; { description = "Interactive, extensible editor for binary data"; homepage = "http://www.jemarch.net/poke"; + changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${version}"; license = licenses.gpl3Plus; maintainers = with maintainers; [ AndersonTorres kira-bruneau ]; platforms = platforms.unix; - changelog = "https://git.savannah.gnu.org/cgit/poke.git/plain/ChangeLog?h=releases/poke-${version}"; + badPlatforms = [ "aarch64-darwin" ]; # Undefined symbols for architecture arm64 }; }