Compare commits

...

2 Commits

3 changed files with 201 additions and 11 deletions

View File

@ -2,11 +2,11 @@
# No Qt5 on RHEL 10 and higher
%bcond_without qt5
%bcond_without qt6
%bcond_without python
%bcond_with python
%global base_name gpgme
%global gnupg2_min_ver 2.2.24
%global libgpg_error_min_ver 1.36
%global libgpg_error_min_ver 1.40
# we are doing out of source build
%global _configure ../configure
@ -18,6 +18,7 @@
%global python3_pkgversion 3.11
%global _syslibdir %{_libdir}
%global _sysincludedir %{_includedir}
%global _prefix /opt/rx
%global _sysconfdir %{_prefix}/etc
@ -56,8 +57,8 @@ Patch3001: 1001-qt-skip-test-remarks-for-gnupg2-2.4.patch
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
#BuildRequires: gcc
BuildRequires: clang
BuildRequires: gawk
BuildRequires: texinfo
BuildRequires: rx-gnupg2 >= %{gnupg2_min_ver}
@ -76,6 +77,8 @@ BuildRequires: cmake
Requires: rx-gnupg2 >= %{gnupg2_min_ver}
Provides: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# On the following architectures workaround multiarch conflict of -devel packages:
%define multilib_arches %{ix86} x86_64 ia64 ppc ppc64 s390 s390x %{sparc}
@ -102,6 +105,7 @@ Conflicts: gpgme-devel
Summary: C++ bindings/wrapper for GPGME
Provides: %{name}-pp = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}-pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n %{name}pp
@ -126,7 +130,8 @@ Summary: Qt5 API bindings/wrapper for GPGME
Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Test)
Provides: rx-q%{base_name}
Obsoletes: rx-q%{base_name} < %{?epoch:%{epoch}:}%{version}-%{release}
Provides: rx-q%{base_name} = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n rx-q%{base_name}-qt5
%{summary}.
@ -207,14 +212,16 @@ sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in
sed -i 's/3.8/%{python3_pkgversion}/g' configure
%build
export CC=clang
export CXX=clang++
# People neeed to learn that you can't run autogen.sh anymore
#./autogen.sh
# Since 1.16.0, we need to explicitly pass -D_LARGEFILE_SOURCE and
# -D_FILE_OFFSET_BITS=64 for the QT binding to build successfully on 32-bit
# platforms.
export CFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
export CXXFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
export CFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
export CXXFLAGS='-I%{_sysincludedir} -I%{_sysincludedir}/Qt6 %{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
# Explicit new lines in C(XX)FLAGS can break naive build scripts
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')"
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')"
@ -298,8 +305,8 @@ rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt
# Remove duplicate stuff
rm -rf %{buildroot}%{_bindir}/%{base_name}-json
rm -fv %{buildroot}%{_libdir}/lib%{base_name}.so.11
rm -fv %{buildroot}%{_libdir}/lib%{base_name}pp.so.6
#rm -fv %{buildroot}%{_libdir}/lib%{base_name}.so.11
#rm -fv %{buildroot}%{_libdir}/lib%{base_name}pp.so.6
mkdir -p %{buildroot}%{_syslibdir}/cmake
ln -sf %{_libdir}/cmake/Gpgmepp %{buildroot}%{_syslibdir}/cmake/Gpgmepp
@ -320,7 +327,7 @@ popd
%files
%license COPYING* LICENSES
%doc AUTHORS NEWS README*
%{_libdir}/lib%{base_name}.so.11.*
%{_libdir}/lib%{base_name}.so.11*
%files devel
%{_bindir}/%{base_name}-config
@ -337,7 +344,7 @@ popd
%files -n %{name}pp
%doc lang/cpp/README
%{_libdir}/lib%{base_name}pp.so.6.*
%{_libdir}/lib%{base_name}pp.so.6*
%files -n %{name}pp-devel
%{_includedir}/%{base_name}++/

View File

