lib32/lib32-js17/PKGBUILD
2014-11-14 10:53:00 +00:00

68 lines
1.9 KiB
Bash

# Maintainer: Ram-Z <samir.benmendil[at]gmail[dot]com
# Contributor: jtts
# Contributor: Ionut Biru <ibiru@archlinux.org>
_pkgbasename=js17
pkgname=lib32-$_pkgbasename
pkgver=17.0.0
pkgrel=1
pkgdesc="JavaScript interpreter and libraries (legacy) (32-bit)"
arch=(x86_64)
url="https://developer.mozilla.org/En/SpiderMonkey/17"
license=(MPL)
depends=($_pkgbasename lib32-nspr gcc-libs-multilib lib32-libffi lib32-readline)
makedepends=(gcc-multilib python2 zip)
options=(!staticlibs)
conflicts=("lib32-js=17")
replaces=("lib32-js=17")
source=(http://ftp.mozilla.org/pub/mozilla.org/js/mozjs$pkgver.tar.gz)
sha256sums=('321e964fe9386785d3bf80870640f2fa1c683e32fe988eeb201b04471c172fba')
build() {
export CC='gcc -m32'
export CXX='g++ -m32'
export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'
# The configure-script tries to look these as i686-pc-linux-gnu-$TOOLNAME
# and fails miserably. Define the variables here.
export RANLIB=ranlib
export AR=ar
export AS=as
export LD=ld
export STRIP=strip
cd mozjs$pkgver/js/src
# _FORTIFY_SOURCE causes configure error
unset CPPFLAGS
# These configure options do not work, since Arclinux doesn't have
# a 32-bit nspr-config. We have to pass nspr-cflags and nspr-libs
# variables manually to the configure script.
# --with-system-nspr
# --with-nspr-exec-prefix=/usr/lib32
# --with-nspr-prefix=/usr/lib32
./configure --prefix=/usr \
--target=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--with-nspr-cflags="-I/usr/include/nspr" \
--with-nspr-libs="-L/usr/lib32 -lplds4 -lplc4 -lnspr4 -lpthread -ldl" \
--with-system-ffi \
--enable-readline --enable-threadsafe
make
}
#check() {
# cd mozjs$pkgver/js/src
# make check
#}
package() {
cd mozjs$pkgver/js/src
make DESTDIR="$pkgdir" install
find "$pkgdir"/usr/{lib32/pkgconfig,include} -type f -exec chmod -x {} +
# cleanup for lib32 package
rm -rf "${pkgdir}"/{etc,sbin,usr/bin,usr/{include,share}}
}