foomatic-filters: fix build with gcc15; modernize (#475888)

This commit is contained in:
Sizhe Zhao
2026-01-01 13:05:27 +00:00
committed by GitHub
2 changed files with 38 additions and 5 deletions

View File

@@ -0,0 +1,25 @@
From 822bf358b1e47704365feb84cac8a0af08611ea5 Mon Sep 17 00:00:00 2001
From: Moraxyc <i@qaq.li>
Date: Thu, 1 Jan 2026 20:28:52 +0800
Subject: [PATCH] fix incompatible pointer types
---
process.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/process.h b/process.h
index b95dcb4..58aa8bf 100644
--- a/process.h
+++ b/process.h
@@ -28,7 +28,7 @@
#include <sys/types.h>
#include <sys/wait.h>
-pid_t start_process(const char *name, int (*proc_func)(), void *user_arg, FILE **fdin, FILE **fdout);
+pid_t start_process(const char *name, int (*proc_func)(FILE *, FILE *, void *), void *user_arg, FILE **fdin, FILE **fdout);
pid_t start_system_process(const char *name, const char *command, FILE **fdin, FILE **fdout);
/* returns command's return status (see waitpid(2)) */
--
2.51.2

View File

@@ -8,15 +8,16 @@
cups,
dbus,
enscript,
versionCheckHook,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "foomatic-filters";
version = "4.0.17";
src = fetchurl {
url = "https://www.openprinting.org/download/foomatic/foomatic-filters-${version}.tar.gz";
sha256 = "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2";
url = "https://www.openprinting.org/download/foomatic/foomatic-filters-${finalAttrs.version}.tar.gz";
hash = "sha256-ouLlPlAlceiO65AQxFoNVGcfFXB+4QT1ycIrWep6M+M=";
};
nativeBuildInputs = [ pkg-config ];
@@ -33,10 +34,14 @@ stdenv.mkDerivation rec {
url = "https://salsa.debian.org/debian/foomatic-filters/raw/a3abbef2d2f8c7e62d2fe64f64afe294563fdf8f/debian/patches/0500-r7406_also_consider_the_back_tick_as_an_illegal_shell_escape_character.patch";
sha256 = "055nwi3sjf578nk40bqsch3wx8m2h65hdih0wmxflb6l0hwkq4p4";
})
# Fix build with gcc15
# process.h:31:45: note: expected 'int (*)(void)' but argument is of type 'int (*)(FILE *, FILE *, void *)'
./fix-incompatible-pointer-types.patch
];
preConfigure = ''
substituteInPlace foomaticrip.c --replace /bin/bash ${stdenv.shell}
substituteInPlace foomaticrip.c \
--replace-fail /bin/bash ${stdenv.shell}
'';
# Workaround build failure on -fno-common toolchains like upstream
@@ -52,6 +57,9 @@ stdenv.mkDerivation rec {
"CUPS_BACKENDS=$(out)/lib/cups/backend"
];
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
description = "Foomatic printing filters";
mainProgram = "foomatic-rip";
@@ -59,4 +67,4 @@ stdenv.mkDerivation rec {
platforms = lib.platforms.linux;
license = lib.licenses.gpl2Plus;
};
}
})