I need to apply an upstream patch in the gdb
derivation. For this I use the fetchpatch
function as follows:
patches = [ ./debug-info-from-env.patch ];
++ stdenv.lib.optional stdenv.isDarwin ./darwin-target-match.patch
++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
name = "darwin-mojave.patch";
url = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=fc7b364aba41819a5d74ae0ac69f050af282d057";
sha256 = "02ipryra2c3xhhkm22bvsni5xsslx0wid8jz90g8g8igc064x29q"; });
The third patch fails to apply because it does not contain the top directory source name (“gdb-8.0”), while the two others do. In principle I could use the patchFlags
to set -p1
for the first two and -p0
for the last one, but as far as I understand, it is not possible to set a different flag for each patch.
Is there a way to apply this patch using fetchpatch
, or should I create an another patch?