]> git.pld-linux.org Git - packages/llvm.git/commitdiff
- added python-modules patch (fix python modules detection)
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 6 Oct 2019 06:11:51 +0000 (08:11 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 6 Oct 2019 06:11:51 +0000 (08:11 +0200)
- BR: z3-devel (+z3 bcond) for constraint solver in Clang Static Analyzer

llvm-python-modules.patch [new file with mode: 0644]
llvm.spec

diff --git a/llvm-python-modules.patch b/llvm-python-modules.patch
new file mode 100644 (file)
index 0000000..461d6f1
--- /dev/null
@@ -0,0 +1,49 @@
+python modules detection in config-ix relies on PYTHON_EXECUTABLE
+--- llvm-8.0.1.src/CMakeLists.txt.orig 2019-09-15 20:47:11.346277376 +0200
++++ llvm-8.0.1.src/CMakeLists.txt      2019-10-05 16:14:04.833671630 +0200
+@@ -579,6 +579,22 @@
+ set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR OFF CACHE BOOL
+   "Enable per-target runtimes directory")
++# Verify that we can find a Python 2 interpreter.  Python 3 is unsupported.
++# FIXME: We should support systems with only Python 3, but that requires work
++# on LLDB.
++set(Python_ADDITIONAL_VERSIONS 2.7)
++include(FindPythonInterp)
++if( NOT PYTHONINTERP_FOUND )
++  message(FATAL_ERROR
++"Unable to find Python interpreter, required for builds and testing.
++
++Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
++endif()
++
++if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
++  message(FATAL_ERROR "Python 2.7 or newer is required")
++endif()
++
+ # All options referred to from HandleLLVMOptions have to be specified
+ # BEFORE this include, otherwise options will not be correctly set on
+ # first cmake run
+@@ -598,22 +614,6 @@
+ include(HandleLLVMOptions)
+-# Verify that we can find a Python 2 interpreter.  Python 3 is unsupported.
+-# FIXME: We should support systems with only Python 3, but that requires work
+-# on LLDB.
+-set(Python_ADDITIONAL_VERSIONS 2.7)
+-include(FindPythonInterp)
+-if( NOT PYTHONINTERP_FOUND )
+-  message(FATAL_ERROR
+-"Unable to find Python interpreter, required for builds and testing.
+-
+-Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+-endif()
+-
+-if( ${PYTHON_VERSION_STRING} VERSION_LESS 2.7 )
+-  message(FATAL_ERROR "Python 2.7 or newer is required")
+-endif()
+-
+ ######
+ # LLVMBuild Integration
+ #
index 9e43ee446b06d8a06207350fc16605161c8d8381..4218cd15278eacdaca05457d4c820e19bdf1f9de 100644 (file)
--- a/llvm.spec
+++ b/llvm.spec
@@ -18,6 +18,7 @@
 %bcond_without rt              # compiler-rt libraries
 %bcond_without multilib        # compiler-rt multilib libraries
 %bcond_without ocaml           # OCaml binding
+%bcond_without z3              # Z3 constraint solver support in Clang Static Analyzer
 %bcond_without doc             # HTML docs and man pages
 %bcond_with    apidocs         # doxygen docs (HUGE, so they are not built by default)
 %bcond_with    tests           # run tests
@@ -50,6 +51,7 @@ Source5:      https://github.com/llvm/llvm-project/releases/download/llvmorg-%{versio
 Source6:       https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
 # Source6-md5: ee4fe10c625bbc66b1055c5d33017daf
 Patch1:                %{name}-pld.patch
+Patch2:                %{name}-python-modules.patch
 Patch3:                x32-gcc-toolchain.patch
 Patch4:                cmake-buildtype.patch
 Patch5:                %{name}-ocaml-shared.patch
@@ -78,11 +80,14 @@ BuildRequires:      ocaml-ounit >= 2
 BuildRequires: perl-base >= 1:5.6
 BuildRequires: perl-tools-pod
 BuildRequires: python >= 1:2.7
+BuildRequires: python-PyYAML
+BuildRequires: python-pygments >= 2.0
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.734
 %{?with_doc:BuildRequires:     sphinx-pdg}
 BuildRequires: tar >= 1:1.22
 BuildRequires: xz
+%{?with_z3:BuildRequires:      z3-devel >= 4.7.1}
 BuildRequires: zlib-devel
 %if %{with apidocs}
 BuildRequires: doxygen
@@ -539,6 +544,7 @@ Integracja narzÄ™dzi Clang do formatowania i zmiany nazw z Vimem.
 %{__mv} lld-%{version}.src tools/lld
 
 %patch1 -p1
+%patch2 -p1
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
@@ -560,31 +566,31 @@ install -d build
 cd build
 CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
 
-%cmake \
-%if "%{_lib}" == "lib64"
-       -DLLVM_LIBDIR_SUFFIX:STRING=64 \
-%endif
-%if "%{_lib}" == "libx32"
-       -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
-%endif
+%cmake .. \
+       -DBUILD_SHARED_LIBS:BOOL=OFF \
+       %{!?with_z3:-DCLANG_ANALYZER_ENABLE_Z3_SOLVER:BOOL=OFF} \
+       -DENABLE_LINKER_BUILD_ID:BOOL=ON \
+       -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
+       -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
+       -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
+       -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
+       -DLLVM_ENABLE_CXX1Y:BOOL=ON \
 %if %{with apidocs}
        -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
 %endif
+       -DLLVM_ENABLE_PIC:BOOL=ON \
+       -DLLVM_ENABLE_RTTI:BOOL=ON \
 %if %{with doc}
        -DLLVM_ENABLE_SPHINX:BOOL=ON \
-       -DSPHINX_WARNINGS_AS_ERRORS=OFF \
 %endif
-       -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
-       -DLLVM_ENABLE_CXX1Y:BOOL=ON \
-       -DLLVM_ENABLE_RTTI:BOOL=ON \
-       -DLLVM_ENABLE_PIC:BOOL=ON \
-       -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
-       -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
+%if "%{_lib}" == "lib64"
+       -DLLVM_LIBDIR_SUFFIX:STRING=64 \
+%endif
+%if "%{_lib}" == "libx32"
+       -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
+%endif
        -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-       -DBUILD_SHARED_LIBS:BOOL=OFF \
-       -DENABLE_LINKER_BUILD_ID:BOOL=ON \
-       -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
-       ../
+       -DSPHINX_WARNINGS_AS_ERRORS=OFF
 
 %{__make} \
        VERBOSE=1 \
This page took 0.238176 seconds and 4 git commands to generate.