pkgsrc/graphics/xv/patches/patch-Imakefile

122 lines
3.1 KiB
Text

$NetBSD: patch-Imakefile,v 1.1 2019/02/21 14:32:32 tsutsui Exp $
- use jpeg, png, tiff, and zlib from pkgsrc
- make ghostscript support optional
--- Imakefile.orig 2019-02-21 14:07:37.512579350 +0000
+++ Imakefile
@@ -6,13 +6,15 @@
/* if, for whatever reason, you're unable to get the JPEG library to compile
* on your machine, *COMMENT OUT* the following line
*/
-#define HaveJpeg
+/* #define HaveJpeg */
+#define UseInstalledJpeg
/* if, for whatever reason, you're unable to get the TIFF library to compile
* on your machine, *COMMENT OUT* the following line
*/
-#define HaveTiff
+/* #define HaveTiff */
+#define UseInstalledTiff
/* if, for whatever reason, you're unable to get the PDS/VICAR support
@@ -21,6 +23,10 @@
#define HavePDS
+/* #define UseInstalledGhostScript */
+#define UseInstalledPng
+#define UseInstalledZlib
+
/*
* if you are running on a SysV-based machine, such as HP, Silicon Graphics,
* etc, uncomment one of the following lines to get you *most* of the way
@@ -124,20 +130,66 @@ MGCSFX = -DMGCSFXDIR=\"$(MGCSFXDIR)\"
JPEG = -DDOJPEG
JPEGDIR = jpeg
LIBJPEG = $(JPEGDIR)/libjpeg.a
+DEPLIBJPEG = $(LIBJPEG)
JPEGINCLUDE = -I$(JPEGDIR)
#endif
+#ifdef UseInstalledJpeg
+JPEG = -DDOJPEG
+LIBJPEG = $(LDFLAGS) -L$(PREFIX)/lib -Wl,-R$(PREFIX)/lib -ljpeg
+JPEGINCLUDE = -I$(PREFIX)/include
+#endif
+
#ifdef HaveTiff
TIFF = -DDOTIFF
TIFFDIR = tiff
LIBTIFF = $(TIFFDIR)/libtiff.a
+DEPLIBTIFF = $(LIBTIFF)
TIFFINCLUDE = -I$(TIFFDIR)
#endif
+#ifdef UseInstalledTiff
+TIFF = -DDOTIFF
+LIBTIFF = -L$(PREFIX)/lib -Wl,-R$(PREFIX)/lib -ltiff -ljpeg -lz
+TIFFINCLUDE = -I$(PREFIX)/include
+#endif
+
#ifdef HavePDS
PDS = -DDOPDS
#endif
+#ifdef UseInstalledGhostScript
+GS = -DDOGS
+#endif
+
+/*
+###
+### if, for whatever reason, you're unable to get the PNG library to compile
+### on your machine, *COMMENT OUT* the following lines
+###
+*/
+#ifdef UseInstalledPng
+PNG = -DDOPNG
+PNGDIR = ${PREFIX}
+PNGINC = -I$(PNGDIR)/include
+PNGLIB = -L$(PNGDIR)/lib -lpng -lz
+LIBPNG = ${PNGLIB}
+PNGINCLUDE = ${PNGINC}
+#endif
+
+/*
+###
+### if, for whatever reason, you're unable to get the PNG library to compile
+### on your machine, *COMMENT OUT* the following lines
+###
+*/
+#ifdef UseInstalledZlib
+ZLIBDIR = $(PREFIX)
+ZLIBINC = -I$(ZLIBDIR)/include
+ZLIBLIB = -L$(ZLIBDIR)/lib -lz
+LIBZLIB = ${ZLIB}
+ZLIBINCLUDE = ${ZLIBINC}
+#endif
#if defined(SCOArchitecture)
SCO= -Dsco -DPOSIX -DNO_RANDOM
@@ -149,14 +201,14 @@ SYS_LIBRARIES= -lm
#endif
-DEPLIBS = $(LIBJPEG) $(LIBTIFF)
-LOCAL_LIBRARIES = $(XLIB) $(DEPLIBS)
+DEPLIBS = $(DEPLIBJPEG) $(DEPLIBTIFF) $(DEPLIBPNG) $(DEPLIBZLIB)
+LOCAL_LIBRARIES = $(XLIB) $(LIBJPEG) $(LIBTIFF) $(LIBPNG) $(LIBZLIB)
DEFINES= $(SCO) $(UNIX) $(NODIRENT) $(VPRINTF) $(TIMERS) \
- $(HPUX7) $(JPEG) $(TIFF) $(PDS) $(DXWM) $(RAND) \
+ $(HPUX7) $(JPEG) $(TIFF) $(GS) $(PNG) $(PDS) $(DXWM) $(RAND) \
$(BACKING_STORE) $(BSDTYPES) $(SGI) $(MGCSFX)
-INCLUDES = $(JPEGINCLUDE) $(TIFFINCLUDE)
+INCLUDES = $(JPEGINCLUDE) $(TIFFINCLUDE) $(PNGINCLUDE) $(ZLIBINCLUDE)
SRCS1 = xv.c xvevent.c xvroot.c xvmisc.c xvimage.c xvcolor.c xvsmooth.c \
xv24to8.c xvgif.c xvpm.c xvinfo.c xvctrl.c xvscrl.c xvalg.c \