diff --git a/gen_libs.sh b/gen_libs.sh index 28f31b2..bdf83d6 100755 --- a/gen_libs.sh +++ b/gen_libs.sh @@ -3,7 +3,7 @@ set -e echo -n "Downloading header-only libraries..." mkdir deps -wget https://github.com/nlohmann/json/releases/download/v3.1.1/json.hpp -O deps/json.hpp 2> /dev/null +wget https://github.com/nlohmann/json/releases/download/v3.1.2/json.hpp -O deps/json.hpp 2> /dev/null wget https://github.com/mpark/variant/releases/download/v1.3.0/variant.hpp -O deps/variant.hpp 2> /dev/null echo " Done." diff --git a/nheko.spec b/nheko.spec index eebb5af..c35dc1e 100644 --- a/nheko.spec +++ b/nheko.spec @@ -6,6 +6,14 @@ %global commit2 850100c0ac2b5a04720b2a1f09270749bf99f7dd %global shortcommit2 %(c=%{commit2}; echo ${c:0:7}) +# Due to GCC 7.3.1 regression https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84785 +# build under Fedora <= 28 using clang. +%if 0%{?fedora} < 28 +%bcond_without clang +%else +%bcond_with clang +%endif + Summary: Desktop client for the Matrix protocol Name: nheko Version: 0.2.1 @@ -34,6 +42,14 @@ Source4: gen_libs.sh Patch0: %{name}-drop-flags.patch Patch1: %{name}-drop-rpath.patch +%if %{with clang} +BuildRequires: clang +BuildRequires: llvm +%else +BuildRequires: gcc-c++ +BuildRequires: gcc +%endif + BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Network) BuildRequires: cmake(Qt5Multimedia) @@ -45,9 +61,7 @@ BuildRequires: libappstream-glib BuildRequires: ninja-build BuildRequires: lmdb-devel BuildRequires: doxygen -BuildRequires: gcc-c++ BuildRequires: cmake -BuildRequires: gcc Requires: hicolor-icon-theme @@ -69,11 +83,17 @@ pushd ".third-party" mv matrix-structs-%{commit2} matrix_structs pushd matrix_structs sed -i 's@add_library(${LIBRARY_NAME} ${SRC})@add_library(${LIBRARY_NAME} STATIC ${SRC})@g' CMakeLists.txt + sed -i '/-Werror/d' CMakeLists.txt tar -xf %{SOURCE3} popd popd %build +%if %{with clang} +export CC=clang +export CXX=clang++ +%endif + pushd %{_target_platform} %cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. popd diff --git a/sources b/sources index e1c8ea4..df984bc 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (header_only.tar.gz) = c5b6f6bd9f0dd1ca0daee04048f733e306e6b4ac93c9100136a2714b28d0f9d17864362209359c4251ba65aeb69e14fbaf45942b27f47df9dccf2e268f3cbcb9 +SHA512 (header_only.tar.gz) = 6ce0b8740e690d196f0dfddeb8c2a93c2185e702ba574a606ab26e10c26f3a3aa421497489b3dcb3696e45aa4c5869eb9628493962179018e70ef05963c532ad SHA512 (lmdbxx-0b43ca8.tar.gz) = 025a945288a398b09549c91c98509a57912f8614c14b476e7c8d4fb0dc8fc1288fa1b3a33567cccea474277a1c48b3701f2df31e8a6acc851eb9549a9822f074 SHA512 (matrix-structs-850100c.tar.gz) = 0cd10c865528ed5c5d80c889b7d9fc315796e12b69476696f7e10e745a7774c2a5866fc6de0a10b43ef4de2fb71bf3211899f7c68fa354ae013e28647decc899 SHA512 (nheko-0.2.1.tar.gz) = 7d08c5c561c0388756b663da98b209c3074b61f5743cefa8f1ad21e3184b0de3973a8a6b129a0f1f602e6dbb3c99d7f0cf47e394a4c9527086a250aff7ca5b85