File mission-center.spec of Package mission-center

#
# spec file for package mission-center
#
# Copyright (c) 2023 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/
#


%define _lto_cflags %{nil}
%define nvtop_ver 3.0.2
Name:           mission-center
Version:        0.4.1
Release:        0
Summary:        A simple yet powerful bluetooth client
License:        GPL-3.0-or-later
URL:            https://github.com/kaii-lb/overskride
Source0:        %{url}/archive/v%{version}/%{name}-v%{version}.tar.gz
Source1:        vendor.tar.zst
Source2:        https://github.com/Syllo/nvtop/archive/nvtop-%{nvtop_ver}.tar.gz
BuildRequires:  cargo-packaging
BuildRequires:  meson blueprint-compiler
BuildRequires:  appstream-glib desktop-file-utils
BuildRequires:  pkgconfig(gtk4)
BuildRequires:  pkgconfig(libadwaita-1)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  python3

BuildRequires:  cmake gcc-c++ nvtop
BuildRequires:  pkgconfig(libdrm) pkgconfig(gbm) pkgconfig(libglvnd)
BuildRequires:  pkgconfig(libudev)

%description
A Bluetooth and Obex client that is straight to the point, DE/WM agnostic,
and beautiful

%lang_package

%prep
%autosetup -n %{name}-v%{version} -a2

mkdir .cargo
cargo vendor --no-delete -s src/sys_info_v2/gatherer/Cargo.toml \
| sed 's/^directory = ".*"/directory = "vendor"/g' > .cargo/config
tar -cf %{SOURCE1} .cargo/ vendor/

sed -i 's|\(#!/usr/bin/\)env \(python\)|\1\23|' data/hwdb/*.py

pushd nvtop-%{nvtop_ver}
for p in ../src/sys_info_v2/gatherer/3rdparty/nvtop/patches/*.patch; do
patch -p1 < $p; done
popd

mkdir -p %{buildroot}/src/sys_info_v2/gatherer/src/debug/build/native
mv nvtop-%{nvtop_ver} %{buildroot}/src/sys_info_v2/gatherer/src/debug/build/native/nvtop-%nvtop_ver

%build
%meson
%meson_build

%install
%meson_install

%find_lang missioncenter

%files
%license COPYING
%doc README*
%{_bindir}/%{name}
%{_bindir}/%{name}-gatherer
%{_datadir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/metainfo/*.xml
%{_datadir}/glib-2.0/schemas/*.xml
%{_datadir}/icons/hicolor/*/*/*.svg

%files lang -f missioncenter.lang

%changelog
openSUSE Build Service is sponsored by