File weylus.spec of Package weylus
#
# spec file for package weylus
#
# Copyright (c) 2021 Florian "sp1rit" <packaging@sp1rit.anonaddy.me>
# Copyright (c) 2021 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/
#
%bcond_with x264
Name: weylus
Version: 0.11.4+git.11~7cd2be6
Release: 0
Summary: Use your tablet as graphic tablet/touch screen on your computer
License: AGPL-3.0-or-later
URL: https://github.com/H-M-H/Weylus
Source0: %{name}-%{version}.tar.xz
Source1: autopilot.tar.xz
Source2: vendor.tar.xz
Source3: cargo_config
BuildRequires: cargo-packaging
BuildRequires: extra-cmake-modules
BuildRequires: pkgconfig(dbus-1) >= 1.6
BuildRequires: git
BuildRequires: typescript
BuildRequires: pkgconfig(x11) pkgconfig(xext) pkgconfig(xcomposite) pkgconfig(xi) pkgconfig(xrandr) pkgconfig(xtst) pkgconfig(xinerama) pkgconfig(xcursor) pkgconfig(xft)
BuildRequires: pkgconfig(libavcodec) pkgconfig(libavdevice) pkgconfig(libavfilter) pkgconfig(libavformat) pkgconfig(libswscale) pkgconfig(libva)
BuildRequires: pkgconfig(libpostproc)
BuildRequires: pkgconfig(fontconfig) pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gstreamer-1.0)
BuildRequires: pkgconfig(gstreamer-video-1.0) >= 1.8
%if %{with x264}
BuildRequires: pkgconfig(x264)
%endif
# I'm not sure, but you'll likely need an x264 gst plugin
Requires: gstreamer-plugins-base
Recommends: gstreamer-plugin-pipewire
%description
Weylus turns your tablet or smart phone into a graphic tablet/touch screen for your computer!
%prep
%autosetup -p1 -b1 -a2
sed '/\[source\.crates\-io\]/,/replace-with/d' -i .cargo/config
cat %{SOURCE3} >> .cargo/config
echo "" >> .cargo/config
sed -E 's|^autopilot\s*?=.*$|autopilot = { path = "../autopilot/" }|' -i Cargo.toml
sed '/cc_video.include.*$/a cc_video.include("/usr/include/ffmpeg");' -i build.rs
%if ! %{with x264}
sed '/cargo:rustc-link-lib={}=x264/d' -i build.rs
%endif
%build
%{cargo_build} --features="ffmpeg-system"
%install
install -Dm755 target/release/%{name} -t %{buildroot}%{_bindir}
install -Dm644 "%{name}.desktop" -t "%{buildroot}%{_datadir}/applications
%files
%license LICENSE
%doc Readme.md CONTRIBUTORS
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%changelog