# Compiling Time: 4.74 SBU # Maintainer: Marius Cirsta : ${USE_DEVEL="n"} pkgname=llvm pkgver=12.0.1 pkgrel=1 gcc_ver=9.2.1 url="http://www.llvm.org" pkgdesc="Low Level Virtual Machine (Compiler , Tools and Libs)" depends=("libstdc++>=${gcc_ver}") makedepends=('groff' 'libffi' 'python3-sphinx' 'ocaml-ctypes>=0.18' \ 'ocaml-findlib>=1.8.1' 'ncurses>=6.0-16' 'lib32-libffi' 'lib32-libxml2' \ 'python3-recommonmark') ## tc bump -- we need for rebuilds foo>=x-y sytle to be sure is rebuilt with ## the right versions of the packages makedepends=("${makedepends[@]}" "libstdc++>=${gcc_ver}" 'binutils>=2.32' 'glibc>=2.29-5' "gcc>=${gcc_ver}") rodepends=("$pkgname-libs") groups=('devel') archs=("x86_64") if Fuse DEVEL; then unset source sha1sums pkgver=999.g61d9d49 pkgrel=0 _F_scm_type="git" _F_scm_url="https://github.com/llvm/llvm-project.git" _F_cd_path="llvm" Finclude scm else _F_github_author=llvm _F_github_name=llvm-project _F_github_tag=yes _F_github_grepv="rc1\|rc2\|rc3\|rc4" Finclude github up2date="$up2date | sed 's/llvmorg-//'" source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/$pkgname-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/clang-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/clang-tools-extra-$pkgver.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxx-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libcxxabi-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/lld-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/libunwind-$pkgver.src.tar.xz \ https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/compiler-rt-$pkgver.src.tar.xz) _F_archive_ver="${pkgver}.src" signatures=("${source[0]}.sig" \ "${source[1]}.sig" \ "${source[2]}.sig" \ "${source[3]}.sig" \ "${source[4]}.sig" \ "${source[5]}.sig" \ "${source[6]}.sig" \ "${source[7]}.sig" ) fi _F_cross32_delete=('usr/docs' 'usr/share' \ 'usr/lib/ocaml' 'usr/libexec/') Finclude cross32 python subpkgs=("clang") subdescs=("C/C++ language family frontend for LLVM") subdepends=("libxml2 libffi>=3.4") subrodepends=("clang-libs>=$pkgver") subgroups=('devel') subarchs=("x86_64") subpkgs+=("clang-libs") subdescs+=("C/C++ language family frontend for LLVM Libs") subdepends+=("libxml2 libffi>=3.4") subrodepends+=("$pkgname-libs>=$pkgver") subgroups+=('lib') subarchs+=("x86_64") subpkgs+=("lib32-clang") subdescs+=("C/C++ language family frontend for LLVM (32-bit)") subdepends+=("lib32-libxml2 lib32-libffi>=3.4") subrodepends+=("lib32-clang-libs>=$pkgver") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("lib32-clang-libs") subdescs+=("C/C++ language family frontend for LLVM Libs (32-bit)") subdepends+=("lib32-libxml2 lib32-libffi>=3.4") subrodepends+=("lib32-$pkgname-libs>=$pkgver") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("compiler-rt") subdescs+=("Compiler runtime libraries for clang") subdepends+=("") subrodepends+=("") subgroups+=('devel') subarchs+=("x86_64") subpkgs+=("$pkgname-ocaml") subdescs+=("OCaml bindings for LLVM") subdepends+=("ocaml>=4.10.0") subrodepends+=("$pkgname>=$pkgver") subgroups+=('devel-extra') subarchs+=("x86_64") subpkgs+=("$pkgname-libs") subdescs+=("LLVM shared libs") subdepends+=("ncurses>=6.0-16 libedit>=20190324_3.1 libffi>=3.4") subrodepends+=("") subgroups+=('lib') subarchs+=("x86_64") subpkgs+=("libc++") subdescs+=("A new implementation of the C++ standard library") subdepends+=("libgcc") subrodepends+=("") subgroups+=('lib-extra') subarchs+=("x86_64") subpkgs+=("lib32-libc++") subdescs+=("A new implementation of the C++ standard library") subdepends+=("libgcc>=${gcc_ver}") subrodepends+=("") subgroups+=('lib-extra') subarchs+=("x86_64") subpkgs+=("lib32-${pkgname}-libs") subdescs+=("LLVM shared libs (32-bit)") subdepends+=("lib32-ncurses>=6.0-12 lib32-libedit>=20160903_3.1i lib32-libffi>=3.4") subrodepends+=("") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("lib32-${pkgname}") subdescs+=("Low Level Virtual Machine (Compiler, Tools and Libs) (32-bit)") subdepends+=("libstdc++>=${gcc_ver}") subrodepends+=("") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("${pkgname}-static") subdescs+=("Low Level Virtual Machine (Compiler, Tools and Libs) (static)") subdepends+=("") subrodepends+=("") subgroups+=('devel-extra') subarchs+=("x86_64") subpkgs+=("clang-static") subdescs+=("C/C++ language family frontend for LLVM (static)") subdepends+=("") subrodepends+=("") subgroups+=('devel-extra') subarchs+=("x86_64") subpkgs+=("lib32-${pkgname}-static") subdescs+=("Low Level Virtual Machine (Compiler, Tools and Libs) (32-bit static)") subdepends+=("") subrodepends+=("") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("lib32-clang-static") subdescs+=("C/C++ language family frontend for LLVM (32-bit static)") subdepends+=("") subrodepends+=("") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("compiler-rt-static") subdescs+=("Compiler runtime libraries for clang (static)") subdepends+=("") subrodepends+=("") subgroups+=('devel-extra') subarchs+=("x86_64") subpkgs+=("libc++-static") subdescs+=("A new implementation of the C++ standard library (static)") subdepends+=("") subrodepends+=("") subgroups+=('devel-extra') subarchs+=("x86_64") subpkgs+=("lib32-libc++-static") subdescs+=("A new implementation of the C++ standard library (32-bit static)") subdepends+=("") subrodepends+=("") subgroups+=('lib32-extra') subarchs+=("x86_64") subpkgs+=("$pkgname-ocaml-static") subdescs+=("OCaml bindings for LLVM (static)") subdepends+=("") subrodepends+=("") subgroups+=('devel-extra') subarchs+=("x86_64") # Common CMake options _F_cmake_type="Release" # (crazy) FIXME , why do we need DC_INCLUDE_DIRS ? _common_cmake_confopts=" -DCMAKE_INSTALL_PREFIX=/usr \ -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DLLVM_ENABLE_RTTI=ON \ -DLLVM_INSTALL_UTILS=ON \ -DLLVM_ENABLE_FFI=ON \ -DLLVM_BUILD_DOCS=ON \ -DLLVM_ENABLE_SPHINX=OFF \ -DLLVM_ENABLE_DOXYGEN=OFF \ -DLLVM_HOST_TRIPLE=${CARCH}-frugalware-linux \ -DLLVM_DEFAULT_TARGET_TRIPLE=${CARCH}-frugalware-linux \ -DC_INCLUDE_DIRS=/usr/local/include:/usr/${CHOST}/include:/usr/include/c++/${gcc_ver}/${CHOST}:/usr/include/c++/${gcc_ver}/backward:/usr/include/c++/${gcc_ver}:/usr/include \ -DLLVM_BINUTILS_INCDIR=/usr/include \ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=ON \ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=${Fsrcdir}/clang-tools-extra-${_F_archive_ver} \ -DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=OFF" Finclude cmake options+=('static' 'nolto') _Fbuild_no_patch=yes build() { CFLAGS+=" -fno-strict-aliasing" CXXFLAGS+=" -fno-strict-aliasing" if Fuse DEVEL; then Funpack_scm fi Fexec cd ${Fsrcdir}/llvm-${_F_archive_ver} # clang must be copied here to build with llvm Fexec rm -rf tools/clang if Fuse DEVEL; then Fexec cd tools || Fdie git clone --depth=1 https://github.com/llvm-mirror/clang.git Fexec cd .. || Fdie else Fexec mv -f ../libunwind-${_F_archive_ver}/ ../libunwind || Fdie Fexec mv -f ../clang-${_F_archive_ver}/ tools/clang || Fdie Fexec mv -f ../libcxx-${_F_archive_ver}/ projects/libcxx || Fdie Fexec mv -f ../libcxxabi-${_F_archive_ver}/ projects/libcxxabi || Fdie Fexec mv -f ../lld-${_F_archive_ver}/ tools/lld || Fdie fi Fcross32_prepare Fcross32_copy_source ## 32-bit CMake options _F_cmake_confopts+=" ${_common_cmake_confopts} -DLLVM_LIBDIR_SUFFIX=32 \ -DCMAKE_CXX_FLAGS:STRING=-m32 \ -DFFI_INCLUDE_DIR=$(pkg-config --cflags-only-I libffi | cut -c3-) \ -DLLVM_TARGET_ARCH:STRING=i686" sed -i '/^[[:blank:]]*find_library(FFI_LIBRARY_PATH/i\list(INSERT CMAKE_LIBRARY_PATH 0 /usr/lib32)' cmake/config-ix.cmake CMake_make Fexec make -C ../docs -f Makefile.sphinx man || Fdie Fexec make -C ../docs -f Makefile.sphinx html || Fdie Fexec make -C ../tools/clang/docs -f Makefile.sphinx html || Fdie Fexec make -C ../tools/clang/docs -f Makefile.sphinx man || Fdie Fexec make ocaml_doc CMake_install Fcross32_copy_back_source Fcross32_reset_and_fix Fcross32_delete_empty Fmkdir usr/i686-frugalware-linux/ Fmv usr/include usr/i686-frugalware-linux/ Fmv usr/bin usr/i686-frugalware-linux/ Fsplit lib32-clang-static usr/lib32/libclang*.a Fsplit lib32-clang-static usr/lib32/libfindAllSymbols.a Fsplit lib32-clang usr/i686-frugalware-linux/bin/clang* Fsplit lib32-clang usr/i686-frugalware-linux/bin/c-index-test Fsplit lib32-clang usr/i686-frugalware-linux/include/clang* Fsplit lib32-clang usr/lib32/clang/ Fsplit lib32-clang-libs usr/lib32/libclang* Fsplit lib32-clang usr/i686-frugalware-linux/bin/find-all-symbols Fsplit lib32-clang usr/i686-frugalware-linux/bin/modularize Frm usr/include Fmkdir usr/bin/ Fmv usr/i686-frugalware-linux/bin/llvm-config usr/bin/llvm-config32 Fsplit lib32-libc++-static usr/lib32/libc++*.a Fsplit lib32-libc++ usr/lib32/libc++\* Fsplit lib32-libc++ usr/i686-frugalware-linux/include/c++/ # Fsplit lib32-clang usr/lib32/CheckerDependencyHandlingAnalyzerPlugin.so # Fsplit lib32-clang usr/lib32/CheckerOptionHandlingAnalyzerPlugin.so # Fsplit lib32-clang usr/lib32/SampleAnalyzerPlugin.so Fsplit lib32-$pkgname-libs usr/lib32/\*.so\* Fsplit lib32-$pkgname-static usr/lib32/*.a Fsplit lib32-$pkgname /\* ## 64-bit CMake options _F_cmake_confopts=" ${_common_cmake_confopts} \ -DFFI_INCLUDE_DIR=$(pkg-config --cflags-only-I libffi | cut -c3-)" Fcd # compiler-rt only works on x86_64 Fexec mv -f ../compiler-rt-${_F_archive_ver}/ projects/compiler-rt CMake_make Fexec make -C ../docs -f Makefile.sphinx man || Fdie Fexec make -C ../docs -f Makefile.sphinx html || Fdie Fexec make -C ../tools/clang/docs -f Makefile.sphinx html || Fdie Fexec make -C ../tools/clang/docs -f Makefile.sphinx man || Fdie Fexec make ocaml_doc CMake_install ## Python bindings Fmkdir ${_F_python_libdir} Fcprel ../tools/clang/bindings/python/clang ${_F_python_libdir} Fexec python -m compileall $Fdestdir/${_F_python_libdir} Fexec python -O -m compileall $Fdestdir/${_F_python_libdir} Fexec python -m compileall $Fdestdir/usr/share Fexec python -O -m compileall $Fdestdir/usr/share ## Pytho3n bindings Fmkdir ${_F_python3_libdir} Fcprel ../tools/clang/bindings/python/clang ${_F_python3_libdir} Fexec python3 -m compileall $Fdestdir/${_F_python3_libdir} Fexec python3 -O -m compileall $Fdestdir/${_F_python3_libdir} Fexec python3 -m compileall $Fdestdir/usr/share Fexec python3 -O -m compileall $Fdestdir/usr/share ## libexec stuff Fmkdir usr/lib/$pkgname Fsed 'libexec' 'lib/llvm' $Fdestdir/usr/bin/scan-build Fmv usr/libexec/* usr/lib/llvm/ Frm usr/libexec # Install man pages Fmkdir usr/share/man/man1 Fcp ${_F_cd_path}/docs/_build/man/*.1 usr/share/man/man1/ Fcp ${_F_cd_path}/tools/clang/docs/_build/man/*.1 usr/share/man/man1/ # Install html docs Fmkdir usr/share/doc/$pkgname-$pkgver/html/ Fcp ${_F_cd_path}/docs/_build/html/* usr/share/doc/$pkgname-$pkgver/html/ Frm usr/share/doc/$pkgname-$pkgver/html/_sources # Install html docs of clang Fmkdir usr/share/doc/$pkgname-$pkgver/html/clang Fcp ${_F_cd_path}/tools/clang/docs/_build/html/* usr/share/doc/$pkgname-$pkgver/html/clang Frm usr/share/doc/$pkgname-$pkgver/html/clang/_sources # Install html docs of llvm-ocaml Fmkdir usr/share/doc/$pkgname-$pkgver/ocamldoc Fcp ${_F_cd_path}/${_F_cmake_build_dir}/docs/ocamldoc/html/* usr/share/doc/$pkgname-$pkgver/ocamldoc Frm usr/docs Fsplit compiler-rt-static /usr/lib/clang/$pkgver/lib/linux/libclang_rt*.a Fsplit compiler-rt usr/lib/clang/${pkgver}/include/sanitizer Fsplit compiler-rt usr/lib/clang/${pkgver}/include/xray Fsplit compiler-rt usr/lib/clang/${pkgver}/lib/ Fsplit compiler-rt usr/lib/clang/${pkgver}/share/ Fsplit compiler-rt usr/share/doc/llvm-${pkgver}/html/clang/_static/language_data.js Fsplit compiler-rt usr/share/doc/llvm-${pkgver}/html/_static/language_data.js Fsplit clang-static usr/lib/libclang*.a Fsplit clang-static usr/lib/libfindAllSymbols.a Fsplit clang usr/bin/clang* Fsplit clang usr/bin/c-index-test Fsplit clang usr/bin/scan-build Fsplit clang usr/bin/scan-view Fsplit clang usr/include/clang* Fsplit clang usr/lib/clang/ Fsplit clang-libs usr/lib/libclang* # Fsplit clang usr/lib/CheckerDependencyHandlingAnalyzerPlugin.so # Fsplit clang usr/lib/CheckerOptionHandlingAnalyzerPlugin.so # Fsplit clang usr/lib/SampleAnalyzerPlugin.so Fsplit clang usr/share/man/man1/clang* Fsplit clang usr/share/doc/$pkgname-$pkgver/html/clang/ Fsplit clang usr/bin/find-all-symbols Fsplit clang usr/bin/modularize Fsplit clang $_F_python_libdir Fsplit clang $_F_python3_libdir Fsplit clang usr/share/clang/ Fsplit clang usr/share/opt-viewer/ Fsplit clang usr/share/scan-view/ Fsplit $pkgname-ocaml-static usr/lib/ocaml/llvm/*.a Fsplit $pkgname-ocaml usr/lib/ocaml/ Fsplit $pkgname-ocaml usr/lib/cmake/llvm/{Find,Add}OCaml.cmake Fsplit $pkgname-ocaml usr/share/doc/$pkgname-$pkgver/html/tutorial/OCamlLangImpl*.html Fsplit lib32-libc++-static /usr/lib/libc++*.a Fsplit libc++ usr/lib/libc++* Fsplit libc++ usr/include/c++/ Fsplit $pkgname-static usr/lib/*.a Fsplit $pkgname-libs usr/lib/*.so* } # optimization OK