pkgsrc-Users archive

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

Re: changing the default ghostscript type



Rhialto <rhialto%falu.nl@localhost> writes:

> It was also a while ago that I looked at it in detail, so I had a quick
> look again just now, and I found this sequence of "events":

Thanks - that's really helpful.

> /usr/pkg/share/cups/mime/cupsfilters-ghostscript.convs contains
>
> application/postscript          application/pdf     0 gstopdf
>
> so gstopdf gets run to convert postscript to pdf.
>
> /usr/pkg/libexec/cups/filter/gstopdf calls $CUPS_SERVERBIN/filter/gstoraster

and all of is that is in cups-filters, as I see it.  Dob you

> (Other entries in cupsfilters-ghostscript.convs may call gstoraster
> directly; I'm not sure anymore which, if any, application/vnd.cups*
> types are used as intermediates)
>
> /usr/pkg/libexec/cups/filter/gstoraster is a binary which contains
> strings like "-sDEVICE=cups"
>
> and that device is not compiled into ghostscript by default.

True, and there is no cups option in -agpl.

> Ghostscript-gpl also supplies such an executable that isn't identical
> but it seemed similar enough in functionality.

Right now I believe that ghostscript-agpl should have a cups option,
which adds the cups output driver.   This is my working diff that I'm
cleaning up and will commit later today.  It results in "gs -h" showing
the cups driver (and no PLIST changes).

There is a separate issue about what should be default.  Really someone
should split cups-base into cups-libs that just installs enough to build
the ghostscript-agpl and other such programs' cups option, and no
binaries, so that it being installed does not change behavior.  Then we
could enable cups options by defaults at the cost of a library build, as
long as programs behave ok and not that different if there is not an
actual cups setup.  Right now I just want to fix it so that people that
turn on the cups option get good cups support (without imposting any
cups pain on the cups haters!).


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/print/ghostscript-agpl/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile	5 Sep 2018 13:19:40 -0000	1.34
+++ Makefile	17 Mar 2019 15:28:40 -0000
@@ -22,7 +22,6 @@ USE_LANGUAGES=		c c++
 USE_TOOLS+=		gmake perl:run lex pkg-config
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--with-system-libtiff
-CONFIGURE_ARGS+=	--disable-cups
 CONFIGURE_ENV+=		LPLIBDIR=${PREFIX}/lib
 CONFIGURE_ENV.HPUX+=	ac_cv_func_fopen64=no
 UNLIMIT_RESOURCES+=	datasize	# gsromfs1.c
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/print/ghostscript-agpl/options.mk,v
retrieving revision 1.3
diff -u -p -r1.3 options.mk
--- options.mk	27 Dec 2013 16:42:46 -0000	1.3
+++ options.mk	17 Mar 2019 15:28:40 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.3 2013/12/27 16:42:46 gdt Exp $
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.ghostscript
-PKG_SUPPORTED_OPTIONS=	x11 debug fontconfig disable-compile-inits
+PKG_SUPPORTED_OPTIONS=	x11 cups debug fontconfig disable-compile-inits
 PKG_SUGGESTED_OPTIONS=	x11 fontconfig
 
 .include "../../mk/bsd.options.mk"
@@ -19,6 +19,33 @@ CONFIGURE_ARGS+=	--with-x
 CONFIGURE_ARGS+=	--without-x
 .endif
 
+PLIST_VARS+=		cups
+.if !empty(PKG_OPTIONS:Mcups)
+CONFIGURE_ARGS+=	--enable-cups
+PLIST.cups=		yes
+
+# \todo Remove or explain why
+#BUILD_TARGET+=		cups
+#INSTALL_TARGET+=	install-cups
+
+# \todo Verify that this is in cups-filters
+#CUPS_CONFDIR?=	${PKG_SYSCONFBASEDIR}/cups
+#CUPS_EGDIR=	${PREFIX}/share/examples/cups
+#CONF_FILES+=	${CUPS_EGDIR}/gstoraster.convs ${CUPS_CONFDIR}/gstoraster.convs
+
+SUBST_CLASSES+=		cupsetc
+SUBST_STAGE.cupsetc=	post-extract
+SUBST_MESSAGE.cupsetc=	Fixing CUPS etc directory path to install as example
+SUBST_FILES.cupsetc=	cups/cups.mak
+SUBST_SED.cupsetc=	-e 's|$$(CUPSSERVERROOT)|${CUPS_EGDIR}|g'
+
+.include "../../print/cups-base/buildlink3.mk"
+# \todo Check if this is needed.
+.include "../../mk/jpeg.buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-cups
+.endif
+
 .if !empty(PKG_OPTIONS:Mdebug)
 CONFIGURE_ARGS+=	--enable-debug
 .endif


Home | Main Index | Thread Index | Old Index