Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:aevseev:devel
llvm
llvm.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File llvm.spec of Package llvm
%define realname llvm %define realver 17.0.1 %define srcext tar.xz %define gen %(awk -F. '{print $1}' <<< %{realver}) %define mainver %(awk -F. '{printf "%i.%i", $1, $2}' <<< %{realver}) %bcond_with doc %bcond_without ninja %if 0%{?suse_version} %define pkg_name_lib libLLVM%{gen} %else %define pkg_name_lib llvm-libs %endif %define python3_pkg python3 %define python3 %{_bindir}/python3 %if ! 0%{?py3_ver:1} %define py3_ver %(%python3 -c "import sys; v=sys.version_info[:2]; print ('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON3-NOT-FOUND) %endif # turn off the generation of debuginfo rpm (RH9) ?? %global debug_package %{nil} # Common info Name: %{realname} Version: %{realver} Release: wiz%{?extraver:0.}1%{?dist} License: BSD-3-Clause Group: Development/Languages/Other URL: http://llvm.org/ Summary: Low Level Virtual Machine # Install-time parameters # opt-viewer deps Requires: python(abi) = %{py3_ver} Requires: %python3_pkg-pygments %python3_pkg-PyYAML # Build-time parameters BuildRequires: xz pkg-config cmake >= 3.20.0 BuildRequires: gcc-c++ BuildRequires: git-core %if %{with ninja} BuildRequires: ninja %endif BuildRequires: googletest-devel BuildRequires: %python3_pkg%{?suse_version:-base} >= 3.6 %python3_pkg-setuptools BuildRequires: %python3_pkg-pygments %python3_pkg-PyYAML BuildRequires: libffi-devel BuildRequires: libxml2-devel BuildRequires: libedit-devel ncurses-devel BuildRequires: zlib-devel BuildRequires: libzstd-devel # Required for LLVMgold LTO plugin BuildRequires: binutils-devel # Documentation %if %{with doc} BuildRequires: doxygen graphviz graphviz-gd BuildRequires: fontconfig ghostscript-fonts%{?suse_version:-std} BuildRequires: %python3_pkg-Sphinx %endif %if 0%{?suse_version} BuildRequires: fdupes %endif Source: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{realver}/llvm-%{realver}%{?extraver}.src.%{srcext} # CMake modules Source11: https://github.com/llvm/llvm-project/raw/llvmorg-%{realver}/cmake/Modules/GNUInstallPackageDir.cmake Source12: https://github.com/llvm/llvm-project/raw/llvmorg-%{realver}/cmake/Modules/ExtendPath.cmake #Source13: https://github.com/llvm/llvm-project/raw/llvmorg-%{realver}/cmake/Modules/FindLibEdit.cmake Source14: https://github.com/llvm/llvm-project/raw/llvmorg-%{realver}/cmake/Modules/FindPrefixFromConfig.cmake Source15: https://github.com/llvm/llvm-project/raw/llvmorg-%{realver}/cmake/Modules/CMakePolicy.cmake %description LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, and idle-time optimization of programs from arbitrary programming languages. LLVM is written in C++ and has been developed since 2000 at the University of Illinois and Apple. It currently supports compilation of C and C++ programs, using front-ends derived from GCC 4.0.1. A new front-end for the C family of languages is in development. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. %package -n %{pkg_name_lib} Group: System/Libraries Summary: Shared libraries from LLVM project Provides: llvm-libs = %{version}-%{release} Provides: libLLVM = %{version}-%{release} %description -n %{pkg_name_lib} Shared libraries from LLVM project. %package -n libLTO%{gen} Group: System/Libraries Summary: LLVM Link Time Optimizer shared library %description -n libLTO%{gen} Shared library providing functions and classes used to support LTO. %package devel Group: Development/Languages/C and C++ Summary: Development files for %{name} Requires: %{name} = %{version}-%{release} Requires: %{pkg_name_lib} = %{version}-%{release} Requires: libLTO%{gen} = %{version}-%{release} Requires: llvm-gold-lto-plugin = %{version}-%{release} Requires: ncurses-devel zlib-devel %description devel Development files for %{name} %package gold-lto-plugin Group: Development/Languages/C and C++ Summary: LTO plugin for GNU Gold linker %description gold-lto-plugin Link-time optimization plugin for GNU Gold linker. %package doc Group: Documentation/HTML Summary: Documentation for %{name} Requires: %{name} = %{version} %if ! 0%{?sles_version} BuildArch: noarch %endif %description doc Documentation for %{name} # Preparation step (unpackung and patching if necessary) %prep %setup -q -n %{realname}-%{realver}%{?extraver}.src %{__install} -m0644 %{S:11} cmake/modules/ %{__install} -m0644 %{S:12} cmake/modules/ #%{__install} -m0644 %{S:13} cmake/modules/ %{__install} -m0644 %{S:14} cmake/modules/ %{__install} -m0644 %{S:15} cmake/modules/ # Don't use upper level CMake modules %{__sed} -ri \ -e '/^set\(LLVM_COMMON_CMAKE_UTILS/ s|\.\./||' \ -e 's|/Modules|/modules|' \ CMakeLists.txt %build # Needed to use freshly built llvm-tblgen export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$(pwd -P)/build/%{_lib} # Fix for RHEL/CentOS _CFLAGS="%{optflags}" _LDFLAGS="-Wl,--strip-all -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro" cmake -S . -B build \ %if %{with ninja} -G Ninja \ %endif -DCMAKE_INSTALL_PREFIX=%{_prefix} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_ASM_FLAGS_RELEASE="$_CFLAGS" \ -DCMAKE_CXX_FLAGS_RELEASE="$_CFLAGS" \ -DCMAKE_C_FLAGS_RELEASE="$_CFLAGS" \ -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$_LDFLAGS" \ -DCMAKE_MODULE_LINKER_FLAGS_RELEASE="$_LDFLAGS" \ -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$_LDFLAGS" \ -DCMAKE_SKIP_RPATH=YES \ -DCMAKE_VERBOSE_MAKEFILE=YES \ %if "%{_lib}" == "lib64" -DLLVM_LIBDIR_SUFFIX=64 \ %endif \ -DBUILD_SHARED_LIBS=YES \ -DLLVM_ENABLE_FFI=YES \ %if 0%{?rhel} -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ %endif -DLLVM_ENABLE_LIBPFM=NO \ -DLLVM_ENABLE_ZSTD=YES \ -DLLVM_INSTALL_UTILS=YES \ -DLLVM_INCLUDE_EXAMPLES=NO \ -DLLVM_INCLUDE_TESTS=NO \ -DLLVM_INCLUDE_BENCHMARKS=NO \ %if %{with doc} -DLLVM_BUILD_DOCS=YES \ -DLLVM_ENABLE_DOXYGEN=YES \ -DLLVM_ENABLE_SPHINX=YES \ -DLLVM_INSTALL_DOXYGEN_HTML_DIR=%{_defaultdocdir}/llvm/doxygen-html \ %else -DLLVM_BUILD_DOCS=NO \ %endif -DLLVM_ENABLE_LTO=YES \ \ -DLLVM_HOST_TRIPLE=%{_host} \ -DLLVM_DEFAULT_TARGET_TRIPLE=%{_build} \ \ -DLLVM_BINUTILS_INCDIR=%{_includedir} %if %{with ninja} ninja -v -C build %{?_smp_mflags} %else %{__make} -C build %{?_smp_mflags} %endif %install %if %{with ninja} DESTDIR=%{buildroot} ninja -v -C build install %else %{__make} -C build install DESTDIR=%{buildroot} %endif %{__install} -d -m755 %{buildroot}%{_prefix}/lib/bfd-plugins %{__ln_s} %{_libdir}/LLVMgold.so %{buildroot}%{_prefix}/lib/bfd-plugins/ %if %{with doc} # Fix tblgen manpage name TBLGEN_MANPAGE=$(find %{buildroot}%{_mandir}/man1/ -name tblgen.1\*) %{__ln_s} ${TBLGEN_MANPAGE##*/} %{buildroot}%{_mandir}/man1/llvm-${TBLGEN_MANPAGE##*/} # Move HTML docs to the correct docdir (for SUSE) mv -f %{buildroot}%{_prefix}/share/doc/llvm/html %{buildroot}%{_defaultdocdir}/llvm/ || : # Handle file duplicates %if 0%{?suse_version} %fdupes %{buildroot}%{_defaultdocdir} %endif %endif # Explicitly set python interpreter %{__sed} -ri '1 s|#!.+$|#!%{python3}|' %{buildroot}%{_datadir}/opt-viewer/*.py %clean [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %files %defattr(-,root,root) %license LICENSE.TXT %doc CREDITS.TXT README.txt %{_bindir}/* %{_libdir}/libRemarks.so.%{gen} %dir %{_datadir}/opt-viewer %attr(0644,root,root) %{_datadir}/opt-viewer/*.css %attr(0755,root,root) %{_datadir}/opt-viewer/*.py* %if %{with doc} %doc %{_mandir}/man1/* %endif %exclude %{_bindir}/llvm-config %exclude %{_bindir}/llvm-tblgen %exclude %{_mandir}/man1/llvm-config.1* %exclude %{_mandir}/man1/llvm-tblgen.1* %exclude %{_mandir}/man1/tblgen.1* %exclude %{_defaultdocdir}/llvm/doxygen-html/ %exclude %{_defaultdocdir}/llvm/html/ # LLVM Shared libraries %files -n %{pkg_name_lib} %defattr(-,root,root) %{_libdir}/libLLVM*.so.%{gen} %files -n libLTO%{gen} %defattr(-,root,root) %{_libdir}/libLTO.so.%{gen} # Development stuff %files devel %defattr(-,root,root) %{_bindir}/llvm-config %{_bindir}/llvm-tblgen %{_libdir}/libLTO.so %{_libdir}/libLLVM*.so %{_libdir}/libRemarks.so %{_includedir}/llvm/ %{_includedir}/llvm-c/ %dir %{_libdir}/cmake/llvm %dir %{_libdir}/cmake %{_libdir}/cmake/llvm/*.cmake %{_libdir}/cmake/llvm/llvm-driver-template.cpp.in %if %{with doc} %doc %{_mandir}/man1/llvm-config.1* %doc %{_mandir}/man1/llvm-tblgen.1* %doc %{_mandir}/man1/tblgen.1* %endif # Gold LTO plugin %files gold-lto-plugin %defattr(-,root,root) %{_libdir}/LLVMgold.so %dir %{_prefix}/lib/bfd-plugins/ %{_prefix}/lib/bfd-plugins/LLVMgold.so # Documentation %if %{with doc} %files doc %defattr(-,root,root) %docdir %{_defaultdocdir}/llvm/doxygen-html %docdir %{_defaultdocdir}/llvm/html %dir %{_defaultdocdir}/llvm %doc %{_defaultdocdir}/llvm/doxygen-html/* %doc %{_defaultdocdir}/llvm/html/* %exclude %{_defaultdocdir}/llvm/doxygen-html/*.map %exclude %{_defaultdocdir}/llvm/doxygen-html/*.md5 %exclude %{_defaultdocdir}/llvm/html/.buildinfo %endif %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %post -n libLTO%{gen} -p /sbin/ldconfig %postun -n libLTO%{gen} -p /sbin/ldconfig %post -n %{pkg_name_lib} -p /sbin/ldconfig %postun -n %{pkg_name_lib} -p /sbin/ldconfig %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor