File squeekboard.spec of Package squeekboard

#
# spec file for package squeekboard
#
# 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/
#


Name:           squeekboard
Version:        1.43.0
Release:        0%{?dist}
Summary:        a Wayland virtual keyboard

License:        GPL-3.0-or-later
URL:            https://gitlab.gnome.org/World/Phosh/squeekboard
Source0:        squeekboard-%{version}.tar.xz
Source2:        vendor.tar.gz

Patch0:         0001-fix-rpmlint-shebang.patch

ExclusiveArch:  aarch64 armv6hl armv7hl

BuildRequires:  cargo
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  feedbackd-devel
BuildRequires:  gcc
BuildRequires:  meson
BuildRequires:  rust
BuildRequires:  pkgconfig(gio-2.0) >= 2.26
BuildRequires:  pkgconfig(gnome-desktop-3.0) >= 3.0
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.0
BuildRequires:  pkgconfig(libbsd)
BuildRequires:  pkgconfig(libcroco-0.6)
BuildRequires:  pkgconfig(wayland-client) >= 1.14
BuildRequires:  pkgconfig(wayland-protocols) >= 1.12
BuildRequires:  pkgconfig(xkbcommon)

Requires:       noto-coloremoji-fonts

%description
Squeekboard is a virtual keyboard supporting Wayland, built primarily
for the Librem 5 phone. It squeaks because some Rust got inside.

# # Run locally to create vendor.tar.gz package as OBS don't work well with Cargo
# PACKAGE="squeekboard-1.22.0"
#
# tar -xvf ${PACKAGE}.tar.xz
# cd ${PACKAGE}
# sed -i "s/\@path\@/./g" Cargo.toml.in
# cat Cargo.toml.in Cargo.deps.newer > Cargo.toml
# cargo vendor
# tar -czvf vendor.tar.gz vendor/
# cp vendor.tar.gz ../
#

%lang_package

%prep
%setup -q -a 0 -a 2 -n %{name}-%{version}
%autopatch -p1
mkdir cargo-home
cat >cargo-home/config <<EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'
EOF

%build
export CARGO_HOME=`pwd`/cargo-home/
%meson
%meson_build

%install
export CARGO_HOME=`pwd`/cargo-home/
%meson_install
%find_lang %{name}

%files
%{_bindir}/*
%{_datadir}/applications/sm.puri.Squeekboard.desktop
%{_datadir}/glib-2.0/schemas/sm.puri.Squeekboard.gschema.xml
%doc README.md
%license COPYING

%files lang  -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by