From 04db9fed9e8a9ef0dae2c829b0abe864e2e7f9df Mon Sep 17 00:00:00 2001 From: Stefano Mazzucco Date: Sat, 17 May 2025 08:13:40 +0100 Subject: [PATCH 1/2] qrencode: update src url, use autoreconfHook The source tar is no more available at https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz E.g. $ curl -I 'https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz' HTTP/1.1 404 Not Found Date: Sat, 17 May 2025 07:13:20 GMT Server: Apache/2.4.62 (Debian) Strict-Transport-Security: max-age=31536000 Content-Type: text/html; charset=iso-8859- However, we can download it from the official repository on GitHub as mentioned in the project's home page[1]. To make the package build, we use autoreconfHook to mimick the repo's `autogen.sh` because the GitHub repo does not contain the configure script as mentioned in the project's README[2]: > If there is no "configure" script in the source code directory, run > "autogen.sh" at first to generate it - this is mandatory if you downloaded > the source from GitHub. [1] https://web.archive.org/web/20250413215821/https://fukuchi.org/en/works/qrencode/ [2] https://github.com/fukuchi/libqrencode/blob/50b3e5725cafccfde038c0833cdaa5b1c28491e2/README.md#compile--install --- pkgs/by-name/qr/qrencode/package.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/qr/qrencode/package.nix b/pkgs/by-name/qr/qrencode/package.nix index 246499eba9ce..1194cc014ba7 100644 --- a/pkgs/by-name/qr/qrencode/package.nix +++ b/pkgs/by-name/qr/qrencode/package.nix @@ -1,11 +1,12 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, pkg-config, SDL2, libpng, libiconv, + autoreconfHook, }: stdenv.mkDerivation (finalAttrs: rec { @@ -19,12 +20,17 @@ stdenv.mkDerivation (finalAttrs: rec { "dev" ]; - src = fetchurl { - url = "https://fukuchi.org/works/qrencode/qrencode-${version}.tar.gz"; - sha256 = "sha256-2kSO1PUqumvLDNSMrA3VG4aSvMxM0SdDFAL8pvgXHo4="; + src = fetchFromGitHub { + owner = "fukuchi"; + repo = "libqrencode"; + rev = "v${version}"; + hash = "sha256-nbrmg9SqCqMrLE7WCfNEzMV/eS9UVCKCrjBrGMzAsLk"; }; - nativeBuildInputs = [ pkg-config ]; + nativeBuildInputs = [ + pkg-config + autoreconfHook + ]; buildInputs = [ libiconv From b8246ba626f8c122e615b239985fc340d2eed27c Mon Sep 17 00:00:00 2001 From: Stefano Mazzucco Date: Sat, 17 May 2025 08:24:52 +0100 Subject: [PATCH 2/2] qrencode: remove SDL2 to fix infinite recursion in tests Nix fails with an infinite recursion error When running the qrencode tests with SDL2 in nativeCheckInputs. Removing the dependency fixes the error and the tests still run successfully. --- pkgs/by-name/qr/qrencode/package.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/by-name/qr/qrencode/package.nix b/pkgs/by-name/qr/qrencode/package.nix index 1194cc014ba7..fca976b41d14 100644 --- a/pkgs/by-name/qr/qrencode/package.nix +++ b/pkgs/by-name/qr/qrencode/package.nix @@ -3,7 +3,6 @@ stdenv, fetchFromGitHub, pkg-config, - SDL2, libpng, libiconv, autoreconfHook, @@ -37,8 +36,6 @@ stdenv.mkDerivation (finalAttrs: rec { libpng ]; - nativeCheckInputs = [ SDL2 ]; - doCheck = false; checkPhase = ''