···82828383Most other fetchers return a directory rather than a single file.
84848585+8686+## `fetchDebianPatch` {#fetchdebianpatch}
8787+8888+A wrapper around `fetchpatch`, which takes:
8989+- `patch` and `hash`: the patch's filename without the `.patch` suffix,
9090+ and its hash after normalization by `fetchpatch` ;
9191+- `pname`: the Debian source package's name ;
9292+- `version`: the upstream version number ;
9393+- `debianRevision`: the [Debian revision number] if applicable ;
9494+- the `area` of the Debian archive: `main` (default), `contrib`, or `non-free`.
9595+9696+Here is an example of `fetchDebianPatch` in action:
9797+9898+```nix
9999+{ lib
100100+, fetchDebianPatch
101101+, buildPythonPackage
102102+}:
103103+104104+buildPythonPackage rec {
105105+ pname = "pysimplesoap";
106106+ version = "1.16.2";
107107+ src = ...;
108108+109109+ patches = [
110110+ (fetchDebianPatch {
111111+ inherit pname version;
112112+ debianRevision = "5";
113113+ name = "Add-quotes-to-SOAPAction-header-in-SoapClient";
114114+ hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0=";
115115+ })
116116+ ];
117117+118118+ ...
119119+}
120120+```
121121+122122+Patches are fetched from `sources.debian.org`, and so must come from a
123123+package version that was uploaded to the Debian archive. Packages may
124124+be removed from there once that specific version isn't in any suite
125125+anymore (stable, testing, unstable, etc.), so maintainers should use
126126+`copy-tarballs.pl` to archive the patch if it needs to be available
127127+longer-term.
128128+129129+[Debian revision number]: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
130130+131131+85132## `fetchsvn` {#fetchsvn}
8613387134Used with Subversion. Expects `url` to a Subversion directory, `rev`, and `hash`.