From 0cfc319f8362df42e5471a75e2e39d41dd69d2e7 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:47:59 +0200 Subject: [PATCH 1/3] fetchDebianPatch: Require patch names with extensions Otherwise the fetcher is unuseable with patches whose filename (in Debian) doesn't end in `.patch`. --- doc/builders/fetchers.chapter.md | 4 ++-- pkgs/build-support/fetchdebianpatch/default.nix | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/builders/fetchers.chapter.md b/doc/builders/fetchers.chapter.md index ba105764904c..22ddb3b52497 100644 --- a/doc/builders/fetchers.chapter.md +++ b/doc/builders/fetchers.chapter.md @@ -86,7 +86,7 @@ Most other fetchers return a directory rather than a single file. ## `fetchDebianPatch` {#fetchdebianpatch} A wrapper around `fetchpatch`, which takes: -- `patch` and `hash`: the patch's filename without the `.patch` suffix, +- `patch` and `hash`: the patch's filename, and its hash after normalization by `fetchpatch` ; - `pname`: the Debian source package's name ; - `version`: the upstream version number ; @@ -110,7 +110,7 @@ buildPythonPackage rec { (fetchDebianPatch { inherit pname version; debianRevision = "5"; - name = "Add-quotes-to-SOAPAction-header-in-SoapClient"; + name = "Add-quotes-to-SOAPAction-header-in-SoapClient.patch"; hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; }) ]; diff --git a/pkgs/build-support/fetchdebianpatch/default.nix b/pkgs/build-support/fetchdebianpatch/default.nix index c058b416d381..8d8076bd59d6 100644 --- a/pkgs/build-support/fetchdebianpatch/default.nix +++ b/pkgs/build-support/fetchdebianpatch/default.nix @@ -1,8 +1,8 @@ { lib, fetchpatch }: lib.makeOverridable ( - { pname, version, debianRevision ? null, patch, hash, - area ? "main", name ? "${patch}.patch" }: + { pname, version, debianRevision ? null, area ? "main", + patch, name ? patch, hash }: let inherit (lib.strings) hasPrefix substring; prefix = @@ -14,6 +14,6 @@ lib.makeOverridable ( inherit name hash; url = "https://sources.debian.org/data/${area}/${prefix}/" - + "${pname}/${versionString}/debian/patches/${patch}.patch"; + + "${pname}/${versionString}/debian/patches/${patch}"; } ) From 6190662a4645147529769908494ca48c7d73db4d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:48:04 +0200 Subject: [PATCH 2/3] pdfchain: use upstream fetchDebianPatch --- pkgs/tools/typesetting/pdfchain/default.nix | 33 +++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/typesetting/pdfchain/default.nix b/pkgs/tools/typesetting/pdfchain/default.nix index 84ed38b3836d..256a8ebd6c53 100644 --- a/pkgs/tools/typesetting/pdfchain/default.nix +++ b/pkgs/tools/typesetting/pdfchain/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fetchpatch +{ lib, stdenv, fetchurl, fetchDebianPatch , autoconf, gtkmm3, glib, pdftk, pkg-config, wrapGAppsHook }: @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz"; - sha256 = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0="; + hash = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0="; }; nativeBuildInputs = [ @@ -20,23 +20,24 @@ stdenv.mkDerivation rec { ]; patches = let - fetchDebianPatch = {name, sha256}: fetchpatch { - url = "https://salsa.debian.org/debian/pdfchain/raw/2d29107756a3194fb522bdea8e9b9e393b15a8f3/debian/patches/${name}"; - inherit name sha256; - }; + fetchDebianPatch' = args: fetchDebianPatch ({ + inherit pname; + version = "1:0.4.4.2"; + debianRevision = "2"; + } // args); in [ - (fetchDebianPatch { - name = "fix_crash_on_startup"; - sha256 = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw="; + (fetchDebianPatch' { + patch = "fix_crash_on_startup"; + hash = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw="; }) - (fetchDebianPatch { - name = "fix_desktop_file"; - sha256 = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw="; + (fetchDebianPatch' { + patch = "fix_desktop_file"; + hash = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw="; }) - (fetchDebianPatch { - name = "fix_spelling"; - sha256 = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes="; + (fetchDebianPatch' { + patch = "fix_spelling"; + hash = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes="; }) ]; @@ -51,6 +52,6 @@ stdenv.mkDerivation rec { homepage = "https://pdfchain.sourceforge.io"; license = licenses.gpl3Plus; maintainers = with maintainers; [ hqurve ]; - platforms = platforms.linux; + platforms = platforms.unix; }; } From 67601744b6c59f7c1aab25acd9a6271bba24a4d2 Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 14 Sep 2023 18:57:58 +0000 Subject: [PATCH 3/3] pysimplesoap: Adjust for change in fetchDebianPatch's API --- .../python-modules/pysimplesoap/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pysimplesoap/default.nix b/pkgs/development/python-modules/pysimplesoap/default.nix index b35a6b6d6e70..14bb929936de 100644 --- a/pkgs/development/python-modules/pysimplesoap/default.nix +++ b/pkgs/development/python-modules/pysimplesoap/default.nix @@ -28,17 +28,17 @@ buildPythonPackage rec { debianRevision = "5"; } // args)) [ # Merged upstream: f5f96210e1483f81cb5c582a6619e3ec4b473027 - { patch = "Add-quotes-to-SOAPAction-header-in-SoapClient"; + { patch = "Add-quotes-to-SOAPAction-header-in-SoapClient.patch"; hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; } # Merged upstream: ad03a21cafab982eed321553c4bfcda1755182eb - { patch = "fix-httplib2-version-check"; + { patch = "fix-httplib2-version-check.patch"; hash = "sha256-zUeF3v0N/eMyRVRH3tQLfuUfMKOD/B/aqEwFh/7HxH4="; } - { patch = "reorder-type-check-to-avoid-a-TypeError"; + { patch = "reorder-type-check-to-avoid-a-TypeError.patch"; hash = "sha256-2p5Cqvh0SPfJ8B38wb/xq7jWGYgpI9pavA6qkMUb6hA="; } # Merged upstream: 033e5899e131a2c1bdf7db5852f816f42aac9227 - { patch = "Support-integer-values-in-maxOccurs-attribute"; + { patch = "Support-integer-values-in-maxOccurs-attribute.patch"; hash = "sha256-IZ0DP7io+ihcnB5547cR53FAdnpRLR6z4J5KsNrkfaI="; } - { patch = "PR204"; + { patch = "PR204.patch"; hash = "sha256-JlxeTnKDFxvEMFBthZsaYRbNOoBvLJhBnXCRoiL/nVw="; } ] ++ [ ./stringIO.patch ];