aboutsummaryrefslogblamecommitdiffstats
path: root/main/pjproject/APKBUILD
blob: 2f030848535ff196a0a27297b8c5224667602526 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                   
                 

          
                       
                                     
          
                          
                                                                    
                                                    
                          
                                             
                                                                     
                                  

                                      
 
           

                         
 



                                                       
                                                          







                                                                        
                            



                                                                                                                                 

 
         
                      
                                        


                                 
                               

                                         
                                           

                                        

                                       
                                      
                                    

                                     


                                                               

                    
 
 
           
                      
                                    
                                                      
                                   

 

                                                                                 
                                      
                                                         
 
 
                                                                                                                                                                   
                                                                                                                                                            
                                                                                                                                                                 
# Contributor: Michael Mason <ms13sp@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pjproject
pkgver=2.8
pkgrel=0
pkgdesc="CLI Softphone"
url="https://www.pjsip.org/pjsua.htm"
arch="all"
license="GPL-2.0-or-later"
depends_dev="openssl-dev alsa-lib-dev gsm-dev speex-dev speexdsp-dev
	portaudio-dev libsrtp-dev libsamplerate-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dbg $pkgname-dev pjsua"
source="http://www.pjsip.org/release/$pkgver/$pkgname-$pkgver.tar.bz2
	fix-bb-cp-uniqueness.patch
	pjproject_no_third_party.patch
	"

prepare() {
	default_prepare
	update_config_sub

	# Remove target name from lib names
	sed -i -e 's/-$(TARGET_NAME)//g' \
		-e 's/= $(TARGET_NAME).a/= .a/g' \
		-e 's/-$(LIB_SUFFIX)/$(LIB_SUFFIX)/g' \
		$(find . -name '*.mak*' -o -name Makefile)

	# Fix hardcoded prefix and flags
	sed -i \
		-e 's/poll@/poll@\nexport PREFIX := @prefix@\n/g' \
		-e 's!prefix = /usr/local!prefix = $(PREFIX)!' \
		-e '/PJLIB_CFLAGS/ s/(_CFLAGS)/(_CFLAGS) -fPIC/g' \
		-e '/PJLIB_UTIL_CFLAGS/ s/(_CFLAGS)/(_CFLAGS) -fPIC/g' \
		Makefile \
		build.mak.in

	# Use libsamplerate instead of bundled resample
	sed -i -e "s/resample//" third_party/build/Makefile
	sed -i -e "s#../../third_party/libsamplerate/src/samplerate.h#samplerate.h#" pjmedia/src/pjmedia/resample_libsamplerate.c
}

build() {
	cd "$builddir"
	export CFLAGS="-DNDEBUG $CFLAGS"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-shared \
		--enable-libsamplerate \
		--with-external-speex \
		--with-external-gsm \
		--with-external-srtp \
		--with-external-pa \
		--disable-libwebrtc \
		--disable-static

	# TODO: make it build with only shared libs from system
	# rm -r third_party
	make dep
	make -j1 all
}

package() {
	cd "$builddir"
	install -d "$pkgdir"/usr/lib
	make -j1 DESTDIR="$pkgdir" prefix=/usr install
	rm -f "$pkgdir"/usr/lib/*.a
}

pjsua() {
	pkgdesc="pjsua is an open source command line SIP user agent (softphone)"
	cd "$builddir"/pjsip-apps/bin/
	install -D -m755 pjsua "$subpkgdir"/usr/bin/pjsua
}

sha512sums="0a0ee66932959710f806cb1d88a3b946b214d2caecd54ecc9eabdbdb17f7f4fa0b7d27567dc3796d845a25b850c974536e7c7538d51f93771d13dd2fd309eaf5  pjproject-2.8.tar.bz2
8688885d5d7b4c6725c6b9a98935401a292757533ac859cdec6bcd5210c9668206fc4be09561890541de8842c4b7beba456ae1a044b4793dfc1275278d7f2cd5  fix-bb-cp-uniqueness.patch
fe53b4e8a654dc4025a4bf6350f405953609abc9e7ed967882cb9eb9e6a659e348a0c3c7496c8093562a0dcc4a40459896d8ee1da7275dd089244338111bccbb  pjproject_no_third_party.patch"