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@
This commit is contained in:
kili 2009-01-19 12:46:22 +00:00
parent 1832f492c5
commit e91fb64abf
5 changed files with 54 additions and 25 deletions

View File

@ -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 <bsd.port.mk>
ALL_TARGET = ${ALL_TARGET_NON_SHARED-${NO_SHARED_LIBS}}
INSTALL_TARGET = ${INSTALL_TARGET_NON_SHARED-${NO_SHARED_LIBS}}

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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%%