void-packages/srcpkgs/llvm-git/template

135 lines
3.5 KiB
Plaintext
Raw Normal View History

2014-07-22 07:23:29 +02:00
# Template file for 'llvm-git'
pkgname=llvm-git
2014-09-03 08:20:27 +02:00
version=20140902
_llvmsha=e2d40936f67132ec5606c23d1f77bc7a044d779c
_clangsha=fd2dea560591b0c8777ae693546987595ee57dd8
_crtsha=590928cf13ee02ce57feea4b83a6c91b27ff390c
2014-07-22 07:23:29 +02:00
wrksrc="llvm-${version}.src"
revision=1
lib32disabled=yes
configure_args="--disable-expensive-checks --disable-debug-runtime
--enable-bindings=none --enable-optimize --enable-shared --enable-libffi
--enable-llvmc-dynamic --disable-assertions --enable-keep-symbols
--enable-experimental-targets=R600"
2014-08-17 09:46:36 +02:00
short_desc="Low Level Virtual Machine [3.6-git]"
2014-07-22 07:23:29 +02:00
maintainer="John Galt <johngaltfirstrun@gmail.com>"
homepage="http://www.llvm.org"
license="BSD"
conflicts="llvm>=0"
# XXX Investigate ocaml bindings.
hostmakedepends="groff perl python zlib-devel libffi-devel git"
2014-07-22 07:23:29 +02:00
makedepends="zlib-devel libffi-devel"
do_fetch() {
local urlprefix="git://github.com/llvm-mirror"
msg_normal "Fetching source from $urlprefix ...\n"
git clone ${urlprefix}/llvm ${wrksrc}
git clone ${urlprefix}/clang ${wrksrc}/tools/clang
git clone ${urlprefix}/compiler-rt ${wrksrc}/projects/compiler-rt
cd ${wrksrc}
git reset --hard ${_llvmsha}
cd ${wrksrc}/tools/clang
git reset --hard ${_clangsha}
cd ${wrksrc}/projects/compiler-rt
git reset --hard ${_crtsha}
}
do_configure() {
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
# 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
mkdir build
cd build
../configure ${configure_args}
}
do_build() {
unset CC CXX CPP AR AS RANLIB CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
cd build
make ${makejobs}
}
do_install() {
cd build
make DESTDIR=${DESTDIR} install
# Fix permissions of static libs
chmod -x ${DESTDIR}/usr/lib/*.a
# Get rid of example Hello transformation
rm ${DESTDIR}/usr/lib/*LLVMHello.*
# Required for multilib.
if [ "$XBPS_TARGET_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
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
fi
}
clang-analyzer-git_package() {
noarch=yes
pycompile_dirs="usr/lib/clang-analyzer"
depends="clang-git-${version}_${revision} python"
conflicts="clang-analyzer>=0"
short_desc+=" - A source code analysis framework"
homepage="http://clang-analyzer.llvm.org/"
pkg_install() {
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:0:14}/scan-build
}
}
clang-git_package() {
lib32disabled=yes
depends="libstdc++-devel binutils gcc"
conflicts="clang>=0"
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*"
}
}
libllvm-git_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove usr/lib/libLLVM*.so
}
}
llvm-docs-git_package() {
noarch=yes
conflicts="llvm-docs>=0"
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}