Merge pull request #255175 from nbraud/fetchDebianPatch/extension

fetchDebianPatch: do not assume `.patch` extension (v2)

authored by Weijia Wang and committed by GitHub cc82ad6e c0dcf323

+27 -26
+2 -2
doc/builders/fetchers.chapter.md
··· 86 ## `fetchDebianPatch` {#fetchdebianpatch} 87 88 A wrapper around `fetchpatch`, which takes: 89 - - `patch` and `hash`: the patch's filename without the `.patch` suffix, 90 and its hash after normalization by `fetchpatch` ; 91 - `pname`: the Debian source package's name ; 92 - `version`: the upstream version number ; ··· 110 (fetchDebianPatch { 111 inherit pname version; 112 debianRevision = "5"; 113 - name = "Add-quotes-to-SOAPAction-header-in-SoapClient"; 114 hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; 115 }) 116 ];
··· 86 ## `fetchDebianPatch` {#fetchdebianpatch} 87 88 A wrapper around `fetchpatch`, which takes: 89 + - `patch` and `hash`: the patch's filename, 90 and its hash after normalization by `fetchpatch` ; 91 - `pname`: the Debian source package's name ; 92 - `version`: the upstream version number ; ··· 110 (fetchDebianPatch { 111 inherit pname version; 112 debianRevision = "5"; 113 + name = "Add-quotes-to-SOAPAction-header-in-SoapClient.patch"; 114 hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; 115 }) 116 ];
+3 -3
pkgs/build-support/fetchdebianpatch/default.nix
··· 1 { lib, fetchpatch }: 2 3 lib.makeOverridable ( 4 - { pname, version, debianRevision ? null, patch, hash, 5 - area ? "main", name ? "${patch}.patch" }: 6 let 7 inherit (lib.strings) hasPrefix substring; 8 prefix = ··· 14 inherit name hash; 15 url = 16 "https://sources.debian.org/data/${area}/${prefix}/" 17 - + "${pname}/${versionString}/debian/patches/${patch}.patch"; 18 } 19 )
··· 1 { lib, fetchpatch }: 2 3 lib.makeOverridable ( 4 + { pname, version, debianRevision ? null, area ? "main", 5 + patch, name ? patch, hash }: 6 let 7 inherit (lib.strings) hasPrefix substring; 8 prefix = ··· 14 inherit name hash; 15 url = 16 "https://sources.debian.org/data/${area}/${prefix}/" 17 + + "${pname}/${versionString}/debian/patches/${patch}"; 18 } 19 )
+5 -5
pkgs/development/python-modules/pysimplesoap/default.nix
··· 28 debianRevision = "5"; 29 } // args)) [ 30 # Merged upstream: f5f96210e1483f81cb5c582a6619e3ec4b473027 31 - { patch = "Add-quotes-to-SOAPAction-header-in-SoapClient"; 32 hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; } 33 # Merged upstream: ad03a21cafab982eed321553c4bfcda1755182eb 34 - { patch = "fix-httplib2-version-check"; 35 hash = "sha256-zUeF3v0N/eMyRVRH3tQLfuUfMKOD/B/aqEwFh/7HxH4="; } 36 - { patch = "reorder-type-check-to-avoid-a-TypeError"; 37 hash = "sha256-2p5Cqvh0SPfJ8B38wb/xq7jWGYgpI9pavA6qkMUb6hA="; } 38 # Merged upstream: 033e5899e131a2c1bdf7db5852f816f42aac9227 39 - { patch = "Support-integer-values-in-maxOccurs-attribute"; 40 hash = "sha256-IZ0DP7io+ihcnB5547cR53FAdnpRLR6z4J5KsNrkfaI="; } 41 - { patch = "PR204"; 42 hash = "sha256-JlxeTnKDFxvEMFBthZsaYRbNOoBvLJhBnXCRoiL/nVw="; } 43 ] ++ [ ./stringIO.patch ]; 44
··· 28 debianRevision = "5"; 29 } // args)) [ 30 # Merged upstream: f5f96210e1483f81cb5c582a6619e3ec4b473027 31 + { patch = "Add-quotes-to-SOAPAction-header-in-SoapClient.patch"; 32 hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; } 33 # Merged upstream: ad03a21cafab982eed321553c4bfcda1755182eb 34 + { patch = "fix-httplib2-version-check.patch"; 35 hash = "sha256-zUeF3v0N/eMyRVRH3tQLfuUfMKOD/B/aqEwFh/7HxH4="; } 36 + { patch = "reorder-type-check-to-avoid-a-TypeError.patch"; 37 hash = "sha256-2p5Cqvh0SPfJ8B38wb/xq7jWGYgpI9pavA6qkMUb6hA="; } 38 # Merged upstream: 033e5899e131a2c1bdf7db5852f816f42aac9227 39 + { patch = "Support-integer-values-in-maxOccurs-attribute.patch"; 40 hash = "sha256-IZ0DP7io+ihcnB5547cR53FAdnpRLR6z4J5KsNrkfaI="; } 41 + { patch = "PR204.patch"; 42 hash = "sha256-JlxeTnKDFxvEMFBthZsaYRbNOoBvLJhBnXCRoiL/nVw="; } 43 ] ++ [ ./stringIO.patch ]; 44
+17 -16
pkgs/tools/typesetting/pdfchain/default.nix
··· 1 - { lib, stdenv, fetchurl, fetchpatch 2 , autoconf, gtkmm3, glib, pdftk, pkg-config, wrapGAppsHook 3 }: 4 ··· 8 9 src = fetchurl { 10 url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz"; 11 - sha256 = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0="; 12 }; 13 14 nativeBuildInputs = [ ··· 20 ]; 21 22 patches = let 23 - fetchDebianPatch = {name, sha256}: fetchpatch { 24 - url = "https://salsa.debian.org/debian/pdfchain/raw/2d29107756a3194fb522bdea8e9b9e393b15a8f3/debian/patches/${name}"; 25 - inherit name sha256; 26 - }; 27 in 28 [ 29 - (fetchDebianPatch { 30 - name = "fix_crash_on_startup"; 31 - sha256 = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw="; 32 }) 33 - (fetchDebianPatch { 34 - name = "fix_desktop_file"; 35 - sha256 = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw="; 36 }) 37 - (fetchDebianPatch { 38 - name = "fix_spelling"; 39 - sha256 = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes="; 40 }) 41 ]; 42 ··· 51 homepage = "https://pdfchain.sourceforge.io"; 52 license = licenses.gpl3Plus; 53 maintainers = with maintainers; [ hqurve ]; 54 - platforms = platforms.linux; 55 }; 56 }
··· 1 + { lib, stdenv, fetchurl, fetchDebianPatch 2 , autoconf, gtkmm3, glib, pdftk, pkg-config, wrapGAppsHook 3 }: 4 ··· 8 9 src = fetchurl { 10 url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz"; 11 + hash = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0="; 12 }; 13 14 nativeBuildInputs = [ ··· 20 ]; 21 22 patches = let 23 + fetchDebianPatch' = args: fetchDebianPatch ({ 24 + inherit pname; 25 + version = "1:0.4.4.2"; 26 + debianRevision = "2"; 27 + } // args); 28 in 29 [ 30 + (fetchDebianPatch' { 31 + patch = "fix_crash_on_startup"; 32 + hash = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw="; 33 }) 34 + (fetchDebianPatch' { 35 + patch = "fix_desktop_file"; 36 + hash = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw="; 37 }) 38 + (fetchDebianPatch' { 39 + patch = "fix_spelling"; 40 + hash = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes="; 41 }) 42 ]; 43 ··· 52 homepage = "https://pdfchain.sourceforge.io"; 53 license = licenses.gpl3Plus; 54 maintainers = with maintainers; [ hqurve ]; 55 + platforms = platforms.unix; 56 }; 57 }