···8283Most other fetchers return a directory rather than a single file.
840000000000000000000000000000000000000000000000085## `fetchsvn` {#fetchsvn}
8687Used with Subversion. Expects `url` to a Subversion directory, `rev`, and `hash`.
···8283Most other fetchers return a directory rather than a single file.
8485+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 ;
93+- `debianRevision`: the [Debian revision number] if applicable ;
94+- the `area` of the Debian archive: `main` (default), `contrib`, or `non-free`.
95+96+Here is an example of `fetchDebianPatch` in action:
97+98+```nix
99+{ lib
100+, fetchDebianPatch
101+, buildPythonPackage
102+}:
103+104+buildPythonPackage rec {
105+ pname = "pysimplesoap";
106+ version = "1.16.2";
107+ src = ...;
108+109+ patches = [
110+ (fetchDebianPatch {
111+ inherit pname version;
112+ debianRevision = "5";
113+ name = "Add-quotes-to-SOAPAction-header-in-SoapClient";
114+ hash = "sha256-xA8Wnrpr31H8wy3zHSNfezFNjUJt1HbSXn3qUMzeKc0=";
115+ })
116+ ];
117+118+ ...
119+}
120+```
121+122+Patches are fetched from `sources.debian.org`, and so must come from a
123+package version that was uploaded to the Debian archive. Packages may
124+be removed from there once that specific version isn't in any suite
125+anymore (stable, testing, unstable, etc.), so maintainers should use
126+`copy-tarballs.pl` to archive the patch if it needs to be available
127+longer-term.
128+129+[Debian revision number]: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
130+131+132## `fetchsvn` {#fetchsvn}
133134Used with Subversion. Expects `url` to a Subversion directory, `rev`, and `hash`.