@ -0,0 +1,26 @@
diff -Naur a/llvm/docs/conf.py b/llvm/docs/conf.py
--- a/llvm/docs/conf.py 2020-09-15 09:12:24.318287611 +0000
+++ b/llvm/docs/conf.py 2020-09-15 15:01:00.025893199 +0000
@@ -36,21 +36,7 @@
".rst": "restructuredtext",
}
-try:
- import recommonmark
-except ImportError:
- # manpages do not use any .md sources
- if not tags.has("builder-man"):
- raise
-else:
- import sphinx
-
- if sphinx.version_info >= (3, 0):
- # This requires 0.5 or later.
- extensions.append("recommonmark")
- else:
- source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
- source_suffix[".md"] = "markdown"
+import sphinx
# The encoding of source files.
# source_encoding = 'utf-8-sig'

View File

@ -0,0 +1,157 @@
%global maj_ver 17
%global min_ver 0
%global patch_ver 6
%global baserelease 10
# Limit build jobs on ppc64 systems to avoid running out of memory.
%global _smp_mflags -j8
%global install_prefix %{_libdir}/llvm%{maj_ver}
%global pkg_libdir %{install_prefix}/lib/
# Disable debuginfo on ppc64le to reduce disk space usage.
%ifarch ppc64le
%global _find_debuginfo_dwz_opts %{nil}
%global debug_package %{nil}
%endif
Name: llvm-compat17
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: %{baserelease}%{?dist}
Summary: The Low Level Virtual Machine
License: NCSA
URL: http://llvm.org
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/llvm-%{version}.src.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz
Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/cmake-%{version}.src.tar.xz
# RHEL-specific patch to avoid unwanted recommonmark dep
Patch101: 0101-Deactivate-markdown-doc.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: zlib-devel
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
BuildRequires: multilib-rpm-config
BuildRequires: ninja-build
# This pulls in /usr/bin/python3
BuildRequires: python3-devel
%ifarch %{valgrind_arches}
# Enable extra functionality when run the LLVM JIT under valgrind.
BuildRequires: valgrind-devel
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%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 libs
Summary: LLVM shared libraries
Obsoletes: clang-libs = %{maj_ver}.%{min_ver}
Provides: clang-libs = %{version}-%{release}
Provides: clang-libs%{?_isa} = %{version}-%{release}
Obsoletes: llvm-libs = %{maj_ver}.%{min_ver}
Provides: llvm-libs = %{version}-%{release}
Provides: llvm-libs%{?_isa} = %{version}-%{release}
%description libs
Shared libraries for the LLVM compiler infrastructure.
%prep
%setup -T -q -b 2 -n cmake-%{version}.src
cd ..
mv cmake-%{version}.src cmake
%setup -T -q -b 1 -n clang-%{version}.src
%autopatch -m100 -p2
cd ..
mv clang-%{version}.src clang
%setup -q -n llvm-%{version}.src
%autopatch -M100 -p2
%build
%ifarch s390 %ix86
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif
cd ..
mkdir llvm-build
pushd llvm-build
# force off shared libs as cmake macros turns it on.
%cmake ../llvm-%{version}.src -G Ninja \
-B . \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
%ifarch ppc64le
-DCMAKE_BUILD_TYPE=Release \
%else
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
%endif
%ifarch s390 %ix86
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
%endif
\
-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" \
-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
-DLLVM_ENABLE_ZLIB:BOOL=ON \
-DLLVM_ENABLE_FFI:BOOL=ON \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_ENABLE_PROJECTS="clang" \
-DCMAKE_INSTALL_PREFIX=%{install_prefix}
DESTDIR=%{buildroot} %__ninja %__ninja_common_opts
popd
%install
cd ..
DESTDIR=%{buildroot} %__ninja %__ninja_common_opts -l 8 -C llvm-build \
install-LLVM install-libclang install-clang-cpp
# Create ld.so.conf.d entry
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF
%{pkg_libdir}
EOF
# Remove unversioned symlinks
rm -Rf %{buildroot}%{pkg_libdir}/libclang.so
rm -Rf %{buildroot}%{pkg_libdir}/libclang-cpp.so
%check
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%files libs
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
%{pkg_libdir}/libLLVM-%{maj_ver}.so
%{pkg_libdir}/libclang*.so.*