nheko/nheko.spec

154 lines
4.8 KiB
RPMSpec

# Git revision of lmdbxx...
%global commit1 0b43ca87d8cfabba392dfe884eb1edb83874de02
%global shortcommit1 %(c=%{commit1}; echo ${c:0:7})
# Git revision of matrix-structs...
%global commit2 690080daa3bc1984297c4d7103cde9ea07e2e0b7
%global shortcommit2 %(c=%{commit2}; echo ${c:0:7})
# Git revision of tweeny...
%global commit3 b94ce07cfb02a0eb8ac8aaf66137dabdaea857cf
%global shortcommit3 %(c=%{commit3}; echo ${c:0:7})
# Due to GCC 7.3.1 regression https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84785
# build under some Fedora releases using clang.
%if 0%{?fedora} == 27
%bcond_without clang
%else
%bcond_with clang
%endif
Summary: Desktop client for the Matrix protocol
Name: nheko
Version: 0.4.0
Release: 1%{?dist}
# Application and 3rd-party modules licensing:
# * S0 - GPLv3+ -- main source;
# * S1 (lmdbxx) - Public Domain -- build-time dependency (header-only);
# * S2 (matrix-structs) - Public Domain -- build-time dependency;
# * S3 (tweeny) - MIT -- build-time dependency (header-only);
# * S4 (json) - MIT -- build-time dependency (header-only);
# * S4 (variant) - Boost 1.0 -- build-time dependency (header-only).
# Bundled resources licensing:
# * emojione-android fonts - CC by (v4.0) -- bundled resource;
# * OpenSans fonts - Apache (v2.0) -- bundled resource.
License: GPLv3+ and Public Domain and MIT and Boost and ASL 2.0 and CC-BY
URL: https://github.com/mujx/nheko
# Use ./gen_libs.sh script from repository to generate tarball with header-only libraries...
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/bendiken/lmdbxx/archive/%{commit1}.tar.gz#/lmdbxx-%{shortcommit1}.tar.gz
Source2: https://github.com/mujx/matrix-structs/archive/%{commit2}.tar.gz#/matrix-structs-%{shortcommit2}.tar.gz
Source3: https://github.com/mobius3/tweeny/archive/%{commit3}.tar.gz#/tweeny-%{shortcommit3}.tar.gz
Source4: header_only-f3b7019.tar.gz
Source5: gen_libs.sh
Patch0: %{name}-drop-flags.patch
Patch1: %{name}-drop-rpath.patch
BuildRequires: cmake(Qt5Svg)
BuildRequires: cmake(Qt5Widgets)
BuildRequires: cmake(Qt5Network)
BuildRequires: cmake(Qt5Multimedia)
BuildRequires: cmake(Qt5Concurrent)
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: ninja-build
BuildRequires: lmdb-devel
BuildRequires: gcc-c++
BuildRequires: doxygen
BuildRequires: cmake
BuildRequires: gcc
%if %{with clang}
BuildRequires: clang
BuildRequires: llvm
%endif
Requires: hicolor-icon-theme
%description
The motivation behind the project is to provide a native desktop app
for Matrix that feels more like a mainstream chat app.
%prep
# Unpacking main tarball with sources...
%autosetup -p1
mkdir {%{_target_platform},.third-party}
sed -i '/GIT_/d' cmake/*.cmake
# Unpacking third-party modules...
pushd ".third-party"
tar -xf %{SOURCE1}
mv lmdbxx-%{commit1} lmdbxx
tar -xf %{SOURCE2}
mv matrix-structs-%{commit2} matrix_structs
tar -xf %{SOURCE3}
mv tweeny-%{commit3} tweeny
pushd matrix_structs
sed -i 's@add_library(${LIBRARY_NAME} ${SRC})@add_library(${LIBRARY_NAME} STATIC ${SRC})@g' CMakeLists.txt
sed -i '/-Werror/d' cmake/CompilerFlags.cmake
tar -xf %{SOURCE4}
popd
popd
%build
%if %{with clang}
export CC=clang
export CXX=clang++
%endif
pushd %{_target_platform}
%cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
popd
%ninja_build -C %{_target_platform}
%install
# Installing application...
%ninja_install -C %{_target_platform}
# Installing additional locales...
mkdir -p "%{buildroot}%{_datarootdir}/%{name}/translations"
find %{_target_platform} -maxdepth 1 -type f -name "*.qm" -exec install -m 0644 -p '{}' %{buildroot}%{_datarootdir}/%{name}/translations \;
%find_lang %{name} --with-qt
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%files -f %{name}.lang
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/translations
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%changelog
* Fri May 04 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.4.0-1
- Updated to version 0.4.0.
* Fri Apr 13 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.3.1-1
- Updated to version 0.3.1.
* Tue Apr 03 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.3.0-1
- Updated to version 0.3.0.
* Wed Mar 14 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.2.1-1
- Updated to version 0.2.1.
* Mon Mar 05 2018 Vitaly Zaitsev <vitaly@easycoding.org> - 0.2.0-1
- Updated to version 0.2.0.
* Thu Dec 28 2017 Vitaly Zaitsev <vitaly@easycoding.org> - 0.1.0-1
- Updated to version 0.1.0.
* Mon Sep 25 2017 Vitaly Zaitsev <vitaly@easycoding.org> - 0-1.20170924git9def76a
- Initial SPEC release.