From 58eed70ed403d109e0e416f765dd2035db6e393b Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 30 Dec 2024 22:33:46 +0100 Subject: fix(pkgs/{atuin,ctpv}): Extend instead of replace This allows me, to still benefit from upstream version updates. --- .../ct/ctpv-64-types/allow-up-to-64-types.patch | 26 +++++++++++++ pkgs/by-name/ct/ctpv-64-types/package.nix | 15 ++++++++ pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch | 26 ------------- pkgs/by-name/ct/ctpv/package.nix | 45 ---------------------- 4 files changed, 41 insertions(+), 71 deletions(-) create mode 100644 pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch create mode 100644 pkgs/by-name/ct/ctpv-64-types/package.nix delete mode 100644 pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch delete mode 100644 pkgs/by-name/ct/ctpv/package.nix (limited to 'pkgs/by-name/ct') diff --git a/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch b/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch new file mode 100644 index 00000000..fdecb754 --- /dev/null +++ b/pkgs/by-name/ct/ctpv-64-types/allow-up-to-64-types.patch @@ -0,0 +1,26 @@ +From 069059937741d9a10ac1bdf7cc15e16e26f5da99 Mon Sep 17 00:00:00 2001 +From: Benedikt Peetz +Date: Sun, 24 Nov 2024 17:27:17 +0100 +Subject: [PATCH] fix(config): Allow up to 64 types + +The limit of 16 seems to harsh. +--- + src/config.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/config.c b/src/config.c +index 3556ccf..444fe29 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -274,7 +274,7 @@ static enum Status cmd_preview(Parser *ctx) + Token name = ctx->token; + EXPECT(ctx, TOK_STR); + +- struct TypeSet types[16]; ++ struct TypeSet types[64]; + unsigned int types_len = 0; + + while (accept(ctx, TOK_BLK_OPEN) == STAT_NULL) { +-- +2.47.0 + diff --git a/pkgs/by-name/ct/ctpv-64-types/package.nix b/pkgs/by-name/ct/ctpv-64-types/package.nix new file mode 100644 index 00000000..763b0325 --- /dev/null +++ b/pkgs/by-name/ct/ctpv-64-types/package.nix @@ -0,0 +1,15 @@ +{ctpv}: +ctpv.overrideAttrs (finalAttrs: previousAttrs: { + pname = previousAttrs.pname + "-64-types"; + patches = + (previousAttrs.patches or []) + ++ [ + ./allow-up-to-64-types.patch + ]; + + preFixup = '' + wrapProgram $out/bin/ctpv --set PATH ""; + ''; + + meta.mainProgram = "ctpv"; +}) diff --git a/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch b/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch deleted file mode 100644 index fdecb754..00000000 --- a/pkgs/by-name/ct/ctpv/allow-up-to-64-types.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 069059937741d9a10ac1bdf7cc15e16e26f5da99 Mon Sep 17 00:00:00 2001 -From: Benedikt Peetz -Date: Sun, 24 Nov 2024 17:27:17 +0100 -Subject: [PATCH] fix(config): Allow up to 64 types - -The limit of 16 seems to harsh. ---- - src/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/config.c b/src/config.c -index 3556ccf..444fe29 100644 ---- a/src/config.c -+++ b/src/config.c -@@ -274,7 +274,7 @@ static enum Status cmd_preview(Parser *ctx) - Token name = ctx->token; - EXPECT(ctx, TOK_STR); - -- struct TypeSet types[16]; -+ struct TypeSet types[64]; - unsigned int types_len = 0; - - while (accept(ctx, TOK_BLK_OPEN) == STAT_NULL) { --- -2.47.0 - diff --git a/pkgs/by-name/ct/ctpv/package.nix b/pkgs/by-name/ct/ctpv/package.nix deleted file mode 100644 index 905366bf..00000000 --- a/pkgs/by-name/ct/ctpv/package.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - makeWrapper, - file, - openssl, -}: -stdenv.mkDerivation rec { - pname = "ctpv"; - version = "1.1-unstable-2024-11-24"; - - src = fetchFromGitHub { - owner = "NikitaIvanovV"; - repo = pname; - rev = "4efa0f976eaf8cb814e0aba4f4f1a1d12ee9262e"; - hash = "sha256-tFBXCUey1lsNAg1mB0iQjDoH70qL8aytE6h9rhHlBe4="; - }; - - nativeBuildInputs = [makeWrapper]; - - buildInputs = [ - file # libmagic - openssl - ]; - - patches = [ - ./allow-up-to-64-types.patch - ]; - - makeFlags = ["PREFIX=$(out)"]; - - preFixup = '' - wrapProgram $out/bin/ctpv \ - --set PATH "${lib.makeBinPath []}"; - ''; - - meta = with lib; { - description = "File previewer for a terminal"; - homepage = "https://github.com/NikitaIvanovV/ctpv"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = [maintainers.wesleyjrz]; - }; -} -- cgit 1.4.1