Skip to content

Instantly share code, notes, and snippets.

@Wuestengecko
Last active June 14, 2019 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wuestengecko/c5e12a95a11dcb4e7b31128726ee4565 to your computer and use it in GitHub Desktop.
Save Wuestengecko/c5e12a95a11dcb4e7b31128726ee4565 to your computer and use it in GitHub Desktop.
pjproject AUR package patches
From ae2130a11511f307f46622a48d96c60f411cdccf Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli GNUtoo@cyberdimension.org
Date: Sun, 14 Apr 2019 23:33:27 +0200
Subject: [PATCH 1/3] Fix illegal instructions on x86_64 by disabling
-march=native
Before this package was built with -march=native, so if you build
it on a machine with a processor that supports avx (Advanced Vector
Extensions), libpjsip.so.2 ended up with vpxor instructions that
don't work anymore on machines with a processor that do not have
such extension, and would result in an illegal instruction at
asterisk startup on such machines.
Signed-off-by: Denis 'GNUtoo' Carikli GNUtoo@cyberdimension.org
PKGBUILD | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index 8658642..3543582 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=pjproject
pkgver=2.8
-pkgrel=1
+pkgrel=2
pkgdesc='Open source SIP stack and media stack'
arch=('i686' 'x86_64' 'armv7h')
url='http://www.pjsip.org/'
@@ -18,7 +18,7 @@ sha256sums=('503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79')
build() {
cd "$pkgname-$pkgver"
- export CXXFLAGS="$CXXFLAGS -fPIC -march=native"
+ export CXXFLAGS="$CXXFLAGS -fPIC"
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
echo "#define PJ_HAS_IPV6 1" >> "$srcdir/$pkgname-$pkgver/pjlib/include/pj/config_site.h"
--
2.21.0
From a5fa962b0f0003c95f28e429d6e575131a2dadea Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Date: Sun, 14 Apr 2019 23:48:47 +0200
Subject: [PATCH 2/3] disable libwebrtc on i686 to fix illegal instructions
Both Parabola and archlinux32 whish to support all i686 machines
that don't have SSE2:
- Parabola's minimum system requirements states that:
"Parabola GNU/Linux-libre should run on any i686 compatible machine
[...]"[1]
Wikipedia states that i686 has MMX and SSE[2] but doesn't mention
SSE2 as a requirement[2].
- Archlinux32 states:
"Currently some i686 packages require SSE2 - which is a bug we're
trying to solve."[3]
References:
-----------
[1]https://wiki.parabola.nu/Beginners%27_guide#Minimum_system_requirements
[2]https://en.wikipedia.org/wiki/P6_(microarchitecture)
[3]https://archlinux32.org/architecture/
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
PKGBUILD | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/PKGBUILD b/PKGBUILD
index 3543582..297adb3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=pjproject
pkgver=2.8
-pkgrel=2
+pkgrel=3
pkgdesc='Open source SIP stack and media stack'
arch=('i686' 'x86_64' 'armv7h')
url='http://www.pjsip.org/'
@@ -19,8 +19,12 @@ sha256sums=('503d0bd7f9f13dc1492ac9b71b761b1089851fbb608b9a13996edc3c42006f79')
build() {
cd "$pkgname-$pkgver"
export CXXFLAGS="$CXXFLAGS -fPIC"
+ if [ "$CARCH" = "i686" ]; then
+ export CXXFLAGS="$CXXFLAGS -march=i686"
+ 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
+ ./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
--
2.21.0
From 5fe317891222a6a34a429751f00bce09fee9f1c0 Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Date: Sun, 14 Apr 2019 23:58:49 +0200
Subject: [PATCH 3/3] package: catch ARM binaries
In package(), the trailing '*' was added to
pjsip-apps/bin/pjsua-*gnu in order to catch binaries like
pjsip-apps/bin/pjsua-armv7l-unknown-linux-gnueabihf on ARM.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
PKGBUILD | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PKGBUILD b/PKGBUILD
index 297adb3..5da55c3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -33,5 +33,5 @@ build() {
package() {
cd "$pkgname-$pkgver"
make -j1 DESTDIR="$pkgdir" install
- install -D -m755 pjsip-apps/bin/pjsua-*gnu "$pkgdir"/usr/bin/pjsua
+ install -D -m755 pjsip-apps/bin/pjsua-*gnu* "$pkgdir"/usr/bin/pjsua
}
--
2.21.0
From e80a59bbd32f270638c54f96ef2fee30c38a7408 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?W=C3=BCstengecko?=
<1579756+Wuestengecko@users.noreply.github.com>
Date: Sun, 12 May 2019 17:00:50 +0200
Subject: [PATCH 1/2] 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`.
---
.SRCINFO | 29 +++++++--
0001-Don-t-build-Java-bindings.patch | 25 ++++++++
...executable-for-actual-version-in-use.patch | 35 +++++++++++
PKGBUILD | 60 +++++++++++++++----
ffmpeg.patch | 12 ----
python2.patch | 19 ------
6 files changed, 130 insertions(+), 50 deletions(-)
create mode 100644 0001-Don-t-build-Java-bindings.patch
create mode 100644 0002-Query-python-executable-for-actual-version-in-use.patch
delete mode 100644 ffmpeg.patch
delete mode 100644 python2.patch
diff --git a/.SRCINFO b/.SRCINFO
index 8d782e1..6b27ee0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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 0000000..20470f7
--- /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 0000000..2752e54
--- /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
+
diff --git a/PKGBUILD b/PKGBUILD
index 5da55c3..066958d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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 86fff78..0000000
--- 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 39fad3b..0000000
--- 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:
-
--
2.22.0
From fc3e21e2651b64b121e72ad80664ca4cd0579acd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?W=C3=BCstengecko?=
<1579756+Wuestengecko@users.noreply.github.com>
Date: Fri, 14 Jun 2019 21:31:49 +0200
Subject: [PATCH 2/2] new upstream version 2.9
This commit also switches to the md5sum integrity check, as that is what
upstream provides.
---
.SRCINFO | 12 ++++++------
PKGBUILD | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.SRCINFO b/.SRCINFO
index 6b27ee0..3485136 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = pjproject
pkgdesc = Open source SIP stack and media stack
- pkgver = 2.8
- pkgrel = 4
+ pkgver = 2.9
+ pkgrel = 1
url = http://www.pjsip.org/
arch = i686
arch = x86_64
@@ -19,12 +19,12 @@ pkgbase = pjproject
makedepends = speex
makedepends = swig
makedepends = util-linux
- source = http://www.pjsip.org/release/2.8/pjproject-2.8.tar.bz2
+ source = http://www.pjsip.org/release/2.9/pjproject-2.9.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
+ md5sums = 66757078e7bd7cf316acb0425c2fdd6f
+ md5sums = 84f243ca0469ee9079e01622b622d65f
+ md5sums = feabd9629dd9ab619fbb56894e2e43f4
pkgname = pjproject
depends = openssl
diff --git a/PKGBUILD b/PKGBUILD
index 066958d..6679ee5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,8 +5,8 @@
pkgbase=pjproject
pkgname=(pjproject python-pjproject)
-pkgver=2.8
-pkgrel=4
+pkgver=2.9
+pkgrel=1
pkgdesc='Open source SIP stack and media stack'
arch=('i686' 'x86_64' 'armv7h')
url='http://www.pjsip.org/'
@@ -15,9 +15,9 @@ makedepends=('alsa-lib' 'e2fsprogs' 'ffmpeg' 'libsamplerate' 'libsrtp' 'openssl'
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')
+md5sums=('66757078e7bd7cf316acb0425c2fdd6f'
+ '84f243ca0469ee9079e01622b622d65f'
+ 'feabd9629dd9ab619fbb56894e2e43f4')
prepare() {
cd "$srcdir/$pkgbase-$pkgver"
--
2.22.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment