Skip to content

Instantly share code, notes, and snippets.

@worldofpeace
Created September 5, 2020 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save worldofpeace/297f48a0e156f9ce65d8e14cee125c96 to your computer and use it in GitHub Desktop.
Save worldofpeace/297f48a0e156f9ce65d8e14cee125c96 to your computer and use it in GitHub Desktop.
diff --git a/pkgs/build-support/writers/default.nix b/pkgs/build-support/writers/default.nix
index 4673b4e6cd8..5458d04ea90 100644
--- a/pkgs/build-support/writers/default.nix
+++ b/pkgs/build-support/writers/default.nix
@@ -109,7 +109,7 @@ rec {
# return 0;
# }
# ''
- writeC = name: { libraries ? [] }:
+ writeC = name: { libraries ? [], headers ? [] }:
makeBinWriter {
compileScript = ''
PATH=${makeBinPath [
@@ -125,6 +125,11 @@ rec {
"$(pkg-config --cflags --libs ${
concatMapStringsSep " " (pkg: "$(find ${escapeShellArg pkg}/lib/pkgconfig -name \\*.pc)") libraries
})"
+ } \
+ ${optionalString (headers != [])
+ "${
+ concatMapStringSep " " (header: "-I${header}") headers
+ }"
} \
-O \
-o "$out" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment