Update spec for 2016.1, fix build C++17

This commit is contained in:
Sergey Zhemoitel 2021-01-04 13:35:20 +03:00
parent 77adce0f6a
commit 7be8502ec7
2 changed files with 28 additions and 4 deletions

5
loffice-libcxx-wrapper.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
linker_flags="$(echo "$@" | tr ' ' '\n' | grep '^\-l' | tr '\n' ' ')"
/usr/bin/clang++ "$@" $LIBCCX_LIBS $linker_flags

View file

@ -13,11 +13,16 @@ Release: 1
License: LGPLv2
URL: https://github.com/Kistler-Group/sdbus-cpp
Source0: https://github.com/Kistler-Group/sdbus-cpp/archive/v%{version}.tar.gz?/%{name}-%{version}.tar.gz
Source1: https://abf.io/import/libreoffice/raw/rosa2016.1/loffice-libcxx-wrapper.sh
Source1000: %{name}.rpmlintrc
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: gcc-c++
#BuildRequires: gcc-c++
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(expat)
BuildRequires: clang
BuildRequires: stdc++-gcc10-devel
%description
High-level C++ D-Bus library for Linux designed to provide easy-to-use
@ -90,12 +95,26 @@ out of the D-Bus IDL XML description.
%prep
%setup -q
install -m0755 %{SOURCE1} .
sed 's/clang++/clang/' loffice-libcxx-wrapper.sh > loffice-libc-wrapper.sh
chmod +x *.sh
%build
%cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_CODE_GEN=ON \
-DBUILD_DOXYGEN_DOC=ON
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_CODE_GEN=ON \
-DBUILD_DOXYGEN_DOC=ON \
-DCMAKE_CXX_COMPILER="$RPM_BUILD_DIR/%{name}-%{version}/loffice-libcxx-wrapper.sh" \
-DCMAKE_C_COMPILER="$RPM_BUILD_DIR/%{name}-%{version}/loffice-libc-wrapper.sh" \
-DCMAKE_CXX_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" \
-DCMAKE_C_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host}" \
-DCMAKE_EXE_LINKER_FLAGS="-lstdc++-gcc10" \
-DCMAKE_MODULE_LINKER_FLAGS="-lstdc++-gcc10" \
-DCMAKE_SHARED_LINKER_FLAGS="-lstdc++-gcc10" \
-DCMAKE_INSTALL_PREFIX="%{_prefix}" \
-DCMAKE_INSTALL_LIBDIR="%{_lib}"
%make
%make -C docs