diff options
author | Bob van der Linden <bobvanderlinden@gmail.com> | 2023-02-01 15:38:11 +0100 |
---|---|---|
committer | Bob van der Linden <bobvanderlinden@gmail.com> | 2023-02-11 21:42:55 +0100 |
commit | cbff2010dec85ec733dd243b077a25b9f09ab20e (patch) | |
tree | b0691b2fb4b76b1a3e6817da7e6180795aac6658 /pkgs/applications/networking | |
parent | fab09085df1b60d6a0870c8a89ce26d5a4a708c2 (diff) |
pjsip: add pythonSupport option
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r-- | pkgs/applications/networking/pjsip/default.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/applications/networking/pjsip/default.nix b/pkgs/applications/networking/pjsip/default.nix index eae9a8a3d87a0..781b8462a3927 100644 --- a/pkgs/applications/networking/pjsip/default.nix +++ b/pkgs/applications/networking/pjsip/default.nix @@ -4,8 +4,11 @@ , fetchpatch , openssl , libsamplerate +, swig , alsa-lib , AppKit +, python3 +, pythonSupport ? true }: stdenv.mkDerivation rec { @@ -33,6 +36,9 @@ stdenv.mkDerivation rec { }) ]; + nativeBuildInputs = + lib.optionals pythonSupport [ swig python3 ]; + buildInputs = [ openssl libsamplerate ] ++ lib.optional stdenv.isLinux alsa-lib ++ lib.optional stdenv.isDarwin AppKit; @@ -41,11 +47,22 @@ stdenv.mkDerivation rec { export LD=$CC ''; + postBuild = lib.optionalString pythonSupport '' + make -C pjsip-apps/src/swig/python + ''; + + outputs = [ "out" ] + ++ lib.optional pythonSupport "py"; + postInstall = '' mkdir -p $out/bin cp pjsip-apps/bin/pjsua-* $out/bin/pjsua mkdir -p $out/share/${pname}-${version}/samples cp pjsip-apps/bin/samples/*/* $out/share/${pname}-${version}/samples + '' + lib.optionalString pythonSupport '' + (cd pjsip-apps/src/swig/python && \ + python setup.py install --prefix=$py + ) ''; # We need the libgcc_s.so.1 loadable (for pthread_cancel to work) |