Last active
August 29, 2015 14:10
-
-
Save stubb/fc029959afbcd4e4f482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Sergio Correia <sergio@correia.cc> | |
pkgname=libwebrtc-static | |
_pkgname=libwebrtc | |
pkgver=7746 | |
pkgrel=1 | |
pkgdesc="A library that enables web browsers with Real-Time Communications (RTC) capabilities via simple Javascript APIs" | |
arch=('x86_64') | |
url="http://www.webrtc.org/" | |
license=('custom') | |
depends=('jdk7-openjdk' 'libtinfo') | |
makedepends=('subversion' 'depot-tools-git' 'python2' 'python2-colorama') | |
provides=('libwebrtc') | |
options=('staticlibs') | |
source=('02-dont-make-thin-archives.patch' | |
'LICENSE' | |
'PATENTS') | |
sha256sums=('ede20f8a3896e36f54d954c5ac2d796bd033b58a05b6e6123dfc57ef027ba818' | |
'ab00a482b6a3902e40211b43c5d0441962ea99b6cc7c25c0f243fa270b78d482' | |
'd77073c6cada73cd1d94b8d5e564cda2797e88cc626e91659e27e4bc42d32ddf') | |
prepare() { | |
mkdir -p "${srcdir}"/"${_pkgname}" | |
cd "${srcdir}"/"${_pkgname}" | |
mkdir -p .bin | |
ln -sf /usr/bin/python2 "$(pwd)"/.bin/python | |
export PATH="$(pwd)"/.bin:"${PATH}" | |
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk" | |
gclient config --name src http://webrtc.googlecode.com/svn/trunk | |
gclient sync --revision "${pkgver}" --force --no-history | |
cd src | |
# discarding uncommited changes. | |
pushd chromium/src/tools/gyp/ | |
#svn revert pylib/gyp/generator/ninja.py | |
popd | |
#patch -uNp1 -i ../../02-dont-make-thin-archives.patch | |
} | |
build() { | |
cd "${srcdir}"/"${_pkgname}"/src | |
mkdir -p out/Release | |
ninja -C out/Release | |
} | |
package() { | |
cd "${srcdir}" | |
for i in LICENSE PATENTS; do | |
install -m644 -D "${i}" "${pkgdir}"/usr/share/licenses/"${pkgname}"/"${i}" | |
done | |
cd "${_pkgname}"/src | |
# packaging the library | |
mkdir -p .lib .tmp | |
rm -f .lib/* | |
for l in $(find out/Release -name *.a | grep -vE "do.not.use"); do | |
rm -f .tmp/* | |
pushd .tmp | |
ar vx ../"${l}" | |
r="${RANDOM}" | |
for o in *.o; do | |
cp "${o}" ../.lib/"${r}"-"${o}" | |
done | |
popd | |
done | |
pushd .lib | |
ar rcs libWebRTC.a *.o | |
install -m644 -D libWebRTC.a "${pkgdir}"/usr/lib/libWebRTC.a | |
popd | |
# includes | |
for f in $(find . -name "*.h" | grep -E "^\.\/webrtc|^\.\/talk"); do | |
sed -i 's/#include "/#include <libwebrtc\//g' "${f}" | |
sed -i 's/.h"/.h>/g' "${f}" | |
install -m644 -D "${f}" "${pkgdir}"/usr/include/libwebrtc/"${f}" | |
done | |
} | |
# vim:set ts=2 sw=2 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment