hosttools-llvm.spec 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. %{?!tool_name: %global tool_name hosttools}
  2. %global tool_prefix /opt/%{tool_name}
  3. Name: %{tool_name}-llvm
  4. Version: 14.0.1
  5. Release: 1%{?dist}
  6. Summary: LLVM compiler infrastructure
  7. License: GPLv3+
  8. URL: https://llvm.org
  9. Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.1/llvm-project-%{version}.src.tar.xz
  10. Patch0: llvm-sanitizer-link-libgcc.patch
  11. Patch1: clang-link-libgcc.patch
  12. BuildRequires: gcc-c++ cmake ninja python3
  13. %description
  14. LLVM compiler infrastructure and Clang tools, lld linker
  15. %package devel
  16. Summary: LLVM, Clang and lld development files
  17. %description devel
  18. This package contains LLVM, Clang, lld static libs and headers.
  19. %prep
  20. %setup -q -n llvm-project-%{version}.src
  21. %patch0 -p1
  22. %patch1 -p1
  23. %build
  24. mkdir build-llvm
  25. cd build-llvm
  26. cmake -G Ninja \
  27. -DCMAKE_BUILD_TYPE=Release \
  28. -DCMAKE_INSTALL_PREFIX=%{tool_prefix} \
  29. -DLLVM_ENABLE_PROJECTS='clang;compiler-rt;lld' \
  30. -DLLVM_TARGETS_TO_BUILD=X86 \
  31. -DLLVM_INCLUDE_TESTS=OFF \
  32. -DLLVM_INCLUDE_EXAMPLES=OFF \
  33. -DLLVM_INCLUDE_BENCHMARKS=OFF \
  34. -DCOMPILER_RT_INCLUDE_TESTS=OFF \
  35. -DCLANG_DEFAULT_RTLIB=compiler-rt \
  36. -DLLVM_LIBDIR_SUFFIX=/llvm \
  37. ../llvm
  38. ninja
  39. %install
  40. cd build-llvm
  41. DESTDIR=%{buildroot} ninja install/strip
  42. %files
  43. %{tool_prefix}/bin/*
  44. %exclude %{tool_prefix}/bin/llvm-config
  45. %{tool_prefix}/lib/llvm/clang/%{version}
  46. %{tool_prefix}/libexec/*
  47. %{tool_prefix}/share/clang
  48. %{tool_prefix}/share/opt-viewer
  49. %{tool_prefix}/share/scan-build
  50. %{tool_prefix}/share/scan-view
  51. %{tool_prefix}/share/man/man1/*
  52. # package libclang.so for c-index-test
  53. %{tool_prefix}/lib/llvm/libclang.so
  54. %{tool_prefix}/lib/llvm/libclang.so.13
  55. %{tool_prefix}/lib/llvm/libclang.so.%{version}
  56. %files devel
  57. %{tool_prefix}/bin/llvm-config
  58. %{tool_prefix}/include/clang-c
  59. %{tool_prefix}/include/clang
  60. %{tool_prefix}/include/lld
  61. %{tool_prefix}/include/llvm-c
  62. %{tool_prefix}/include/llvm
  63. %{tool_prefix}/lib/libear
  64. %{tool_prefix}/lib/libscanbuild
  65. %{tool_prefix}/lib/llvm
  66. %exclude %{tool_prefix}/lib/llvm/clang/%{version}
  67. %exclude %{tool_prefix}/lib/llvm/libclang.so
  68. %exclude %{tool_prefix}/lib/llvm/libclang.so.13
  69. %exclude %{tool_prefix}/lib/llvm/libclang.so.%{version}
  70. %changelog