From 1cd94ec0663bdbebc16b59ed3bf249c52c1a24ae Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 4 Feb 2024 01:45:20 +0700 Subject: [PATCH 1/4] adbuco: patch to use XDG directory scheme by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This eliminates clutter in the user’s $HOME directory --- pkgs/tools/misc/abduco/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/abduco/default.nix b/pkgs/tools/misc/abduco/default.nix index 097cfd9170a9..5dc017d57fdc 100644 --- a/pkgs/tools/misc/abduco/default.nix +++ b/pkgs/tools/misc/abduco/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, writeText, conf ? null }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, writeText, conf ? null }: stdenv.mkDerivation rec { pname = "abduco"; @@ -17,6 +17,15 @@ stdenv.mkDerivation rec { installFlags = [ "install-completion" ]; CFLAGS = lib.optionalString stdenv.isDarwin "-D_DARWIN_C_SOURCE"; + patches = [ + # https://github.com/martanne/abduco/pull/22 + (fetchpatch { + name = "use-XDG-directory-scheme-by-default"; + url = "https://github.com/martanne/abduco/commit/0e9a00312ac9777edcb169122144762e3611287b.patch"; + sha256 = "sha256-4NkIflbRkUpS5XTM/fxBaELpvlZ4S5lecRa8jk0XC9g="; + }) + ]; + meta = with lib; { homepage = "http://brain-dump.org/projects/abduco"; license = licenses.isc; From 4c5ada2276ae311d210b4aa262be8b5a59f9f1a8 Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 4 Feb 2024 02:15:45 +0700 Subject: [PATCH 2/4] aduco: add patch to give exit code on dead session --- pkgs/tools/misc/abduco/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/tools/misc/abduco/default.nix b/pkgs/tools/misc/abduco/default.nix index 5dc017d57fdc..85eb225a6eb9 100644 --- a/pkgs/tools/misc/abduco/default.nix +++ b/pkgs/tools/misc/abduco/default.nix @@ -24,6 +24,14 @@ stdenv.mkDerivation rec { url = "https://github.com/martanne/abduco/commit/0e9a00312ac9777edcb169122144762e3611287b.patch"; sha256 = "sha256-4NkIflbRkUpS5XTM/fxBaELpvlZ4S5lecRa8jk0XC9g="; }) + + # “fix bug where attaching to dead session won't give underlying exit code” + # https://github.com/martanne/abduco/pull/45 + (fetchpatch { + name = "exit-code-when-attaching-to-dead-session"; + url = "https://github.com/martanne/abduco/commit/972ca8ab949ee342569dbd66b47cc4a17b28247b.patch"; + sha256 = "sha256-8hios0iKYDOmt6Bi5NNM9elTflGudnG2xgPF1pSkHI0="; + }) ]; meta = with lib; { From 79ba445fd570ee4fee28003071afb80e49a0e603 Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 4 Feb 2024 02:21:29 +0700 Subject: [PATCH 3/4] abduco: add patch to report pixel sizes to child processes --- pkgs/tools/misc/abduco/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/tools/misc/abduco/default.nix b/pkgs/tools/misc/abduco/default.nix index 85eb225a6eb9..a551fa0a7ee0 100644 --- a/pkgs/tools/misc/abduco/default.nix +++ b/pkgs/tools/misc/abduco/default.nix @@ -32,6 +32,15 @@ stdenv.mkDerivation rec { url = "https://github.com/martanne/abduco/commit/972ca8ab949ee342569dbd66b47cc4a17b28247b.patch"; sha256 = "sha256-8hios0iKYDOmt6Bi5NNM9elTflGudnG2xgPF1pSkHI0="; }) + + # “report pixel sizes to child processes that use ioctl(0, TIOCGWINSZ, ...)” + # used for kitty & other terminals that display images + # https://github.com/martanne/abduco/pull/62 + (fetchpatch { + name = "report-pixel-sizes-to-child-processes"; + url = "https://github.com/martanne/abduco/commit/a1e222308119b3251f00b42e1ddff74a385d4249.patch"; + sha256 = "sha256-eiF0A4IqJrrvXxjBYtltuVNpxQDv/iQPO+K7Y8hWBGg="; + }) ]; meta = with lib; { From f0ccbfb33109ac65d09792cc3df8b5be348c149a Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 4 Feb 2024 02:29:28 +0700 Subject: [PATCH 4/4] abduco: add mirror, remove recursion > You can always fetch the current code base from the git repository > located at GitHub or SourceHut. The owner says the source code will be offered in two places so the code fetching should reflect the mirror & it adds resiliance. --- pkgs/tools/misc/abduco/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/misc/abduco/default.nix b/pkgs/tools/misc/abduco/default.nix index a551fa0a7ee0..011f186bbbe2 100644 --- a/pkgs/tools/misc/abduco/default.nix +++ b/pkgs/tools/misc/abduco/default.nix @@ -1,14 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, writeText, conf ? null }: +{ lib, stdenv, fetchpatch, fetchzip, writeText, conf ? null }: -stdenv.mkDerivation rec { +let + rev = "8c32909a159aaa9484c82b71f05b7a73321eb491"; +in +stdenv.mkDerivation { pname = "abduco"; - version = "2020-04-30"; + version = "unstable-2020-04-30"; - src = fetchFromGitHub { - owner = "martanne"; - repo = "abduco"; - rev = "8c32909a159aaa9484c82b71f05b7a73321eb491"; - sha256 = "0a3p8xljhpk7zh203s75248blfir15smgw5jmszwbmdpy4mqzd53"; + src = fetchzip { + urls = [ + "https://github.com/martanne/abduco/archive/${rev}.tar.gz" + "https://git.sr.ht/~martanne/abduco/archive/${rev}.tar.gz" + ]; + hash = "sha256-o7SPK/G31cW/rrLwV3UJOTq6EBHl6AEE/GdeKGlHdyg="; }; preBuild = lib.optionalString (conf != null)