From fe28eb11705adf8b244a33a94017de03eae53b20 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:19:56 +0300 Subject: [PATCH 1/2] runzip: fix build Configure script produces a cryptic message: ``` configure:4540: error: ZLIB version too old, please install at least v1.1.2 ``` It's actually misleading and comes from the vendored libzip 0.7.1 configure check. It fails due to do `-Wimplicit-int`: ``` conftest.c:16:16: error: type defaults to 'int' in declaration of 'unzOpen' [-Wimplicit-int] 16 | extern ZEXPORT unzOpen (const char *path); ``` Vendored libzip is pretty heavily modified and unvendoring seems impossible. Furthermore, libzip from nixpkgs in buildInputs is actually unused and can be dropped - only zlib is necessary. --- pkgs/by-name/ru/runzip/package.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ru/runzip/package.nix b/pkgs/by-name/ru/runzip/package.nix index 7f196224b676..453afa98fe94 100644 --- a/pkgs/by-name/ru/runzip/package.nix +++ b/pkgs/by-name/ru/runzip/package.nix @@ -2,8 +2,8 @@ lib, stdenv, fetchFromGitHub, - libzip, libiconv, + zlib, autoreconfHook, }: @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ libiconv - libzip + zlib ]; src = fetchFromGitHub { @@ -24,6 +24,11 @@ stdenv.mkDerivation rec { sha256 = "0l5zbb5hswxczigvyal877j0aiq3fc01j3gv88bvy7ikyvw3lc07"; }; + env.NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=implicit-int" + "-Wno-error=incompatible-pointer-types" + ]; + meta = { description = "Tool to convert filename encoding inside a ZIP archive"; license = lib.licenses.bsd2; From 2d4d57fd436902d34cd8c573ab94b855bbc38ae3 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:31:20 +0300 Subject: [PATCH 2/2] runzip: enable tests --- pkgs/by-name/ru/runzip/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/ru/runzip/package.nix b/pkgs/by-name/ru/runzip/package.nix index 453afa98fe94..fecd659c7563 100644 --- a/pkgs/by-name/ru/runzip/package.nix +++ b/pkgs/by-name/ru/runzip/package.nix @@ -24,11 +24,17 @@ stdenv.mkDerivation rec { sha256 = "0l5zbb5hswxczigvyal877j0aiq3fc01j3gv88bvy7ikyvw3lc07"; }; + postPatch = '' + patchShebangs tests/check-runzip.sh + ''; + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-int" "-Wno-error=incompatible-pointer-types" ]; + doCheck = true; + meta = { description = "Tool to convert filename encoding inside a ZIP archive"; license = lib.licenses.bsd2;