Merge pull request #214011 from bobvanderlinden/pr-pjsip-python

pjsip: add pythonSupport option
This commit is contained in:
Robert Scott 2023-02-11 23:15:05 +00:00 committed by GitHub
commit e4265b76be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -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,24 @@ stdenv.mkDerivation rec {
export LD=$CC
'';
postBuild = lib.optionalString pythonSupport ''
make -C pjsip-apps/src/swig/python
'';
outputs = [ "out" ]
++ lib.optional pythonSupport "py";
configureFlags = [ "--enable-shared" ];
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)

View file

@ -7186,6 +7186,11 @@ self: super: with self; {
pixelmatch = callPackage ../development/python-modules/pixelmatch { };
pjsua2 = (toPythonModule (pkgs.pjsip.override {
pythonSupport = true;
python3 = self.python;
})).py;
pkce = callPackage ../development/python-modules/pkce { };
pkgconfig = callPackage ../development/python-modules/pkgconfig { };