From 471d45df638bfa3dada42bb1e914b4cd9d5c5509 Mon Sep 17 00:00:00 2001 From: John Galt Date: Mon, 21 Jul 2014 22:23:29 -0700 Subject: [PATCH] New package: llvm-git --- common/shlibs | 3 + srcpkgs/clang-analyzer-git | 1 + srcpkgs/clang-git | 1 + srcpkgs/libllvm-git | 1 + srcpkgs/llvm-docs-git | 1 + srcpkgs/llvm-git/files/llvm-Config-config.h | 9 ++ .../llvm-git/files/llvm-Config-llvm-config.h | 9 ++ srcpkgs/llvm-git/template | 134 ++++++++++++++++++ 8 files changed, 159 insertions(+) create mode 120000 srcpkgs/clang-analyzer-git create mode 120000 srcpkgs/clang-git create mode 120000 srcpkgs/libllvm-git create mode 120000 srcpkgs/llvm-docs-git create mode 100644 srcpkgs/llvm-git/files/llvm-Config-config.h create mode 100644 srcpkgs/llvm-git/files/llvm-Config-llvm-config.h create mode 100644 srcpkgs/llvm-git/template diff --git a/common/shlibs b/common/shlibs index 23afbca2de8..53c2c659cdc 100644 --- a/common/shlibs +++ b/common/shlibs @@ -899,7 +899,10 @@ libyaml-0.so.2 libyaml-0.1.4_1 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1 libyajl.so.2 yajl-2.0.1_1 libconfuse.so.0 confuse-2.7_1 +libclang.so clang-3.4.2_1 +libclang.so clang-git-20140721_1 libLLVM-3.4.so libllvm-3.4.2_1 +libLLVM-3.5svn.so libllvm-git-20140721_1 libisofs.so.6 libisofs-0.6.24_1 libbfd-2.22.so binutils-2.22_1<2.23_1 libopcodes-2.22.so binutils-2.22_1<2.23_1 diff --git a/srcpkgs/clang-analyzer-git b/srcpkgs/clang-analyzer-git new file mode 120000 index 00000000000..0c1ef5a7222 --- /dev/null +++ b/srcpkgs/clang-analyzer-git @@ -0,0 +1 @@ +llvm-git \ No newline at end of file diff --git a/srcpkgs/clang-git b/srcpkgs/clang-git new file mode 120000 index 00000000000..0c1ef5a7222 --- /dev/null +++ b/srcpkgs/clang-git @@ -0,0 +1 @@ +llvm-git \ No newline at end of file diff --git a/srcpkgs/libllvm-git b/srcpkgs/libllvm-git new file mode 120000 index 00000000000..0c1ef5a7222 --- /dev/null +++ b/srcpkgs/libllvm-git @@ -0,0 +1 @@ +llvm-git \ No newline at end of file diff --git a/srcpkgs/llvm-docs-git b/srcpkgs/llvm-docs-git new file mode 120000 index 00000000000..0c1ef5a7222 --- /dev/null +++ b/srcpkgs/llvm-docs-git @@ -0,0 +1 @@ +llvm-git \ No newline at end of file diff --git a/srcpkgs/llvm-git/files/llvm-Config-config.h b/srcpkgs/llvm-git/files/llvm-Config-config.h new file mode 100644 index 00000000000..c369b4551f7 --- /dev/null +++ b/srcpkgs/llvm-git/files/llvm-Config-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "config-32.h" +#elif __WORDSIZE == 64 +#include "config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/srcpkgs/llvm-git/files/llvm-Config-llvm-config.h b/srcpkgs/llvm-git/files/llvm-Config-llvm-config.h new file mode 100644 index 00000000000..2fa08c9be69 --- /dev/null +++ b/srcpkgs/llvm-git/files/llvm-Config-llvm-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "llvm-config-32.h" +#elif __WORDSIZE == 64 +#include "llvm-config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/srcpkgs/llvm-git/template b/srcpkgs/llvm-git/template new file mode 100644 index 00000000000..d9a1396e5f6 --- /dev/null +++ b/srcpkgs/llvm-git/template @@ -0,0 +1,134 @@ +# Template file for 'llvm-git' +pkgname=llvm-git +version=20140721 +_llvmsha=3f1ae7f58c02fa72880a9607bdddfbbf75fa7266 +_clangsha=95dcc5d2fd3e8965b789de600f7ce0bf179abb20 +_crtsha=a9c43b32c19449a0e8d3e0f67b072c3c7077347c +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" +short_desc="Low Level Virtual Machine [3.5-git]" +maintainer="John Galt " +homepage="http://www.llvm.org" +license="BSD" +conflicts="llvm>=0" + +# XXX Investigate ocaml bindings. +hostmakedepends="groff perl python zlib-devel libffi-devel" +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 + } +}