public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-oxipng] f45: Update to 10.2.1 (close RHBZ#2527745)
@ 2026-09-06  7:56 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-09-06  7:56 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rust-oxipng
Branch : f45
Commit : 9e2d4dac23c89c0b2c6ab1733a07955b32c7c33f
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-09-06T08:40:16+01:00
Stats  : +137/-7 in 6 file(s)
URL    : https://src.fedoraproject.org/rpms/rust-oxipng/c/9e2d4dac23c89c0b2c6ab1733a07955b32c7c33f?branch=f45

Log:
Update to 10.2.1 (close RHBZ#2527745)

---
diff --git a/871.patch b/871.patch
new file mode 100644
index 0000000..c32a814
--- /dev/null
+++ b/871.patch
@@ -0,0 +1,26 @@
+From 0da2e7c93cad6d92061c8efd342f43196a8c3338 Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code@musicinmybrain.net>
+Date: Sat, 5 Sep 2026 22:18:47 +0100
+Subject: [PATCH] Support SOURCE_DATE_EPOCH for reproducible man page
+
+https://reproducible-builds.org/docs/source-date-epoch/
+---
+ xtask/src/main.rs | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/xtask/src/main.rs b/xtask/src/main.rs
+index b237ad0d..9c14936c 100644
+--- a/xtask/src/main.rs
++++ b/xtask/src/main.rs
+@@ -44,7 +44,10 @@ fn build_manpages() -> Result<(), Box<dyn Error>> {
+     let mut man_file = BufWriter::new(File::create(manpages_dir.join("oxipng.1"))?);
+     Man::new(package_cmd)
+         .date({
+-            let now = UtcDateTime::now()?;
++            let now = match env::var("SOURCE_DATE_EPOCH") {
++                Ok(val) => UtcDateTime::from_timespec(val.parse::<i64>()?, 0)?,
++                Err(_) => UtcDateTime::now()?,
++            };
+             format!(
+                 "{:04}-{:02}-{:02}",
+                 now.year(),

diff --git a/oxipng-10.2.1-man-jiff.patch b/oxipng-10.2.1-man-jiff.patch
new file mode 100644
index 0000000..c7d18fd
--- /dev/null
+++ b/oxipng-10.2.1-man-jiff.patch
@@ -0,0 +1,50 @@
+diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
+index 7f7ccd35..099aebc6 100644
+--- a/xtask/Cargo.toml
++++ b/xtask/Cargo.toml
+@@ -10,4 +10,4 @@ cargo_metadata = "0.23.1"
+ clap = { version = "4.6.6", features = ["string"] }
+ clap_mangen = "0.3.3"
+ parse-size = "1.1.0"
+-tz-rs = "0.7.3"
++jiff = { version = "0.2", default-features = false, features = ["std"] }
+diff --git a/xtask/src/main.rs b/xtask/src/main.rs
+index 9c14936c..f8f97d9a 100644
+--- a/xtask/src/main.rs
++++ b/xtask/src/main.rs
+@@ -7,7 +7,7 @@ use std::{
+ 
+ use cargo_metadata::MetadataCommand;
+ use clap_mangen::Man;
+-use tz::UtcDateTime;
++use jiff::Timestamp;
+ 
+ include!("../../src/cli.rs");
+ 
+@@ -43,18 +43,14 @@ fn build_manpages() -> Result<(), Box<dyn Error>> {
+ 
+     let mut man_file = BufWriter::new(File::create(manpages_dir.join("oxipng.1"))?);
+     Man::new(package_cmd)
+-        .date({
+-            let now = match env::var("SOURCE_DATE_EPOCH") {
+-                Ok(val) => UtcDateTime::from_timespec(val.parse::<i64>()?, 0)?,
+-                Err(_) => UtcDateTime::now()?,
+-            };
+-            format!(
+-                "{:04}-{:02}-{:02}",
+-                now.year(),
+-                now.month(),
+-                now.month_day(),
+-            )
+-        })
++        .date(
++            match env::var("SOURCE_DATE_EPOCH") {
++                Ok(val) => Timestamp::new(val.parse::<i64>()?, 0)?,
++                Err(_) => Timestamp::now(),
++            }
++            .strftime("%F")
++            .to_string(),
++        )
+         .render(&mut man_file)?;
+ 
+     println!("Manpages generated in {}", manpages_dir.display());

diff --git a/oxipng-fix-metadata-auto.diff b/oxipng-fix-metadata-auto.diff
index dbb945e..070c799 100644
--- a/oxipng-fix-metadata-auto.diff
+++ b/oxipng-fix-metadata-auto.diff
@@ -1,5 +1,5 @@
---- oxipng-10.2.0/Cargo.toml	2006-07-24T01:21:28+00:00
-+++ oxipng-10.2.0/Cargo.toml	2026-08-09T05:57:13.207566+00:00
+--- oxipng-10.2.1/Cargo.toml	2006-07-24T01:21:28+00:00
++++ oxipng-10.2.1/Cargo.toml	2026-09-06T07:39:52.702309+00:00
 @@ -84,7 +84,6 @@
  [features]
  binary = [

diff --git a/rust-oxipng.spec b/rust-oxipng.spec
index 2120363..fd6ba3f 100644
--- a/rust-oxipng.spec
+++ b/rust-oxipng.spec
@@ -4,7 +4,7 @@
 %global crate oxipng
 
 Name:           rust-oxipng
-Version:        10.2.0
+Version:        10.2.1
 Release:        %autorelease
 Summary:        Lossless PNG compression optimizer
 
@@ -20,8 +20,20 @@ Source:         %{crates_source}
 Source10:       https://github.com/shssoichiro/oxipng/archive/v%{version}/oxipng-%{version}.tar.gz
 # Automatically generated patch to strip dependencies and normalize metadata
 Patch:          oxipng-fix-metadata-auto.diff
+# * Support SOURCE_DATE_EPOCH for reproducible man page
+Patch10:        https://github.com/oxipng/oxipng/pull/871.patch
+# * Port man-page date generation from tz-rs to jiff
+# * Applies on top of the SOURCE_DATE_EPOCH patch.
+# * This is really just motivated by the desire to avoid adding a rust-tz-rs
+#   package to Fedora solely for the man page. Any of the more popular date/time
+#   libraries (jiff, chrono, time) would serve equally well here. The general
+#   idea and a sample patch were offered upstream in the comments on
+#   https://github.com/oxipng/oxipng/pull/871, but we’re waiting for upstream
+#   input before opening a PR or deciding to carry the patch downstream-only.
+Patch11:        oxipng-10.2.1-man-jiff.patch
 
 BuildRequires:  cargo-rpm-macros >= 24
+BuildRequires:  tomcli
 
 %global _description %{expand:
 A lossless PNG compression optimizer.}
@@ -159,7 +171,10 @@ use the "zopfli" feature of the "%{crate}" crate.
 %ghost %{crate_instdir}/Cargo.toml
 
 %prep
-%autosetup -n %{crate}-%{version} -p1
+%autosetup -n %{crate}-%{version} -p1 -N
+# NOTE: The -N option must be manually added to the %%autosetup invocation so
+# that we can also apply patches to the contents of the xtask/ directory.
+
 # Copy in the xtask/ directory from the GitHub archive, required for generating
 # the man page. Remove upstream’s lock file, which we cannot respect. Note that
 # the mangen xtask has its own dependencies, so we must run
@@ -167,6 +182,11 @@ use the "zopfli" feature of the "%{crate}" crate.
 # in the build.
 tar -xzvf '%{SOURCE10}' --strip-components=1 oxipng-%{version}/xtask
 rm xtask/Cargo.lock
+
+# Now we can apply all patches, including those that touch xtask/.
+%autopatch -p1
+# Temporarily allow older clap_mangen 0.2
+tomcli set xtask/Cargo.toml str dependencies.clap_mangen '>=0.2, <0.4'
 %cargo_prep
 
 %generate_buildrequires

diff --git a/rust2rpm.toml b/rust2rpm.toml
index a77f195..aaaf4f7 100644
--- a/rust2rpm.toml
+++ b/rust2rpm.toml
@@ -16,16 +16,50 @@ the tests/ directory, which allows us to run tests.\
 """,
 ]
 
+[[package.extra-patches]]
+number = 10
+file = "https://github.com/oxipng/oxipng/pull/871.patch"
+comments = [
+    "Support SOURCE_DATE_EPOCH for reproducible man page",
+]
+
+[[package.extra-patches]]
+number = 11
+file = "oxipng-10.2.1-man-jiff.patch"
+comments = [
+    "Port man-page date generation from tz-rs to jiff",
+    "Applies on top of the SOURCE_DATE_EPOCH patch.",
+    """\
+This is really just motivated by the desire to avoid adding a rust-tz-rs \
+package to Fedora solely for the man page. Any of the more popular date/time \
+libraries (jiff, chrono, time) would serve equally well here. The general idea \
+and a sample patch were offered upstream in the comments on \
+https://github.com/oxipng/oxipng/pull/871, but we’re waiting for upstream input \
+before opening a PR or deciding to carry the patch downstream-only.\
+""",
+]
+
+[requires]
+build = ["tomcli"]
+
 [scripts.prep]
 pre = [
     """\
+# NOTE: The -N option must be manually added to the %%autosetup invocation so
+# that we can also apply patches to the contents of the xtask/ directory.
+
 # Copy in the xtask/ directory from the GitHub archive, required for generating
 # the man page. Remove upstream’s lock file, which we cannot respect. Note that
 # the mangen xtask has its own dependencies, so we must run
 # %%cargo_generate_buildrequires in the xtask directory if we are to invoke it
 # in the build.
 tar -xzvf '%{SOURCE10}' --strip-components=1 oxipng-%{version}/xtask
-rm xtask/Cargo.lock\
+rm xtask/Cargo.lock
+
+# Now we can apply all patches, including those that touch xtask/.
+%autopatch -p1
+# Temporarily allow older clap_mangen 0.2
+tomcli set xtask/Cargo.toml str dependencies.clap_mangen '>=0.2, <0.4'\
     """
 ]
 

diff --git a/sources b/sources
index ef6a47b..4276e05 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (oxipng-10.2.0.crate) = b41f6246c891d3c4df6aa4c7974694309e301b453c77b8d7340ab5238ee7e8c4ab81ad536816709dad2b037b412e7ca2fbaca06e041ded280b2a5cf429ad86cc
-SHA512 (oxipng-10.2.0.tar.gz) = 4aab6e55665834d7e71ffaaf45644115a6f1a40f199f15de5f2c807ee2e764fc5d40388eccc29ee0ab4c248969419a33df1d0c114863139adcbe3a16b6e365c2
+SHA512 (oxipng-10.2.1.crate) = 1fbd35a16094b96a07545f9757b6e44a1f04dc9cfd4ef33dd06af37e5cd3a638e3e43963c0273114a5d730b89c129684716a812df49e18b9748d0f0019bac07d
+SHA512 (oxipng-10.2.1.tar.gz) = 871c16968213d306b708f258bdce7387891e8e13550caed927a8e0f2fe43737444424d9a45fecd95638c6ec74c558ecac7ad1ec4b5807e86071b23ec58f18d5f

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-06  7:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06  7:56 [rpms/rust-oxipng] f45: Update to 10.2.1 (close RHBZ#2527745) Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox