Commit 76aedfaa authored by nicoo's avatar nicoo
Browse files

fetchDebianPatch: Handle the case of `lib*` packages

parent d613fb52
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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";
  }
)
+8 −0
Original line number Diff line number Diff line
@@ -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=";
  };
}