diff options
author | Wüstengecko | 2019-05-12 17:00:50 +0200 |
---|---|---|
committer | Caleb Maclennan | 2019-06-18 16:00:11 +0300 |
commit | 978e9213287f1e9441aed4b8beb1ba55e85db19b (patch) | |
tree | ca2e6ad32a3a4ce3012ebdd2c94f75a130a9bf62 | |
parent | 0e2c0977f53a6490062e16e360afb58ab8066242 (diff) | |
download | aur-978e9213287f1e9441aed4b8beb1ba55e85db19b.tar.gz |
Rewrite for python3 and bindings as split package
Previously the package was applying a patch to build with python version
2. Since this is no longer necessary, and python 2 is nearing its end of
life, this commit removes the patch.
Furthermore this commit changes the PKGBUILD to now build the python
language bindings in addition to the native PJSIP library. These
bindings are built in a split package `python-pjproject`.
-rw-r--r-- | .SRCINFO | 29 | ||||
-rw-r--r-- | 0001-Don-t-build-Java-bindings.patch | 25 | ||||
-rw-r--r-- | 0002-Query-python-executable-for-actual-version-in-use.patch | 35 | ||||
-rw-r--r-- | PKGBUILD | 60 | ||||
-rw-r--r-- | ffmpeg.patch | 12 | ||||
-rw-r--r-- | python2.patch | 19 |
6 files changed, 130 insertions, 50 deletions
@@ -1,14 +1,32 @@ pkgbase = pjproject pkgdesc = Open source SIP stack and media stack pkgver = 2.8 - pkgrel = 1 + pkgrel = 4 url = http://www.pjsip.org/ arch = i686 arch = x86_64 arch = armv7h license = GPL + makedepends = alsa-lib makedepends = e2fsprogs + makedepends = ffmpeg + makedepends = libsamplerate + makedepends = libsrtp + makedepends = openssl + makedepends = opus + makedepends = portaudio makedepends = python + makedepends = speex + makedepends = swig + makedepends = util-linux + source = http://www.pjsip.org/release/2.8/pjproject-2.8.tar.bz2 + source = 0001-Don-t-build-Java-bindings.patch + source = 0002-Query-python-executable-for-actual-version-in-use.patch + sha256sums = 503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79 + sha256sums = 74bdd3f404bf27dc00c235caada2d9c4b0b43e44febc8905b507c815384cf8fb + sha256sums = caa187ae9b75964bbf1a79996b6e89321ff83bc910fd5bbdac33924a2bdb0cfb + +pkgname = pjproject depends = openssl depends = portaudio depends = speex @@ -18,11 +36,10 @@ pkgbase = pjproject depends = ffmpeg depends = libsrtp depends = opus - optdepends = alsa-lib optdepends = e2fsprogs - optdepends = python - source = http://www.pjsip.org/release/2.8/pjproject-2.8.tar.bz2 - sha256sums = 503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79 + optdepends = python-pjproject: Python bindings -pkgname = pjproject +pkgname = python-pjproject + depends = pjproject + depends = python diff --git a/0001-Don-t-build-Java-bindings.patch b/0001-Don-t-build-Java-bindings.patch new file mode 100644 index 000000000000..20470f7a58af --- /dev/null +++ b/0001-Don-t-build-Java-bindings.patch @@ -0,0 +1,25 @@ +From 2a528772c79a6575bef2dfcd0699945409ef9dd1 Mon Sep 17 00:00:00 2001 +From: Nobody <nobody@nowhere.net> +Date: Mon, 17 Sep 2001 00:00:00 +0000 +Subject: [PATCH 1/2] Don't build Java bindings + +--- + pjsip-apps/src/swig/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pjsip-apps/src/swig/Makefile b/pjsip-apps/src/swig/Makefile +index ef8d0c9..e6d2580 100644 +--- a/pjsip-apps/src/swig/Makefile ++++ b/pjsip-apps/src/swig/Makefile +@@ -7,7 +7,7 @@ else + ifneq ($(findstring ios,$(TARGET_NAME)),) + DIRS = csharp + else +- DIRS = python java ++ DIRS = python + endif + endif + +-- +2.20.1 + diff --git a/0002-Query-python-executable-for-actual-version-in-use.patch b/0002-Query-python-executable-for-actual-version-in-use.patch new file mode 100644 index 000000000000..2752e54526a9 --- /dev/null +++ b/0002-Query-python-executable-for-actual-version-in-use.patch @@ -0,0 +1,35 @@ +From 69b94c9d9ee6a525022c40dae70fd0d839db5537 Mon Sep 17 00:00:00 2001 +From: Nobody <nobody@nowhere.net> +Date: Mon, 17 Sep 2001 00:00:00 +0000 +Subject: [PATCH 2/2] Query python executable for actual version in use + +--- + pjsip-apps/src/swig/python/Makefile | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/pjsip-apps/src/swig/python/Makefile b/pjsip-apps/src/swig/python/Makefile +index 5addbb9..0e1d194 100644 +--- a/pjsip-apps/src/swig/python/Makefile ++++ b/pjsip-apps/src/swig/python/Makefile +@@ -3,13 +3,14 @@ PYTHON_SO=_pjsua2.so + USE_PYTHON3?=1 + + ifeq ($(USE_PYTHON3),1) +- PYTHON_EXE=python3.6 +- PYTHON_PKG_DIR=$(HOME)/.local/lib/python3.6/site-packages ++ PYTHON_EXE=python3 + else +- PYTHON_EXE=python2.7 +- PYTHON_PKG_DIR=$(HOME)/.local/lib/python2.7/site-packages ++ PYTHON_EXE=python2 + endif + ++PYTHON_VERSION := $(shell $(PYTHON_EXE) -c 'import sys; print(".".join(str(v) for v in sys.version_info[0:2]))') ++PYTHON_PKG_DIR := $(HOME)/.local/lib/python$(PYTHON_VERSION)/site-packages ++ + #PYTHON_SETUP_FLAGS = --inplace + ifeq ($(OS),Windows_NT) + PYTHON_SETUP_FLAGS += --compiler=mingw32 +-- +2.20.1 + @@ -3,35 +3,69 @@ # Contributor: Marti Raudsepp <marti@juffo.org> # Contributor: Travis Hegner <travis.hegner@gmail.com> -pkgname=pjproject +pkgbase=pjproject +pkgname=(pjproject python-pjproject) pkgver=2.8 -pkgrel=3 +pkgrel=4 pkgdesc='Open source SIP stack and media stack' arch=('i686' 'x86_64' 'armv7h') url='http://www.pjsip.org/' license=('GPL') -depends=('openssl' 'portaudio' 'speex' 'alsa-lib' 'libsamplerate' 'util-linux' 'ffmpeg' 'libsrtp' 'opus') -makedepends=('e2fsprogs' 'python') -optdepends=('alsa-lib' 'e2fsprogs' 'python') -source=("http://www.pjsip.org/release/$pkgver/$pkgname-$pkgver.tar.bz2") -sha256sums=('503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79') +makedepends=('alsa-lib' 'e2fsprogs' 'ffmpeg' 'libsamplerate' 'libsrtp' 'openssl' 'opus' 'portaudio' 'python' 'speex' 'swig' 'util-linux') +source=("http://www.pjsip.org/release/$pkgver/$pkgname-$pkgver.tar.bz2" + 0001-Don-t-build-Java-bindings.patch + 0002-Query-python-executable-for-actual-version-in-use.patch) +sha256sums=('503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79' + '74bdd3f404bf27dc00c235caada2d9c4b0b43e44febc8905b507c815384cf8fb' + 'caa187ae9b75964bbf1a79996b6e89321ff83bc910fd5bbdac33924a2bdb0cfb') + +prepare() { + cd "$srcdir/$pkgbase-$pkgver" + patch -Np1 < "$srcdir/0001-Don-t-build-Java-bindings.patch" + patch -Np1 < "$srcdir/0002-Query-python-executable-for-actual-version-in-use.patch" + echo "#define PJ_HAS_IPV6 1" >> "pjlib/include/pj/config_site.h" +} build() { - cd "$pkgname-$pkgver" + cd "$srcdir/$pkgbase-$pkgver" export CXXFLAGS="$CXXFLAGS -fPIC" if [ "$CARCH" = "i686" ]; then export CXXFLAGS="$CXXFLAGS -march=i686" - arch_opts="--disable-libwebrtc" + arch_opts=(--disable-libwebrtc) fi - export CFLAGS="$CXXFLAGS -DNDEBUG" - ./configure --prefix=/usr --with-external-speex --with-external-srtp --with-external-pa --with-external-gsm --disable-oss --enable-shared --disable-opencore-amr --disable-v4l2 --disable-video --disable-sound ${arch_opts} + export CFLAGS="$CFLAGS -fPIC -DNDEBUG" + ./configure \ + --prefix=/usr \ + --with-external-speex \ + --with-external-srtp \ + --with-external-pa \ + --with-external-gsm \ + --disable-oss \ + --enable-shared \ + --disable-opencore-amr \ + --disable-v4l2 \ + --disable-video \ + --disable-sound \ + "${arch_opts[@]}" + echo "#define PJ_HAS_IPV6 1" >> "$srcdir/$pkgname-$pkgver/pjlib/include/pj/config_site.h" make -j1 dep make -j1 + + make -C pjsip-apps/src/swig -j1 } -package() { - cd "$pkgname-$pkgver" +package_pjproject() { + depends=('openssl' 'portaudio' 'speex' 'alsa-lib' 'libsamplerate' 'util-linux' 'ffmpeg' 'libsrtp' 'opus') + optdepends=('e2fsprogs' 'python-pjproject: Python bindings') + cd "$srcdir/$pkgbase-$pkgver" make -j1 DESTDIR="$pkgdir" install install -D -m755 pjsip-apps/bin/pjsua-*gnu* "$pkgdir"/usr/bin/pjsua } + +package_python-pjproject() { + depends=('pjproject' 'python') + cd "$srcdir/$pkgbase-$pkgver/pjsip-apps/src/swig/python" + + python setup.py install --root="$pkgdir/" --optimize=1 +} diff --git a/ffmpeg.patch b/ffmpeg.patch deleted file mode 100644 index 86fff7806485..000000000000 --- a/ffmpeg.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -aur pjproject-2.2.orig/pjmedia/src/pjmedia/ffmpeg_util.h pjproject-2.2/pjmedia/src/pjmedia/ffmpeg_util.h ---- pjproject-2.2.orig/pjmedia/src/pjmedia/ffmpeg_util.h 2011-07-19 05:42:28.000000000 +0200 -+++ pjproject-2.2/pjmedia/src/pjmedia/ffmpeg_util.h 2014-03-08 11:30:57.675023916 +0100 -@@ -22,6 +22,8 @@ - * that use ffmpeg. This is not a public API. - */ - -+#define CodecID AVCodecID -+ - #ifndef __PJMEDIA_FFMPEG_UTIL_H__ - #define __PJMEDIA_FFMPEG_UTIL_H__ - diff --git a/python2.patch b/python2.patch deleted file mode 100644 index 39fad3b7fcc0..000000000000 --- a/python2.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -aur pjproject-1.14.orig/pjsip-apps/src/python/Makefile pjproject-1.14/pjsip-apps/src/python/Makefile ---- pjproject-1.14.orig/pjsip-apps/src/python/Makefile 2011-02-28 08:16:08.000000000 +0100 -+++ pjproject-1.14/pjsip-apps/src/python/Makefile 2012-05-18 22:46:28.104266975 +0200 -@@ -1,12 +1,12 @@ - all: -- python setup.py build -+ python2 setup.py build - - clean distclean realclean: -- python setup.py clean -+ python2 setup.py clean - rm -rf ./build - - install: -- python setup.py $@ -+ python2 setup.py $@ - - dep doc: - |