C99 compatibility fixes for paps 0.6.8

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2023-04-13 12:17:12 +02:00
parent c702265b93
commit c2bb76914b
2 changed files with 50 additions and 1 deletions

44
paps-c99.patch Normal file
View File

@ -0,0 +1,44 @@
Use AC_USE_SYSTEM_EXTENSIONS and include <config.h>, so that <wchar.h>
makes a declaration of wcwidth available. Include <glib/gprintf.h>
for a declaration of g_vasprintf. This avoids implicit function
declarations and build failures with future compilers.
No need to upstream this because it only impacts the bundled 0.6.8
sources, the later 0.8.0 version has already been fixed upstream. The
g_vasprintf call was introduced in the paps-0.6.6-lcnumeric.patch
downstream patch.
diff -ur paps-0.8.0.orig/paps-0.6.8/configure.in paps-0.8.0/paps-0.6.8/configure.in
--- paps-0.8.0.orig/paps-0.6.8/configure.in 2023-04-13 11:56:29.571277839 +0200
+++ paps-0.8.0/paps-0.6.8/configure.in 2023-04-13 12:00:03.228135149 +0200
@@ -6,6 +6,7 @@
AC_LANG_C
AC_PROG_CC
AM_PROG_LIBTOOL
+AC_USE_SYSTEM_EXTENSIONS
dnl ======================================================
dnl check for CUPS
diff -ur paps-0.8.0.orig/paps-0.6.8/src/paps.c paps-0.8.0/paps-0.6.8/src/paps.c
--- paps-0.8.0.orig/paps-0.6.8/src/paps.c 2023-04-13 11:56:29.583277719 +0200
+++ paps-0.8.0/paps-0.6.8/src/paps.c 2023-04-13 12:02:28.958673663 +0200
@@ -20,7 +20,7 @@
*
*/
-
+#include <config.h>
#include <pango/pango.h>
#include <pango/pangoft2.h>
#include "libpaps.h"
diff -ur paps-0.8.0.orig/paps-0.6.8/src/libpaps.c paps-0.8.0/paps-0.6.8/src/libpaps.c
--- paps-0.8.0.orig/paps-0.6.8/src/libpaps.c 2023-04-13 11:56:29.581277739 +0200
+++ paps-0.8.0/paps-0.6.8/src/libpaps.c 2023-04-13 12:07:17.504779917 +0200
@@ -23,6 +23,7 @@
#include "libpaps.h"
+#include <glib/gprintf.h>
#include <pango/pango.h>
#include <pango/pangoft2.h>
#include <ft2build.h>

View File

@ -1,6 +1,6 @@
Name: paps
Version: 0.8.0
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPL-2.0-or-later
URL: https://github.com/dov/paps
@ -43,6 +43,7 @@ Patch59: %{name}-ft-header.patch
Patch60: %{name}-a3.patch
## rhbz#1214939
Patch61: %{name}-fix-paper-size-truncate.patch
Patch62: paps-c99.patch
### For paps
Patch100: %{name}-fix-src-to-paps.patch
Patch101: %{name}-fix-build.patch
@ -86,6 +87,7 @@ pushd %{name}-0.6.8
%patch59 -p1 -b .ft-header
%patch60 -p1 -b .a3
%patch61 -p1 -b .paper-size
%patch62 -p2 -b .configure-c99
libtoolize -f -c
autoreconf -f -i
popd
@ -144,6 +146,9 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="/usr/bin/install -p"
%changelog
* Thu Apr 13 2023 Florian Weimer <fweimer@redhat.com> - 0.8.0-2
- C99 compatibility fixes for paps 0.6.8
* Wed Mar 1 2023 Akira TAGOH <tagoh@redhat.com> - 0.8.0-1
- New upstream release.
Resolves: rhbz#2168726