File mingw64-llvm13.spec of Package mingw64-llvm13
#
# spec file for package mingw64-llvm13
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _tagver 13.0.1
%define _sonum 13
%define _soclang 13
%define _name llvm%{_soclang}
Name: mingw64-%{_name}
Version: %{_tagver}
Release: 0
Summary: Low Level Virtual Machine
License: Apache-2.0 WITH LLVM-exception AND NCSA
Group: Development/Languages/Other
URL: https://www.llvm.org/
# NOTE: please see README.packaging in the llvm package for details on how to update this package
Source: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{_tagver}/llvm-%{version}.src.tar.xz
Source2: mingw64-llvm13-rpmlintrc
Patch0: llvm-13.0.1-fix-mingw-soversion-support.patch
Patch1: llvm-13.0.1-tumbleweed-build-fix.patch
# native tools
BuildRequires: gcc-c++
BuildRequires: libxml2-devel
BuildRequires: mingw64-cross-filesystem
BuildRequires: pkgconfig(zlib)
BuildRequires: mingw64-cross-cmake
BuildRequires: mingw64-cross-gcc-c++
BuildRequires: mingw64-libxml2-devel
BuildRequires: mingw64(pkg:zlib)
%_mingw64_package_header_debug
%description
LLVM is a compiler infrastructure designed for compile-time,
link-time, runtime, and idle-time optimization of programs from
arbitrary programming languages.
The compiler infrastructure includes mirror sets of programming
tools as well as libraries with equivalent functionality.
%package -n mingw64-libLLVM%{_sonum}
Summary: Libraries for LLVM
Group: System/Libraries
BuildArch: noarch
%description -n mingw64-libLLVM%{_sonum}
This package contains the shared libraries needed for LLVM.
%package -n mingw64-llvm%{_sonum}-devel
Summary: Header Files for LLVM
Group: Development/Libraries/C and C++
Requires: mingw64-cross-llvm%{_sonum}-tools = %{version}
Requires: %{name} = %{version}
%if %{with openmp}
# Referenced by LLVMExports.cmake
Requires: mingw64-libomp%{_sonum}-devel
%endif
Requires: mingw64-libLLVM%{_sonum} = %{version}
Requires: mingw64-libLTO%{_sonum} = %{version}
# provided by mingw64-gcc-c++ yet
#Requires: mingw64-libstdc++6-devel
Requires: libtool
#Requires: mingw64-llvm%%{_sonum}-gold
%if %{with polly}
# Referenced by LLVMExports.cmake
Requires: mingw64-llvm%{_sonum}-polly-devel
%endif
#Requires: pkgconfig
Conflicts: mingw64-llvm-devel-provider < %{version}
#Conflicts: cmake(LLVM)
# libLTO.so used to be a separate package.
#Conflicts: mingw64-libLTO%%{_sonum} < %%{version}
#Provides: libLTO.so = %%{version}
Obsoletes: mingw64-llvm%{_sonum}-LTO-devel < %{version}
Provides: mingw64-llvm%{_sonum}-LTO-devel = %{version}
Provides: mingw64-llvm-devel-provider = %{version}
Provides: mingw64-llvm-devel = %{version}
%if %{with ffi}
Requires: mingw64(pkg:libffi)
%endif
%if %{with oprofile}
Requires: mingw64-oprofile-devel
%endif
BuildArch: noarch
%description -n mingw64-llvm%{_sonum}-devel
This package contains library and header files needed to develop
new native programs that use the LLVM infrastructure.
%package -n mingw64-libLTO%{_sonum}
Summary: Link-time optimizer for LLVM
Group: System/Libraries
BuildArch: noarch
%description -n mingw64-libLTO%{_sonum}
This package contains the link-time optimizer for LLVM.
%package -n mingw64-cross-llvm%{_sonum}-tools
Summary: Tools for LLVM
Group: Development/Languages/C and C++
%description -n mingw64-cross-llvm%{_sonum}-tools
Tools for cross building llvm/clang
%_mingw64_debug_package
%prep
%autosetup -p1 -n llvm-%{version}.src
%build
%_mingw64_cmake \
-DCLANG_ENABLE_ARCMT:BOOL=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=OFF \
-DCMAKE_DLL_NAME_WITH_SOVERSION=1 \
-DCOMPILER_RT_BUILD_SANITIZERS:BOOL=OFF \
-DCOMPILER_RT_BUILD_XRAY:BOOL=OFF \
-DCOMPILER_RT_USE_LIBCXX:BOOL=OFF \
-DENABLE_LINKER_BUILD_ID=ON \
-DHAVE_STEADY_CLOCK_EXITCODE=0 \
-DLIBCXX_INCLUDE_BENCHMARKS:BOOL=OFF \
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
-DLLVM_BUILD_RUNTIME:BOOL=OFF \
-DLLVM_BUILD_UTILS:BOOL=OFF \
-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF \
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \
-DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \
-DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \
-DLLVM_TARGETS_TO_BUILD=Native \
-DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD:BOOL=OFF \
-DRUN_HAVE_STEADY_CLOCK=0 \
-Dexternal_project_source_dirs="-DCMAKE_C_COMPILER=gcc;-DCMAKE_CXX_COMPILER=g++" \
%_mingw64_cmake_build
%install
%_mingw64_cmake_install
# install native tools used by clang package
mkdir -p %{buildroot}%{_prefix}/%{_mingw64_target}/bin
mkdir -p %{buildroot}%{_bindir}/
cp build/NATIVE/bin/llvm-tblgen %{buildroot}%{_prefix}/%{_mingw64_target}/bin
ln -s ../%{_mingw64_target}/bin/llvm-tblgen %{buildroot}%{_bindir}/%{_mingw64_target}-llvm-tblgen
cp build/bin/llvm-tblgen.exe %{buildroot}%{_mingw64_bindir}
# fix mingw64-llvm13-devel.noarch: E: env-script-interpreter
sed -i 's,/usr/bin/env ,/usr/bin/,g' %{buildroot}%{_mingw64_datadir}/opt-viewer/*.py
# mingw64-llvm13-devel.noarch: W: script-without-shebang /usr/i686-w64-mingw64/sys-root/mingw/share/opt-viewer/optpmap.py
chmod a-x %{buildroot}%{_mingw64_datadir}/opt-viewer/optpmap.py
chmod a-x %{buildroot}%{_mingw64_datadir}/opt-viewer/style.css
%files -n mingw64-llvm%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%{_mingw64_bindir}/bugpoint.exe
%{_mingw64_bindir}/dsymutil.exe
%{_mingw64_bindir}/llc.exe
%{_mingw64_bindir}/lli.exe
%{_mingw64_bindir}/llvm-addr2line.exe
%{_mingw64_bindir}/llvm-ar.exe
%{_mingw64_bindir}/llvm-as.exe
%{_mingw64_bindir}/llvm-bcanalyzer.exe
%{_mingw64_bindir}/llvm-bitcode-strip.exe
%{_mingw64_bindir}/llvm-c-test.exe
%{_mingw64_bindir}/llvm-cat.exe
%{_mingw64_bindir}/llvm-cfi-verify.exe
%{_mingw64_bindir}/llvm-config.exe
%{_mingw64_bindir}/llvm-cov.exe
%{_mingw64_bindir}/llvm-cvtres.exe
%{_mingw64_bindir}/llvm-cxxdump.exe
%{_mingw64_bindir}/llvm-cxxfilt.exe
%{_mingw64_bindir}/llvm-cxxmap.exe
%{_mingw64_bindir}/llvm-diff.exe
%{_mingw64_bindir}/llvm-dis.exe
%{_mingw64_bindir}/llvm-dlltool.exe
%{_mingw64_bindir}/llvm-dwarfdump.exe
%{_mingw64_bindir}/llvm-dwp.exe
%{_mingw64_bindir}/llvm-exegesis.exe
%{_mingw64_bindir}/llvm-extract.exe
%{_mingw64_bindir}/llvm-gsymutil.exe
%{_mingw64_bindir}/llvm-ifs.exe
%{_mingw64_bindir}/llvm-install-name-tool.exe
%{_mingw64_bindir}/llvm-jitlink.exe
%{_mingw64_bindir}/llvm-lib.exe
%{_mingw64_bindir}/llvm-libtool-darwin.exe
%{_mingw64_bindir}/llvm-link.exe
%{_mingw64_bindir}/llvm-lipo.exe
%{_mingw64_bindir}/llvm-lto.exe
%{_mingw64_bindir}/llvm-lto2.exe
%{_mingw64_bindir}/llvm-mc.exe
%{_mingw64_bindir}/llvm-mca.exe
%{_mingw64_bindir}/llvm-ml.exe
%{_mingw64_bindir}/llvm-modextract.exe
%{_mingw64_bindir}/llvm-mt.exe
%{_mingw64_bindir}/llvm-nm.exe
%{_mingw64_bindir}/llvm-objcopy.exe
%{_mingw64_bindir}/llvm-objdump.exe
%{_mingw64_bindir}/llvm-opt-report.exe
%{_mingw64_bindir}/llvm-otool.exe
%{_mingw64_bindir}/llvm-pdbutil.exe
%{_mingw64_bindir}/llvm-profdata.exe
%{_mingw64_bindir}/llvm-profgen.exe
%{_mingw64_bindir}/llvm-ranlib.exe
%{_mingw64_bindir}/llvm-rc.exe
%{_mingw64_bindir}/llvm-readelf.exe
%{_mingw64_bindir}/llvm-readobj.exe
%{_mingw64_bindir}/llvm-reduce.exe
%{_mingw64_bindir}/llvm-rtdyld.exe
%{_mingw64_bindir}/llvm-sim.exe
%{_mingw64_bindir}/llvm-size.exe
%{_mingw64_bindir}/llvm-split.exe
%{_mingw64_bindir}/llvm-stress.exe
%{_mingw64_bindir}/llvm-strings.exe
%{_mingw64_bindir}/llvm-strip.exe
%{_mingw64_bindir}/llvm-symbolizer.exe
%{_mingw64_bindir}/llvm-tapi-diff.exe
%{_mingw64_bindir}/llvm-undname.exe
%{_mingw64_bindir}/llvm-windres.exe
%{_mingw64_bindir}/llvm-xray.exe
%{_mingw64_bindir}/opt.exe
%{_mingw64_bindir}/sancov.exe
%{_mingw64_bindir}/sanstats.exe
%{_mingw64_bindir}/split-file.exe
%{_mingw64_bindir}/verify-uselistorder.exe
%files -n mingw64-libLLVM%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%{_mingw64_bindir}/libLLVM*.dll
%{_mingw64_bindir}/libRemarks*.dll
%files -n mingw64-libLTO%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%{_mingw64_bindir}/libLTO*.dll
%files -n mingw64-llvm%{_sonum}-devel
%license CREDITS.TXT LICENSE.TXT
%{_mingw64_bindir}/llvm-tblgen.exe
%{_mingw64_datadir}/opt-viewer
%{_mingw64_includedir}/llvm
%{_mingw64_includedir}/llvm-c
%{_mingw64_libdir}/cmake/llvm
%{_mingw64_libdir}/libLLVM*.dll.a
%{_mingw64_libdir}/libRemarks*.dll.a
%{_mingw64_libdir}/libLTO*.dll.a
%files -n mingw64-cross-llvm%{_sonum}-tools
%license CREDITS.TXT LICENSE.TXT
%{_prefix}/%{_mingw64_target}/bin/llvm-tblgen
%{_bindir}/%{_mingw64_target}-llvm-tblgen