mvfst: split outputs

(cherry picked from commit 49ad47893e)
(cherry picked from commit e2e183ea2a)
This commit is contained in:
Emily 2024-11-14 02:59:42 +00:00 committed by Vladimír Čunát
parent 54d1271125
commit 0258bacd24
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -6,6 +6,7 @@
cmake,
ninja,
removeReferencesTo,
folly,
gflags,
@ -22,6 +23,12 @@ stdenv.mkDerivation (finalAttrs: {
pname = "mvfst";
version = "2024.11.18.00";
outputs = [
"bin"
"out"
"dev"
];
src = fetchFromGitHub {
owner = "facebook";
repo = "mvfst";
@ -32,6 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake
ninja
removeReferencesTo
];
buildInputs =
@ -60,6 +68,8 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "CMAKE_INSTALL_RPATH_USE_LINK_PATH" true)
(lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" (placeholder "dev"))
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Homebrew sets this, and the shared library build fails without
@ -107,6 +117,21 @@ 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
)
# TODO: Do this in `gtest` rather than downstream.
remove-references-to -t ${gtest.dev} $out/lib/*
'';
meta = {
description = "Implementation of the QUIC transport protocol";
homepage = "https://github.com/facebook/mvfst";