public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/perl-GDGraph] epel8: Fix logo_xbm_noext test (GH#1)
@ 2026-06-22  7:24 Paul Howarth
  0 siblings, 0 replies; only message in thread
From: Paul Howarth @ 2026-06-22  7:24 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/perl-GDGraph
Branch : epel8
Commit : 0710097861be7df624e3450242ef5be7b50d8339
Author : Paul Howarth <paul@city-fan.org>
Date   : 2026-06-22T08:20:06+01:00
Stats  : +60/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-GDGraph/c/0710097861be7df624e3450242ef5be7b50d8339?branch=epel8

Log:
Fix logo_xbm_noext test (GH#1)

---
diff --git a/GDGraph-1.54-XBM-Magic.patch b/GDGraph-1.54-XBM-Magic.patch
new file mode 100644
index 0000000..542514c
--- /dev/null
+++ b/GDGraph-1.54-XBM-Magic.patch
@@ -0,0 +1,51 @@
+From 96862391296b235c60e0e36140f8ea498f70a74d Mon Sep 17 00:00:00 2001
+From: Reini Urban <rurban@cpan.org>
+Date: Tue, 1 Feb 2022 15:10:53 +0100
+Subject: [PATCH] fix logo_xbm_noext test
+
+causing t/bugfixes.t to fail with latest GD
+provide xbm magic, which has no newFromXbmData method.
+---
+ Graph.pm        | 6 +++++-
+ t/images/main.c | 8 ++++++++
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+ create mode 100644 t/images/main.c
+
+diff --git a/Graph.pm b/Graph.pm
+index 816c99a..f12d588 100644
+--- a/Graph.pm
++++ b/Graph.pm
+@@ -347,7 +347,8 @@ sub _read_logo_file
+             pack("H8",'ffd8ffe0') => "jpeg",
+             'GIF8' => "gif",
+             '.PNG' => "png",
+-            '/* X'=> "xpm", # technically '/* XPM */', but I'm hashing, here
++            '/* X' => "xpm", # technically '/* XPM */', but I'm hashing, here
++            '#def' => "xbm",
+         );
+         if (my $match = $magic{ substr $logodata, 0, 4 }) {
+             push @tried, $match;
+@@ -362,6 +363,9 @@ sub _read_logo_file
+                     $glogo = GD::Image->$gdimport(\*LOGO);
+                 }
+             }
++        } elsif ($logo_path =~ /_xbm_/) { # no magic possible for xbm
++            push @tried, 'xbm';
++            $glogo = GD::Image->newFromXbm($logo_path);
+         # should this actually be "if (!$glogo), rather than an else?            
+         } else { # Hail Mary, full of Grace!  Blessed art thou among women...
+             push @tried, 'libgd best-guess';
+diff --git a/t/images/main.c b/t/images/main.c
+new file mode 100644
+index 0000000..6d64b11
+--- /dev/null
++++ b/t/images/main.c
+@@ -0,0 +1,8 @@
++#include <stdio.h>
++#include "logo_xbm_noext.c"
++
++void main() {
++  FILE *f = fopen ("logo_xbm_noext", "w");
++  fwrite (logo_bits, sizeof(logo_bits), 1, f);
++  fclose (f);
++}

diff --git a/perl-GDGraph.spec b/perl-GDGraph.spec
index 8ce673f..65641e1 100644
--- a/perl-GDGraph.spec
+++ b/perl-GDGraph.spec
@@ -1,11 +1,12 @@
 Name:           perl-GDGraph
 Epoch:          1
 Version:        1.54
-Release:        11%{?dist}
+Release:        19%{?dist}
 Summary:        Graph generation package for Perl
 License:        (GPL+ or Artistic) and GPLv2+
 URL:            https://metacpan.org/release/GDGraph
 Source0:        https://cpan.metacpan.org/modules/by-module/GD/GDGraph-%{version}.tar.gz
+Patch0:         GDGraph-1.54-XBM-Magic.patch
 BuildArch:      noarch
 # Build
 BuildRequires:  coreutils
@@ -50,6 +51,10 @@ Requires:       perl(Text::ParseWords)
 %prep
 %setup -q -n GDGraph-%{version}
 
+# Fix logo_xbm_noext test
+# https://github.com/mgjv/GDGraph/pull/1
+%patch0 -p1
+
 # Fix shellbangs
 perl -pi -e 's{^#!/usr/local/bin/perl\b}{#!%{__perl}}' \
   samples/sample1A.pl \
@@ -82,6 +87,9 @@ make test
 %{_mandir}/man3/GD::Graph::hbars.3*
 
 %changelog
+* Tue Feb  1 2022 Paul Howarth <paul@city-fan.org> - 1:1.54-19
+- Fix logo_xbm_noext test (GH#1)
+
 * Sun Sep 29 2019 Paul Howarth <paul@city-fan.org> - 1:1.54-11
 - Spec tidy-up
   - Use author-independent source URL

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-22  7:24 [rpms/perl-GDGraph] epel8: Fix logo_xbm_noext test (GH#1) Paul Howarth

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