Loading pkgs/build-support/fetchdebianpatch/default.nix +8 −3 Original line number Diff line number Diff line Loading @@ -3,12 +3,17 @@ lib.makeOverridable ( { pname, version, debianRevision ? null, patch, hash, area ? "main", name ? "${patch}.patch" }: let versionString = if debianRevision == null then version else "${version}-${debianRevision}"; let inherit (lib.strings) hasPrefix substring; prefix = substring 0 (if hasPrefix "lib" pname then 4 else 1) pname; versionString = if debianRevision == null then version else "${version}-${debianRevision}"; in fetchpatch { inherit name hash; url = "https://sources.debian.org/data/${area}/${builtins.substring 0 1 pname}/" "https://sources.debian.org/data/${area}/${prefix}/" + "${pname}/${versionString}/debian/patches/${patch}.patch"; } ) pkgs/build-support/fetchdebianpatch/tests.nix +8 −0 Original line number Diff line number Diff line Loading @@ -8,4 +8,12 @@ patch = "Add-quotes-to-SOAPAction-header-in-SoapClient"; hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; }; libPackage = testers.invalidateFetcherByDrvHash fetchDebianPatch { pname = "libfile-pid-perl"; version = "1.01"; debianRevision = "2"; patch = "missing-pidfile"; hash = "sha256-VBsIYyCnjcZLYQ2Uq2MKPK3kF2wiMKvnq0m727DoavM="; }; } Loading
pkgs/build-support/fetchdebianpatch/default.nix +8 −3 Original line number Diff line number Diff line Loading @@ -3,12 +3,17 @@ lib.makeOverridable ( { pname, version, debianRevision ? null, patch, hash, area ? "main", name ? "${patch}.patch" }: let versionString = if debianRevision == null then version else "${version}-${debianRevision}"; let inherit (lib.strings) hasPrefix substring; prefix = substring 0 (if hasPrefix "lib" pname then 4 else 1) pname; versionString = if debianRevision == null then version else "${version}-${debianRevision}"; in fetchpatch { inherit name hash; url = "https://sources.debian.org/data/${area}/${builtins.substring 0 1 pname}/" "https://sources.debian.org/data/${area}/${prefix}/" + "${pname}/${versionString}/debian/patches/${patch}.patch"; } )
pkgs/build-support/fetchdebianpatch/tests.nix +8 −0 Original line number Diff line number Diff line Loading @@ -8,4 +8,12 @@ patch = "Add-quotes-to-SOAPAction-header-in-SoapClient"; hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0="; }; libPackage = testers.invalidateFetcherByDrvHash fetchDebianPatch { pname = "libfile-pid-perl"; version = "1.01"; debianRevision = "2"; patch = "missing-pidfile"; hash = "sha256-VBsIYyCnjcZLYQ2Uq2MKPK3kF2wiMKvnq0m727DoavM="; }; }