From e91fb64abf3757864689a5a952ac1c3275d9e170 Mon Sep 17 00:00:00 2001 From: kili Date: Mon, 19 Jan 2009 12:46:22 +0000 Subject: [PATCH] Build, install and use libgs in all flavors on shared archs. Note: there is currently no libgs (not even a libgs.a) on static archs. Install only *one* binary (bin/gs), even in the gtk flavor; the gsc binary in the gtk flavor was identically to gsx, with the exception that the display driver (which is the sole purpose of the gtk flavor) didn't work in gsc. ok ajacoutot@ --- print/ghostscript/gnu/Makefile | 43 +++++++++++++------ .../gnu/patches/patch-src_unix-dll_mak | 26 ++++++++--- print/ghostscript/gnu/pkg/DESCR | 2 +- .../gnu/pkg/{PFRAG.gtk => PFRAG.shared} | 4 +- print/ghostscript/gnu/pkg/PLIST | 4 +- 5 files changed, 54 insertions(+), 25 deletions(-) rename print/ghostscript/gnu/pkg/{PFRAG.gtk => PFRAG.shared} (60%) diff --git a/print/ghostscript/gnu/Makefile b/print/ghostscript/gnu/Makefile index 93cf36dc963..d33bd8a21a5 100644 --- a/print/ghostscript/gnu/Makefile +++ b/print/ghostscript/gnu/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.62 2008/12/23 10:55:30 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.63 2009/01/19 12:46:22 kili Exp $ COMMENT= GNU PostScript interpreter VERSION= 8.63 DISTNAME= ghostscript-${VERSION} -PKGNAME= ${DISTNAME}p2 +PKGNAME= ${DISTNAME}p3 CATEGORIES= print lang SHARED_LIBS= gs 11.0 @@ -73,9 +73,12 @@ MAKE_FLAGS= BINDIR=./obj \ SHARE_ZLIB=1 \ SOBINRELDIR=../obj \ SOOBJRELDIR=../obj \ + SOC_CFLAGS="${SOC_CFLAGS}" \ + SOC_LIBS="${SOC_LIBS}" \ STDLIBS='-pthread -lm -liconv' \ SYNC=posync \ TRUE_PREFIX='${LOCALBASE}' \ + USE_GTK=${USE_GTK} \ XLDFLAGS=-L${LOCALBASE}/lib \ prefix='${PREFIX}' @@ -90,6 +93,15 @@ CONFIGURE_ENV= AWK=/usr/bin/awk \ LDFLAGS='${LDFLAGS} -L${LOCALBASE}/lib' \ LIBS=-ljpeg +# Hack to let ALL_TARGET etc. depend on the value of NO_SHARED_LIBS, +# which is available only after the inclusion of bsd.port.mk. +ALL_TARGET_NON_SHARED-No = so +ALL_TARGET_NON_SHARED-Yes = all +INSTALL_TARGET_NON_SHARED-No = install install-so +INSTALL_TARGET_NON_SHARED-Yes = install + +SOC_LIBS = -L${LOCALBASE}/lib -ljpeg -pthread + .if ${FLAVOR:L:Ma4} CFLAGS+= -DA4 .endif @@ -101,20 +113,22 @@ LIB_DEPENDS+= gdk-x11-2.0.>=1000,gdk_pixbuf-2.0.>=1000,gtk-x11-2.0.>=1000::x11/g MODULES+= devel/gettext WANTLIB+= Xcomposite Xcursor Xdamage Xau Xdmcp Xfixes Xi Xinerama \ Xrandr Xrender atk-1.0 cairo expat fontconfig freetype \ - glib-2.0 glitz gmodule-2.0 gobject-2.0 pango-1.0 \ + gio-2.0 glib-2.0 glitz gmodule-2.0 gobject-2.0 pango-1.0 \ pangocairo-1.0 pangoft2-1.0 pixman-1 -MAKE_FLAGS+= SOC_CFLAGS="$$(pkg-config gtk+-2.0 --cflags)" \ - SOC_LIBS="$$(pkg-config gtk+-2.0 --libs) -pthread" -ALL_TARGET= so -INSTALL_TARGET= install install-so NOT_FOR_ARCHS= ${NO_SHARED_ARCHS} DEVICES+= ${GTK_DEVICES} +SOC_CFLAGS= $$(pkg-config gtk+-2.0 --cflags) +SOC_LIBS+= $$(pkg-config gtk+-2.0 --libs) +USE_GTK= Yes +.else +USE_GTK= No .endif .if !${FLAVOR:L:Mno_x11} USE_X11= Yes WANTLIB+= X11 Xt Xext DEVICES+= ${X11_DEVICES} +SOC_LIBS+= -L${X11BASE}/lib -lXt -lXt -lXext .endif NO_REGRESS= Yes @@ -139,13 +153,13 @@ STRIP= : .endif post-install: -.if ${FLAVOR:L:Mgtk} - ${STRIP} ${PREFIX}/bin/gsc - ${STRIP} ${PREFIX}/bin/gsx - ln -sf gsc ${PREFIX}/bin/gs -.else + if [ -x ${PREFIX}/bin/gsc ]; then \ + mv ${PREFIX}/bin/gsc ${PREFIX}/bin/gs; \ + fi + if [ -x ${PREFIX}/bin/gsx ]; then \ + mv ${PREFIX}/bin/gsx ${PREFIX}/bin/gs; \ + fi ${STRIP} ${PREFIX}/bin/gs -.endif cd ${PREFIX}/man/man1 && \ ln -sf ps2ps.1 eps2eps.1 && \ ln -sf gslp.1 gsbj.1 && \ @@ -279,3 +293,6 @@ DEVICES+= cups GTK_DEVICES= display .include + +ALL_TARGET = ${ALL_TARGET_NON_SHARED-${NO_SHARED_LIBS}} +INSTALL_TARGET = ${INSTALL_TARGET_NON_SHARED-${NO_SHARED_LIBS}} diff --git a/print/ghostscript/gnu/patches/patch-src_unix-dll_mak b/print/ghostscript/gnu/patches/patch-src_unix-dll_mak index fba73cc3bca..3ffa7351416 100644 --- a/print/ghostscript/gnu/patches/patch-src_unix-dll_mak +++ b/print/ghostscript/gnu/patches/patch-src_unix-dll_mak @@ -1,7 +1,18 @@ -$OpenBSD: patch-src_unix-dll_mak,v 1.6 2008/04/01 20:37:01 kili Exp $ +$OpenBSD: patch-src_unix-dll_mak,v 1.7 2009/01/19 12:46:23 kili Exp $ --- src/unix-dll.mak.orig Tue Nov 27 23:58:40 2007 -+++ src/unix-dll.mak Sat Mar 22 22:28:22 2008 -@@ -47,9 +47,9 @@ GS_SONAME_BASE=lib$(GS) ++++ src/unix-dll.mak Sun Jan 18 13:00:33 2009 +@@ -39,7 +39,9 @@ GSSOC=$(BINDIR)/$(SOBINRELDIR)/$(GSSOC_XENAME) + # loader suporting display device using Gtk+ + GSSOX_XENAME=$(GS)x$(XE) + GSSOX_XE=$(BINDIR)/$(GSSOX_XENAME) +-GSSOX=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME) ++GSSOX-Yes=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME) ++GSSOX-No= ++GSSOX=$(GSSOX-$(USE_GTK)) + + # shared library + GS_SONAME_BASE=lib$(GS) +@@ -47,9 +49,9 @@ GS_SONAME_BASE=lib$(GS) # GNU/Linux GS_SOEXT=so GS_SONAME=$(GS_SONAME_BASE).$(GS_SOEXT) @@ -14,7 +25,7 @@ $OpenBSD: patch-src_unix-dll_mak,v 1.6 2008/04/01 20:37:01 kili Exp $ # MacOS X #GS_SOEXT=dylib -@@ -78,11 +78,12 @@ $(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR) +@@ -78,11 +80,12 @@ $(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR) # Build the small Ghostscript loaders, with Gtk+ and without @@ -31,7 +42,7 @@ $OpenBSD: patch-src_unix-dll_mak,v 1.6 2008/04/01 20:37:01 kili Exp $ -L$(BINDIR) -l$(GS) $(SOC_LIBS) # ------------------------- Recursive make targets ------------------------- # -@@ -100,7 +101,7 @@ SODEFS=LDFLAGS='$(LDFLAGS) $(LDFLAGS_SO)'\ +@@ -100,7 +103,7 @@ SODEFS=LDFLAGS='$(LDFLAGS) $(LDFLAGS_SO)'\ # Normal shared object so: SODIRS @@ -40,8 +51,11 @@ $OpenBSD: patch-src_unix-dll_mak,v 1.6 2008/04/01 20:37:01 kili Exp $ # Debug shared object # Note that this is in the same directory as the normal shared -@@ -119,10 +120,6 @@ install-so: so +@@ -117,12 +120,9 @@ install-so: so + -mkdir -p $(DESTDIR)$(libdir) + -mkdir -p $(DESTDIR)$(gsincludedir) $(INSTALL_PROGRAM) $(GSSOC) $(DESTDIR)$(bindir)/$(GSSOC_XENAME) ++ [ "$(USE_GTK)" = No ] || \ $(INSTALL_PROGRAM) $(GSSOX) $(DESTDIR)$(bindir)/$(GSSOX_XENAME) $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR_MINOR) - $(RM_) $(DESTDIR)$(libdir)/$(GS_SONAME) diff --git a/print/ghostscript/gnu/pkg/DESCR b/print/ghostscript/gnu/pkg/DESCR index 9d414a35037..e2f2d827679 100644 --- a/print/ghostscript/gnu/pkg/DESCR +++ b/print/ghostscript/gnu/pkg/DESCR @@ -4,5 +4,5 @@ many different printers, file formats and some displays. Flavors: a4 - Build with support for A4 page size - gtk - Build with Gtk+ support + gtk - Build with Gtk+ support (display driver) no_x11 - Build without X support diff --git a/print/ghostscript/gnu/pkg/PFRAG.gtk b/print/ghostscript/gnu/pkg/PFRAG.shared similarity index 60% rename from print/ghostscript/gnu/pkg/PFRAG.gtk rename to print/ghostscript/gnu/pkg/PFRAG.shared index 633a47c2b84..3c116d213ee 100644 --- a/print/ghostscript/gnu/pkg/PFRAG.gtk +++ b/print/ghostscript/gnu/pkg/PFRAG.shared @@ -1,6 +1,4 @@ -@comment $OpenBSD: PFRAG.gtk,v 1.7 2008/10/28 17:53:42 kili Exp $ -@bin bin/gsc -@bin bin/gsx +@comment $OpenBSD: PFRAG.shared,v 1.1 2009/01/19 12:46:23 kili Exp $ include/ghostscript/ include/ghostscript/gdevdsp.h include/ghostscript/iapi.h diff --git a/print/ghostscript/gnu/pkg/PLIST b/print/ghostscript/gnu/pkg/PLIST index c6d0f0b6361..96283609ed9 100644 --- a/print/ghostscript/gnu/pkg/PLIST +++ b/print/ghostscript/gnu/pkg/PLIST @@ -1,6 +1,7 @@ -@comment $OpenBSD: PLIST,v 1.16 2008/11/19 09:59:38 ajacoutot Exp $ +@comment $OpenBSD: PLIST,v 1.17 2009/01/19 12:46:23 kili Exp $ @pkgpath print/ghostscript/afpl${FLAVOR_STRING} @pkgpath print/ghostscript/gnu${FLAVOR_STRING},cups +%%SHARED%% bin/bdftops bin/dumphint bin/dvipdf @@ -670,4 +671,3 @@ share/ghostscript/${VERSION}/lib/winmaps.ps share/ghostscript/${VERSION}/lib/wrfont.ps share/ghostscript/${VERSION}/lib/xlatmap share/ghostscript/${VERSION}/lib/zeroline.ps -%%gtk%%