diff --git a/pkgs/by-name/fo/folly/package.nix b/pkgs/by-name/fo/folly/package.nix index b5999f17cbd0..050cbf86bcb3 100644 --- a/pkgs/by-name/fo/folly/package.nix +++ b/pkgs/by-name/fo/folly/package.nix @@ -7,6 +7,7 @@ cmake, ninja, pkg-config, + removeReferencesTo, boost, double-conversion, @@ -54,6 +55,7 @@ stdenv.mkDerivation (finalAttrs: { cmake ninja pkg-config + removeReferencesTo ]; # See CMake/folly-deps.cmake in the Folly source tree. @@ -113,6 +115,18 @@ stdenv.mkDerivation (finalAttrs: { '@CMAKE_INSTALL_FULL_INCLUDEDIR@' ''; + postFixup = '' + # Sanitize header paths to avoid runtime dependencies leaking in + # through `__FILE__`. + ( + shopt -s globstar + for header in "$dev/include"/**/*.h; do + sed -i "1i#line 1 \"$header\"" "$header" + remove-references-to -t "$dev" "$header" + done + ) + ''; + passthru = { # folly-config.cmake, will `find_package` these, thus there should be # a way to ensure abi compatibility.