From 44d07f6997a264f2828775292ac6fffd44dbcfd2 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 tarball is no longer available at . ``` $ 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 mimic 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 (cherry picked from commit 04db9fed9e8a9ef0dae2c829b0abe864e2e7f9df) --- pkgs/development/libraries/qrencode/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/qrencode/default.nix b/pkgs/development/libraries/qrencode/default.nix index a5e5c2042323c..19ea6c39376d4 100644 --- a/pkgs/development/libraries/qrencode/default.nix +++ b/pkgs/development/libraries/qrencode/default.nix @@ -1,12 +1,13 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, pkg-config, SDL2, libpng, libiconv, libobjc, + autoreconfHook, }: stdenv.mkDerivation (finalAttrs: rec { @@ -20,12 +21,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 da540558947be1e6af6f99ab27df3e599471e403 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. (cherry picked from commit b8246ba626f8c122e615b239985fc340d2eed27c) --- pkgs/development/libraries/qrencode/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/development/libraries/qrencode/default.nix b/pkgs/development/libraries/qrencode/default.nix index 19ea6c39376d4..a5d74ac914d62 100644 --- a/pkgs/development/libraries/qrencode/default.nix +++ b/pkgs/development/libraries/qrencode/default.nix @@ -3,7 +3,6 @@ stdenv, fetchFromGitHub, pkg-config, - SDL2, libpng, libiconv, libobjc, @@ -38,8 +37,6 @@ stdenv.mkDerivation (finalAttrs: rec { libpng ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libobjc ]; - nativeCheckInputs = [ SDL2 ]; - doCheck = false; checkPhase = ''