From 5a12a87aedc9fc549da4fb183506bf73a7526cff Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 27 Jun 2021 12:50:44 +0200 Subject: [PATCH] cups: Include TargetConditionals.h on Darwin --- pkgs/misc/cups/0001-TargetConditionals.patch | 29 ++++++++++++++++++++ pkgs/misc/cups/default.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/misc/cups/0001-TargetConditionals.patch diff --git a/pkgs/misc/cups/0001-TargetConditionals.patch b/pkgs/misc/cups/0001-TargetConditionals.patch new file mode 100644 index 00000000000..42cd4c051d4 --- /dev/null +++ b/pkgs/misc/cups/0001-TargetConditionals.patch @@ -0,0 +1,29 @@ +From 1204c841999808ba27267a0039777dcbccdcd6e3 Mon Sep 17 00:00:00 2001 +From: toonn +Date: Sun, 27 Jun 2021 12:30:08 +0200 +Subject: [PATCH] TargetConditionals + +--- + test/ippserver.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/test/ippserver.c b/test/ippserver.c +index 38b304f..68ccab1 100644 +--- a/test/ippserver.c ++++ b/test/ippserver.c +@@ -25,7 +25,11 @@ + * Include necessary headers... + */ + +-#include /* CUPS configuration header */ ++#ifdef __APPLE__ ++# include /* CUPS configuration header macOS */ ++#else ++# include /* CUPS configuration header */ ++#endif /* __APPLE__ */ + #include /* Public API */ + #include /* CUPS string functions */ + #include /* For multithreading functions */ +-- +2.17.2 (Apple Git-113) + diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 1d467f0a534..bbada33054d 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -40,6 +40,8 @@ stdenv.mkDerivation rec { outputs = [ "out" "lib" "dev" "man" ]; + patches = lib.optional (version == "2.2.6") ./0001-TargetConditionals.patch; + postPatch = '' substituteInPlace cups/testfile.c \ --replace 'cupsFileFind("cat", "/bin' 'cupsFileFind("cat", "${coreutils}/bin'