pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

started working on upgrading cups-filters



Module Name:	pkgsrc-wip
Committed By:	Kevin Bloom <kevin.bloom%posteo.net@localhost>
Pushed By:	nuclearkev
Date:		Fri Apr 12 13:07:10 2024 -0400
Changeset:	d168e6308e48e69ddc83789ed8d409366af58c11

Added Files:
	cups-filters/DESCR
	cups-filters/Makefile
	cups-filters/PLIST
	cups-filters/buildlink3.mk
	cups-filters/distinfo
	cups-filters/files/cups-browsed-daemonize.sh
	cups-filters/files/cups-browsed.sh
	cups-filters/opatches/patch-Makefile.in
	cups-filters/opatches/patch-filter_gstoraster.c
	cups-filters/opatches/patch-filter_mupdftoraster.c
	cups-filters/opatches/patch-fontembed_test__pdf.c
	cups-filters/opatches/patch-fontembed_test__ps.c
	cups-filters/opatches/patch-utils_cups-browsed.c
	cups-filters/options.mk
	libcupsfilters/DESCR
	libcupsfilters/Makefile
	libcupsfilters/PLIST
	libcupsfilters/buildlink3.mk
	libcupsfilters/distinfo
	libcupsfilters/options.mk
	libcupsfilters/patches/patch-cupsfilters_filter.c
	libcupsfilters/patches/patch-cupsfilters_ghostscript.c
	libppd/DESCR
	libppd/Makefile
	libppd/PLIST
	libppd/buildlink3.mk
	libppd/distinfo

Log Message:
started working on upgrading cups-filters

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d168e6308e48e69ddc83789ed8d409366af58c11

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 cups-filters/DESCR                                 |  19 ++++
 cups-filters/Makefile                              | 106 +++++++++++++++++++++
 cups-filters/PLIST                                 |  63 ++++++++++++
 cups-filters/buildlink3.mk                         |  15 +++
 cups-filters/distinfo                              |  11 +++
 cups-filters/files/cups-browsed-daemonize.sh       |   4 +
 cups-filters/files/cups-browsed.sh                 |  28 ++++++
 cups-filters/opatches/patch-Makefile.in            |  16 ++++
 cups-filters/opatches/patch-filter_gstoraster.c    |  16 ++++
 cups-filters/opatches/patch-filter_mupdftoraster.c |  16 ++++
 cups-filters/opatches/patch-fontembed_test__pdf.c  |  24 +++++
 cups-filters/opatches/patch-fontembed_test__ps.c   |  26 +++++
 cups-filters/opatches/patch-utils_cups-browsed.c   |  15 +++
 cups-filters/options.mk                            |  27 ++++++
 libcupsfilters/DESCR                               |  23 +++++
 libcupsfilters/Makefile                            |  38 ++++++++
 libcupsfilters/PLIST                               |  49 ++++++++++
 libcupsfilters/buildlink3.mk                       |  33 +++++++
 libcupsfilters/distinfo                            |   7 ++
 libcupsfilters/options.mk                          |  17 ++++
 libcupsfilters/patches/patch-cupsfilters_filter.c  |  12 +++
 .../patches/patch-cupsfilters_ghostscript.c        |  13 +++
 libppd/DESCR                                       |  23 +++++
 libppd/Makefile                                    |  22 +++++
 libppd/PLIST                                       |  24 +++++
 libppd/buildlink3.mk                               |  18 ++++
 libppd/distinfo                                    |   5 +
 27 files changed, 670 insertions(+)

