lib32/lib32-llvm/PKGBUILD

131 lines
4.1 KiB
Bash
Raw Normal View History

2012-04-28 06:22:56 +08:00
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# resynced with Arch's version from https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/lib32-llvm
# adjusted for Chakra
2012-04-28 06:22:56 +08:00
pkgname=('lib32-llvm' 'lib32-llvm-libs')
2013-07-18 19:28:58 +08:00
pkgver=3.3
_gcc_ver=4.8.0
pkgrel=3
2012-04-28 06:22:56 +08:00
arch=('x86_64')
url="http://llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
makedepends=('lib32-libffi' 'lib32-zlib' 'python2' "gcc-multilib=${_gcc_ver}")
source=(http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.gz
http://llvm.org/releases/$pkgver/compiler-rt-$pkgver.src.tar.gz)
sha256sums=('68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578'
'0e2f3180d6316e6c43f064fdd406c5c6515e682c5f31c57c28335b68c7525423')
2012-04-28 06:22:56 +08:00
build() {
# preparation
2012-12-22 00:39:35 +08:00
cd "$srcdir/llvm-$pkgver.src"
2012-04-28 06:22:56 +08:00
rm -rf tools/clang
rm -rf projects/compiler-rt
mv "$srcdir/compiler-rt-$pkgver.src" projects/compiler-rt
# Fix installation directories, ./configure doesn't seem to set them right
sed -i -e 's:\$(PROJ_prefix)/lib:$(PROJ_prefix)/lib32:' \
-e 's:\$(PROJ_prefix)/docs/llvm:$(PROJ_prefix)/share/doc/llvm:' \
Makefile.config.in
sed -i '/ActiveLibDir = ActivePrefix/s:lib:lib32:' \
tools/llvm-config/llvm-config.cpp
sed -i 's:LLVM_LIBDIR="${prefix}/lib":LLVM_LIBDIR="${prefix}/lib32":' \
autoconf/configure.ac \
configure
2012-04-28 06:22:56 +08:00
# Fix insecure rpath (http://bugs.archlinux.org/task/14017)
sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules
cd "$srcdir/llvm-$pkgver.src"
export CC="gcc -m32"
export CXX="g++ -m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
2012-04-28 06:22:56 +08:00
# Apply strip option to configure
_optimized_switch="enable"
[[ $(check_option strip) == n ]] && _optimized_switch="disable"
# Include location of libffi headers in CPPFLAGS
CPPFLAGS+=" $(pkg-config --cflags libffi)"
# We had to force host and target to get
# a proper triplet reported by llvm
2012-04-28 06:22:56 +08:00
./configure \
--prefix=/usr \
--libdir=/usr/lib32 \
2012-04-28 06:22:56 +08:00
--sysconfdir=/etc \
--enable-shared \
--enable-libffi \
--enable-targets=all \
--enable-experimental-targets=R600 \
2012-04-28 06:22:56 +08:00
--disable-expensive-checks \
--disable-debug-runtime \
--disable-assertions \
--with-binutils-include=/usr/include \
--with-python=/usr/bin/python2 \
--host=i386-pc-linux-gnu \
--target=i386-pc-linux-gnu \
--$_optimized_switch-optimized
2012-04-28 06:22:56 +08:00
make REQUIRES_RTTI=1
}
package_lib32-llvm() {
pkgdesc="Low Level Virtual Machine (32-bit)"
depends=('lib32-llvm-libs' 'llvm')
2012-04-28 06:22:56 +08:00
cd "$srcdir/llvm-$pkgver.src"
2012-04-28 06:22:56 +08:00
make DESTDIR="$pkgdir" install
2012-04-28 06:22:56 +08:00
# The runtime library goes into lib32-llvm-libs
mv "$pkgdir/usr/lib32/libLLVM-3.3.so" "$srcdir"
2012-04-28 06:22:56 +08:00
# Fix permissions of static libs
chmod -x "$pkgdir"/usr/lib32/*.a
2012-04-28 06:22:56 +08:00
mv "$pkgdir/usr/bin/i386-pc-linux-gnu-llvm-config" "$pkgdir/usr/lib32/llvm-config"
2012-04-28 06:22:56 +08:00
# Get rid of example Hello transformation
rm "$pkgdir"/usr/lib32/*LLVMHello.*
2012-04-28 06:22:56 +08:00
# Symlink LLVMgold.so into /usr/lib/bfd-plugins
# (https://bugs.archlinux.org/task/28479)
install -d "$pkgdir/usr/lib32/bfd-plugins"
ln -s ../LLVMgold.so "$pkgdir/usr/lib32/bfd-plugins/LLVMgold.so"
2012-04-28 06:22:56 +08:00
mv "$pkgdir"/usr/include/llvm/Config/*config.h "$pkgdir/"
rm -rf "$pkgdir"/usr/{bin,include,share/{doc,man}}
install -d "$pkgdir/usr/include/llvm/Config"
mv "$pkgdir/config.h" "$pkgdir/usr/include/llvm/Config/config-32.h"
mv "$pkgdir/llvm-config.h" "$pkgdir/usr/include/llvm/Config/llvm-config-32.h"
mkdir "$pkgdir"/usr/bin
mv "$pkgdir/usr/lib32/llvm-config" "$pkgdir/usr/bin/llvm-config32"
install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_lib32-llvm-libs() {
pkgdesc="Low Level Virtual Machine (runtime library)(32-bit) "
depends=('lib32-libffi' 'lib32-zlib' 'lib32-gcc-libs')
cd "$srcdir"
install -D libLLVM-3.3.so "$pkgdir/usr/lib32/libLLVM-3.3.so"
install -Dm644 llvm-$pkgver.src/LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
2012-04-28 06:22:56 +08:00
}
# vim:set ts=2 sw=2 et: