From 7d24989226fd91edcf292dc330735c1bc29fb9c6 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 14 Nov 2024 03:03:15 +0000 Subject: [PATCH] wangle: split outputs (cherry picked from commit 5205f55d4d0a46e33956d9732c2185afe70932d0) --- pkgs/by-name/wa/wangle/package.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkgs/by-name/wa/wangle/package.nix b/pkgs/by-name/wa/wangle/package.nix index f20316fcccb8..ca3e7a6f285d 100644 --- a/pkgs/by-name/wa/wangle/package.nix +++ b/pkgs/by-name/wa/wangle/package.nix @@ -6,6 +6,7 @@ cmake, ninja, + removeReferencesTo, folly, fizz, @@ -24,6 +25,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "wangle"; version = "2024.11.18.00"; + outputs = [ + "out" + "dev" + ]; + src = fetchFromGitHub { owner = "facebook"; repo = "wangle"; @@ -34,6 +40,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ninja + removeReferencesTo ]; buildInputs = @@ -61,6 +68,10 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) (lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck) + + (lib.cmakeFeature "INCLUDE_INSTALL_DIR" "${placeholder "dev"}/include") + (lib.cmakeFeature "LIB_INSTALL_DIR" "${placeholder "out"}/lib") + (lib.cmakeFeature "CMAKE_INSTALL_DIR" "${placeholder "dev"}/lib/cmake/wangle") ]; env.GTEST_FILTER = @@ -98,6 +109,18 @@ stdenv.mkDerivation (finalAttrs: { runHook postCheck ''; + 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 + ) + ''; + meta = { description = "Open-source C++ networking library"; longDescription = ''