about summary refs log tree commit diff
path: root/pkgs/applications/networking/pjsip
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2023-12-03 15:27:28 +0000
committerRobert Scott <code@humanleg.org.uk>2023-12-03 15:28:38 +0000
commit79567db9149d508c99f03b83b7fed6d32faaa971 (patch)
treef0ec0136ac947f4188926e373523f1101ee2659a /pkgs/applications/networking/pjsip
parent0b62f5adfd6635f8013d800ceb0cf39411a8216f (diff)
pjsip: fix build on clang/darwin
Diffstat (limited to 'pkgs/applications/networking/pjsip')
-rw-r--r--pkgs/applications/networking/pjsip/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/applications/networking/pjsip/default.nix b/pkgs/applications/networking/pjsip/default.nix
index 4ed0bad26c6f4..ca19a8f7d5086 100644
--- a/pkgs/applications/networking/pjsip/default.nix
+++ b/pkgs/applications/networking/pjsip/default.nix
@@ -35,12 +35,19 @@ stdenv.mkDerivation (finalAttrs: {
     ++ lib.optional stdenv.isLinux alsa-lib
     ++ lib.optionals stdenv.isDarwin [ AppKit CoreFoundation Security ];
 
+  env = lib.optionalAttrs (stdenv.cc.libcxx != null) {
+    # work around https://github.com/NixOS/nixpkgs/issues/166205
+    NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
+  } // lib.optionalAttrs stdenv.cc.isClang {
+    CXXFLAGS = "-std=c++11";
+  } // lib.optionalAttrs stdenv.isDarwin {
+    NIX_CFLAGS_LINK = "-headerpad_max_install_names";
+  };
+
   preConfigure = ''
     export LD=$CC
   '';
 
-  NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin "-headerpad_max_install_names";
-
   postBuild = lib.optionalString pythonSupport ''
     make -C pjsip-apps/src/swig/python
   '';