2010-04-28 18:11:40 +02:00
|
|
|
# Template file for 'llvm'
|
|
|
|
pkgname=llvm
|
2014-09-07 04:41:38 +02:00
|
|
|
version=3.5.0
|
2014-05-14 10:33:07 +02:00
|
|
|
wrksrc="llvm-${version}.src"
|
2014-09-07 04:41:38 +02:00
|
|
|
revision=1
|
2014-04-02 17:05:27 +02:00
|
|
|
lib32disabled=yes
|
2010-04-28 18:11:40 +02:00
|
|
|
configure_args="--disable-expensive-checks --disable-debug-runtime
|
2014-09-07 11:57:35 +02:00
|
|
|
--enable-bindings=none --enable-optimized --enable-shared --enable-libffi
|
2014-07-22 00:39:00 +02:00
|
|
|
--enable-llvmc-dynamic --disable-assertions --enable-keep-symbols
|
|
|
|
--enable-experimental-targets=R600"
|
2014-07-25 09:39:26 +02:00
|
|
|
conflicts="llvm-git>=0"
|
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"
|
2014-11-03 15:51:42 +01:00
|
|
|
update_site="http://www.llvm.org/releases/download.html"
|
2011-11-06 09:54:22 +01:00
|
|
|
license="BSD"
|
2013-01-04 10:17:21 +01:00
|
|
|
distfiles="
|
2014-09-07 04:41:38 +02:00
|
|
|
http://www.llvm.org/releases/${version}/llvm-${version}.src.tar.xz
|
|
|
|
http://www.llvm.org/releases/${version}/cfe-${version}.src.tar.xz
|
|
|
|
http://www.llvm.org/releases/${version}/compiler-rt-${version}.src.tar.xz"
|
2010-04-28 18:11:40 +02:00
|
|
|
checksum="
|
2014-09-07 04:41:38 +02:00
|
|
|
28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03
|
|
|
|
fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b
|
|
|
|
a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136"
|
2013-01-04 10:17:21 +01:00
|
|
|
|
|
|
|
# XXX Investigate ocaml bindings.
|
2014-01-07 12:17:38 +01:00
|
|
|
hostmakedepends="groff perl python zlib-devel libffi-devel"
|
2013-10-27 08:38:12 +01:00
|
|
|
makedepends="zlib-devel 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.
|
2014-05-14 10:33:07 +02:00
|
|
|
if [ -d ${XBPS_BUILDDIR}/cfe-${version}.src ]; then
|
|
|
|
mv ${XBPS_BUILDDIR}/cfe-${version}.src ${wrksrc}/tools/clang
|
2010-04-28 18:11:40 +02:00
|
|
|
fi
|
2013-01-04 10:17:21 +01:00
|
|
|
# Move compiler-rt files into the llvm source.
|
2014-05-14 10:33:07 +02:00
|
|
|
if [ -d ${XBPS_BUILDDIR}/compiler-rt-${version%.*} ]; then
|
|
|
|
mv ${XBPS_BUILDDIR}/compiler-rt-${version%.*} ${wrksrc}/projects/compiler-rt
|
2013-01-04 10:17:21 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-06-18 15:12:13 +02:00
|
|
|
do_configure() {
|
2014-01-07 12:17:38 +01:00
|
|
|
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
|
2013-06-18 15:16:31 +02:00
|
|
|
|
2013-01-04 10:17:21 +01: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 15:12:13 +02:00
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
../configure ${configure_args}
|
|
|
|
}
|
|
|
|
|
|
|
|
do_build() {
|
2014-01-07 12:17:38 +01:00
|
|
|
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
|
2013-06-18 15:16:31 +02:00
|
|
|
|
2013-06-18 15:12:13 +02:00
|
|
|
cd build
|
|
|
|
make ${makejobs}
|
2013-01-04 10:17:21 +01:00
|
|
|
}
|
|
|
|
|
2013-06-18 15:12:13 +02:00
|
|
|
do_install() {
|
|
|
|
cd build
|
|
|
|
make DESTDIR=${DESTDIR} install
|
|
|
|
|
2013-01-04 10:17:21 +01:00
|
|
|
# Fix permissions of static libs
|
2013-06-18 09:20:37 +02:00
|
|
|
chmod -x ${DESTDIR}/usr/lib/*.a
|
2013-01-04 10:17:21 +01:00
|
|
|
|
|
|
|
# Get rid of example Hello transformation
|
2013-06-18 09:20:37 +02:00
|
|
|
rm ${DESTDIR}/usr/lib/*LLVMHello.*
|
2013-01-04 10:17:21 +01:00
|
|
|
|
|
|
|
# Required for multilib.
|
2013-06-18 15:12:13 +02:00
|
|
|
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
|
2013-01-04 10:17:21 +01: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 15:12:13 +02:00
|
|
|
|
|
|
|
# Remove llvm-config-host in cross builds.
|
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
rm -f ${DESTDIR}/usr/bin/llvm-config-host
|
|
|
|
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"
|
2013-06-18 09:20:37 +02:00
|
|
|
depends="clang-${version}_${revision} python"
|
2014-07-25 09:39:26 +02:00
|
|
|
conflicts="clang-analyzer-git>=0"
|
2013-04-12 19:13:19 +02:00
|
|
|
short_desc="Low-Level Virtual Machine (LLVM) - A source code analysis framework"
|
|
|
|
homepage="http://clang-analyzer.llvm.org/"
|
|
|
|
pkg_install() {
|
2014-01-07 00:15:35 +01:00
|
|
|
vmkdir usr/bin
|
|
|
|
vmkdir usr/lib/clang-analyzer
|
2013-04-12 19:13:19 +02:00
|
|
|
|
|
|
|
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() {
|
2014-04-02 17:05:27 +02:00
|
|
|
lib32disabled=yes
|
2013-06-18 09:20:37 +02:00
|
|
|
depends="libstdc++-devel binutils gcc"
|
2014-07-25 09:39:26 +02:00
|
|
|
conflicts="clang-git>=0"
|
2013-06-18 15:12:13 +02:00
|
|
|
short_desc+=" - C language family frontend"
|
2013-04-12 19:13:19 +02:00
|
|
|
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
|
2013-06-18 09:20:37 +02:00
|
|
|
vmove "usr/lib/libclang*"
|
2013-04-12 19:13:19 +02:00
|
|
|
vmove "usr/share/man/man1/*clang*"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
llvm-docs_package() {
|
|
|
|
noarch=yes
|
2014-07-25 09:39:26 +02:00
|
|
|
conflicts="llvm-docs-git>=0"
|
2013-06-18 15:12:13 +02:00
|
|
|
short_desc+=" - documentation files"
|
2013-04-12 19:13:19 +02:00
|
|
|
pkg_install() {
|
|
|
|
vmove usr/share/doc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-18 09:20:37 +02:00
|
|
|
libllvm_package() {
|
|
|
|
short_desc+=" - runtime library"
|
|
|
|
replaces="llvm>3.2<3.3_4"
|
|
|
|
pkg_install() {
|
2014-06-17 10:06:27 +02:00
|
|
|
vmove usr/lib/libLLVM-${version%.*}.so
|
2013-06-18 09:20:37 +02:00
|
|
|
vmove usr/lib/libLLVM-${version}.so
|
|
|
|
}
|
|
|
|
}
|