summaryrefslogtreecommitdiff
path: root/clang/Pkgfile
blob: cdd500f60d232e125393d7af37ada6893cf9f7d6 (plain)
    1 # Description: LLVM + clang compiler
    2 # URL:         http://llvm.org/
    3 # Maintainer:  Thomas Penteker, tek at serverop dot de
    4 # Depends on:  llvm
    5 
    6 name=clang
    7 version=9.0.0
    8 release=1
    9 source=(http://releases.llvm.org/$version/{llvm,cfe}-$version.src.tar.xz)
   10 
   11 build() {
   12   mv cfe-$version.src llvm-$version.src/tools/clang
   13 
   14   cd llvm-$version.src
   15   mkdir build
   16   cd build
   17 
   18   cmake .. -G Ninja \
   19     -DLLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
   20     -DLLVM_ENABLE_CXX1Y=1 \
   21     -DLLVM_INCLUDE_EXAMPLES=0 \
   22     -DLLVM_INCLUDE_TESTS=0 \
   23     -DLLVM_ENABLE_FFI=1 \
   24     -DLLVM_ENABLE_RTTI=1 \
   25     -DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
   26     -DCMAKE_BUILD_TYPE=Release \
   27     -DCMAKE_INSTALL_PREFIX=/usr \
   28     -DLLVM_APPEND_VC_REV=0 \
   29     -Wno-dev
   30 
   31   ninja
   32   DESTDIR=$PKG ninja install
   33 
   34   # only clang may be left, remove llvm
   35   rm -r $PKG/usr/include/llvm{,-c}
   36   rm -r $PKG/usr/lib/cmake/llvm
   37   rm -r $PKG/usr/share/opt-viewer
   38   rm $PKG/usr/bin/{bugpoint,ll*,opt,obj2yaml,sancov,sanstats,verify-uselistorder,yaml2obj,dsymutil}
   39   rm $PKG/usr/lib/{libLTO.*,libRemarks*,libLLVM*}
   40 
   41   mv $PKG/usr/libexec/{c++-analyzer,ccc-analyzer} $PKG/usr/lib/clang
   42   rmdir $PKG/usr/libexec
   43   sed -i 's|libexec|lib/clang|' $PKG/usr/bin/scan-build
   44 }

Generated by cgit