summaryrefslogtreecommitdiff
path: root/clang/Pkgfile
blob: 0293cb1cf09ad36f02997e77fbde90c93117bebb (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=4.0.1
    8 release=1
    9 source=(https://llvm.org/releases/$version/{llvm,cfe}-$version.src.tar.xz \
   10   llvm-config.h)
   11 
   12 build() {
   13   mv cfe-$version.src llvm-$version.src/tools/clang
   14 
   15   cd llvm-$version.src
   16   mkdir build
   17   cd build
   18 
   19   cmake -DLLVM_ENABLE_CXX1Y=1 \
   20     -DLLVM_INCLUDE_EXAMPLES=0 \
   21     -DLLVM_INCLUDE_TESTS=0 \
   22     -DLLVM_ENABLE_FFI=1 \
   23     -DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
   24     -DCMAKE_BUILD_TYPE=Release \
   25     -DCMAKE_INSTALL_PREFIX=/usr \
   26     -Wno-dev ..
   27 
   28   MAKEFLAGS="$MAKEFLAGS" make
   29   make DESTDIR=$PKG install
   30 
   31   # multilib stub
   32   mv $PKG/usr/include/llvm/Config/llvm-config{,-64}.h
   33   install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
   34 
   35   # only clang may be left, remove llvm
   36   rm -r $PKG/usr/include/llvm{,-c}
   37   rm -r $PKG/usr/lib/cmake/llvm
   38   rm $PKG/usr/bin/{bugpoint,ll*,opt,obj2yaml,sancov,sanstats,verify-uselistorder,yaml2obj}
   39   rm $PKG/usr/lib/{LLVMHello.so,BugpointPasses.so,libLTO.*,libLLVM*}
   40 
   41   mv $PKG/usr/libexec/{c++-analyzer,ccc-analyzer} $PKG/usr/lib/clang
   42   rmdir $PKG/usr/libexec
   43 }

Generated by cgit