diffs:
diff --git a/cups-filters/DESCR b/cups-filters/DESCR
new file mode 100644
index 0000000000..9f11f8d35c
--- /dev/null
+++ b/cups-filters/DESCR
@@ -0,0 +1,19 @@
+CUPS is a standards-based, open source printing system developed
+by Apple Inc. for Mac OS X and other UNIX-like operating systems.
+CUPS uses the Internet Printing Protocol ("IPP") and provides System
+V and Berkeley command-line interfaces, a web interface, and a C
+API to manage printers and print jobs.
+
+This distribution contains backends, filters, and other software
+that was once part of the core CUPS distribution but is no longer
+maintained by Apple Inc. In addition it contains additional filters
+and software developed independently of Apple, especially filters
+for the PDF-centric printing workflow introduced by OpenPrinting
+and a daemon to browse Bonjour broadcasts of remote CUPS printers
+and makes these printers available locally.
+
+From CUPS 1.6.0 on, this package is required for using printer
+drivers with CUPS under Linux. With CUPS 1.5.x and earlier this
+package can be used optionally to switch over to PDF-based printing.
+In that case some filters are provided by both CUPS and this package.
+Then the filters of this package should be used.
diff --git a/cups-filters/Makefile b/cups-filters/Makefile
new file mode 100644
index 0000000000..e6b7b98c53
--- /dev/null
+++ b/cups-filters/Makefile
@@ -0,0 +1,106 @@
+# $NetBSD: Makefile,v 1.184 2024/04/07 07:34:51 wiz Exp $
+
+DISTNAME=	cups-filters-2.0.0
+CATEGORIES=	print
+MASTER_SITES=	${MASTER_SITE_GITHUB:=OpenPrinting/}
+GITHUB_PROJECT=	cups-filters
+GITHUB_RELEASE=	2.0.0
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://wiki.linuxfoundation.org/openprinting/cups-filters
+COMMENT=	Backends, filters, and other software for cups
+LICENSE=	gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND mit
+
+# https://github.com/OpenPrinting/cups-filters/issues/411
+DEPENDS+=	dejavu-ttf-[0-9]*:../../fonts/dejavu-ttf
+DEPENDS+=	poppler-utils-[0-9]*:../../print/poppler-utils
+
+# qpdf's include/qpdf/QPDF.hh uses std::string_view
+USE_LANGUAGES=		c c++17
+USE_LIBTOOL=		yes
+USE_TOOLS+=		bash:run pkg-config gmake gdbus-codegen
+GNU_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=	--disable-braille
+CONFIGURE_ARGS+=	--disable-ldap
+CONFIGURE_ARGS+=	--disable-mutool
+CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
+CONFIGURE_ARGS+=	--with-apple-raster-filter=rastertopdf
+CONFIGURE_ARGS+=	--with-gs-path=${PREFIX}/bin/gs
+CONFIGURE_ARGS+=	--with-pdftops-path=${PREFIX}/bin/pdftops
+CONFIGURE_ARGS+=	--with-shell=${TOOLS_PATH.bash}
+CONFIGURE_ARGS+=	--with-test_font_path=${PREFIX}/share/fonts/X11/TTF/DejaVuSans.ttf
+
+LDFLAGS.SunOS+=		-lresolv
+
+#PKGCONFIG_OVERRIDE+=	libcupsfilters.pc.in
+PKGCONFIG_OVERRIDE+=	libfontembed.pc.in
+
+CONFLICTS+=	cups<1.6
+
+#REPLACE_BASH+=	filter/braille/drivers/generic/brftoembosser.in
+#REPLACE_BASH+=	filter/braille/drivers/index/imageubrltoindexv3.in
+#REPLACE_BASH+=	filter/braille/drivers/index/imageubrltoindexv4.in
+#REPLACE_BASH+=	filter/braille/drivers/index/textbrftoindexv3.in
+#REPLACE_BASH+=	filter/braille/filters/brftopagedbrf.in
+#REPLACE_BASH+=	filter/braille/filters/imagetobrf.in
+#REPLACE_BASH+=	filter/braille/filters/texttobrf.in
+REPLACE_BASH+=	configure
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Darwin"
+CFLAGS+=	-framework IOKit
+.endif
+
+CPPFLAGS.SunOS+=	-D_POSIX_PTHREAD_SEMANTICS
+
+BUILD_DEFS+=		VARBASE
+
+RCD_SCRIPTS=		cups-browsed
+#CONF_FILES+=		${PREFIX}/share/examples/cups-filters/cups-browsed.conf ${PKG_SYSCONFDIR}/cups/cups-browsed.conf
+
+TEST_TARGET=		check
+
+post-extract:
+	${CP} ${FILESDIR}/cups-browsed-daemonize.sh ${WRKSRC}
+
+SUBST_CLASSES+=			daemonize
+SUBST_STAGE.daemonize=		pre-configure
+SUBST_MESSAGE.daemonize=	Customizing daemonizing script
+SUBST_FILES.daemonize=		cups-browsed-daemonize.sh
+SUBST_VARS.daemonize=		PREFIX VARBASE
+
+INSTALLATION_DIRS+=		share/examples/cups-filters
+
+post-install:
+#	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/cups/cups-browsed.conf \
+#		${DESTDIR}${PREFIX}/share/examples/cups-filters/cups-browsed.conf
+	# backends that need root access should not have world read and execute permissions
+	${CHMOD} go-rwx ${DESTDIR}${PREFIX}/libexec/cups/backend/parallel
+	${CHMOD} go-rwx ${DESTDIR}${PREFIX}/libexec/cups/backend/serial
+	${INSTALL_SCRIPT} ${WRKSRC}/cups-browsed-daemonize.sh ${DESTDIR}${PREFIX}/libexec/cups-browsed
+
+.include "options.mk"
+
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/fontconfig/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/lcms2/buildlink3.mk"
+.include "../../graphics/libexif/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../print/cups-base/buildlink3.mk"
+.include "../../wip/libcupsfilters/buildlink3.mk"
+.include "../../wip/libppd/buildlink3.mk"
+.include "../../print/ghostscript/buildlink3.mk"
+.include "../../print/ijs/buildlink3.mk"
+.include "../../print/poppler-cpp/buildlink3.mk"
+BUILDLINK_API_DEPENDS.poppler+=	poppler>=23.12.0
+.include "../../print/poppler/buildlink3.mk"
+.include "../../print/poppler-includes/buildlink3.mk"
+.include "../../print/qpdf/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/atomic64.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/cups-filters/PLIST b/cups-filters/PLIST
new file mode 100644
index 0000000000..1362c08636
--- /dev/null
+++ b/cups-filters/PLIST
@@ -0,0 +1,63 @@
+@comment $NetBSD$
+bin/driverless
+bin/driverless-fax
+bin/foomatic-rip
+libexec/cups-browsed
+libexec/cups/backend/beh
+libexec/cups/backend/driverless
+libexec/cups/backend/driverless-fax
+libexec/cups/backend/parallel
+libexec/cups/backend/serial
+libexec/cups/driver/driverless
+libexec/cups/driver/driverless-fax
+libexec/cups/filter/bannertopdf
+libexec/cups/filter/commandtoescpx
+libexec/cups/filter/commandtopclx
+libexec/cups/filter/foomatic-rip
+libexec/cups/filter/gstopdf
+libexec/cups/filter/gstopxl
+libexec/cups/filter/gstoraster
+libexec/cups/filter/imagetopdf
+libexec/cups/filter/imagetops
+libexec/cups/filter/imagetoraster
+libexec/cups/filter/pclmtoraster
+libexec/cups/filter/pdftopdf
+libexec/cups/filter/pdftops
+libexec/cups/filter/pdftoraster
+libexec/cups/filter/pwgtopclm
+libexec/cups/filter/pwgtopdf
+libexec/cups/filter/pwgtoraster
+libexec/cups/filter/rastertoescpx
+libexec/cups/filter/rastertopclx
+libexec/cups/filter/rastertops
+libexec/cups/filter/texttopdf
+libexec/cups/filter/texttops
+libexec/cups/filter/texttotext
+libexec/cups/filter/universal
+man/man1/driverless.1
+man/man1/foomatic-rip.1
+share/cups/drv/cupsfilters.drv
+share/cups/mime/cupsfilters-universal-postscript.convs
+share/cups/mime/cupsfilters-universal.convs
+share/cups/mime/cupsfilters.convs
+share/cups/mime/cupsfilters.types
+share/doc/cups-filters/ABOUT-NLS
+share/doc/cups-filters/AUTHORS
+share/doc/cups-filters/CHANGES-1.x.md
+share/doc/cups-filters/CHANGES.md
+share/doc/cups-filters/CONTRIBUTING.md
+share/doc/cups-filters/COPYING
+share/doc/cups-filters/DEVELOPING.md
+share/doc/cups-filters/INSTALL
+share/doc/cups-filters/LICENSE
+share/doc/cups-filters/NOTICE
+share/doc/cups-filters/README.md
+share/ppd/cupsfilters/Fuji_Xerox-DocuPrint_CM305_df-PDF.ppd
+share/ppd/cupsfilters/Generic-PDF_Printer-PDF.ppd
+share/ppd/cupsfilters/HP-Color_LaserJet_CM3530_MFP-PDF.ppd
+share/ppd/cupsfilters/Ricoh-PDF_Printer-PDF.ppd
+share/ppd/cupsfilters/pxlcolor.ppd
+share/ppd/cupsfilters/pxlmono.ppd
+share/ppdc/escp.h
+share/ppdc/pcl.h
+@pkgdir share/examples/cups-filters
diff --git a/cups-filters/buildlink3.mk b/cups-filters/buildlink3.mk
new file mode 100644
index 0000000000..f983da616f
--- /dev/null
+++ b/cups-filters/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.26 2023/11/08 13:20:40 wiz Exp $
+
+BUILDLINK_TREE+=	cups-filters
+
+.if !defined(CUPS_FILTERS_BUILDLINK3_MK)
+CUPS_FILTERS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.cups-filters+=	cups-filters>=1.8.2
+BUILDLINK_ABI_DEPENDS.cups-filters+=	cups-filters>=1.28.16nb5
+BUILDLINK_PKGSRCDIR.cups-filters?=	../../print/cups-filters
+
+.include "../../print/cups-base/buildlink3.mk"
+.endif # CUPS_FILTERS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-cups-filters
diff --git a/cups-filters/distinfo b/cups-filters/distinfo
new file mode 100644
index 0000000000..e97bed4299
--- /dev/null
+++ b/cups-filters/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.81 2023/05/07 13:16:26 wiz Exp $
+
+BLAKE2s (cups-filters-2.0.0.tar.gz) = 23245732cef9e31219b3954e51f9af2c04a7f98ae0bd4b23a8773bb0a9ccc9bd
+SHA512 (cups-filters-2.0.0.tar.gz) = f91abaedcc34c2ae668478a3133c7559f58f33a84831f60cb9832f5a19762884685c67f63aef59ab42f69e78c1149205296d5f71c251e9f9f3c00a0f5428d979
+Size (cups-filters-2.0.0.tar.gz) = 642362 bytes
+SHA1 (patch-Makefile.in) = 440497f8f2e02c452ce3bfa660ab3ba62ec40de8
+SHA1 (patch-filter_gstoraster.c) = 4eef8d91d8ca26a5a874e29885b836e9670d9e5d
+SHA1 (patch-filter_mupdftoraster.c) = 81a06cbb3be9a7fd3e797a2effa5ef0aecfc2621
+SHA1 (patch-fontembed_test__pdf.c) = 5ffb13a59ed4d860a3ae4355e364059973715290
+SHA1 (patch-fontembed_test__ps.c) = 70f9ab9c8f74ab96abe04cda926a7116386d5f2e
+SHA1 (patch-utils_cups-browsed.c) = 7aca6e830eebe8dde48e23f04b5d3b5a4820b208
diff --git a/cups-filters/files/cups-browsed-daemonize.sh b/cups-filters/files/cups-browsed-daemonize.sh
new file mode 100644
index 0000000000..e711952bf8
--- /dev/null
+++ b/cups-filters/files/cups-browsed-daemonize.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# cups-browsed itself doesn't daemonize
+( cd /; @PREFIX@/sbin/cups-browsed </dev/null >/dev/null 2>&1 & echo $! >@VARBASE@/run/cups-browsed.pid ) &
diff --git a/cups-filters/files/cups-browsed.sh b/cups-filters/files/cups-browsed.sh
new file mode 100644
index 0000000000..ee96dd2485
--- /dev/null
+++ b/cups-filters/files/cups-browsed.sh
@@ -0,0 +1,28 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: cups-browsed.sh,v 1.1 2017/06/22 12:30:25 wiz Exp $
+#
+# PROVIDE: cups-browsed
+# REQUIRE: cups
+
+. /etc/rc.subr
+
+# The program's name is "cups-browsed", but shell varnames can't contain hyphens
+# Also, the program itself doesn't daemonize, use a shell wrapper
+
+name="cups_browsed" # Prefix for various ${name}_XXX variables
+cups_browsed_rcname="cups-browsed" # File name in rc.conf.d
+rcvar="cups_browsed" # Name of YES/NO rc variable
+command=@PREFIX@/libexec/cups-browsed # Daemonizing wrapper
+procname="@PREFIX@/sbin/cups-browsed" # Real command that appears in ps(1) output
+conf_file="@PKG_SYSCONFDIR@/cups/cups-browsed.conf"
+required_files="${conf_file}"
+pidfile=@VARBASE@/run/cups-browsed.pid
+stop_postcmd=cups_browsed_remove_pidfile
+
+cups_browsed_remove_pidfile() {
+	rm -f "${pidfile}"
+}
+
+load_rc_config $cups_browsed_rcname
+run_rc_command $1
diff --git a/cups-filters/opatches/patch-Makefile.in b/cups-filters/opatches/patch-Makefile.in
new file mode 100644
index 0000000000..6336910a5a
--- /dev/null
+++ b/cups-filters/opatches/patch-Makefile.in
@@ -0,0 +1,16 @@
+$NetBSD: patch-Makefile.in,v 1.8 2023/05/07 13:16:26 wiz Exp $
+
+Needs C++17
+https://github.com/OpenPrinting/cups-filters/issues/512
+
+--- Makefile.in.orig	2022-08-24 12:40:10.000000000 +0000
++++ Makefile.in
+@@ -1662,7 +1662,7 @@ pdftopdf_CFLAGS = \
+ 	$(LIBQPDF_CFLAGS) \
+ 	$(CUPS_CFLAGS)
+ 
+-pdftopdf_CXXFLAGS = -std=c++0x $(pdftopdf_CFLAGS)   # -std=c++11
++pdftopdf_CXXFLAGS = $(pdftopdf_CFLAGS)
+ pdftopdf_LDADD = \
+ 	$(LIBQPDF_LIBS) \
+ 	$(CUPS_LIBS)
diff --git a/cups-filters/opatches/patch-filter_gstoraster.c b/cups-filters/opatches/patch-filter_gstoraster.c
new file mode 100644
index 0000000000..1f56d16b16
--- /dev/null
+++ b/cups-filters/opatches/patch-filter_gstoraster.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-filter_gstoraster.c,v 1.2 2018/02/27 17:48:20 leot Exp $
+
+execvpe(3) appeared only on NetBSD 8.0, use execve(3) instead (like
+cups-filters-1.11.4).
+
+--- filter/gstoraster.c.orig	2018-02-07 22:08:42.000000000 +0000
++++ filter/gstoraster.c
+@@ -503,7 +503,7 @@ gs_spawn (const char *filename,
+     }
+ 
+     /* Execute Ghostscript command line ... */
+-    execvpe(filename, gsargv, envp);
++    execve(filename, gsargv, envp);
+     fprintf(stderr, "ERROR: Unable to launch Ghostscript: %s: %s\n", filename, strerror(errno));
+     goto out;
+   }
diff --git a/cups-filters/opatches/patch-filter_mupdftoraster.c b/cups-filters/opatches/patch-filter_mupdftoraster.c
new file mode 100644
index 0000000000..a743d70683
--- /dev/null
+++ b/cups-filters/opatches/patch-filter_mupdftoraster.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-filter_mupdftoraster.c,v 1.2 2019/06/01 17:39:05 leot Exp $
+
+execvpe(3) appeared only on NetBSD 8.0, use execve(3) instead (like
+cups-filters-1.11.4).
+
+--- filter/mupdftoraster.c.orig	2019-05-16 13:02:29.000000000 +0000
++++ filter/mupdftoraster.c
+@@ -202,7 +202,7 @@ mutool_spawn (const char *filename,
+ 
+   if ((pid = fork()) == 0) {
+     /* Execute mutool command line ... */
+-    execvpe(filename, mutoolargv, envp);
++    execve(filename, mutoolargv, envp);
+     perror(filename);
+     goto out;
+   }
diff --git a/cups-filters/opatches/patch-fontembed_test__pdf.c b/cups-filters/opatches/patch-fontembed_test__pdf.c
new file mode 100644
index 0000000000..bbc886825d
--- /dev/null
+++ b/cups-filters/opatches/patch-fontembed_test__pdf.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-fontembed_test__pdf.c,v 1.2 2018/12/05 18:49:39 leot Exp $
+
+`%m' is not supported in printf(3), use strerror(3).
+
+--- fontembed/test_pdf.c.orig	2018-11-23 21:18:49.000000000 +0000
++++ fontembed/test_pdf.c
+@@ -2,14 +2,16 @@
+ #include "config.h"
+ #include "sfnt.h"
+ #include <assert.h>
++#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ 
+ static void example_outfn(const char *buf,int len,void *context) // {{{
+ {
+   FILE *f=(FILE *)context;
+   if (fwrite(buf,1,len,f)!=len) {
+-    fprintf(stderr,"Short write: %m\n");
++    fprintf(stderr,"Short write: %s\n", strerror(errno));
+     assert(0);
+     return;
+   }
diff --git a/cups-filters/opatches/patch-fontembed_test__ps.c b/cups-filters/opatches/patch-fontembed_test__ps.c
new file mode 100644
index 0000000000..605b5da100
--- /dev/null
+++ b/cups-filters/opatches/patch-fontembed_test__ps.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-fontembed_test__ps.c,v 1.2 2018/12/05 18:49:39 leot Exp $
+
+`%m' is not supported in printf(3), use strerror(3).
+
+--- fontembed/test_ps.c.orig	2018-11-23 21:18:49.000000000 +0000
++++ fontembed/test_ps.c
+@@ -2,8 +2,10 @@
+ #include "config.h"
+ #include "sfnt.h"
+ #include <assert.h>
++#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ 
+ const char *emb_otf_get_fontname(OTF_FILE *otf); // TODO
+ 
+@@ -11,7 +13,7 @@ static void example_outfn(const char *bu
+ {
+   FILE *f=(FILE *)context;
+   if (fwrite(buf,1,len,f)!=len) {
+-    fprintf(stderr,"Short write: %m\n");
++    fprintf(stderr,"Short write: %s\n", strerror(errno));
+     assert(0);
+     return;
+   }
diff --git a/cups-filters/opatches/patch-utils_cups-browsed.c b/cups-filters/opatches/patch-utils_cups-browsed.c
new file mode 100644
index 0000000000..6f04047956
--- /dev/null
+++ b/cups-filters/opatches/patch-utils_cups-browsed.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-utils_cups-browsed.c,v 1.7 2022/09/18 14:41:07 he Exp $
+
+Fix a rather obvious bug, should pass length of allocation...
+
+--- utils/cups-browsed.c.orig	2022-04-11 19:56:40.000000000 +0000
++++ utils/cups-browsed.c
+@@ -10242,7 +10242,7 @@ static void resolve_callback(AvahiServic
+ 		   address->proto == AVAHI_PROTO_INET6 &&
+ 		   interface != AVAHI_IF_UNSPEC &&
+ 		   IPBasedDeviceURIs != IP_BASED_URIS_IPV4_ONLY) {
+-	  strncpy(addrstr, "[v1.", sizeof(addrstr) - 1);
++	  strncpy(addrstr, "[v1.", 255); /* size of allocation - 1 for null */
+ 	  avahi_address_snprint(addrstr + 4, 256 - 6, address);
+ 	  addrlen = strlen(addrstr + 4);
+ 	  addr->sa_family = AF_INET6;
diff --git a/cups-filters/options.mk b/cups-filters/options.mk
new file mode 100644
index 0000000000..af309e7fe3
--- /dev/null
+++ b/cups-filters/options.mk
@@ -0,0 +1,27 @@
+# $NetBSD: options.mk,v 1.1 2017/12/17 21:16:07 leot Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.cups-filters
+PKG_SUPPORTED_OPTIONS=	avahi dbus
+PKG_SUGGESTED_OPTIONS=	avahi dbus
+
+.include "../../mk/bsd.options.mk"
+
+#
+# Avahi support
+#
+.if !empty(PKG_OPTIONS:Mavahi)
+.include "../../net/avahi/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-avahi
+.else
+CONFIGURE_ARGS+=	--disable-avahi
+.endif
+
+#
+# DBus support
+#
+.if !empty(PKG_OPTIONS:Mdbus)
+.include "../../sysutils/dbus/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-dbus
+.else
+CONFIGURE_ARGS+=	--disable-dbus
+.endif
diff --git a/libcupsfilters/DESCR b/libcupsfilters/DESCR
new file mode 100644
index 0000000000..2f251d9052
--- /dev/null
+++ b/libcupsfilters/DESCR
@@ -0,0 +1,23 @@
+TODO: Adjust the following lines from README.md
+
+# OpenPrinting libcupsfilters v2.0.0 - 2023-09-22
+
+Looking for compile instructions? Read the file "INSTALL"
+instead...
+
+
+## INTRODUCTION
+
+CUPS is a standards-based, open-source printing system used by Apple's
+Mac OS® and other UNIX®-like operating systems, especially also
+Linux. CUPS uses the Internet Printing Protocol ("IPP") and provides
+System V and Berkeley command-line interfaces, a web interface, and a
+C API to manage printers and print jobs.
+
+CUPS 1.0 was released in early 2000 and since then and until CUPS 2.x
+(at least) conversion of the data format of incoming print jobs to the
+format the printer needs was done by external filter executables, each
+taking an input format on stdin and producing an output format on
+stdout. Depending on conversion needs one or more of them were run in
+a chain.
+...
diff --git a/libcupsfilters/Makefile b/libcupsfilters/Makefile
new file mode 100644
index 0000000000..b91e4eaf3e
--- /dev/null
+++ b/libcupsfilters/Makefile
@@ -0,0 +1,38 @@
+# $NetBSD$
+
+GITHUB_PROJECT=	libcupsfilters
+DISTNAME=	libcupsfilters-2.0.0
+CATEGORIES=	print
+MASTER_SITES=	${MASTER_SITE_GITHUB:=OpenPrinting/}
+GITHUB_RELEASE=	2.0.0
+
+MAINTAINER=	INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/OpenPrinting/libcupsfilters/
+COMMENT=	TODO: Short description of the package
+#LICENSE=	# TODO: (see mk/license.mk)
+
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+USE_TOOLS+=	pkg-config
+USE_LANGUAGES=	c c++
+
+CONFLICTS=        cups-filters<2.0.0
+
+PKGCONFIG_OVERRIDE+=	libcupsfilters.pc.in
+
+.include "options.mk"
+
+.include "../../fonts/fontconfig/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/lcms2/buildlink3.mk"
+.include "../../graphics/libexif/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../print/libcups/buildlink3.mk"
+.include "../../print/poppler-cpp/buildlink3.mk"
+#BUILDLINK_API_DEPENDS.poppler+=	poppler>=23.12.0
+.include "../../print/poppler/buildlink3.mk"
+.include "../../print/poppler-includes/buildlink3.mk"
+.include "../../print/qpdf/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libcupsfilters/PLIST b/libcupsfilters/PLIST
new file mode 100644
index 0000000000..ac4d783bea
--- /dev/null
+++ b/libcupsfilters/PLIST
@@ -0,0 +1,49 @@
+@comment $NetBSD$
+include/cupsfilters/bitmap.h
+include/cupsfilters/catalog.h
+include/cupsfilters/colord.h
+include/cupsfilters/colormanager.h
+include/cupsfilters/driver.h
+include/cupsfilters/filter.h
+include/cupsfilters/ieee1284.h
+include/cupsfilters/image.h
+include/cupsfilters/ipp.h
+include/cupsfilters/log.h
+include/cupsfilters/pdf.h
+include/cupsfilters/raster.h
+lib/libcupsfilters.la
+lib/pkgconfig/libcupsfilters.pc
+share/cups/banners/classified
+share/cups/banners/confidential
+share/cups/banners/form
+share/cups/banners/secret
+share/cups/banners/standard
+share/cups/banners/topsecret
+share/cups/banners/unclassified
+share/cups/charsets/pdf.utf-8
+share/cups/charsets/pdf.utf-8.heavy
+share/cups/charsets/pdf.utf-8.simple
+share/cups/data/classified.pdf
+share/cups/data/confidential.pdf
+share/cups/data/default-testpage.pdf
+share/cups/data/default.pdf
+share/cups/data/form_english.pdf
+share/cups/data/form_english_in.odt
+share/cups/data/form_russian.pdf
+share/cups/data/form_russian_in.odt
+share/cups/data/secret.pdf
+share/cups/data/standard.pdf
+share/cups/data/testprint
+share/cups/data/topsecret.pdf
+share/cups/data/unclassified.pdf
+share/doc/libcupsfilters/ABOUT-NLS
+share/doc/libcupsfilters/AUTHORS
+share/doc/libcupsfilters/CHANGES-1.x.md
+share/doc/libcupsfilters/CHANGES.md
+share/doc/libcupsfilters/CONTRIBUTING.md
+share/doc/libcupsfilters/COPYING
+share/doc/libcupsfilters/DEVELOPING.md
+share/doc/libcupsfilters/INSTALL
+share/doc/libcupsfilters/LICENSE
+share/doc/libcupsfilters/NOTICE
+share/doc/libcupsfilters/README.md
diff --git a/libcupsfilters/buildlink3.mk b/libcupsfilters/buildlink3.mk
new file mode 100644
index 0000000000..81d39c55b2
--- /dev/null
+++ b/libcupsfilters/buildlink3.mk
@@ -0,0 +1,33 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libcupsfilters
+
+.if !defined(LIBCUPSFILTERS_BUILDLINK3_MK)
+LIBCUPSFILTERS_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libcupsfilters+=	libcupsfilters>=2.0.0
+BUILDLINK_ABI_DEPENDS.libcupsfilters+=	libcupsfilters>=2.0.0
+BUILDLINK_PKGSRCDIR.libcupsfilters?=	../../wip/libcupsfilters
+
+pkgbase := libcupsfilters
+.include "../../mk/pkg-build-options.mk"
+
+.if ${PKG_BUILD_OPTIONS.libcupsfilters:Mdbus}
+.include "../../sysutils/dbus/buildlink3.mk"
+.endif
+
+.include "../../fonts/fontconfig/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/lcms2/buildlink3.mk"
+.include "../../graphics/libexif/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../graphics/tiff/buildlink3.mk"
+.include "../../print/libcups/buildlink3.mk"
+.include "../../print/poppler-cpp/buildlink3.mk"
+.include "../../print/poppler/buildlink3.mk"
+.include "../../print/poppler-includes/buildlink3.mk"
+.include "../../print/qpdf/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.endif # LIBCUPSFILTERS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libcupsfilters
diff --git a/libcupsfilters/distinfo b/libcupsfilters/distinfo
new file mode 100644
index 0000000000..3cf0eb5a45
--- /dev/null
+++ b/libcupsfilters/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+BLAKE2s (libcupsfilters-2.0.0.tar.gz) = 5ced0d9c4bb881641dd023f565f8a9e8af06f30d103dced4aa7ede2677789b53
+SHA512 (libcupsfilters-2.0.0.tar.gz) = ec0046bd35b593b3c8153fcc85ba0fc3e6dca4f8fcdbbcbd8e0a31dc3e160c1e31d2f3d7951a80adfc5121d00f6ac56129c702bc7a9dc7d9128f5acdfd28a47d
+Size (libcupsfilters-2.0.0.tar.gz) = 1642773 bytes
+SHA1 (patch-cupsfilters_filter.c) = b862412239aea83ec0d1a21a787d1bf6a74c53f2
+SHA1 (patch-cupsfilters_ghostscript.c) = 7a5fd0ffedcea81f8666daf3fb48a417231dfdf0
diff --git a/libcupsfilters/options.mk b/libcupsfilters/options.mk
new file mode 100644
index 0000000000..3467b15bc9
--- /dev/null
+++ b/libcupsfilters/options.mk
@@ -0,0 +1,17 @@
+# $NetBSD $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.libcupsfilters
+PKG_SUPPORTED_OPTIONS=	dbus
+PKG_SUGGESTED_OPTIONS=	dbus
+
+.include "../../mk/bsd.options.mk"
+
+#
+# DBus support
+#
+.if !empty(PKG_OPTIONS:Mdbus)
+.include "../../sysutils/dbus/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-dbus
+.else
+CONFIGURE_ARGS+=	--disable-dbus
+.endif
diff --git a/libcupsfilters/patches/patch-cupsfilters_filter.c b/libcupsfilters/patches/patch-cupsfilters_filter.c
new file mode 100644
index 0000000000..77becc85e3
--- /dev/null
+++ b/libcupsfilters/patches/patch-cupsfilters_filter.c
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- cupsfilters/filter.c.orig	2024-04-12 14:26:34.910553039 +0000
++++ cupsfilters/filter.c
+@@ -19,6 +19,7 @@
+ #include <errno.h>
+ #include <signal.h>
+ #include <sys/wait.h>
++#include <sys/stat.h>
+ #include <cups/file.h>
+ #include <cups/array.h>
+ 
diff --git a/libcupsfilters/patches/patch-cupsfilters_ghostscript.c b/libcupsfilters/patches/patch-cupsfilters_ghostscript.c
new file mode 100644
index 0000000000..bf6047a0b7
--- /dev/null
+++ b/libcupsfilters/patches/patch-cupsfilters_ghostscript.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- cupsfilters/ghostscript.c.orig	2023-09-21 22:21:04.000000000 +0000
++++ cupsfilters/ghostscript.c
+@@ -613,7 +613,7 @@ gs_spawn (const char *filename,
+     }
+ 
+     // Execute Ghostscript command line ...
+-    execvpe(filename, gsargv, envp);
++    execve(filename, gsargv, envp);
+     if (log) log(ld, CF_LOGLEVEL_ERROR,
+ 		 "cfFilterGhostscript: Unable to launch Ghostscript: %s: %s",
+ 		 filename, strerror(errno));
diff --git a/libppd/DESCR b/libppd/DESCR
new file mode 100644
index 0000000000..81814dd38f
--- /dev/null
+++ b/libppd/DESCR
@@ -0,0 +1,23 @@
+TODO: Adjust the following lines from README.md
+
+# OpenPrinting libppd v2.0.0 - 2023-09-22
+
+Looking for compile instructions? Read the file "INSTALL"
+instead...
+
+
+## INTRODUCTION
+
+CUPS is a standards-based, open-source printing system used by Apple's
+Mac OS® and other UNIX®-like operating systems, especially also
+Linux. CUPS uses the Internet Printing Protocol ("IPP") and provides
+System V and Berkeley command-line interfaces, a web interface, and a
+C API to manage printers and print jobs.
+
+CUPS 1.0 was released in early 2000 and since then and until CUPS 2.x
+PPD (PostScript Printer Description) files were used to describe the
+properties, features and user-settable options of printers. The
+development of PPD files (and also PostScript) was stopped by Adobe
+back in 1984, and Michael Sweet, author of CUPS, deprecated PPD files
+already ~10 years ago, seeking for a more modern alternative.
+...
diff --git a/libppd/Makefile b/libppd/Makefile
new file mode 100644
index 0000000000..d1015cfd28
--- /dev/null
+++ b/libppd/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD$
+
+GITHUB_PROJECT=	libppd
+DISTNAME=	libppd-2.0.0
+CATEGORIES=	# TODO: add primary category
+MASTER_SITES=	${MASTER_SITE_GITHUB:=OpenPrinting/}
+GITHUB_RELEASE=	2.0.0
+
+MAINTAINER=	INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/OpenPrinting/libppd/
+COMMENT=	TODO: Short description of the package
+#LICENSE=	# TODO: (see mk/license.mk)
+
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+USE_TOOLS+=	pkg-config
+USE_LANGUAGES=	c c++
+
+PKGCONFIG_OVERRIDE+=	libppd.pc.in
+
+.include "../../wip/libcupsfilters/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libppd/PLIST b/libppd/PLIST
new file mode 100644
index 0000000000..0dcc43395c
--- /dev/null
+++ b/libppd/PLIST
@@ -0,0 +1,24 @@
+@comment $NetBSD$
+include/ppd/ppd-filter.h
+include/ppd/ppd.h
+include/ppd/ppdc.h
+lib/libppd.la
+lib/pkgconfig/libppd.pc
+share/doc/libppd/ABOUT-NLS
+share/doc/libppd/AUTHORS
+share/doc/libppd/CHANGES-1.x.md
+share/doc/libppd/CHANGES.md
+share/doc/libppd/CONTRIBUTING.md
+share/doc/libppd/COPYING
+share/doc/libppd/DEVELOPING.md
+share/doc/libppd/INSTALL
+share/doc/libppd/LICENSE
+share/doc/libppd/NOTICE
+share/doc/libppd/README.md
+share/ppdc/epson.h
+share/ppdc/font.defs
+share/ppdc/hp.h
+share/ppdc/label.h
+share/ppdc/media.defs
+share/ppdc/raster.defs
+@pkgdir bin
diff --git a/libppd/buildlink3.mk b/libppd/buildlink3.mk
new file mode 100644
index 0000000000..91652180a8
--- /dev/null
+++ b/libppd/buildlink3.mk
@@ -0,0 +1,18 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libppd
+
+.if !defined(LIBPPD_BUILDLINK3_MK)
+LIBPPD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libppd+=	libppd>=2.0.0
+BUILDLINK_ABI_DEPENDS.libppd+=	libppd>=2.0.0
+BUILDLINK_PKGSRCDIR.libppd?=	../../wip/libppd
+
+pkgbase := libppd
+.include "../../mk/pkg-build-options.mk"
+
+.include "../../wip/libcupsfilters/buildlink3.mk"
+.endif # LIBPPD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libppd
diff --git a/libppd/distinfo b/libppd/distinfo
new file mode 100644
index 0000000000..b50fa34c8f
--- /dev/null
+++ b/libppd/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+BLAKE2s (libppd-2.0.0.tar.gz) = b1f1f36e710750a099912db5a173d8462c62eb72623a88afb87b4c56a32ee447
+SHA512 (libppd-2.0.0.tar.gz) = 9eff31bcb7088f9957b1bb7933619316d66c2f0fbbc1656afc654ba067aab47f2187a15fd6d99a8037edb553bc73d2abf4d4e07fd781e040bdebbc5f0d103f99
+Size (libppd-2.0.0.tar.gz) = 844183 bytes


Home | Main Index | Thread Index | Old Index