File rutabaga_gfx.spec of Package rutabaga_gfx
#
# spec file for package rutabaga_gfx
#
# Copyright (c) 2024 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: rutabaga_gfx
Version: 0
Release: 0
Summary:Handling virtio-gpu protocols
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License: BSD-3-Clause AND LGPL-2.1-or-later
URL: https://chromium.googlesource.com/crosvm/crosvm.git
Source: _service
Source1: vendor-rutabaga_gfx.tar.zst
Source2: vendor-ffi.tar.zst
BuildRequires: cargo
BuildRequires: pkgconfig(gfxstream_backend)
BuildRequires: cargo-packaging
BuildRequires: zstd
BuildRequires: meson
BuildRequires: gcc-c++
BuildRequires: pkgconfig(aemu_base)
BuildRequires: pkgconfig(libdrm)
%description
Handling virtio-gpu protocols
%package devel
Summary: Handling virtio-gpu protocols
Requires: rutabaga_gfx = %{version}
%description devel
Handling virtio-gpu protocols
%prep
%setup -q -n %_sourcedir/%name-%version -T -D
%__mkdir -p %_builddir/%_sourcedir
%__mv %_sourcedir/%name-%version/rutabaga_gfx %_sourcedir
%__rm -rf %_sourcedir/%name-%version
%__mv %_sourcedir/rutabaga_gfx %_sourcedir/%name-%version
%__ln -s %_sourcedir/%name-%version %_builddir/%_sourcedir
cd %_sourcedir/%name-%version
%__rpmuncompress -x %{SOURCE1}
cd %_sourcedir/%name-%version/ffi
%__rpmuncompress -x %{SOURCE1}
%__rpmuncompress -x %{SOURCE2}
%build
%define CARGO_FEATURE_GFXSTREAM true
pushd %_sourcedir/%name-%version/ffi
%{cargo_build} --features=gfxstream
popd
%install
pushd %_sourcedir/%name-%version/ffi
install -D -m 755 target/release/librutabaga_gfx_ffi.so %{buildroot}%{_libdir}/librutabaga_gfx_ffi.so.%version
ln -s librutabaga_gfx_ffi.so.%version %{buildroot}%{_libdir}/librutabaga_gfx_ffi.so.0
ln -s librutabaga_gfx_ffi.so.%version %{buildroot}%{_libdir}/librutabaga_gfx_ffi.so
install -D -m 644 target/release/rutabaga_gfx_ffi.pc %{buildroot}%{_libdir}/pkgconfig/rutabaga_gfx_ffi.pc
install -D -m 644 src/include/rutabaga_gfx_ffi.h %{buildroot}%{_includedir}/rutabaga_gfx/rutabaga_gfx_ffi.h
popd
%files
%license LICENSE
%_libdir/lib%{name}_ffi.so.*
%files devel
%_libdir/lib%{name}_ffi.so
%{_includedir}/%name
%{_libdir}/pkgconfig/%{name}_ffi.pc
%changelog