File nheko.spec of Package nheko
#
# spec file for package nheko
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global _coeurl_source coeurl-831e2ee8e9cf.tar.bz2
%global _mtxclient_source mtxclient-03bb6fbd6652.tar.bz2
Name: nheko
Version: 0.11.3+git20240116.8ca0f61
Release: 0%{?dist}
Summary: Desktop client for the Matrix protocol
License: GPL-3.0-or-later AND Apache-2.0 AND CC-BY-4.0
Group: Productivity/Networking/Talk/Clients
URL: https://github.com/Nheko-Reborn/%{name}
Source0: %{name}-%{version}.tar.xz
Source1: %{_coeurl_source}
Source2: %{_mtxclient_source}
BuildRequires: appstream-glib
BuildRequires: asciidoc
BuildRequires: cmake >= 3.13.0
BuildRequires: cmark-devel
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: libappstream-glib8
BuildRequires: libboost_atomic-devel
BuildRequires: libboost_chrono-devel
BuildRequires: libboost_date_time-devel
BuildRequires: libboost_iostreams-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_program_options-devel
BuildRequires: libboost_random-devel
BuildRequires: libboost_regex-devel
BuildRequires: libboost_system-devel
BuildRequires: libboost_thread-devel
BuildRequires: lmdb-devel
BuildRequires: lmdbxx-devel
BuildRequires: memory-constraints
BuildRequires: ninja
BuildRequires: nlohmann_json-devel >= 3.2.0
BuildRequires: olm-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: spdlog-devel >= 1.0.0
BuildRequires: zlib-devel
BuildRequires: cmake(re2)
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6DBus)
BuildRequires: cmake(Qt6Keychain)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(Qt6Multimedia)
BuildRequires: cmake(Qt6QuickControls2)
BuildRequires: cmake(Qt6Svg)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(KDSingleApplication-qt6)
BuildRequires: qt6-qml-private-devel
BuildRequires: qt6-gui-private-devel
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libevent)
BuildRequires: pkgconfig(gstreamer-webrtc-1.0)
BuildRequires: pkgconfig(xcb)
BuildRequires: pkgconfig(xcb-ewmh)
Provides: bundled(libcoeurl)
Provides: bundled(libmatrix_client) = 0.9.2
Requires(post): binutils
%description
The motivation behind the project is to provide a native desktop app
for Matrix that feels more like a mainstream chat app.
%package zsh-completion
Summary: Zsh completion for %{name}
Group: System/Management
Requires: zsh
Requires: %{name}
Supplements: (%{name} and zsh)
BuildArch: noarch
%description zsh-completion
This package contain the zsh completion command for the %{name} matrix client.
%prep
%autosetup -p1
# unpack bundled coeurl and mtxclient libs
mkdir -p ./builds/_deps
cd ./builds/_deps && mkdir coeurl && tar -xf ${RPM_SOURCE_DIR}/%{_coeurl_source} --strip 1 -C coeurl
mkdir mtxclient && tar -xf ${RPM_SOURCE_DIR}/%{_mtxclient_source} --strip 1 -C mtxclient
%build
%limit_build -m 1800
%define __builder ninja
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DHUNTER_ENABLED=OFF \
-DCI_BUILD=OFF \
-DASAN=OFF \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DFETCHCONTENT_SOURCE_DIR_COEURL=../builds/_deps/coeurl \
-DFETCHCONTENT_SOURCE_DIR_MATRIXCLIENT=../builds/_deps/mtxclient \
-DUSE_BUNDLED_SPDLOG=OFF \
-DUSE_BUNDLED_OLM=OFF \
-DQML_DEBUGGING=OFF \
-DBUILD_DOCS=OFF \
-DUSE_BUNDLED_GTEST=OFF \
-DUSE_BUNDLED_CMARK=OFF \
-DUSE_BUNDLED_LMDBXX=OFF \
-DUSE_BUNDLED_MTXCLIENT=ON \
-DUSE_BUNDLED_LMDB=OFF \
-DUSE_BUNDLED_QTKEYCHAIN=OFF \
-DUSE_BUNDLED_JSON=OFF \
-DUSE_BUNDLED_COEURL=ON \
-DUSE_BUNDLED_LIBEVENT=OFF \
-DUSE_BUNDLED_QTKEYCHAIN=OFF \
-DUSE_BUNDLED_SPDLOG=OFF \
-DUSE_BUNDLED_OPENSSL=OFF
%cmake_build
%install
%cmake_install
rm -r %{buildroot}%{_includedir}/coeurl
rm -r %{buildroot}%{_includedir}/mtx*
rm -r %{buildroot}/usr/lib64/cmake/*
strip %{buildroot}%{_bindir}/%{name}
strip %{buildroot}%{_libdir}/libcoeurl.so
strip %{buildroot}%{_libdir}/libmatrix_client.so*
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml
%files
%defattr(-,root,root,-)
%doc README.md
%license COPYING
%{_bindir}/%{name}
%{_datadir}/metainfo/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*
%{_mandir}/man1/nheko.1%{?ext_man}
%{_libdir}/libcoeurl.so
%{_libdir}/libmatrix_client.so.*
%exclude %{_libdir}/libmatrix_client.so
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files zsh-completion
%{_datadir}/zsh/site-functions/_nheko
%changelog