# Contributor: Roberto Alsina # Contributor: Tomas Lindquist Olsen # Contributor: Anders Bergh # Contributor: Tobias Kieslich [tobias funnychar archlinux dot org] pkgname=llvm-clang-svn pkgver=85149 pkgrel=1 pkgdesc="Low Level Virtual Machine - Compiler infrastructure" arch=('i686' 'x86_64') url="http://llvm.org" license=(custom:"University of Illinois/NCSA Open Source License") depends=('libtool' 'libelf' 'gcc-libs') makedepends=('gcc' 'subversion') optdepends=('perl: the scan-build tool for the clang static analyzer' \ 'python: the helpers for the scan-view tool') provides=('llvm') conflicts=('llvm') source=() md5sums=() # this is always the latest svn so debug info can be useful # but llvm was always very stable for me #options=('!strip') _svntrunk=http://llvm.org/svn/llvm-project/llvm/trunk _svnmod=llvm build() { cd ${srcdir} if [ -d ${_svnmod}/.svn ]; then (cd ${_svnmod} && svn up -r ${pkgver}) else svn co ${_svntrunk} --config-dir ./ -r ${pkgver} ${_svnmod} fi msg "SVN checkout done or server timeout" msg "Starting make..." rm -r ${srcdir}/${_svnmod}-build svn export ${_svnmod} ${_svnmod}-build # get clang in here cd ${srcdir} if [ -d clang/.svn ]; then (cd clang && svn up) cd ${srcdir} else svn co http://llvm.org/svn/llvm-project/cfe/trunk clang fi svn export clang ${_svnmod}-build/tools/clang cd ${_svnmod}-build # prepare the build # remove docs from the make targets # sed 's:runtime docs:runtime:' -i Makefile || return 1 # remove examples projects and bindings from the make targets sed 's:examples projects bindings::' -i Makefile || return 1 # remove libHello transformation sed 's: Hello::' -i lib/Transforms/Makefile || return 1 # start the build - FIXME: make that libexec thing working for clang stuff ./configure --prefix=/usr \ --sysconfdir=/etc \ --libexecdir=/usr/lib/clang \ --enable-optimized \ --enable-assertions \ --enable-pic \ --enable-targets=host-only \ --disable-bindings \ --enable-shared \ --enable-static \ --disable-expensive-checks || return 1 make -j2 || return 1 make DESTDIR=${pkgdir} install || return 1 install -Dm644 ${srcdir}/llvm-build/LICENSE.TXT \ ${pkgdir}/usr/share/licenses/llvm/COPYING # install scan-build tool cd tools/clang/utils install -dm755 "${pkgdir}/usr/lib/clang/libexec" install -m755 scan-build ccc-analyzer "${pkgdir}/usr/lib/clang/" install -m644 scanview.css sorttable.js "${pkgdir}/usr/lib/clang/" # make scan-build available from path ln -s /usr/lib/clang/scan-build "${pkgdir}/usr/bin/scan-build" # make clang-cc available for scan-build (/usr/libexec is not searched but if we move the binary # clang-cc doesn't find the header files ... bummer) ln -s /usr/libexec/clang-cc "${pkgdir}/usr/lib/clang/libexec/clang-cc" cd ../tools/scan-view cp -pr Reporter.py Resources ScanView.py scan-view startfile.py "${pkgdir}/usr/lib/clang/" ln -s /usr/lib/clang/scan-view "${pkgdir}/usr/bin/scan-view" # no docs please -- these are justps and html formatted manpages rm -rf ${pkgdir}/usr/docs }