summaryrefslogtreecommitdiff
path: root/pkgs/by-name/ca/capnproto/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ca/capnproto/package.nix')
-rw-r--r--pkgs/by-name/ca/capnproto/package.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/pkgs/by-name/ca/capnproto/package.nix b/pkgs/by-name/ca/capnproto/package.nix
index 59c8a631bc2b..0cc1208c534d 100644
--- a/pkgs/by-name/ca/capnproto/package.nix
+++ b/pkgs/by-name/ca/capnproto/package.nix
@@ -1,11 +1,14 @@
{
binutils,
lib,
+ libucontext,
+ pkg-config,
clangStdenv,
fetchFromGitHub,
cmake,
openssl,
zlib,
+ nix-update-script,
}:
let
@@ -40,12 +43,22 @@ clangStdenv.mkDerivation rec {
hash = "sha256-gxkko7LFyJNlxpTS+CWOd/p9x/778/kNIXfpDGiKM2A=";
};
- nativeBuildInputs = [ cmake ];
+ patches = [
+ # https://github.com/capnproto/capnproto/pull/2377
+ ./fix-libucontext.patch
+ ];
+
+ nativeBuildInputs = [
+ cmake
+ pkg-config
+ ];
propagatedBuildInputs = [
openssl
zlib
]
- ++ lib.optional (clangStdenv.cc.isClang && clangStdenv.hostPlatform.isStatic) empty-libgcc_eh;
+ ++ lib.optional (clangStdenv.cc.isClang && clangStdenv.hostPlatform.isStatic) empty-libgcc_eh
+ # musl doesn't ship getcontext/setcontext unlike basically every other libc
+ ++ lib.optional clangStdenv.hostPlatform.isMusl libucontext;
# FIXME: separate the binaries from the stuff that user systems actually use
# This runs into a terrible UX issue in Lix and I just don't want to debug it
@@ -55,6 +68,10 @@ clangStdenv.mkDerivation rec {
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
+ # merely requires setcontext/getcontext (libc), lix expects fibers to
+ # be available, and we want to make sure that the build will fail if
+ # it breaks
+ (lib.cmakeBool "WITH_FIBERS" true)
# Take optimization flags from CXXFLAGS rather than cmake injecting them
(lib.cmakeFeature "CMAKE_BUILD_TYPE" "None")
];
@@ -66,6 +83,8 @@ clangStdenv.mkDerivation rec {
separateDebugInfo = true;
+ passthru.updateScript = nix-update-script { };
+
meta = with lib; {
homepage = "https://capnproto.org/";
description = "Cap'n Proto cerealization protocol";