void-packages/srcpkgs/llvm/template

133 lines
3.6 KiB
Text
Raw Normal View History

# Template file for 'llvm'
pkgname=llvm
2014-05-14 08:33:07 +00:00
version=3.4.1
wrksrc="llvm-${version}.src"
revision=1
lib32disabled=yes
configure_args="--disable-expensive-checks --disable-debug-runtime
2013-06-18 13:12:13 +00:00
--enable-bindings=none --enable-optimize --enable-shared --enable-libffi
--enable-llvmc-dynamic --disable-assertions --enable-keep-symbols"
short_desc="Low Level Virtual Machine"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.llvm.org"
license="BSD"
2013-01-04 09:17:21 +00:00
distfiles="
http://www.llvm.org/releases/${version}/llvm-${version}.src.tar.gz
2014-05-14 08:33:07 +00:00
http://www.llvm.org/releases/${version}/cfe-${version}.src.tar.gz
http://www.llvm.org/releases/${version%.*}/compiler-rt-${version%.*}.src.tar.gz"
checksum="
2014-05-14 08:33:07 +00:00
7d28bb6eca243a2bb6d65a05743ab915b57958a7770277364e93534b63eef93a
ab83f30951b34d75729026e0e73c180a728a140f2a02cbb8915805051a9d6bb7
2014-01-06 23:15:35 +00:00
f37c89b1383ce462d47537a0245ac798600887a9be9f63073e16b79ed536ab5c"
2013-01-04 09:17:21 +00:00
# XXX Investigate ocaml bindings.
hostmakedepends="groff perl python zlib-devel libffi-devel"
2013-10-27 07:38:12 +00:00
makedepends="zlib-devel libffi-devel"
post_extract() {
# Move clang files into the llvm source.
2014-05-14 08:33:07 +00:00
if [ -d ${XBPS_BUILDDIR}/cfe-${version}.src ]; then
mv ${XBPS_BUILDDIR}/cfe-${version}.src ${wrksrc}/tools/clang
fi
2013-01-04 09:17:21 +00:00
# Move compiler-rt files into the llvm source.
2014-05-14 08:33:07 +00:00
if [ -d ${XBPS_BUILDDIR}/compiler-rt-${version%.*} ]; then
mv ${XBPS_BUILDDIR}/compiler-rt-${version%.*} ${wrksrc}/projects/compiler-rt
2013-01-04 09:17:21 +00:00
fi
}
2013-06-18 13:12:13 +00:00
do_configure() {
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
2013-01-04 09:17:21 +00:00
# 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)/docs/llvm:$(PROJ_prefix)/share/doc/llvm:' \
Makefile.config.in
2013-06-18 13:12:13 +00:00
mkdir build
cd build
../configure ${configure_args}
}
do_build() {
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
2013-06-18 13:12:13 +00:00
cd build
make ${makejobs}
2013-01-04 09:17:21 +00:00
}
2013-06-18 13:12:13 +00:00
do_install() {
cd build
make DESTDIR=${DESTDIR} install
2013-01-04 09:17:21 +00:00
# Fix permissions of static libs
chmod -x ${DESTDIR}/usr/lib/*.a
2013-01-04 09:17:21 +00:00
# Get rid of example Hello transformation
rm ${DESTDIR}/usr/lib/*LLVMHello.*
2013-01-04 09:17:21 +00:00
# Required for multilib.
2013-06-18 13:12:13 +00:00
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
2013-01-04 09:17:21 +00:00
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
2013-06-18 13:12:13 +00:00
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
fi
}
clang-analyzer_package() {
noarch=yes
pycompile_dirs="usr/lib/clang-analyzer"
depends="clang-${version}_${revision} python"
short_desc="Low-Level Virtual Machine (LLVM) - A source code analysis framework"
homepage="http://clang-analyzer.llvm.org/"
pkg_install() {
2014-01-06 23:15:35 +00:00
vmkdir usr/bin
vmkdir 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() {
lib32disabled=yes
depends="libstdc++-devel binutils gcc"
2013-06-18 13:12:13 +00:00
short_desc+=" - 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/libclang*"
vmove "usr/share/man/man1/*clang*"
}
}
llvm-docs_package() {
noarch=yes
2013-06-18 13:12:13 +00:00
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}
libllvm_package() {
short_desc+=" - runtime library"
replaces="llvm>3.2<3.3_4"
pkg_install() {
vmove usr/lib/libLLVM-${version}.so
}
}