From 9754528d5f9c571efefb5ceea2068d1f3a4091b0 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Thu, 1 Jan 2026 20:31:37 +0800 Subject: [PATCH 1/2] foomatic-filters: fix build with gcc15 --- .../fix-incompatible-pointer-types.patch | 25 +++++++++++++++++++ pkgs/by-name/fo/foomatic-filters/package.nix | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/by-name/fo/foomatic-filters/fix-incompatible-pointer-types.patch diff --git a/pkgs/by-name/fo/foomatic-filters/fix-incompatible-pointer-types.patch b/pkgs/by-name/fo/foomatic-filters/fix-incompatible-pointer-types.patch new file mode 100644 index 000000000000..04c181c6d5ad --- /dev/null +++ b/pkgs/by-name/fo/foomatic-filters/fix-incompatible-pointer-types.patch @@ -0,0 +1,25 @@ +From 822bf358b1e47704365feb84cac8a0af08611ea5 Mon Sep 17 00:00:00 2001 +From: Moraxyc +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 + #include + +-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 + diff --git a/pkgs/by-name/fo/foomatic-filters/package.nix b/pkgs/by-name/fo/foomatic-filters/package.nix index 5f69ec334aa2..0ba0eb13fa3c 100644 --- a/pkgs/by-name/fo/foomatic-filters/package.nix +++ b/pkgs/by-name/fo/foomatic-filters/package.nix @@ -33,6 +33,9 @@ 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 = '' From 6cee19c60923946c63ddda98aa14742d32e5b843 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Thu, 1 Jan 2026 20:35:45 +0800 Subject: [PATCH 2/2] foomatic-filters: modernize --- pkgs/by-name/fo/foomatic-filters/package.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/fo/foomatic-filters/package.nix b/pkgs/by-name/fo/foomatic-filters/package.nix index 0ba0eb13fa3c..3a3eca5773a0 100644 --- a/pkgs/by-name/fo/foomatic-filters/package.nix +++ b/pkgs/by-name/fo/foomatic-filters/package.nix @@ -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 ]; @@ -39,7 +40,8 @@ stdenv.mkDerivation rec { ]; 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 @@ -55,6 +57,9 @@ stdenv.mkDerivation rec { "CUPS_BACKENDS=$(out)/lib/cups/backend" ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + meta = { description = "Foomatic printing filters"; mainProgram = "foomatic-rip"; @@ -62,4 +67,4 @@ stdenv.mkDerivation rec { platforms = lib.platforms.linux; license = lib.licenses.gpl2Plus; }; -} +})