Skip to content

Commit

Permalink
Upgrade rust-tiny-dfr to upstream tag v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpenedblade committed Jul 29, 2024
1 parent dcdf911 commit f51f83d
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 53 deletions.
24 changes: 0 additions & 24 deletions rust-tiny-dfr/0002-downgrade-cairo-rs.patch

This file was deleted.

107 changes: 78 additions & 29 deletions rust-tiny-dfr/rust-tiny-dfr.spec
Original file line number Diff line number Diff line change
@@ -1,39 +1,77 @@
%global forgeurl https://github.com/sharpenedblade/tiny-dfr
%global commit 82d80aef1a6e7ce2c5bd3dd766e6c658ed4a51da
# Generated by rust2rpm 26
%bcond_without check

%global crate tiny-dfr
%forgemeta

Name: rust-%{crate}
Version: 0.2.0
Release: 6%{?dist}
Summary: The most basic dynamic function row daemon possible
License: MIT AND Apache-2.0
URL: %{forgeurl}
Source: %{forgesource}

%{?fc39:Patch: 0002-downgrade-cairo-rs.patch}

BuildRequires: rust-packaging >= 23
BuildRequires: systemd-rpm-macros

%description
The most basic dynamic function row daemon possible

License: Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND ISC AND LGPL-2.1-or-later AND MIT AND MPL-2.0 AND Unicode-DFS-2016 AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)

%files

Name: rust-tiny-dfr
Version: 0.3.1
Release: 1%{?dist}
Summary: Most basic dynamic function row daemon possible

License: MIT AND Apache-2.0
URL: https://crates.io/crates/tiny-dfr
Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * bump cairo-rs dependency from 0.18 to 0.19
# * bump drm dependency from 0.10 to 0.11:
# https://github.com/WhatAmISupposedToPutHere/tiny-dfr/pull/30
# * bump freetype-rs dependency from 0.32 to 0.35
# * restrict librsvg dependency from 2.56 to ~2.58:
# the librsvg crate does not follow SemVer versioning
%if 0%{?fedora} >= 40
Patch: tiny-dfr-fix-metadata.diff
%endif

BuildRequires: cargo-rpm-macros >= 24
BuildRequires: systemd-rpm-macros

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}

%global _description %{expand:
The most basic dynamic function row daemon possible.}

%description %{_description}

%package -n %{crate}
Summary: %{summary}
# (Apache-2.0 OR MIT) AND BSD-3-Clause
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# 0BSD OR MIT OR Apache-2.0
# Apache-2.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# ISC
# LGPL-2.1-or-later
# MIT
# MIT AND Apache-2.0
# MIT OR Apache-2.0
# MIT OR Apache-2.0 OR Zlib
# MIT OR Zlib OR Apache-2.0
# MPL-2.0
# Unlicense OR MIT
# Zlib OR Apache-2.0 OR MIT
License: Apache-2.0 AND BSD-3-Clause AND ISC AND LGPL-2.1-or-later AND MIT AND MPL-2.0 AND Unicode-DFS-2016 AND (Apache-2.0 OR MIT) AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown

%description -n %{crate} %{_description}

%files -n %{crate}
%license LICENSE
%license LICENSE.material
%license LICENSE.dependencies
%doc README.md
%{_bindir}/%{crate}
%{_bindir}/tiny-dfr
%{_datadir}/%{crate}/
%{_udevrulesdir}/*.rules
%{_unitdir}/*.service
%dir %{_sysconfdir}/%{crate}/
%config(noreplace) %ghost %{_sysconfdir}/%{crate}/config.toml

%prep
%forgeautosetup -p1
%autosetup -n %{crate}-%{version} -p1
%cargo_prep

%generate_buildrequires
%cargo_generate_buildrequires

Expand All @@ -44,15 +82,26 @@ License: Apache-2.0 AND BSD-3-Clause AND CC0-1.0 AND ISC AND LGPL-2.1-or-later A

%install
%cargo_install
install -Dpm0644 -t %{buildroot}%{_datadir}/%{crate} share/%{crate}/*

install -Dpm0644 -t %{buildroot}%{_datadir}/%{crate} \
share/%{crate}/*.svg share/%{crate}/config.toml \
install -Ddpm0755 %{buildroot}%{_sysconfdir}/%{crate}
touch %{buildroot}%{_sysconfdir}/%{crate}/config.toml
install -Dpm0644 -t %{buildroot}%{_udevrulesdir} etc/udev/rules.d/*.rules
install -Dpm0644 -t %{buildroot}%{_unitdir} etc/systemd/system/*.service

%post
%post -n %{crate}
%systemd_post %{crate}.service

%preun
%preun -n %{crate}
%systemd_preun %{crate}.service

%postun
%postun -n %{crate}
%systemd_postun_with_restart %{crate}.service

%if %{with check}
%check
%cargo_test
%endif

%changelog
29 changes: 29 additions & 0 deletions rust-tiny-dfr/tiny-dfr-fix-metadata.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- tiny-dfr-0.3.1/Cargo.toml 1970-01-01T00:00:01+00:00
+++ tiny-dfr-0.3.1/Cargo.toml 2024-07-29T20:38:26+00:00
@@ -32,7 +32,7 @@
version = "1"

[dependencies.cairo-rs]
-version = "0.18"
+version = "0.19"
features = ["freetype"]
default-features = false

@@ -40,7 +40,7 @@
version = "0.11.1"

[dependencies.freetype-rs]
-version = "0.32"
+version = "0.35"

[dependencies.input]
version = "0.8"
@@ -56,7 +56,7 @@
version = "0.2"

[dependencies.librsvg]
-version = "2.57"
+version = "~2.58"

[dependencies.nix]
version = "0.27"

0 comments on commit f51f83d

Please sign in to comment.