2010-04-28 18:11:40 +02:00
|
|
|
# Template file for 'llvm'
|
|
|
|
pkgname=llvm
|
2013-01-04 10:17:21 +01:00
|
|
|
version=3.2
|
|
|
|
wrksrc="llvm-${version}.src"
|
2013-01-25 09:06:53 +01:00
|
|
|
revision=3
|
2011-10-24 14:14:47 +02:00
|
|
|
build_style=gnu-configure
|
2010-04-28 18:11:40 +02:00
|
|
|
configure_args="--disable-expensive-checks --disable-debug-runtime
|
2013-01-04 10:17:21 +01:00
|
|
|
--enable-targets=all --enable-bindings=none --enable-optimize
|
|
|
|
--enable-shared --enable-libffi --enable-llvmc-dynamic
|
|
|
|
--disable-assertions --libdir=/usr/lib/llvm"
|
2010-04-28 18:11:40 +02:00
|
|
|
short_desc="Low Level Virtual Machine"
|
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2011-11-06 09:54:22 +01:00
|
|
|
homepage="http://www.llvm.org"
|
|
|
|
license="BSD"
|
2013-01-04 10:17:21 +01:00
|
|
|
distfiles="
|
|
|
|
http://www.llvm.org/releases/${version}/llvm-${version}.src.tar.gz
|
|
|
|
http://www.llvm.org/releases/${version}/clang-${version}.src.tar.gz
|
|
|
|
http://dev.archlinux.org/~foutrelis/sources/compiler-rt/compiler-rt-${version}.src.tar.xz"
|
2010-04-28 18:11:40 +02:00
|
|
|
checksum="
|
2013-01-04 10:17:21 +01:00
|
|
|
125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343
|
|
|
|
2aaaf03f7c0f6b16fe97ecc81247dc2bf2d4bec7620a77cc74670b7e07ff5658
|
|
|
|
a9a6b73a1bd5fc763f3b3826a6ce796cb150042d37d319e06e72d3d9778aaac1"
|
|
|
|
|
|
|
|
# Do not build huge debug pkgs.
|
|
|
|
disable_debug=yes
|
|
|
|
|
|
|
|
# XXX gzip compressed wtf?!!
|
|
|
|
skip_extraction="compiler-rt-${version}.src.tar.xz"
|
|
|
|
|
|
|
|
# XXX Investigate ocaml bindings.
|
2013-04-12 19:13:19 +02:00
|
|
|
hostmakedepends="groff bsdtar perl python"
|
|
|
|
makedepends="libffi-devel"
|
2010-04-28 18:11:40 +02:00
|
|
|
|
2011-11-06 09:54:22 +01:00
|
|
|
post_extract() {
|
2010-04-28 18:11:40 +02:00
|
|
|
# Move clang files into the llvm source.
|
2011-12-02 09:49:47 +01:00
|
|
|
if [ -d ${XBPS_BUILDDIR}/clang-${version}.src ]; then
|
|
|
|
mv ${XBPS_BUILDDIR}/clang-${version}.src ${wrksrc}/tools/clang
|
2010-04-28 18:11:40 +02:00
|
|
|
fi
|
2013-01-04 10:17:21 +01:00
|
|
|
# XXX unpack with bsdtar due to being gzip compressed!
|
|
|
|
bsdtar xf ${XBPS_SRCDISTDIR}/compiler-rt-${version}.src.tar.xz -C ${XBPS_BUILDDIR}
|
|
|
|
# Move compiler-rt files into the llvm source.
|
|
|
|
if [ -d ${XBPS_BUILDDIR}/compiler-rt-${version}.src ]; then
|
|
|
|
mv ${XBPS_BUILDDIR}/compiler-rt-${version}.src \
|
|
|
|
${wrksrc}/projects/compiler-rt
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
pre_configure() {
|
|
|
|
# Fix installation directories, ./configure doesn't seem to set them right
|
|
|
|
sed -i -e 's:\$(PROJ_prefix)/etc/llvm:/etc/llvm:' \
|
|
|
|
-e 's:\$(PROJ_prefix)/lib:$(PROJ_prefix)/lib/llvm:' \
|
|
|
|
-e 's:\$(PROJ_prefix)/docs/llvm:$(PROJ_prefix)/share/doc/llvm:' \
|
|
|
|
Makefile.config.in
|
|
|
|
sed -i '/ActiveLibDir = ActivePrefix/s:lib:lib/llvm:' \
|
|
|
|
tools/llvm-config/llvm-config.cpp
|
|
|
|
sed -i 's:LLVM_LIBDIR="${prefix}/lib":LLVM_LIBDIR="${prefix}/lib/llvm":' \
|
|
|
|
autoconf/configure.ac configure
|
|
|
|
|
|
|
|
# Drop "svn" suffix from version string
|
|
|
|
sed -i 's/3\.2svn/3.2/g' configure
|
|
|
|
}
|
|
|
|
|
|
|
|
post_install() {
|
|
|
|
# Fix permissions of static libs
|
|
|
|
chmod -x ${DESTDIR}/usr/lib/llvm/*.a
|
|
|
|
|
|
|
|
# Get rid of example Hello transformation
|
|
|
|
rm ${DESTDIR}/usr/lib/llvm/*LLVMHello.*
|
|
|
|
|
|
|
|
# Add ld.so.conf.d entry
|
|
|
|
vmkdir etc/ld.so.conf.d
|
|
|
|
echo /usr/lib/llvm > ${DESTDIR}/etc/ld.so.conf.d/llvm.conf
|
|
|
|
|
|
|
|
# Required for multilib.
|
|
|
|
if [ "$XBPS_MACHINE" = "x86_64" ]; then
|
|
|
|
for _header in config llvm-config; do
|
|
|
|
mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
|
|
|
|
vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
|
|
|
|
usr/include/llvm/Config ${_header}.h
|
|
|
|
done
|
|
|
|
fi
|
2010-04-28 18:11:40 +02:00
|
|
|
}
|
2013-04-12 19:13:19 +02:00
|
|
|
|
|
|
|
clang-analyzer_package() {
|
|
|
|
noarch=yes
|
|
|
|
pycompile_dirs="usr/lib/clang-analyzer"
|
|
|
|
depends="clang>=${version} python"
|
|
|
|
short_desc="Low-Level Virtual Machine (LLVM) - A source code analysis framework"
|
|
|
|
homepage="http://clang-analyzer.llvm.org/"
|
|
|
|
pkg_install() {
|
|
|
|
install -d ${PKGDESTDIR}/usr/bin
|
|
|
|
install -d ${PKGDESTDIR}/usr/lib/clang-analyzer
|
|
|
|
|
|
|
|
for f in build view; do
|
|
|
|
cp -r ${wrksrc}/tools/clang/tools/scan-${f} ${PKGDESTDIR}/usr/lib/clang-analyzer
|
|
|
|
cd ${PKGDESTDIR}/usr/bin
|
|
|
|
ln -s ../lib/${pkgname}/scan-${f}/scan-${f} scan-${f}
|
|
|
|
done
|
|
|
|
|
|
|
|
ln -sf /usr/bin/clang ${PKGDESTDIR}/usr/lib/${pkgname}/scan-build
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
clang_package() {
|
|
|
|
depends="libstdc++-devel binutils"
|
|
|
|
short_desc="Low-Level Virtual Machine (LLVM) -- C language family frontend"
|
|
|
|
homepage="http://clang.llvm.org/"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/include/clang
|
|
|
|
vmove "usr/bin/*clang*"
|
|
|
|
vmove usr/bin/c-index-test
|
|
|
|
vmove usr/lib/clang
|
|
|
|
vmove "usr/lib/llvm/libclang*"
|
|
|
|
vmove "usr/share/man/man1/*clang*"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
llvm-docs_package() {
|
|
|
|
noarch=yes
|
|
|
|
short_desc+=" - documentation files"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/share/doc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
llvm_package() {
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr
|
|
|
|
}
|
|
|
|
}
|