From a474001e5a310118fee934f04d33e5ffd9fa8844 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Thu, 13 May 2021 15:22:10 +0200 Subject: [PATCH] fakeroot: apply all brew patches to fix Darwin --- pkgs/tools/system/fakeroot/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/tools/system/fakeroot/default.nix b/pkgs/tools/system/fakeroot/default.nix index 57a986e3da99..0e4f51c7ea6c 100644 --- a/pkgs/tools/system/fakeroot/default.nix +++ b/pkgs/tools/system/fakeroot/default.nix @@ -37,6 +37,18 @@ stdenv.mkDerivation rec { sed -i -e "s@getopt@$(type -p getopt)@g" -e "s@sed@$(type -p sed)@g" ${pname}-${version}/scripts/fakeroot.in ''; + postConfigure = let + # additional patch from brew, but needs to be applied to a generated file + patch-wraptmpf = fetchpatch { + name = "fakeroot-patch-wraptmpf-h.patch"; + url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?att=3;bug=766649;filename=fakeroot-patch-wraptmpf-h.patch;msg=20"; + sha256 = "1jhsi4bv6nnnjb4vmmmbhndqg719ckg860hgw98bli8m05zwbx6a"; + }; + in lib.optional stdenv.isDarwin '' + make wraptmpf.h + patch -p1 < ${patch-wraptmpf} + ''; + meta = { homepage = "https://salsa.debian.org/clint/fakeroot"; description = "Give a fake root environment through LD_PRELOAD";