summaryrefslogtreecommitdiff
path: root/graphics/netpbm
diff options
context:
space:
mode:
authorwiz <wiz>2014-09-08 21:22:28 +0000
committerwiz <wiz>2014-09-08 21:22:28 +0000
commit9b82fe19d7b39776f130ae42a395f0a37deea407 (patch)
tree9301dee26733c10fda0eab911d6a279957aff035 /graphics/netpbm
parent88adc10d9af67455453c831971b5fc928fc24a1e (diff)
downloadpkgsrc-9b82fe19d7b39776f130ae42a395f0a37deea407.tar.gz
Update to 10.67.03. This is the current release of the Advanced
branch of netpbm. Lots and lots of changes since our Super Stable release version.
Diffstat (limited to 'graphics/netpbm')
-rw-r--r--graphics/netpbm/Makefile75
-rw-r--r--graphics/netpbm/PLIST140
-rw-r--r--graphics/netpbm/distinfo33
-rw-r--r--graphics/netpbm/hacks.mk54
-rw-r--r--graphics/netpbm/patches/patch-aa195
-rw-r--r--graphics/netpbm/patches/patch-ac402
-rw-r--r--graphics/netpbm/patches/patch-ad15
-rw-r--r--graphics/netpbm/patches/patch-ae12
-rw-r--r--graphics/netpbm/patches/patch-ag16
-rw-r--r--graphics/netpbm/patches/patch-ai13
-rw-r--r--graphics/netpbm/patches/patch-aj17
-rw-r--r--graphics/netpbm/patches/patch-ak81
-rw-r--r--graphics/netpbm/patches/patch-al20
-rw-r--r--graphics/netpbm/patches/patch-ao16
-rw-r--r--graphics/netpbm/patches/patch-aw16
-rw-r--r--graphics/netpbm/patches/patch-ax16
-rw-r--r--graphics/netpbm/patches/patch-ay26
-rw-r--r--graphics/netpbm/patches/patch-buildtools_installosf15
-rw-r--r--graphics/netpbm/patches/patch-cb16
-rw-r--r--graphics/netpbm/patches/patch-converter_other_pngtopnm.c899
-rw-r--r--graphics/netpbm/patches/patch-converter_other_pstopnm.c50
-rw-r--r--graphics/netpbm/patches/patch-converter_ppm_ppmtompeg_psocket.c27
-rw-r--r--graphics/netpbm/patches/patch-da17
-rw-r--r--graphics/netpbm/patches/patch-db17
-rw-r--r--graphics/netpbm/patches/patch-dc16
-rw-r--r--graphics/netpbm/patches/patch-dd16
-rw-r--r--graphics/netpbm/patches/patch-lib_libpbm3.c16
-rw-r--r--graphics/netpbm/patches/patch-lib_libsystem.c41
-rw-r--r--graphics/netpbm/patches/patch-ppmdraw13
29 files changed, 204 insertions, 2086 deletions
diff --git a/graphics/netpbm/Makefile b/graphics/netpbm/Makefile
index 8127fbcfb5f..495ce53320e 100644
--- a/graphics/netpbm/Makefile
+++ b/graphics/netpbm/Makefile
@@ -1,9 +1,12 @@
-# $NetBSD: Makefile,v 1.188 2014/08/25 10:01:43 wiz Exp $
+# $NetBSD: Makefile,v 1.189 2014/09/08 21:22:28 wiz Exp $
-DISTNAME= netpbm-10.35.93
-PKGREVISION= 1
+DISTNAME= netpbm-10.67.03
CATEGORIES= graphics
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=netpbm/}
+MASTER_SITES= #
+# manually created from svn checkout of
+# svn checkout http://svn.code.sf.net/p/netpbm/code/advanced netpbm
+# tar --exclude netpbm/.svn/\* -cvzf /archive/distfiles/netpbm-$VERSION.tar.gz netpbm
+# where VERSION comes from reading netpbm/doc/HISTORY
EXTRACT_SUFX= .tgz
MAINTAINER= adam@NetBSD.org
@@ -11,24 +14,23 @@ HOMEPAGE= http://netpbm.sourceforge.net/
COMMENT= Toolkit for conversion of images between different formats
LICENSE= gnu-gpl-v2
-MAKE_JOBS_SAFE= no
-PKG_INSTALLATION_TYPES= overwrite pkgviews
-
USE_TOOLS+= bash:run gmake lex pax perl
USE_FEATURES= snprintf
-USE_GCC_RUNTIME=yes
INSTALL_TARGET= install-dev install-run
MAKE_ENV+= INSTALL=${INSTALL:Q} STRIPFLAG=${_STRIPFLAG_INSTALL:Q} \
pkgdir=${STAGEDIR:Q} MACHINE=${MACHINE:Q}
MAKE_FILE= GNUmakefile
-REPLACE_PERL+= editor/ppmfade editor/ppmshadow editor/pnmquant \
- generator/ppmrainbow manweb editor/pnmflip editor/ppmquant
+REPLACE_PERL+= converter/pbm/pbmtox10bm
+REPLACE_PERL+= editor/pnmflip
+REPLACE_PERL+= editor/pnmquant
+REPLACE_PERL+= editor/ppmfade
+REPLACE_PERL+= editor/ppmquant
+REPLACE_PERL+= editor/ppmshadow
+REPLACE_PERL+= generator/ppmrainbow
+REPLACE_PERL+= manweb
STAGEDIR= ${WRKDIR}/staging
-
-LIBS.SunOS+= -lsocket -lnsl
-MAKE_ENV+= NETWORKLD=${LIBS:Q}
-MAKE_FLAGS+= PKGMANDIR=${PKGMANDIR}
+WRKSRC= ${WRKDIR}/netpbm
WRAPPER_REORDER_CMDS+= reorder:l:rle:netpbm
@@ -44,7 +46,6 @@ REPLACE_FILES.bash+= converter/ppm/hpcdtoppm/pcdovtoppm
REPLACE_FILES.bash+= editor/pamstretch-gen
REPLACE_FILES.bash+= editor/pnmindex.sh
REPLACE_FILES.bash+= editor/pnmmargin
-REPLACE_FILES.bash+= editor/ppmquantall
REPLACE_FILES.bash+= other/ppmtomap
SUBST_CLASSES+= rgb_txt
@@ -55,34 +56,30 @@ SUBST_SED.rgb_txt+= -e 's,@@PREFIX@@,${PREFIX},'
.include "../../mk/bsd.prefs.mk"
-# Fiasco fails to compile on Darwin-8.x.
-PLIST_VARS+= fiasco
-.if !empty(MACHINE_PLATFORM:MDarwin-8.*-*)
-MAKE_ENV+= BUILD_FIASCO=N
-.else
-PLIST.fiasco= yes
-.endif
-
-.if ${OPSYS} == "Darwin"
-MAKE_ENV+= NETPBMLIBTYPE="dylib" NETPBMLIBSUFFIX="dylib"
-.elif ${OPSYS} == "HPUX" && ${OBJECT_FMT} == "SOM"
-MAKE_ENV+= NETPBMLIBTYPE="unixshared" NETPBMLIBSUFFIX="sl"
-.else
-MAKE_ENV+= NETPBMLIBTYPE="unixshared" NETPBMLIBSUFFIX="so"
-.endif
-
-.if ${OS_VARIANT} == "SCOOSR5"
-LDFLAGS.SCO_SV+= -lsocket
-.endif
-
-.if !empty(PKGSRC_COMPILER:Mido)
-CPPFLAGS+= -DSGI_IDO_CC
+# only used if NEED_RUNTIME_PATH is set, so set it unconditionally
+MAKE_FLAGS+= NETPBMLIB_RUNTIME_PATH=${PREFIX}
+
+.if ${OPSYS} == "NetBSD"
+MAKE_FLAGS+= NEED_RUNTIME_PATH=Y
+.elif ${OPSYS} == "Darwin"
+MAKE_FLAGS+= NETPBMLIBTYPE=dylib
+MAKE_FLAGS+= NETPBMLIBSUFFIX=dylib
+.elif ${OPSYS} == "SunOS"
+MAKE_FLAGS+= LDSHLIB=-shared
+MAKE_FLAGS+= NEED_RUNTIME_PATH=Y
+MAKE_FLAGS+= NETWORKLD="-lsocket -lnsl"
+.elif ${OS_VARIANT} == "SCOOSR5"
+MAKE_FLAGS+= NETWORKLD="-lsocket -lresolv"
.endif
INSTALLATION_DIRS= ${PKGMANDIR}/man1 share/netpbm
-pre-configure:
- ${CP} ${WRKSRC}/Makefile.config.in ${WRKSRC}/Makefile.config
+post-extract:
+ cd ${WRKSRC} && ${CP} config.mk.in config.mk
+ ${ECHO} "CFLAGS_SHLIB = -fPIC" >> ${WRKSRC}/config.mk
+.if ${OPSYS} == "Darwin"
+ ${ECHO} 'LDSHLIB=-dynamiclib -install_name $$(PREFIX)/lib/libnetpbm.$$(MAJ).dylib -compatibility_version $$(MAJ) -current_version $$(MAJ).$$(MIN)' >> ${WRKSRC}/config.mk
+.endif
pre-install:
${RM} -fr ${STAGEDIR}
diff --git a/graphics/netpbm/PLIST b/graphics/netpbm/PLIST
index f0c65cc780e..19f697d40cd 100644
--- a/graphics/netpbm/PLIST
+++ b/graphics/netpbm/PLIST
@@ -1,19 +1,21 @@
-@comment $NetBSD: PLIST,v 1.8 2011/04/04 09:17:24 adam Exp $
+@comment $NetBSD: PLIST,v 1.9 2014/09/08 21:22:28 wiz Exp $
bin/411toppm
bin/anytopnm
bin/asciitopgm
bin/atktopbm
+bin/avstopam
bin/bioradtopgm
bin/bmptopnm
bin/bmptoppm
bin/brushtopbm
bin/cameratopam
+bin/cistopbm
bin/cmuwmtopbm
bin/ddbugtopbm
bin/doc.url
bin/escp2topbm
bin/eyuvtoppm
-${PLIST.fiasco}bin/fiascotopnm
+bin/fiascotopnm
bin/fitstopnm
bin/fstopgm
bin/g3topbm
@@ -30,7 +32,6 @@ bin/imgtoppm
bin/infotopam
bin/jbigtopnm
bin/jpeg2ktopam
-bin/jpegtopnm
bin/leaftoppm
bin/lispmtopgm
bin/macptopbm
@@ -43,6 +44,7 @@ bin/neotoppm
bin/palmtopnm
bin/pamaddnoise
bin/pamarith
+bin/pambackground
bin/pambayer
bin/pamchannel
bin/pamcomp
@@ -54,7 +56,10 @@ bin/pamditherbw
bin/pamedge
bin/pamendian
bin/pamenlarge
+bin/pamexec
bin/pamfile
+bin/pamfix
+bin/pamfixtrunc
bin/pamflip
bin/pamfunc
bin/pamgauss
@@ -62,15 +67,20 @@ bin/pamgradient
bin/pamlookup
bin/pammasksharpen
bin/pammixinterlace
+bin/pammosaicknit
bin/pamoil
+bin/pampaintspill
bin/pamperspective
bin/pampick
bin/pampop9
+bin/pamrecolor
bin/pamrgbatopng
+bin/pamrubber
bin/pamscale
bin/pamseq
bin/pamsharpmap
bin/pamsharpness
+bin/pamsistoaglyph
bin/pamslice
bin/pamsplit
bin/pamstack
@@ -81,22 +91,33 @@ bin/pamsumm
bin/pamsummcol
bin/pamthreshold
bin/pamtilt
+bin/pamtoavs
bin/pamtodjvurle
bin/pamtofits
+bin/pamtogif
bin/pamtohdiff
bin/pamtohtmltbl
bin/pamtojpeg2k
+bin/pamtompfont
+bin/pamtooctaveimg
+bin/pamtopam
+bin/pamtopdbimg
bin/pamtopfm
bin/pamtopnm
+bin/pamtosrf
bin/pamtosvg
bin/pamtotga
-bin/pamtotiff
bin/pamtouil
+bin/pamtowinicon
bin/pamtoxvmini
+bin/pamundice
+bin/pamvalidate
+bin/pamwipeout
bin/pbmclean
bin/pbmlife
bin/pbmmake
bin/pbmmask
+bin/pbmminkowski
bin/pbmpage
bin/pbmpscale
bin/pbmreduce
@@ -107,6 +128,7 @@ bin/pbmto4425
bin/pbmtoascii
bin/pbmtoatk
bin/pbmtobbnbg
+bin/pbmtocis
bin/pbmtocmuwm
bin/pbmtodjvurle
bin/pbmtoepsi
@@ -133,6 +155,7 @@ bin/pbmtoplot
bin/pbmtoppa
bin/pbmtopsg3
bin/pbmtoptx
+bin/pbmtosunicon
bin/pbmtowbmp
bin/pbmtox10bm
bin/pbmtoxbm
@@ -142,6 +165,7 @@ bin/pbmupc
bin/pc1toppm
bin/pcdovtoppm
bin/pcxtoppm
+bin/pdbimgtopam
bin/pfmtopam
bin/pgmabel
bin/pgmbentley
@@ -171,6 +195,7 @@ bin/pi3topbm
bin/picttoppm
bin/pjtoppm
bin/pktopbm
+bin/pngtopam
bin/pngtopnm
bin/pnmalias
bin/pnmarith
@@ -191,6 +216,7 @@ bin/pnmindex
bin/pnminterp
bin/pnminvert
bin/pnmmargin
+bin/pnmmercator
bin/pnmmontage
bin/pnmnlfilt
bin/pnmnoraw
@@ -199,6 +225,7 @@ bin/pnmpad
bin/pnmpaste
bin/pnmpsnr
bin/pnmquant
+bin/pnmquantall
bin/pnmremap
bin/pnmrotate
bin/pnmscale
@@ -209,10 +236,9 @@ bin/pnmsplit
bin/pnmstitch
bin/pnmtile
bin/pnmtoddif
-${PLIST.fiasco}bin/pnmtofiasco
+bin/pnmtofiasco
bin/pnmtofits
bin/pnmtojbig
-bin/pnmtojpeg
bin/pnmtopalm
bin/pnmtopclxl
bin/pnmtoplainpnm
@@ -223,8 +249,6 @@ bin/pnmtorast
bin/pnmtorle
bin/pnmtosgi
bin/pnmtosir
-bin/pnmtotiff
-bin/pnmtotiffcmyk
bin/pnmtoxwd
bin/ppm3d
bin/ppmbrighten
@@ -259,13 +283,14 @@ bin/ppmshadow
bin/ppmshift
bin/ppmspread
bin/ppmtoacad
+bin/ppmtoapplevol
bin/ppmtoarbtxt
+bin/ppmtoascii
bin/ppmtobmp
bin/ppmtoeyuv
bin/ppmtogif
bin/ppmtoicr
bin/ppmtoilbm
-bin/ppmtojpeg
bin/ppmtoleaf
bin/ppmtolj
bin/ppmtomap
@@ -282,6 +307,7 @@ bin/ppmtoppm
bin/ppmtopuzz
bin/ppmtorgb3
bin/ppmtosixel
+bin/ppmtospu
bin/ppmtoterm
bin/ppmtouil
bin/ppmtowinicon
@@ -306,11 +332,13 @@ bin/sldtoppm
bin/spctoppm
bin/spottopgm
bin/sputoppm
+bin/srftopam
+bin/sunicontopnm
bin/svgtopam
bin/tgatoppm
bin/thinkjettopbm
-bin/tifftopnm
bin/wbmptopbm
+bin/winicontopam
bin/winicontoppm
bin/xbmtopbm
bin/ximtoppm
@@ -321,41 +349,45 @@ bin/ybmtopbm
bin/yuvsplittoppm
bin/yuvtoppm
bin/zeisstopnm
-include/bitio.h
-include/colorname.h
-include/mallocvar.h
-include/nstring.h
-include/pam.h
-include/pammap.h
-include/pbm.h
-include/pbmfont.h
-include/pgm.h
-include/pm.h
-include/pm_config.h
-include/pm_gamma.h
-include/pm_system.h
-include/pnm.h
-include/ppm.h
-include/ppmcmap.h
-include/ppmfloyd.h
-include/shhopt.h
+include/netpbm/bitio.h
+include/netpbm/colorname.h
+include/netpbm/mallocvar.h
+include/netpbm/pam.h
+include/netpbm/pamdraw.h
+include/netpbm/pammap.h
+include/netpbm/pbm.h
+include/netpbm/pbmfont.h
+include/netpbm/pgm.h
+include/netpbm/pm.h
+include/netpbm/pm_config.h
+include/netpbm/pm_gamma.h
+include/netpbm/pm_system.h
+include/netpbm/pnm.h
+include/netpbm/ppm.h
+include/netpbm/ppmcmap.h
+include/netpbm/ppmdfont.h
+include/netpbm/ppmdraw.h
+include/netpbm/ppmfloyd.h
+include/netpbm/shhopt.h
lib/libnetpbm.a
lib/libnetpbm.so
-lib/libnetpbm.so.10
-lib/libnetpbm.so.10.35
+lib/libnetpbm.so.11
+lib/libnetpbm.so.11.67
man/man1/411toppm.1
man/man1/anytopnm.1
man/man1/asciitopgm.1
man/man1/atktopbm.1
+man/man1/avstopam.1
man/man1/bioradtopgm.1
man/man1/bmptopnm.1
man/man1/brushtopbm.1
man/man1/cameratopam.1
+man/man1/cistopbm.1
man/man1/cmuwmtopbm.1
man/man1/ddbugtopbm.1
man/man1/escp2topbm.1
man/man1/eyuvtoppm.1
-${PLIST.fiasco}man/man1/fiascotopnm.1
+man/man1/fiascotopnm.1
man/man1/fitstopnm.1
man/man1/fstopgm.1
man/man1/g3topbm.1
@@ -365,13 +397,11 @@ man/man1/gouldtoppm.1
man/man1/hdifftopam.1
man/man1/hipstopgm.1
man/man1/hpcdtoppm.1
-man/man1/icontopbm.1
man/man1/ilbmtoppm.1
man/man1/imgtoppm.1
man/man1/infotopam.1
man/man1/jbigtopnm.1
man/man1/jpeg2ktopam.1
-man/man1/jpegtopnm.1
man/man1/leaftoppm.1
man/man1/lispmtopgm.1
man/man1/macptopbm.1
@@ -384,6 +414,7 @@ man/man1/neotoppm.1
man/man1/palmtopnm.1
man/man1/pamaddnoise.1
man/man1/pamarith.1
+man/man1/pambackground.1
man/man1/pambayer.1
man/man1/pamchannel.1
man/man1/pamcomp.1
@@ -395,7 +426,10 @@ man/man1/pamditherbw.1
man/man1/pamedge.1
man/man1/pamendian.1
man/man1/pamenlarge.1
+man/man1/pamexec.1
man/man1/pamfile.1
+man/man1/pamfix.1
+man/man1/pamfixtrunc.1
man/man1/pamflip.1
man/man1/pamfunc.1
man/man1/pamgauss.1
@@ -403,15 +437,20 @@ man/man1/pamgradient.1
man/man1/pamlookup.1
man/man1/pammasksharpen.1
man/man1/pammixinterlace.1
+man/man1/pammosaicknit.1
man/man1/pamoil.1
+man/man1/pampaintspill.1
man/man1/pamperspective.1
man/man1/pampick.1
man/man1/pampop9.1
+man/man1/pamrecolor.1
man/man1/pamrgbatopng.1
+man/man1/pamrubber.1
man/man1/pamscale.1
man/man1/pamseq.1
man/man1/pamsharpmap.1
man/man1/pamsharpness.1
+man/man1/pamsistoaglyph.1
man/man1/pamslice.1
man/man1/pamsplit.1
man/man1/pamstack.1
@@ -422,22 +461,33 @@ man/man1/pamsumm.1
man/man1/pamsummcol.1
man/man1/pamthreshold.1
man/man1/pamtilt.1
+man/man1/pamtoavs.1
man/man1/pamtodjvurle.1
man/man1/pamtofits.1
+man/man1/pamtogif.1
man/man1/pamtohdiff.1
man/man1/pamtohtmltbl.1
man/man1/pamtojpeg2k.1
+man/man1/pamtompfont.1
+man/man1/pamtooctaveimg.1
+man/man1/pamtopam.1
+man/man1/pamtopdbimg.1
man/man1/pamtopfm.1
man/man1/pamtopnm.1
+man/man1/pamtosrf.1
man/man1/pamtosvg.1
man/man1/pamtotga.1
-man/man1/pamtotiff.1
man/man1/pamtouil.1
+man/man1/pamtowinicon.1
man/man1/pamtoxvmini.1
+man/man1/pamundice.1
+man/man1/pamvalidate.1
+man/man1/pamwipeout.1
man/man1/pbmclean.1
man/man1/pbmlife.1
man/man1/pbmmake.1
man/man1/pbmmask.1
+man/man1/pbmminkowski.1
man/man1/pbmpage.1
man/man1/pbmpscale.1
man/man1/pbmreduce.1
@@ -448,6 +498,7 @@ man/man1/pbmto4425.1
man/man1/pbmtoascii.1
man/man1/pbmtoatk.1
man/man1/pbmtobbnbg.1
+man/man1/pbmtocis.1
man/man1/pbmtocmuwm.1
man/man1/pbmtodjvurle.1
man/man1/pbmtoepsi.1
@@ -457,7 +508,6 @@ man/man1/pbmtog3.1
man/man1/pbmtogem.1
man/man1/pbmtogo.1
man/man1/pbmtoibm23xx.1
-man/man1/pbmtoicon.1
man/man1/pbmtolj.1
man/man1/pbmtoln03.1
man/man1/pbmtolps.1
@@ -474,6 +524,7 @@ man/man1/pbmtoplot.1
man/man1/pbmtoppa.1
man/man1/pbmtopsg3.1
man/man1/pbmtoptx.1
+man/man1/pbmtosunicon.1
man/man1/pbmtowbmp.1
man/man1/pbmtox10bm.1
man/man1/pbmtoxbm.1
@@ -483,6 +534,7 @@ man/man1/pbmupc.1
man/man1/pc1toppm.1
man/man1/pcdovtoppm.1
man/man1/pcxtoppm.1
+man/man1/pdbimgtopam.1
man/man1/pfmtopam.1
man/man1/pgmabel.1
man/man1/pgmbentley.1
@@ -508,14 +560,13 @@ man/man1/pi3topbm.1
man/man1/picttoppm.1
man/man1/pjtoppm.1
man/man1/pktopbm.1
-man/man1/pngtopnm.1
+man/man1/pngtopam.1
man/man1/pnmalias.1
man/man1/pnmcat.1
man/man1/pnmcolormap.1
man/man1/pnmcomp.1
man/man1/pnmconvol.1
man/man1/pnmcrop.1
-man/man1/pnmcut.1
man/man1/pnmflip.1
man/man1/pnmgamma.1
man/man1/pnmhisteq.1
@@ -523,6 +574,7 @@ man/man1/pnmhistmap.1
man/man1/pnmindex.1
man/man1/pnminvert.1
man/man1/pnmmargin.1
+man/man1/pnmmercator.1
man/man1/pnmmontage.1
man/man1/pnmnlfilt.1
man/man1/pnmnorm.1
@@ -530,18 +582,17 @@ man/man1/pnmpad.1
man/man1/pnmpaste.1
man/man1/pnmpsnr.1
man/man1/pnmquant.1
+man/man1/pnmquantall.1
man/man1/pnmremap.1
man/man1/pnmrotate.1
-man/man1/pnmscale.1
man/man1/pnmscalefixed.1
man/man1/pnmshear.1
man/man1/pnmsmooth.1
man/man1/pnmstitch.1
man/man1/pnmtile.1
man/man1/pnmtoddif.1
-${PLIST.fiasco}man/man1/pnmtofiasco.1
+man/man1/pnmtofiasco.1
man/man1/pnmtojbig.1
-man/man1/pnmtojpeg.1
man/man1/pnmtopalm.1
man/man1/pnmtopclxl.1
man/man1/pnmtoplainpnm.1
@@ -551,7 +602,6 @@ man/man1/pnmtorast.1
man/man1/pnmtorle.1
man/man1/pnmtosgi.1
man/man1/pnmtosir.1
-man/man1/pnmtotiffcmyk.1
man/man1/pnmtoxwd.1
man/man1/ppm3d.1
man/man1/ppmbrighten.1
@@ -577,7 +627,6 @@ man/man1/ppmmix.1
man/man1/ppmntsc.1
man/man1/ppmpat.1
man/man1/ppmquant.1
-man/man1/ppmquantall.1
man/man1/ppmrainbow.1
man/man1/ppmrelief.1
man/man1/ppmrough.1
@@ -585,7 +634,9 @@ man/man1/ppmshadow.1
man/man1/ppmshift.1
man/man1/ppmspread.1
man/man1/ppmtoacad.1
+man/man1/ppmtoapplevol.1
man/man1/ppmtoarbtxt.1
+man/man1/ppmtoascii.1
man/man1/ppmtobmp.1
man/man1/ppmtoeyuv.1
man/man1/ppmtogif.1
@@ -607,6 +658,7 @@ man/man1/ppmtoppm.1
man/man1/ppmtopuzz.1
man/man1/ppmtorgb3.1
man/man1/ppmtosixel.1
+man/man1/ppmtospu.1
man/man1/ppmtoterm.1
man/man1/ppmtowinicon.1
man/man1/ppmtoxpm.1
@@ -630,11 +682,13 @@ man/man1/sldtoppm.1
man/man1/spctoppm.1
man/man1/spottopgm.1
man/man1/sputoppm.1
+man/man1/srftopam.1
+man/man1/sunicontopnm.1
man/man1/svgtopam.1
man/man1/tgatoppm.1
man/man1/thinkjettopbm.1
-man/man1/tifftopnm.1
man/man1/wbmptopbm.1
+man/man1/winicontopam.1
man/man1/winicontoppm.1
man/man1/xbmtopbm.1
man/man1/ximtoppm.1
diff --git a/graphics/netpbm/distinfo b/graphics/netpbm/distinfo
index cec608f0c8c..6de12589e7c 100644
--- a/graphics/netpbm/distinfo
+++ b/graphics/netpbm/distinfo
@@ -1,28 +1,7 @@
-$NetBSD: distinfo,v 1.90 2014/08/25 08:23:22 wiz Exp $
+$NetBSD: distinfo,v 1.91 2014/09/08 21:22:28 wiz Exp $
-SHA1 (netpbm-10.35.93.tgz) = fe80f0e1ccf182a614cfaab617cf486892c5f9fb
-RMD160 (netpbm-10.35.93.tgz) = 9e4bf4c66584e928e399a4b44b11a06a7daae77a
-Size (netpbm-10.35.93.tgz) = 2557610 bytes
-SHA1 (patch-aa) = fd533685c5b0058f19d1b4525a4b2b9f2b239627
-SHA1 (patch-ac) = 9ca2e6ba91dc1552aed51835c952c4f35251c88b
-SHA1 (patch-ad) = 29d58c6c9eb05deaf40a31c5439dacb30f9d34d1
-SHA1 (patch-ae) = 33a5be2843dd85b530f5e6ba496cd0380cd5edd1
-SHA1 (patch-ag) = 4c59c79164d8718dbd329765f99f327a78e7f59f
-SHA1 (patch-ai) = 083ddf8b36a74ca39508b6a3b0c35956ac19fbb7
-SHA1 (patch-aj) = 130910b88e22c57314fd2cecbb07b0a03ea560e7
-SHA1 (patch-ak) = 6c358f811cd5f5632efdf2c7a2512e51b155a04b
-SHA1 (patch-al) = 00c29f69faa24d6bb0c9021291f73dea60020e6b
-SHA1 (patch-ao) = 20bd6ac29b9e2ee25f22a24f3758dca2a01f7bd5
-SHA1 (patch-aw) = 7c1fde7b578f93e5a075bd941c46b34a43d5d3c3
-SHA1 (patch-ax) = 91deefdd6c7eb263b43c9313725268a4d627d525
-SHA1 (patch-ay) = 8d75488d897853b7ecbf9b836bb92f720f8f75ae
-SHA1 (patch-cb) = 25b53b56f9fa4de70f863a7ef8b5fcc4e0a8941a
-SHA1 (patch-converter_other_pngtopnm.c) = 43db1eeee8d077bc4b3c8b6e12e5ccec031ede48
-SHA1 (patch-converter_ppm_ppmtompeg_psocket.c) = ebb11ea1867ed401a0299eeb907aad70276ce843
-SHA1 (patch-da) = 8ae329469bf0bd55b671dffeb4253b8d14621f5c
-SHA1 (patch-db) = 23a05e54043ee84a0b7ec507a383d5cd8adfcca5
-SHA1 (patch-dc) = affd0ca1b437a6c5b10f1ffacff5d0ed9185cda7
-SHA1 (patch-dd) = 9f9c53959f5afd444ce427b782f9ba2c73068f27
-SHA1 (patch-lib_libpbm3.c) = bdca78193847cf28cde1255d05a3a01ae3bfef22
-SHA1 (patch-lib_libsystem.c) = 2f634cc295f696d270054fcc4badf4e37025691b
-SHA1 (patch-ppmdraw) = d901a690f8f21a1af940129d1edef509b369ea1a
+SHA1 (netpbm-10.67.03.tgz) = b22dfa9f18e336e9e3999058c3458c49cc0e1ef4
+RMD160 (netpbm-10.67.03.tgz) = bca7cd6ed349ec455c16ab8c3884e464cfcf709d
+Size (netpbm-10.67.03.tgz) = 2698057 bytes
+SHA1 (patch-buildtools_installosf) = 03f6bf84e9f8294c0b33d2f8789d74d6fd58b768
+SHA1 (patch-converter_other_pstopnm.c) = fde8c6da48a419867e5aed4cb1210d4ec1157b26
diff --git a/graphics/netpbm/hacks.mk b/graphics/netpbm/hacks.mk
deleted file mode 100644
index b29352a7be6..00000000000
--- a/graphics/netpbm/hacks.mk
+++ /dev/null
@@ -1,54 +0,0 @@
-# $NetBSD: hacks.mk,v 1.8 2011/04/04 09:17:24 adam Exp $
-
-.if !defined(NETPBM_HACKS_MK)
-NETPBM_HACKS_MK= # defined
-
-### [historic : ???]
-### gcc optimization fixes
-###
-.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "arm32"
-PKG_HACKS+= optimization
-GCC_REQD+= 2.95.3
-.endif
-.if ${MACHINE_ARCH} == "alpha"
-PKG_HACKS+= optimization
-GCC_REQD+= 3.0
-.endif
-
-### [Mon Jan 24 20:47:14 UTC 2005 : tv]
-### substitute for <inttypes.h> on Interix
-###
-.if ${OPSYS} == "Interix"
-PKG_HACKS+= standard-headers
-MAKE_FLAGS+= INTTYPES_H='<sys/types.h>'
-.endif
-
-### [Fri Dec 30 21:00:59 CET 2005 : schwarz]
-### make sys/types.h not conflict with inttypes.h
-### (issue is specific to IRIX 5.3)
-###
-.if !empty(MACHINE_PLATFORM:MIRIX-5.3-*)
-PKG_HACKS+= sys_types_h-inttypes_h-conflict
-post-wrapper:
- ${MKDIR} ${BUILDLINK_DIR}/include/sys && ${GREP} -v '^typedef.*[^u_]int[12368]*_t;' /usr/include/sys/types.h > ${BUILDLINK_DIR}/include/sys/types.h
-# should match int8_t, int16_t, and int32_t (only)
-.endif
-
-### [ Sun Mar 5 20:19:52 CET 2006 : schwarz ]
-### work around bug in Apple's gcc-4.0.0
-### that shows up when compiling frame.c
-###
-.if ${OPSYS} == "Darwin" && !empty(PKGSRC_COMPILER:Mgcc)
-_BAD_GCC_BUILD!= ${CC} --version | (${GREP} -c '^powerpc-apple-darwin8-gcc-4\.0\.0.*build\ 4061' || ${TRUE})
-. if ${_BAD_GCC_BUILD} == "1"
-PKG_HACKS+= apple-gcc-4-bug
-BUILDLINK_TRANSFORM+= rm:-finline-floor # unknown option to gcc-3.3
-BUILDLINK_TRANSFORM+= rm:-mpowerpc64 # prevent internal compiler error
-# with gcc-3.3 when compiling exif.c
-post-wrapper:
- ${SED} -e s,/gcc,/gcc-3.3, ${WRKDIR}/.gcc/bin/gcc > ${WRKDIR}/.gcc/bin/gcc-3.3 && ${MV} -f ${WRKDIR}/.gcc/bin/gcc-3.3 ${WRKDIR}/.gcc/bin/gcc && ${CHMOD} a+rx ${WRKDIR}/.gcc/bin/gcc
-# use gcc-3.3 instead of gcc-4.0.0
-. endif
-.endif
-
-.endif
diff --git a/graphics/netpbm/patches/patch-aa b/graphics/netpbm/patches/patch-aa
deleted file mode 100644
index 9976088109d..00000000000
--- a/graphics/netpbm/patches/patch-aa
+++ /dev/null
@@ -1,195 +0,0 @@
-$NetBSD: patch-aa,v 1.41 2012/07/25 14:42:03 jperkin Exp $
-
---- Makefile.config.in.orig 2008-12-07 01:58:20.000000000 +0000
-+++ Makefile.config.in 2012-07-25 14:32:55.129209505 +0000
-@@ -24,7 +24,7 @@
- # and skip it on those systems unless you want to debug it and fix it.
- # OpenBSD:
- #BUILD_FIASCO = N
--BUILD_FIASCO = Y
-+BUILD_FIASCO?= Y
-
- # The following are commands for the build process to use. These values
- # do not get built into anything.
-@@ -33,7 +33,7 @@
- #CC = gcc
- # Note that 'cc' is usually an alias for whatever is the main compiler
- # on a system, e.g. the GNU Compiler on Linux.
--CC = cc
-+#CC = cc
-
- # The linker.
- LD = $(CC)
-@@ -100,7 +100,7 @@
-
- # MAKE is set automatically by Make to what was used to invoke Make.
-
--INSTALL = $(SRCDIR)/buildtools/install.sh
-+#INSTALL = $(SRCDIR)/buildtools/install.sh
- #Solaris:
- #INSTALL = /usr/ucb/install
- #Tru64:
-@@ -112,7 +112,7 @@
-
- # STRIPFLAG is the option you pass to the above install program to make it
- # strip unnecessary information out of binaries.
--STRIPFLAG = -s
-+#STRIPFLAG = -s
- # If you don't want to strip the binaries, just leave it null:
- #STRIPFLAG =
-
-@@ -131,13 +131,15 @@
- AR = ar
- RANLIB = ranlib
- # IRIX, SCO don't have Ranlib:
--#RANLIB = true
-+ifeq ($(OPSYS),IRIX)
-+RANLIB = ar rs
-+endif
-
- # LEX is the beginning of a shell command that runs a Lex-like
- # pattern matcher generator. Null string means there isn't any such
- # command. That means the build will skip parts that need one.
-
--LEX = flex
-+#LEX = flex
- # Solaris:
- # LEX = flex -e
- # Windows Mingw:
-@@ -228,7 +230,7 @@
-
- # Here, $(SONAME) resolves to the soname for the shared library being created.
- # The following are gcc options. This works on GNU libc systems.
--LDSHLIB = -shared -Wl,-soname,$(SONAME)
-+LDSHLIB = -shared -Wl,-h,$(SONAME)
- # You need -nostart instead of -shared on BeOS. Though the BeOS compiler is
- # ostensibly gcc, it has the -nostart option, which is not mentioned in gcc
- # documentation and doesn't exist in at least one non-BeOS installation.
-@@ -261,6 +263,15 @@
- #LDRELOC = ld --reloc
- #LDRELOC = ld -r
-
-+ifeq ($(OPSYS),Darwin)
-+LDSHLIB = -dynamiclib -install_name $(PREFIX)/lib/libnetpbm.$(MAJ).dylib \
-+ -compatibility_version $(MAJ) -current_version $(MAJ).$(MIN)
-+endif
-+
-+ifeq ($(OPSYS),Interix)
-+# random base address between 0x6B000000 and 0x6D000000
-+LDSHLIB+= -Wl,--image-base,$$(($$RANDOM %64/2*1048576+1795162112))
-+endif
-
- # On older systems, you have to make shared libraries out of position
- # independent code, so you need -fpic or fPIC here. (The rule is: if
-@@ -283,11 +294,23 @@
- CFLAGS_SHLIB =
- # Gcc:
- #CFLAGS_SHLIB = -fpic
--#CFLAGS_SHLIB = -fPIC
-+CFLAGS_SHLIB = -fPIC
- # Sun compiler:
- #CFLAGS_SHLIB = -Kpic
- #CFLAGS_SHLIB = -KPIC
-
-+ifeq ($(OPSYS),Darwin)
-+CFLAGS_SHLIB = -fno-common
-+endif
-+
-+ifeq ($(OPSYS),IRIX)
-+CFLAGS_SHLIB = -KPIC
-+endif
-+
-+ifeq ($(OPSYS),Interix)
-+CFLAGS_SHLIB = # none!
-+endif
-+
- # SHLIB_CLIB is the link option to include the C library in a shared library,
- # normally "-lc". On typical systems, this serves no purpose. On some,
- # though, it causes information about which C library to use to be recorded
-@@ -356,8 +379,8 @@
- #TIFFLIB = libtiff.so
- #TIFFHDR_DIR = /usr/include/libtiff
- #NetBSD:
--#TIFFLIB = $(LOCALBASE)/lib/libtiff.so
--#TIFFHDR_DIR = $(LOCALBASE)/include
-+TIFFLIB = $(BUILDLINK_DIR)/lib/libtiff.so
-+TIFFHDR_DIR = $(BUILDLINK_DIR)/include
- # OSF, Tru64:
- #TIFFLIB = /usr/local1/DEC/lib/libtiff.so
- #TIFFHDR_DIR = /usr/local1/DEC/include
-@@ -387,8 +410,8 @@
- #JPEGLIB = libjpeg.so
- #JPEGHDR_DIR = /usr/include/jpeg
- # Netbsd:
--#JPEGLIB = ${LOCALBASE}/lib/libjpeg.so
--#JPEGHDR_DIR = ${LOCALBASE}/include
-+JPEGLIB = ${BUILDLINK_DIR}/lib/libjpeg.so
-+JPEGHDR_DIR = ${BUILDLINK_DIR}/include
- # OSF, Tru64:
- #JPEGLIB = /usr/local1/DEC/libjpeg.so
- #JPEGHDR_DIR = /usr/local1/DEC/include
-@@ -415,12 +438,12 @@
-
- PNGLIB = NONE
- PNGHDR_DIR =
--PNGVER =
-+PNGVER = 12
- #PNGLIB = libpng$(PNGVER).so
- #PNGHDR_DIR = /usr/include/libpng$(PNGVER)
- # NetBSD:
--#PNGLIB = $(LOCALBASE)/lib/libpng$(PNGVER).so
--#PNGHDR_DIR = $(LOCALBASE)/include
-+PNGLIB = $(BUILDLINK_DIR)/lib/libpng$(PNGVER).so
-+#PNGHDR_DIR = $(BUILDLINK_DIR)/include
- # OSF/Tru64:
- #PNGLIB = /usr/local1/DEC/lib/libpng$(PNGVER).so
- #PNGHDR_DIR = /usr/local1/DEC/include
-@@ -432,8 +455,8 @@
- #
- # If you have 'libpng-config' (see above), these are irrelevant.
-
--ZLIB = NONE
--ZHDR_DIR =
-+ZLIB = $(BUILDLINK_DIR)/lib/libz.so
-+ZHDR_DIR = $(BUILDLINK_DIR)/include
- #ZLIB = libz.so
-
- # The JBIG lossless image compression library (aka JBIG-KIT):
-@@ -442,8 +465,8 @@
- JBIGHDR_DIR = $(SRCDIR)/converter/other/jbig
-
- # The Jasper JPEG-2000 image compression library (aka JasPer):
--JASPERLIB = $(INTERNAL_JASPERLIB)
--JASPERHDR_DIR = $(INTERNAL_JASPERHDR_DIR)
-+JASPERLIB = -ljasper
-+JASPERHDR_DIR = /doesnt-matter
- # JASPERDEPLIBS is the libraries (-l options or file names) on which
- # The Jasper library depends -- i.e. what you have to link into any
- # executable that links in the Jasper library.
-@@ -488,7 +511,7 @@
- # built into the standard C library, so this can be null. This is irrelevant
- # if OMIT_NETWORK is "y".
-
--NETWORKLD =
-+#NETWORKLD =
- # Solaris, SunOS:
- #NETWORKLD = -lsocket -lnsl
- # SCO:
-@@ -542,7 +565,7 @@
- #Netpbm library functions. The value is used only in make file tests.
- # "unixshared" means a unix-style shared library, typically named like
- # libxyz.so.2.3
--NETPBMLIBTYPE = unixshared
-+NETPBMLIBTYPE? = unixshared
- # "unixstatic" means a unix-style static library, (like libxyz.a)
- #NETPBMLIBTYPE = unixstatic
- # "dll" means a Windows DLL shared library
-@@ -553,7 +576,7 @@
- #NETPBMLIBSUFFIX is the suffix used on whatever kind of library is
- #selected above. All this is used for is to construct library names.
- #The make files never examine the actual value.
--NETPBMLIBSUFFIX = so
-+NETPBMLIBSUFFIX?= so
-
- # "a" is the suffix for unix-style static libraries. It is also
- # traditionally used for shared libraries on AIX. The Visual Age C
diff --git a/graphics/netpbm/patches/patch-ac b/graphics/netpbm/patches/patch-ac
deleted file mode 100644
index e7396739f9a..00000000000
--- a/graphics/netpbm/patches/patch-ac
+++ /dev/null
@@ -1,402 +0,0 @@
-$NetBSD: patch-ac,v 1.23 2014/08/25 08:23:22 wiz Exp $
-
-Fix build with png-1.5.
-Already included in Advanced release.
-
---- converter/other/pnmtopng.c.orig 2010-12-10 18:19:40.000000000 +0000
-+++ converter/other/pnmtopng.c 2011-01-15 11:15:25.000000000 +0000
-@@ -61,7 +61,8 @@
- #include <assert.h>
- #include <string.h> /* strcat() */
- #include <limits.h>
--#include <png.h> /* includes zlib.h and setjmp.h */
-+#include <png.h> /* includes setjmp.h */
-+#include <zlib.h>
- #include "pnm.h"
- #include "pngtxt.h"
- #include "shhopt.h"
-@@ -69,13 +70,6 @@
- #include "nstring.h"
- #include "version.h"
-
--#if PNG_LIBPNG_VER >= 10400
--#error Your PNG library (<png.h>) is incompatible with this Netpbm source code.
--#error You need either an older PNG library (older than 1.4)
--#error newer Netpbm source code (at least 10.47.04)
--#endif
--
--
- struct zlibCompression {
- /* These are parameters that describe a form of zlib compression.
- Values have the same meaning as the similarly named arguments to
-@@ -2079,6 +2073,7 @@
- gray * const alpha_mask,
- colorhash_table const cht,
- coloralphahash_table const caht,
-+ png_struct * const png_ptr,
- png_info * const info_ptr,
- xelval const png_maxval,
- unsigned int const depth) {
-@@ -2091,20 +2086,20 @@
- xel p_png;
- xel const p = xelrow[col];
- PPM_DEPTH(p_png, p, maxval, png_maxval);
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
-+ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA) {
- if (depth == 16)
- *pp++ = PNM_GET1(p_png) >> 8;
- *pp++ = PNM_GET1(p_png) & 0xff;
-- } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-+ } else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
- unsigned int paletteIndex;
- if (alpha)
- paletteIndex = lookupColorAlpha(caht, &p, &alpha_mask[col]);
- else
- paletteIndex = ppm_lookupcolor(cht, &p);
- *pp++ = paletteIndex;
-- } else if (info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
-+ } else if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB ||
-+ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA) {
- if (depth == 16)
- *pp++ = PPM_GETR(p_png) >> 8;
- *pp++ = PPM_GETR(p_png) & 0xff;
-@@ -2117,7 +2112,7 @@
- } else
- pm_error("INTERNAL ERROR: undefined color_type");
-
-- if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA) {
-+ if (png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) {
- int const png_alphaval = (int)
- alpha_mask[col] * (float) png_maxval / maxval + 0.5;
- if (depth == 16)
-@@ -2174,7 +2169,7 @@
-
- makePngLine(line, xelrow, cols, maxval,
- alpha, alpha ? alpha_mask[row] : NULL,
-- cht, caht, info_ptr, png_maxval, depth);
-+ cht, caht, png_ptr, info_ptr, png_maxval, depth);
-
- png_write_row(png_ptr, line);
- }
-@@ -2186,12 +2181,12 @@
-
- static void
- doGamaChunk(struct cmdlineInfo const cmdline,
-+ png_struct * const png_ptr,
- png_info * const info_ptr) {
-
- if (cmdline.gammaSpec) {
- /* gAMA chunk */
-- info_ptr->valid |= PNG_INFO_gAMA;
-- info_ptr->gamma = cmdline.gamma;
-+ png_set_gAMA(png_ptr, info_ptr, cmdline.gamma);
- }
- }
-
-@@ -2199,20 +2194,15 @@
-
- static void
- doChrmChunk(struct cmdlineInfo const cmdline,
-+ png_struct * const png_ptr,
- png_info * const info_ptr) {
-
- if (cmdline.rgbSpec) {
- /* cHRM chunk */
-- info_ptr->valid |= PNG_INFO_cHRM;
--
-- info_ptr->x_white = cmdline.rgb.wx;
-- info_ptr->y_white = cmdline.rgb.wy;
-- info_ptr->x_red = cmdline.rgb.rx;
-- info_ptr->y_red = cmdline.rgb.ry;
-- info_ptr->x_green = cmdline.rgb.gx;
-- info_ptr->y_green = cmdline.rgb.gy;
-- info_ptr->x_blue = cmdline.rgb.bx;
-- info_ptr->y_blue = cmdline.rgb.by;
-+
-+ png_set_cHRM (png_ptr, info_ptr, cmdline.rgb.wx, cmdline.rgb.wy,
-+ cmdline.rgb.rx, cmdline.rgb.ry, cmdline.rgb.gx,
-+ cmdline.rgb.gy, cmdline.rgb.bx, cmdline.rgb.by);
- }
- }
-
-@@ -2220,15 +2210,12 @@
-
- static void
- doPhysChunk(struct cmdlineInfo const cmdline,
-+ png_struct * const png_ptr,
- png_info * const info_ptr) {
-
- if (cmdline.sizeSpec) {
- /* pHYS chunk */
-- info_ptr->valid |= PNG_INFO_pHYs;
--
-- info_ptr->x_pixels_per_unit = cmdline.size.x;
-- info_ptr->y_pixels_per_unit = cmdline.size.y;
-- info_ptr->phys_unit_type = cmdline.size.unit;
-+ png_set_pHYs(png_ptr, info_ptr, cmdline.size.x, cmdline.size.y, cmdline.size.unit);
- }
- }
-
-@@ -2237,26 +2224,28 @@
-
- static void
- doTimeChunk(struct cmdlineInfo const cmdline,
-+ png_struct * const png_ptr,
- png_info * const info_ptr) {
-
- if (cmdline.modtimeSpec) {
- /* tIME chunk */
-- info_ptr->valid |= PNG_INFO_tIME;
--
-- png_convert_from_time_t(&info_ptr->mod_time, cmdline.modtime);
-+ png_timep ptime;
-+ png_convert_from_time_t(ptime, cmdline.modtime);
-+ png_set_tIME(png_ptr, info_ptr, ptime);
- }
- }
-
-
-
- static void
--doSbitChunk(png_info * const pngInfoP,
-+doSbitChunk(png_struct * const pngP,
-+ png_info * const pngInfoP,
- xelval const pngMaxval,
- xelval const maxval,
- bool const alpha,
- xelval const alphaMaxval) {
-
-- if (pngInfoP->color_type != PNG_COLOR_TYPE_PALETTE &&
-+ if (png_get_color_type(pngP, pngInfoP) != PNG_COLOR_TYPE_PALETTE &&
- (pngMaxval > maxval || (alpha && pngMaxval > alphaMaxval))) {
-
- /* We're writing in a bit depth that doesn't match the maxval
-@@ -2275,26 +2264,28 @@
- sBIT chunk.
- */
-
-- pngInfoP->valid |= PNG_INFO_sBIT;
--
- {
- int const sbitval = pm_maxvaltobits(MIN(maxval, pngMaxval));
-+ png_color_8 sbit;
-
-- if (pngInfoP->color_type & PNG_COLOR_MASK_COLOR) {
-- pngInfoP->sig_bit.red = sbitval;
-- pngInfoP->sig_bit.green = sbitval;
-- pngInfoP->sig_bit.blue = sbitval;
-+ (void)memset(&sbit, 0, sizeof(sbit));
-+ if (png_get_color_type(pngP, pngInfoP) & PNG_COLOR_MASK_COLOR) {
-+ sbit.red = sbitval;
-+ sbit.green = sbitval;
-+ sbit.blue = sbitval;
- } else
-- pngInfoP->sig_bit.gray = sbitval;
-+ sbit.gray = sbitval;
-
- if (verbose)
- pm_message("Writing sBIT chunk with bits = %d", sbitval);
-- }
-- if (pngInfoP->color_type & PNG_COLOR_MASK_ALPHA) {
-- pngInfoP->sig_bit.alpha =
-- pm_maxvaltobits(MIN(alphaMaxval, pngMaxval));
-- if (verbose)
-- pm_message(" alpha bits = %d", pngInfoP->sig_bit.alpha);
-+
-+ if (png_get_color_type(pngP, pngInfoP) & PNG_COLOR_MASK_ALPHA) {
-+ sbit.alpha =
-+ pm_maxvaltobits(MIN(alphaMaxval, pngMaxval));
-+ if (verbose)
-+ pm_message(" alpha bits = %d", sbit.alpha);
-+ }
-+ png_set_sBIT(pngP, pngInfoP, &sbit);
- }
- }
- }
-@@ -2391,6 +2382,8 @@
- xelval maxmaxval;
- gray ** alpha_mask;
-
-+ int color_type;
-+
- /* these guys are initialized to quiet compiler warnings: */
- maxmaxval = 255;
- alpha_mask = NULL;
-@@ -2576,43 +2569,42 @@
- pm_error ("setjmp returns error condition (2)");
- }
-
-- png_init_io (png_ptr, stdout);
-- info_ptr->width = cols;
-- info_ptr->height = rows;
-- info_ptr->bit_depth = depth;
--
- if (colorMapped)
-- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
-- else if (pnm_type == PPM_TYPE)
-- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
-- else
-- info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
-+ color_type = PNG_COLOR_TYPE_PALETTE;
-+ else if (pnm_type == PPM_TYPE) {
-+ if (alpha)
-+ color_type = PNG_COLOR_TYPE_RGB_ALPHA;
-+ else
-+ color_type = PNG_COLOR_TYPE_RGB;
-+ } else {
-+ if (alpha)
-+ color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
-+ else
-+ color_type = PNG_COLOR_TYPE_GRAY;
-+ }
-
-- if (alpha && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
-- info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
-+ png_set_IHDR(png_ptr, info_ptr, cols, rows, depth, color_type, 0, 0, 0);
-+ png_init_io (png_ptr, stdout);
-
-- info_ptr->interlace_type = cmdline.interlace;
-+ if (cmdline.interlace)
-+ png_set_interlace_handling(png_ptr);
-
-- doGamaChunk(cmdline, info_ptr);
-+ doGamaChunk(cmdline, png_ptr, info_ptr);
-
-- doChrmChunk(cmdline, info_ptr);
-+ doChrmChunk(cmdline, png_ptr, info_ptr);
-
-- doPhysChunk(cmdline, info_ptr);
-+ doPhysChunk(cmdline, png_ptr, info_ptr);
-
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
-
- /* creating PNG palette (PLTE and tRNS chunks) */
-
- createPngPalette(palette_pnm, palette_size, maxval,
- trans_pnm, trans_size, alpha_maxval,
- palette, trans);
-- info_ptr->valid |= PNG_INFO_PLTE;
-- info_ptr->palette = palette;
-- info_ptr->num_palette = palette_size;
-+ png_set_PLTE(png_ptr, info_ptr, palette, palette_size);
- if (trans_size > 0) {
-- info_ptr->valid |= PNG_INFO_tRNS;
-- info_ptr->trans = trans;
-- info_ptr->num_trans = trans_size; /* omit opaque values */
-+ png_set_tRNS(png_ptr, info_ptr, trans, trans_size, NULL);
- }
- /* creating hIST chunk */
- if (cmdline.hist) {
-@@ -2638,18 +2630,17 @@
-
- ppm_freecolorhash(cht);
-
-- info_ptr->valid |= PNG_INFO_hIST;
-- info_ptr->hist = histogram;
-+ png_set_hIST(png_ptr, info_ptr, histogram);
- if (verbose)
- pm_message("histogram created");
- }
- } else { /* color_type != PNG_COLOR_TYPE_PALETTE */
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB) {
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
-+ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB) {
- if (transparent > 0) {
-- info_ptr->valid |= PNG_INFO_tRNS;
-- info_ptr->trans_values =
-- xelToPngColor_16(transcolor, maxval, png_maxval);
-+ png_color_16 trans_color = xelToPngColor_16(transcolor, maxval, png_maxval);
-+ png_set_tRNS(png_ptr, info_ptr, NULL, 0, &trans_color);
-+
- }
- } else {
- /* This is PNG_COLOR_MASK_ALPHA. Transparency will be handled
-@@ -2657,43 +2648,49 @@
- */
- }
- if (verbose) {
-- if (info_ptr->valid && PNG_INFO_tRNS)
-+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
-+ png_color_16p trans_color;
-+
-+ png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_color);
- pm_message("Transparent color {gray, red, green, blue} = "
- "{%d, %d, %d, %d}",
-- info_ptr->trans_values.gray,
-- info_ptr->trans_values.red,
-- info_ptr->trans_values.green,
-- info_ptr->trans_values.blue);
-- else
-+ trans_color->gray,
-+ trans_color->red,
-+ trans_color->green,
-+ trans_color->blue);
-+ } else
- pm_message("No transparent color");
- }
- }
-
- /* bKGD chunk */
- if (cmdline.background) {
-- info_ptr->valid |= PNG_INFO_bKGD;
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-- info_ptr->background.index = background_index;
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
-+ png_color_16 background;
-+
-+ (void)memset(&background, 0, sizeof(background));
-+ background.index = background_index;
-+ png_set_bKGD(png_ptr, info_ptr, &background);
- } else {
-- info_ptr->background =
-- xelToPngColor_16(backcolor, maxval, png_maxval);
-+ png_color_16 background = xelToPngColor_16(backcolor, maxval, png_maxval);
-+ png_set_bKGD(png_ptr, info_ptr, &background);
- if (verbose)
- pm_message("Writing bKGD chunk with background color "
- " {gray, red, green, blue} = {%d, %d, %d, %d}",
-- info_ptr->background.gray,
-- info_ptr->background.red,
-- info_ptr->background.green,
-- info_ptr->background.blue );
-+ background.gray,
-+ background.red,
-+ background.green,
-+ background.blue );
- }
- }
-
-- doSbitChunk(info_ptr, png_maxval, maxval, alpha, alpha_maxval);
-+ doSbitChunk(png_ptr, info_ptr, png_maxval, maxval, alpha, alpha_maxval);
-
- /* tEXT and zTXT chunks */
- if (cmdline.text || cmdline.ztxt)
-- pnmpng_read_text(info_ptr, tfp, !!cmdline.ztxt, cmdline.verbose);
-+ pnmpng_read_text(png_ptr, info_ptr, tfp, !!cmdline.ztxt, cmdline.verbose);
-
-- doTimeChunk(cmdline, info_ptr);
-+ doTimeChunk(cmdline, png_ptr, info_ptr);
-
- if (cmdline.filterSet != 0)
- png_set_filter(png_ptr, 0, cmdline.filterSet);
-@@ -2703,6 +2700,7 @@
- /* write the png-info struct */
- png_write_info(png_ptr, info_ptr);
-
-+#if 0
- if (cmdline.text || cmdline.ztxt)
- /* prevent from being written twice with png_write_end */
- info_ptr->num_text = 0;
-@@ -2710,6 +2708,7 @@
- if (cmdline.modtime)
- /* prevent from being written twice with png_write_end */
- info_ptr->valid &= ~PNG_INFO_tIME;
-+#endif
-
- /* let libpng take care of, e.g., bit-depth conversions */
- png_set_packing (png_ptr);
diff --git a/graphics/netpbm/patches/patch-ad b/graphics/netpbm/patches/patch-ad
deleted file mode 100644
index 98ebbbf5099..00000000000
--- a/graphics/netpbm/patches/patch-ad
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-ad,v 1.22 2014/08/25 08:23:22 wiz Exp $
-
---- converter/ppm/ppmtompeg/parallel.c.orig 2006-08-19 03:12:28.000000000 +0000
-+++ converter/ppm/ppmtompeg/parallel.c
-@@ -12,7 +12,10 @@
- * HEADER FILES *
- *==============*/
-
-+/* SCO OpenServer 5.0.7/3.2 does not typedef u_long, when _XOPEN_SOURCE is defined. */
-+#if !defined(_SCO_DS)
- #define _XOPEN_SOURCE 500 /* Make sure stdio.h contains pclose() */
-+#endif
- /* _ALL_SOURCE is needed on AIX to make the C library include the
- socket services (e.g. define struct sockaddr)
-
diff --git a/graphics/netpbm/patches/patch-ae b/graphics/netpbm/patches/patch-ae
deleted file mode 100644
index 8a8d0649a0e..00000000000
--- a/graphics/netpbm/patches/patch-ae
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-ae,v 1.10 2005/01/18 14:16:20 adam Exp $
-
---- generator/pbmtextps.c.orig 2003-10-08 02:39:27.000000000 +0000
-+++ generator/pbmtextps.c
-@@ -15,7 +15,6 @@
- * Additions by Bryan Henderson contributed to public domain by author.
- *
- */
--#define _XOPEN_SOURCE /* Make sure popen() is in stdio.h */
- #define _BSD_SOURCE /* Make sure stdrup() is in string.h */
- #include <stdio.h>
- #include <stdlib.h>
diff --git a/graphics/netpbm/patches/patch-ag b/graphics/netpbm/patches/patch-ag
deleted file mode 100644
index ae45f0ec0d4..00000000000
--- a/graphics/netpbm/patches/patch-ag
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-ag,v 1.21 2014/08/25 08:23:22 wiz Exp $
-
-Use LDFLAGS from environment.
-Similar fix already in current Advanced release.
-
---- buildtools/Makefile.orig 2010-10-28 07:01:24.000000000 +0000
-+++ buildtools/Makefile
-@@ -37,7 +37,7 @@ typegen.o endiangen.o:%.o:%.c
- $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $<
-
- $(PROGS):%:%.o
-- $(LD_FOR_BUILD) -o $@ $<
-+ $(LD_FOR_BUILD) $(LDFLAGS) -o $@ $<
-
- distclean clean: cleanlocal
- .PHONY: cleanlocal
diff --git a/graphics/netpbm/patches/patch-ai b/graphics/netpbm/patches/patch-ai
deleted file mode 100644
index d2e39c9bcf6..00000000000
--- a/graphics/netpbm/patches/patch-ai
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ai,v 1.13 2010/11/04 10:57:50 adam Exp $
-
---- pm_config.in.h.orig 2010-11-04 10:46:22.000000000 +0000
-+++ pm_config.in.h
-@@ -68,7 +68,7 @@
- #define RGB_DB3 "PBMplus_Dir:RGB.TXT"
- #else
- #define RGB_DB1 "/usr/lib/X11/rgb.txt"
--#define RGB_DB2 "/usr/share/X11/rgb.txt"
-+#define RGB_DB2 "@@PREFIX@@/share/netpbm/rgb.txt"
- #define RGB_DB3 "/usr/X11R6/lib/X11/rgb.txt"
- #endif
-
diff --git a/graphics/netpbm/patches/patch-aj b/graphics/netpbm/patches/patch-aj
deleted file mode 100644
index 08eecac5aee..00000000000
--- a/graphics/netpbm/patches/patch-aj
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-aj,v 1.14 2014/08/25 08:23:22 wiz Exp $
-
-Fix build with png-1.5.
-Already included in Advanced release.
-
---- converter/other/pngtxt.h.orig 2006-08-19 04:12:28.000000000 +0100
-+++ converter/other/pngtxt.h 2011-01-14 21:39:26.000000000 +0000
-@@ -5,7 +5,8 @@
- #include <png.h>
-
- void
--pnmpng_read_text (png_info * const info_ptr,
-+pnmpng_read_text (png_struct * png_ptr,
-+ png_info * const info_ptr,
- FILE * const tfp,
- bool const ztxt,
- bool const verbose);
diff --git a/graphics/netpbm/patches/patch-ak b/graphics/netpbm/patches/patch-ak
deleted file mode 100644
index 479dd2a1f2a..00000000000
--- a/graphics/netpbm/patches/patch-ak
+++ /dev/null
@@ -1,81 +0,0 @@
-$NetBSD: patch-ak,v 1.10 2014/08/25 08:23:22 wiz Exp $
-
-Fix build with png-1.5.
-Already included in Advanced release.
-
---- converter/other/pngtxt.c.orig 2006-08-19 04:12:28.000000000 +0100
-+++ converter/other/pngtxt.c 2011-01-14 21:28:09.000000000 +0000
-@@ -240,7 +240,8 @@
-
-
- void
--pnmpng_read_text (png_info * const info_ptr,
-+pnmpng_read_text (png_struct * png_ptr,
-+ png_info * info_ptr,
- FILE * const tfp,
- bool const ztxt,
- bool const verbose) {
-@@ -250,6 +251,7 @@
- unsigned int commentIdx;
- bool noCommentsYet;
- bool eof;
-+ png_textp text_ptr;
- unsigned int allocatedComments;
- /* Number of entries currently allocated for the info_ptr->text
- array
-@@ -257,8 +259,8 @@
-
- allocatedComments = 256; /* initial value */
-
-- MALLOCARRAY(info_ptr->text, allocatedComments);
-- if (info_ptr->text == NULL)
-+ MALLOCARRAY(text_ptr, allocatedComments);
-+ if (text_ptr == NULL)
- pm_error("unable to allocate memory for comment array");
-
- commentIdx = 0;
-@@ -273,7 +275,7 @@
- if (lineLength == 0) {
- /* skip this empty line */
- } else {
-- handleArrayAllocation(&info_ptr->text, &allocatedComments,
-+ handleArrayAllocation(&text_ptr, &allocatedComments,
- commentIdx);
- if ((textline[0] != ' ') && (textline[0] != '\t')) {
- /* Line doesn't start with white space, which
-@@ -285,7 +287,7 @@
- ++commentIdx;
- noCommentsYet = FALSE;
-
-- startComment(&info_ptr->text[commentIdx],
-+ startComment(&text_ptr[commentIdx],
- textline, lineLength, ztxt);
- } else {
- /* Line starts with whitespace, which means it is
-@@ -295,20 +297,20 @@
- pm_error("Invalid comment file format: "
- "first line is a continuation line! "
- "(It starts with whitespace)");
-- continueComment(&info_ptr->text[commentIdx],
-+ continueComment(&text_ptr[commentIdx],
- textline, lineLength);
- }
- }
- strfree(textline);
- }
- }
-- if (noCommentsYet)
-- info_ptr->num_text = 0;
-- else
-- info_ptr->num_text = commentIdx + 1;
-+ if (!noCommentsYet)
-+ png_set_text(png_ptr, info_ptr, text_ptr, commentIdx + 1);
-
- if (verbose)
-- pm_message("%d comments placed in text chunk", info_ptr->num_text);
-+ pm_message("%d comments placed in text chunk", commentIdx + 1);
-+
-+ free(text_ptr);
- }
-
-
diff --git a/graphics/netpbm/patches/patch-al b/graphics/netpbm/patches/patch-al
deleted file mode 100644
index 4d402c825c0..00000000000
--- a/graphics/netpbm/patches/patch-al
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-al,v 1.6 2014/08/25 08:23:22 wiz Exp $
-
-Fix build with png-1.5.
-Already included in Advanced release.
-
---- converter/other/pamrgbatopng.c.orig 2006-08-19 04:12:28.000000000 +0100
-+++ converter/other/pamrgbatopng.c 2011-01-15 18:24:36.000000000 +0000
-@@ -101,10 +101,8 @@
- if (!infoP)
- pm_error("Could not allocate PNG info structure");
- else {
-- infoP->width = pamP->width;
-- infoP->height = pamP->height;
-- infoP->bit_depth = 8;
-- infoP->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
-+ png_set_IHDR(pngP, infoP, pamP->width, pamP->height,
-+ 8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);
-
- png_init_io(pngP, ofP);
-
diff --git a/graphics/netpbm/patches/patch-ao b/graphics/netpbm/patches/patch-ao
deleted file mode 100644
index e629bcf330e..00000000000
--- a/graphics/netpbm/patches/patch-ao
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-ao,v 1.5 2014/08/25 08:23:22 wiz Exp $
-
-Add missing header.
-Already included in current Advanced release.
-
---- converter/ppm/ppmtompeg/headers/frames.h.orig 2006-10-18 18:29:13.000000000 +0000
-+++ converter/ppm/ppmtompeg/headers/frames.h
-@@ -8,6 +8,8 @@
- #ifndef FRAMES_INCLUDED
- #define FRAMES_INCLUDED
-
-+#include "pm_config.h"
-+
- /*==============*
- * HEADER FILES *
- *==============*/
diff --git a/graphics/netpbm/patches/patch-aw b/graphics/netpbm/patches/patch-aw
deleted file mode 100644
index e9d4799fd12..00000000000
--- a/graphics/netpbm/patches/patch-aw
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-aw,v 1.4 2014/08/25 08:23:22 wiz Exp $
-
-Use CPPFLAGS from environment.
-Already included in current Advanced release.
-
---- lib/Makefile.orig 2006-10-03 20:55:25.000000000 +0200
-+++ lib/Makefile 2006-10-03 20:55:56.000000000 +0200
-@@ -81,7 +81,7 @@
- $(LIBOBJECTS): %.o: %.c importinc
- # Note that the user may have configured -I options into CFLAGS.
- $(CC) -c $(INCLUDES) -DNDEBUG $(CFLAGS) $(CFLAGS_SHLIB) \
-- $(CFLAGS_PERSONAL) $(CADD) -o $@ $<
-+ $(CFLAGS_PERSONAL) $(CPPFLAGS) $(CADD) -o $@ $<
-
- MAJ = $(NETPBM_MAJOR_RELEASE)
- MIN = $(NETPBM_MINOR_RELEASE)
diff --git a/graphics/netpbm/patches/patch-ax b/graphics/netpbm/patches/patch-ax
deleted file mode 100644
index 1b6b6f59354..00000000000
--- a/graphics/netpbm/patches/patch-ax
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-ax,v 1.4 2014/08/25 08:23:22 wiz Exp $
-
-Fix unportablet test(1) construct.
-Will be included in next Advanced release.
-
---- converter/ppm/hpcdtoppm/pcdovtoppm.orig 2004-10-23 00:12:12.000000000 +0100
-+++ converter/ppm/hpcdtoppm/pcdovtoppm 2006-11-19 15:46:03.000000000 +0000
-@@ -195,7 +195,7 @@
- rowfiles="$rowfiles $rowfile"
- fi
-
--if [ ${#rowfiles[*]} == 1 ]; then
-+if [ ${#rowfiles[*]} = 1 ]; then
- cat $rowfiles
- else
- if [ "$colors" = "n" ] ; then
diff --git a/graphics/netpbm/patches/patch-ay b/graphics/netpbm/patches/patch-ay
deleted file mode 100644
index e046ddff6f9..00000000000
--- a/graphics/netpbm/patches/patch-ay
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-ay,v 1.4 2014/08/25 08:23:22 wiz Exp $
-
-This is needed for some non-gcc compilers such as the Sun
-Studio c-compiler.
-Will be included in next Super Stable release.
-
---- lib/ppm.h.orig 2006-04-29 18:13:01.000000000 -0400
-+++ lib/ppm.h
-@@ -233,7 +233,7 @@ struct hsv
- ppm_hsv_from_color(pixel const color,
- pixval const maxval);
-
--static __inline pixval
-+static __inline__ pixval
- ppm_colorvalue(pixel const p) {
- /*----------------------------------------------------------------------------
- The color value (V is HSV) as a pixval
-@@ -241,7 +241,7 @@ ppm_colorvalue(pixel const p) {
- return PPM_MAX(PPM_GETR(p), PPM_MAX(PPM_GETG(p), PPM_GETB(p)));
- }
-
--static __inline pixval
-+static __inline__ pixval
- ppm_saturation(pixel const p,
- pixval const maxval) {
- /*----------------------------------------------------------------------------
diff --git a/graphics/netpbm/patches/patch-buildtools_installosf b/graphics/netpbm/patches/patch-buildtools_installosf
new file mode 100644
index 00000000000..024a895593d
--- /dev/null
+++ b/graphics/netpbm/patches/patch-buildtools_installosf
@@ -0,0 +1,15 @@
+$NetBSD: patch-buildtools_installosf,v 1.1 2014/09/08 21:22:29 wiz Exp $
+
+Fix unportable test(1) operator.
+
+--- buildtools/installosf.orig 2014-09-01 21:22:24.000000000 +0000
++++ buildtools/installosf
+@@ -17,7 +17,7 @@ while [ $# -gt 0 ]; do
+ elif [ "$1" = "-m" ]; then
+ shift
+ PERMISSIONS=$1
+- elif [ ${SOURCE_FILE}x == x ]; then
++ elif [ ${SOURCE_FILE}x = x ]; then
+ SOURCE_FILE=$1
+ else
+ TARGET_DIR=$1
diff --git a/graphics/netpbm/patches/patch-cb b/graphics/netpbm/patches/patch-cb
deleted file mode 100644
index 68a03ddb1d4..00000000000
--- a/graphics/netpbm/patches/patch-cb
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-cb,v 1.2 2014/08/25 08:23:22 wiz Exp $
-
-Fix unportablet test(1) construct.
-Will be included in next Advanced release.
-
---- buildtools/installosf.orig 2002-01-29 05:03:15.000000000 +0100
-+++ buildtools/installosf 2006-10-11 20:41:35.000000000 +0200
-@@ -17,7 +17,7 @@ while [ $# -gt 0 ]; do
- elif [ "$1" = "-m" ]; then
- shift
- PERMISSIONS=$1
-- elif [ ${SOURCE_FILE}x == x ]; then
-+ elif [ ${SOURCE_FILE}x = x ]; then
- SOURCE_FILE=$1
- else
- TARGET_DIR=$1
diff --git a/graphics/netpbm/patches/patch-converter_other_pngtopnm.c b/graphics/netpbm/patches/patch-converter_other_pngtopnm.c
deleted file mode 100644
index c49e187a379..00000000000
--- a/graphics/netpbm/patches/patch-converter_other_pngtopnm.c
+++ /dev/null
@@ -1,899 +0,0 @@
-$NetBSD: patch-converter_other_pngtopnm.c,v 1.2 2014/08/25 08:23:22 wiz Exp $
-
-Fix build with png-1.5 and newer.
-Already included in Advanced release.
-
---- converter/other/pngtopnm.c.orig 2011-11-25 00:15:46.000000000 +0000
-+++ converter/other/pngtopnm.c
-@@ -44,12 +44,6 @@
- #include "nstring.h"
- #include "shhopt.h"
-
--#if PNG_LIBPNG_VER >= 10400
--#error Your PNG library (<png.h>) is incompatible with this Netpbm source code.
--#error You need either an older PNG library (older than 1.4)
--#error newer Netpbm source code (at least 10.48)
--#endif
--
- typedef struct _jmpbuf_wrapper {
- jmp_buf jmpbuf;
- } jmpbuf_wrapper;
-@@ -187,7 +181,7 @@ parseCommandLine(int arg
-
-
-
--#define get_png_val(p) _get_png_val (&(p), info_ptr->bit_depth)
-+#define get_png_val(p) _get_png_val (&(p), png_get_bit_depth(png_ptr, info_ptr))
-
- static png_uint_16
- _get_png_val (png_byte ** const pp,
-@@ -266,33 +260,39 @@ png_color c;
- }
-
- #ifdef __STDC__
--static void save_text (png_info *info_ptr, FILE *tfp)
-+static void save_text (png_structp png_ptr, png_info *info_ptr, FILE *tfp)
- #else
--static void save_text (info_ptr, tfp)
-+static void save_text (png_ptr, info_ptr, tfp)
-+png_structp png_ptr;
- png_info *info_ptr;
- FILE *tfp;
- #endif
- {
- int i, j, k;
-+ png_textp text_ptr;
-+ int num_text;
-+
-+ if (png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) == 0)
-+ return;
-
-- for (i = 0 ; i < info_ptr->num_text ; i++) {
-+ for (i = 0 ; i < num_text ; i++) {
- j = 0;
-- while (info_ptr->text[i].key[j] != '\0' && info_ptr->text[i].key[j] != ' ')
-+ while (text_ptr[i].key[j] != '\0' && text_ptr[i].key[j] != ' ')
- j++;
-- if (info_ptr->text[i].key[j] != ' ') {
-- fprintf (tfp, "%s", info_ptr->text[i].key);
-- for (j = strlen (info_ptr->text[i].key) ; j < 15 ; j++)
-+ if (text_ptr[i].key[j] != ' ') {
-+ fprintf (tfp, "%s", text_ptr[i].key);
-+ for (j = strlen (text_ptr[i].key) ; j < 15 ; j++)
- putc (' ', tfp);
- } else {
-- fprintf (tfp, "\"%s\"", info_ptr->text[i].key);
-- for (j = strlen (info_ptr->text[i].key) ; j < 13 ; j++)
-+ fprintf (tfp, "\"%s\"", text_ptr[i].key);
-+ for (j = strlen (text_ptr[i].key) ; j < 13 ; j++)
- putc (' ', tfp);
- }
- putc (' ', tfp); /* at least one space between key and text */
-
-- for (j = 0 ; j < info_ptr->text[i].text_length ; j++) {
-- putc (info_ptr->text[i].text[j], tfp);
-- if (info_ptr->text[i].text[j] == '\n')
-+ for (j = 0 ; j < text_ptr[i].text_length ; j++) {
-+ putc (text_ptr[i].text[j], tfp);
-+ if (text_ptr[i].text[j] == '\n')
- for (k = 0 ; k < 16 ; k++)
- putc ((int)' ', tfp);
- }
-@@ -301,9 +301,10 @@ FILE *tfp;
- }
-
- #ifdef __STDC__
--static void show_time (png_info *info_ptr)
-+static void show_time (png_structp png_ptr, png_info *info_ptr)
- #else
--static void show_time (info_ptr)
-+static void show_time (png_ptr, info_ptr)
-+png_structp png_ptr;
- png_info *info_ptr;
- #endif
- {
-@@ -311,19 +312,20 @@ png_info *info_ptr;
- "", "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
- };
-+ png_timep mod_time;
-
-- if (info_ptr->valid & PNG_INFO_tIME) {
-- if (info_ptr->mod_time.month < 1 ||
-- info_ptr->mod_time.month >= ARRAY_SIZE(month)) {
-+ if (png_get_tIME(png_ptr, info_ptr, &mod_time) & PNG_INFO_tIME) {
-+ if (mod_time->month < 1 ||
-+ mod_time->month >= ARRAY_SIZE(month)) {
- pm_message("tIME chunk in PNG input is invalid; "
- "modification time of image is unknown. "
- "The month value, which should be in the range "
-- "1-12, is %u", info_ptr->mod_time.month);
-+ "1-12, is %u", mod_time->month);
- } else
- pm_message ("modification time: %02d %s %d %02d:%02d:%02d",
-- info_ptr->mod_time.day, month[info_ptr->mod_time.month],
-- info_ptr->mod_time.year, info_ptr->mod_time.hour,
-- info_ptr->mod_time.minute, info_ptr->mod_time.second);
-+ mod_time->day, month[mod_time->month],
-+ mod_time->year, mod_time->hour,
-+ mod_time->minute, mod_time->second);
- }
- }
-
-@@ -360,12 +362,28 @@ png_const_charp msg;
-
-
- static void
--dump_png_info(png_info *info_ptr) {
-+dump_png_info(png_structp png_ptr, png_info *info_ptr) {
-
- const char *type_string;
- const char *filter_string;
-+ png_color_16p background;
-+ int num_trans;
-+ double gamma;
-+ png_color_8p sig_bit;
-+ png_colorp palette;
-+ int num_palette;
-+ png_uint_16p hist;
-+ int res_x, res_y, unit_type;
-+ png_int_32 offset_x, offset_y;
-+ png_timep mod_time;
-+ png_charp purpose;
-+ png_int_32 X0, X1;
-+ int type, nparams;
-+ png_charp units;
-+ png_charpp params;
-+ int file_srgb_intent;
-
-- switch (info_ptr->color_type) {
-+ switch (png_get_color_type(png_ptr, info_ptr)) {
- case PNG_COLOR_TYPE_GRAY:
- type_string = "gray";
- break;
-@@ -387,90 +405,101 @@ dump_png_info(png_info *info_ptr) {
- break;
- }
-
-- switch (info_ptr->filter_type) {
-+ switch (png_get_filter_type(png_ptr, info_ptr)) {
- case PNG_FILTER_TYPE_BASE:
- asprintfN(&filter_string, "base filter");
- break;
- default:
- asprintfN(&filter_string, "unknown filter type %d",
-- info_ptr->filter_type);
-+ png_get_filter_type(png_ptr, info_ptr));
- }
-
-- pm_message("reading a %ldw x %ldh image, %d bit%s",
-- info_ptr->width, info_ptr->height,
-- info_ptr->bit_depth, info_ptr->bit_depth > 1 ? "s" : "");
-+ pm_message("reading a %uw x %uh image, %d bit%s",
-+ png_get_image_width(png_ptr, info_ptr),
-+ png_get_image_height(png_ptr, info_ptr),
-+ png_get_bit_depth(png_ptr, info_ptr),
-+ png_get_bit_depth(png_ptr, info_ptr) > 1 ? "s" : "");
- pm_message("%s, %s, %s",
- type_string,
-- info_ptr->interlace_type ?
-+ png_get_interlace_type(png_ptr, info_ptr) ?
- "Adam7 interlaced" : "not interlaced",
- filter_string);
-- pm_message("background {index, gray, red, green, blue} = "
-- "{%d, %d, %d, %d, %d}",
-- info_ptr->background.index,
-- info_ptr->background.gray,
-- info_ptr->background.red,
-- info_ptr->background.green,
-- info_ptr->background.blue);
-+
-+ if (png_get_bKGD(png_ptr, info_ptr, &background) & PNG_INFO_bKGD) {
-+ pm_message("background {index, gray, red, green, blue} = "
-+ "{%d, %d, %d, %d, %d}",
-+ background->index,
-+ background->gray,
-+ background->red,
-+ background->green,
-+ background->blue);
-+ }
-
- strfree(filter_string);
-
-- if (info_ptr->valid & PNG_INFO_tRNS)
-+ if (png_get_tRNS(png_ptr, info_ptr,
-+ NULL, &num_trans, NULL) & PNG_INFO_tRNS)
- pm_message("tRNS chunk (transparency): %u entries",
-- info_ptr->num_trans);
-+ num_trans);
- else
- pm_message("tRNS chunk (transparency): not present");
-
-- if (info_ptr->valid & PNG_INFO_gAMA)
-- pm_message("gAMA chunk (image gamma): gamma = %4.2f", info_ptr->gamma);
-+ if (png_get_gAMA(png_ptr, info_ptr, &gamma) & PNG_INFO_gAMA)
-+ pm_message("gAMA chunk (image gamma): gamma = %4.2f", gamma);
- else
- pm_message("gAMA chunk (image gamma): not present");
-
-- if (info_ptr->valid & PNG_INFO_sBIT)
-+ if (png_get_sBIT(png_ptr, info_ptr, &sig_bit) & PNG_INFO_sBIT)
- pm_message("sBIT chunk: present");
- else
- pm_message("sBIT chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_cHRM)
-+ if (png_get_cHRM(png_ptr, info_ptr,
-+ NULL, NULL, NULL, NULL,
-+ NULL, NULL, NULL, NULL) & PNG_INFO_cHRM)
- pm_message("cHRM chunk: present");
- else
- pm_message("cHRM chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_PLTE)
-- pm_message("PLTE chunk: %d entries", info_ptr->num_palette);
-+ if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette) & PNG_INFO_PLTE)
-+ pm_message("PLTE chunk: %d entries", num_palette);
- else
- pm_message("PLTE chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_bKGD)
-+ if (png_get_bKGD(png_ptr, info_ptr, &background) & PNG_INFO_bKGD)
- pm_message("bKGD chunk: present");
- else
- pm_message("bKGD chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_hIST)
-+ if (png_get_hIST(png_ptr, info_ptr, &hist) & PNG_INFO_hIST)
- pm_message("hIST chunk: present");
- else
- pm_message("hIST chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_pHYs)
-+ if (png_get_pHYs(png_ptr, info_ptr,
-+ &res_x, &res_y, &unit_type) & PNG_INFO_pHYs)
- pm_message("pHYs chunk: present");
- else
- pm_message("pHYs chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_oFFs)
-+ if (png_get_oFFs(png_ptr, info_ptr,
-+ &offset_x, &offset_y, &unit_type) & PNG_INFO_oFFs)
- pm_message("oFFs chunk: present");
- else
- pm_message("oFFs chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_tIME)
-+ if (png_get_tIME(png_ptr, info_ptr, &mod_time) & PNG_INFO_tIME)
- pm_message("tIME chunk: present");
- else
- pm_message("tIME chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_pCAL)
-+ if (png_get_pCAL(png_ptr, info_ptr, &purpose, &X0, &X1,
-+ &type, &nparams, &units, &params) & PNG_INFO_pCAL)
- pm_message("pCAL chunk: present");
- else
- pm_message("pCAL chunk: not present");
-
-- if (info_ptr->valid & PNG_INFO_sRGB)
-+ if (png_get_sRGB(png_ptr, info_ptr, &file_srgb_intent) & PNG_INFO_sRGB)
- pm_message("sRGB chunk: present");
- else
- pm_message("sRGB chunk: not present");
-@@ -479,19 +508,19 @@ dump_png_info(png_info *info_ptr) {
-
-
- static bool
--isTransparentColor(pngcolor const color,
-- png_info * const info_ptr,
-- double const totalgamma) {
-+isTransparentColor(pngcolor const color,
-+ png_structp const png_ptr,
-+ png_info * const info_ptr,
-+ double const totalgamma) {
- /*----------------------------------------------------------------------------
- Return TRUE iff pixels of color 'color' are supposed to be transparent
- everywhere they occur. Assume it's an RGB image.
- -----------------------------------------------------------------------------*/
- bool retval;
-+ png_color_16p transColorP;
-
-- if (info_ptr->valid & PNG_INFO_tRNS) {
-- const png_color_16 * const transColorP = &info_ptr->trans_values;
--
--
-+ if (png_get_tRNS(png_ptr, info_ptr,
-+ NULL, NULL, &transColorP) & PNG_INFO_tRNS) {
- /* There seems to be a problem here: you can't compare real
- numbers for equality. Also, I'm not sure the gamma
- corrected/uncorrected color spaces are right here.
-@@ -537,9 +566,11 @@ setupGammaCorrection(png_struct * const
- if (displaygamma == -1.0)
- *totalgammaP = -1.0;
- else {
-+ double fileGamma;
- float imageGamma;
-- if (info_ptr->valid & PNG_INFO_gAMA)
-- imageGamma = info_ptr->gamma;
-+
-+ if (png_get_gAMA(png_ptr, info_ptr, &fileGamma) & PNG_INFO_gAMA)
-+ imageGamma = fileGamma;
- else {
- if (verbose)
- pm_message("PNG doesn't specify image gamma. Assuming 1.0");
-@@ -555,10 +586,14 @@ setupGammaCorrection(png_struct * const
- } else {
- png_set_gamma(png_ptr, displaygamma, imageGamma);
- *totalgammaP = imageGamma * displaygamma;
-+#ifdef NOT_SUPPORTED_ANYMORE
-+ /* The API doesn't clearing PNG_INFO_sBIT. */
-+
- /* in case of gamma-corrections, sBIT's as in the
- PNG-file are not valid anymore
- */
- info_ptr->valid &= ~PNG_INFO_sBIT;
-+#endif
- if (verbose)
- pm_message("image gamma is %4.2f, "
- "converted for display gamma of %4.2f",
-@@ -570,20 +605,24 @@ setupGammaCorrection(png_struct * const
-
-
- static bool
--paletteHasPartialTransparency(png_info * const info_ptr) {
-+paletteHasPartialTransparency(png_structp png_ptr, png_info * const info_ptr) {
-
- bool retval;
-
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-- if (info_ptr->valid & PNG_INFO_tRNS) {
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
-+ png_bytep trans_alpha;
-+ int num_trans;
-+
-+ if (png_get_tRNS(png_ptr, info_ptr,
-+ &trans_alpha, &num_trans, NULL) & PNG_INFO_tRNS) {
- bool foundGray;
- unsigned int i;
-
- for (i = 0, foundGray = FALSE;
-- i < info_ptr->num_trans && !foundGray;
-+ i < num_trans && !foundGray;
- ++i) {
-- if (info_ptr->trans[i] != 0 &&
-- info_ptr->trans[i] != maxval) {
-+ if (trans_alpha[i] != 0 &&
-+ trans_alpha[i] != maxval) {
- foundGray = TRUE;
- }
- }
-@@ -611,14 +650,16 @@ setupSignificantBits(png_struct *
-
- Return the result as *maxvalP.
- -----------------------------------------------------------------------------*/
-+ png_color_8p sig_bit;
-+
- /* Initial assumption of maxval */
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) {
- if (alpha == ALPHA_ONLY) {
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB)
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
-+ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB)
- /* The alpha mask will be all opaque, so maxval 1 is plenty */
- *maxvalP = 1;
-- else if (paletteHasPartialTransparency(info_ptr))
-+ else if (paletteHasPartialTransparency(png_ptr, info_ptr))
- /* Use same maxval as PNG transparency palette for simplicity*/
- *maxvalP = 255;
- else
-@@ -628,7 +669,7 @@ setupSignificantBits(png_struct *
- /* Use same maxval as PNG palette for simplicity */
- *maxvalP = 255;
- } else {
-- *maxvalP = (1l << info_ptr->bit_depth) - 1;
-+ *maxvalP = (1l << png_get_bit_depth(png_ptr, info_ptr)) - 1;
- }
-
- /* sBIT handling is very tricky. If we are extracting only the
-@@ -641,20 +682,26 @@ setupSignificantBits(png_struct *
- is used
- */
-
-- if (info_ptr->valid & PNG_INFO_sBIT) {
-+ if (png_get_sBIT(png_ptr, info_ptr, &sig_bit) & PNG_INFO_sBIT) {
-+ png_byte color_type;
-+ png_bytep trans_alpha;
-+ int num_trans;
-+
-+ color_type = png_get_color_type(png_ptr, info_ptr);
- switch (alpha) {
- case ALPHA_MIX:
-- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
-- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-+ if (color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
-+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
- break;
-- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
-- (info_ptr->valid & PNG_INFO_tRNS)) {
-+ if (color_type == PNG_COLOR_TYPE_PALETTE &&
-+ png_get_tRNS(png_ptr, info_ptr,
-+ &trans_alpha, &num_trans, NULL) & PNG_INFO_tRNS) {
-
- bool trans_mix;
- unsigned int i;
- trans_mix = TRUE;
-- for (i = 0; i < info_ptr->num_trans; ++i)
-- if (info_ptr->trans[i] != 0 && info_ptr->trans[i] != 255) {
-+ for (i = 0; i < num_trans; ++i)
-+ if (trans_alpha[i] != 0 && trans_alpha[i] != 255) {
- trans_mix = FALSE;
- break;
- }
-@@ -665,70 +712,76 @@ setupSignificantBits(png_struct *
- /* else fall though to normal case */
-
- case ALPHA_NONE:
-- if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
-- (info_ptr->sig_bit.red != info_ptr->sig_bit.green ||
-- info_ptr->sig_bit.red != info_ptr->sig_bit.blue) &&
-+ if ((color_type == PNG_COLOR_TYPE_PALETTE ||
-+ color_type == PNG_COLOR_TYPE_RGB ||
-+ color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
-+ (sig_bit->red != sig_bit->green ||
-+ sig_bit->red != sig_bit->blue) &&
- alpha == ALPHA_NONE) {
- pm_message("This program cannot handle "
- "different bit depths for color channels");
- pm_message("writing file with %d bit resolution",
-- info_ptr->bit_depth);
-+ png_get_bit_depth(png_ptr, info_ptr));
- *errorlevelP = PNMTOPNG_WARNING_LEVEL;
- } else {
-- if ((info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) &&
-- (info_ptr->sig_bit.red < 255)) {
-+ png_colorp palette;
-+ int num_palette;
-+
-+ if ((color_type == PNG_COLOR_TYPE_PALETTE) &&
-+ (sig_bit->red < 255) &&
-+ png_get_PLTE(png_ptr, info_ptr,
-+ &palette, &num_palette) & PNG_INFO_PLTE) {
- unsigned int i;
-- for (i = 0; i < info_ptr->num_palette; ++i) {
-- info_ptr->palette[i].red >>=
-- (8 - info_ptr->sig_bit.red);
-- info_ptr->palette[i].green >>=
-- (8 - info_ptr->sig_bit.green);
-- info_ptr->palette[i].blue >>=
-- (8 - info_ptr->sig_bit.blue);
-+
-+ for (i = 0; i < num_palette; ++i) {
-+ palette[i].red >>=
-+ (8 - sig_bit->red);
-+ palette[i].green >>=
-+ (8 - sig_bit->green);
-+ palette[i].blue >>=
-+ (8 - sig_bit->blue);
- }
-- *maxvalP = (1l << info_ptr->sig_bit.red) - 1;
-+ *maxvalP = (1l << sig_bit->red) - 1;
- if (verbose)
- pm_message ("image has fewer significant bits, "
- "writing file with %d bits per channel",
-- info_ptr->sig_bit.red);
-+ sig_bit->red);
- } else
-- if ((info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
-- info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
-- (info_ptr->sig_bit.red < info_ptr->bit_depth)) {
-- png_set_shift (png_ptr, &(info_ptr->sig_bit));
-- *maxvalP = (1l << info_ptr->sig_bit.red) - 1;
-+ if ((color_type == PNG_COLOR_TYPE_RGB ||
-+ color_type == PNG_COLOR_TYPE_RGB_ALPHA) &&
-+ (sig_bit->red < png_get_bit_depth(png_ptr, info_ptr))) {
-+ png_set_shift (png_ptr, sig_bit);
-+ *maxvalP = (1l << sig_bit->red) - 1;
- if (verbose)
- pm_message("image has fewer significant bits, "
- "writing file with %d "
- "bits per channel",
-- info_ptr->sig_bit.red);
-+ sig_bit->red);
- } else
-- if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-- info_ptr->color_type ==
-+ if ((color_type == PNG_COLOR_TYPE_GRAY ||
-+ color_type ==
- PNG_COLOR_TYPE_GRAY_ALPHA) &&
-- (info_ptr->sig_bit.gray < info_ptr->bit_depth)) {
-- png_set_shift (png_ptr, &(info_ptr->sig_bit));
-- *maxvalP = (1l << info_ptr->sig_bit.gray) - 1;
-+ (sig_bit->gray < png_get_bit_depth(png_ptr, info_ptr))) {
-+ png_set_shift (png_ptr, sig_bit);
-+ *maxvalP = (1l << sig_bit->gray) - 1;
- if (verbose)
- pm_message("image has fewer significant bits, "
- "writing file with %d bits",
-- info_ptr->sig_bit.gray);
-+ sig_bit->gray);
- }
- }
- break;
-
- case ALPHA_ONLY:
-- if ((info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
-- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) &&
-- (info_ptr->sig_bit.gray < info_ptr->bit_depth)) {
-- png_set_shift (png_ptr, &(info_ptr->sig_bit));
-+ if ((color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
-+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA) &&
-+ (sig_bit->gray < png_get_bit_depth(png_ptr, info_ptr))) {
-+ png_set_shift (png_ptr, sig_bit);
- if (verbose)
- pm_message ("image has fewer significant bits, "
- "writing file with %d bits",
-- info_ptr->sig_bit.alpha);
-- *maxvalP = (1l << info_ptr->sig_bit.alpha) - 1;
-+ sig_bit->alpha);
-+ *maxvalP = (1l << sig_bit->alpha) - 1;
- }
- break;
-
-@@ -739,22 +792,28 @@ setupSignificantBits(png_struct *
-
-
- static bool
--imageHasColor(png_info * const info_ptr) {
-+imageHasColor(png_structp const png_ptr, png_info * const info_ptr) {
-
- bool retval;
--
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-+ png_byte color_type;
-+ png_colorp palette;
-+ int num_palette;
-+
-+ color_type = png_get_color_type(png_ptr, info_ptr);
-+ if (color_type == PNG_COLOR_TYPE_GRAY ||
-+ color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-
- retval = FALSE;
-- else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-+ else if (color_type == PNG_COLOR_TYPE_PALETTE &&
-+ png_get_PLTE(png_ptr, info_ptr,
-+ &palette, &num_palette) & PNG_INFO_PLTE) {
- bool foundColor;
- unsigned int i;
-
- for (i = 0, foundColor = FALSE;
-- i < info_ptr->num_palette && !foundColor;
-+ i < num_palette && !foundColor;
- ++i) {
-- if (iscolor(info_ptr->palette[i]))
-+ if (iscolor(palette[i]))
- foundColor = TRUE;
- }
- retval = foundColor;
-@@ -767,14 +826,15 @@ imageHasColor(png_info * const info_ptr)
-
-
- static void
--determineOutputType(png_info * const info_ptr,
-+determineOutputType(png_structp const png_ptr,
-+ png_info * const info_ptr,
- enum alpha_handling const alphaHandling,
- pngcolor const bgColor,
- xelval const maxval,
- int * const pnmTypeP) {
-
- if (alphaHandling != ALPHA_ONLY &&
-- (imageHasColor(info_ptr) || !isGrayscale(bgColor)))
-+ (imageHasColor(png_ptr, info_ptr) || !isGrayscale(bgColor)))
- *pnmTypeP = PPM_TYPE;
- else {
- if (maxval > 1)
-@@ -787,7 +847,8 @@ determineOutputType(png_info *
-
-
- static void
--getBackgroundColor(png_info * const info_ptr,
-+getBackgroundColor(png_structp const png_ptr,
-+ png_info * const info_ptr,
- const char * const requestedColor,
- float const totalgamma,
- xelval const maxval,
-@@ -798,6 +859,8 @@ getBackgroundColor(png_info * con
- Otherwise, if the PNG specifies a background color, that's the one.
- And otherwise, it's white.
- -----------------------------------------------------------------------------*/
-+ png_color_16p background;
-+
- if (requestedColor) {
- /* Background was specified from the command-line; we always
- use that. I chose to do no gamma-correction in this case;
-@@ -809,27 +872,32 @@ getBackgroundColor(png_info * con
- bgColorP->g = PPM_GETG(backcolor);
- bgColorP->b = PPM_GETB(backcolor);
-
-- } else if (info_ptr->valid & PNG_INFO_bKGD) {
-+ } else if (png_get_bKGD(png_ptr, info_ptr, &background) & PNG_INFO_bKGD) {
- /* didn't manage to get libpng to work (bugs?) concerning background
- processing, therefore we do our own.
- */
-- switch (info_ptr->color_type) {
-+ switch (png_get_color_type(png_ptr, info_ptr)) {
- case PNG_COLOR_TYPE_GRAY:
- case PNG_COLOR_TYPE_GRAY_ALPHA:
- bgColorP->r = bgColorP->g = bgColorP->b =
-- gamma_correct(info_ptr->background.gray, totalgamma);
-+ gamma_correct(background->gray, totalgamma);
- break;
- case PNG_COLOR_TYPE_PALETTE: {
-- png_color const rawBgcolor =
-- info_ptr->palette[info_ptr->background.index];
-- bgColorP->r = gamma_correct(rawBgcolor.red, totalgamma);
-- bgColorP->g = gamma_correct(rawBgcolor.green, totalgamma);
-- bgColorP->b = gamma_correct(rawBgcolor.blue, totalgamma);
-+ png_colorp palette;
-+ int num_palette;
-+
-+ if (png_get_PLTE(png_ptr, info_ptr,
-+ &palette, &num_palette) & PNG_INFO_PLTE) {
-+ png_color const rawBgcolor = palette[background->index];
-+ bgColorP->r = gamma_correct(rawBgcolor.red, totalgamma);
-+ bgColorP->g = gamma_correct(rawBgcolor.green, totalgamma);
-+ bgColorP->b = gamma_correct(rawBgcolor.blue, totalgamma);
-+ }
- }
- break;
- case PNG_COLOR_TYPE_RGB:
- case PNG_COLOR_TYPE_RGB_ALPHA: {
-- png_color_16 const rawBgcolor = info_ptr->background;
-+ png_color_16 const rawBgcolor = *background;
-
- bgColorP->r = gamma_correct(rawBgcolor.red, totalgamma);
- bgColorP->g = gamma_correct(rawBgcolor.green, totalgamma);
-@@ -848,6 +916,7 @@ static void
- writePnm(FILE * const ofP,
- xelval const maxval,
- int const pnm_type,
-+ png_structp const png_ptr,
- png_info * const info_ptr,
- png_byte ** const png_image,
- pngcolor const bgColor,
-@@ -865,6 +934,7 @@ writePnm(FILE * const ofP,
- -----------------------------------------------------------------------------*/
- xel * xelrow;
- unsigned int row;
-+ png_uint_32 width, height;
-
- if (verbose)
- pm_message ("writing a %s file (maxval=%u)",
-@@ -874,27 +944,35 @@ writePnm(FILE * const ofP,
- "UNKNOWN!",
- maxval);
-
-- xelrow = pnm_allocrow(info_ptr->width);
-+ xelrow = pnm_allocrow(png_get_image_width(png_ptr, info_ptr));
-
-- pnm_writepnminit(stdout, info_ptr->width, info_ptr->height, maxval,
-- pnm_type, FALSE);
-+ width = png_get_image_width(png_ptr, info_ptr);
-+ height = png_get_image_height(png_ptr, info_ptr);
-
-- for (row = 0; row < info_ptr->height; ++row) {
-+ pnm_writepnminit(stdout, width, height, maxval, pnm_type, FALSE);
-+
-+ for (row = 0; row < height; ++row) {
- png_byte * png_pixelP;
- int col;
-
- png_pixelP = &png_image[row][0]; /* initial value */
-- for (col = 0; col < info_ptr->width; ++col) {
-- switch (info_ptr->color_type) {
-+ for (col = 0; col < width; ++col) {
-+ switch (png_get_color_type(png_ptr, info_ptr)) {
- case PNG_COLOR_TYPE_GRAY: {
- pngcolor fgColor;
-+ png_color_16p trans_color;
-+
- fgColor.r = fgColor.g = fgColor.b = get_png_val(png_pixelP);
-- setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-- ((info_ptr->valid & PNG_INFO_tRNS) &&
-- (fgColor.r ==
-- gamma_correct(info_ptr->trans_values.gray,
-- totalgamma))) ?
-- 0 : maxval);
-+
-+ if (png_get_tRNS(png_ptr, info_ptr,
-+ NULL, NULL, &trans_color) & PNG_INFO_tRNS &&
-+ (fgColor.r == gamma_correct(trans_color->gray,
-+ totalgamma))) {
-+ setXel(&xelrow[col], fgColor, bgColor, alpha_handling, 0);
-+ } else {
-+ setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-+ maxval);
-+ }
- }
- break;
-
-@@ -909,19 +987,31 @@ writePnm(FILE * const ofP,
- break;
-
- case PNG_COLOR_TYPE_PALETTE: {
-- png_uint_16 const index = get_png_val(png_pixelP);
-- png_color const paletteColor = info_ptr->palette[index];
--
-- pngcolor fgColor;
--
-- fgColor.r = paletteColor.red;
-- fgColor.g = paletteColor.green;
-- fgColor.b = paletteColor.blue;
--
-- setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-- (info_ptr->valid & PNG_INFO_tRNS) &&
-- index < info_ptr->num_trans ?
-- info_ptr->trans[index] : maxval);
-+ png_uint_16 const index = get_png_val(png_pixelP);
-+ png_colorp palette;
-+ int num_palette;
-+
-+ if (png_get_PLTE(png_ptr, info_ptr,
-+ &palette, &num_palette) & PNG_INFO_PLTE) {
-+ png_color const paletteColor = palette[index];
-+ pngcolor fgColor;
-+ png_bytep trans_alpha;
-+ int num_trans;
-+
-+ fgColor.r = paletteColor.red;
-+ fgColor.g = paletteColor.green;
-+ fgColor.b = paletteColor.blue;
-+
-+ if (png_get_tRNS(png_ptr, info_ptr,
-+ &trans_alpha,
-+ &num_trans, NULL) & PNG_INFO_tRNS) {
-+ setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-+ index < num_trans ? trans_alpha[index] : maxval);
-+ } else {
-+ setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-+ maxval);
-+ }
-+ }
- }
- break;
-
-@@ -932,8 +1022,8 @@ writePnm(FILE * const ofP,
- fgColor.g = get_png_val(png_pixelP);
- fgColor.b = get_png_val(png_pixelP);
- setXel(&xelrow[col], fgColor, bgColor, alpha_handling,
-- isTransparentColor(fgColor, info_ptr, totalgamma) ?
-- 0 : maxval);
-+ isTransparentColor(fgColor, png_ptr, info_ptr,
-+ totalgamma) ? 0 : maxval);
- }
- break;
-
-@@ -950,10 +1040,10 @@ writePnm(FILE * const ofP,
- break;
-
- default:
-- pm_error ("unknown PNG color type: %d", info_ptr->color_type);
-+ pm_error ("unknown PNG color type: %d", png_get_color_type(png_ptr, info_ptr));
- }
- }
-- pnm_writepnmrow(ofP, xelrow, info_ptr->width, maxval, pnm_type, FALSE);
-+ pnm_writepnmrow(ofP, xelrow, width, maxval, pnm_type, FALSE);
- }
- pnm_freerow (xelrow);
- }
-@@ -974,6 +1064,7 @@ convertpng(FILE * const ifp,
- int pnm_type;
- pngcolor bgColor;
- float totalgamma;
-+ int res_x, res_y, unit_type;
-
- *errorlevelP = 0;
-
-@@ -996,28 +1087,28 @@ convertpng(FILE * const ifp,
- png_set_sig_bytes (png_ptr, SIG_CHECK_SIZE);
- png_read_info (png_ptr, info_ptr);
-
-- MALLOCARRAY(png_image, info_ptr->height);
-+ MALLOCARRAY(png_image, png_get_image_height(png_ptr, info_ptr));
- if (png_image == NULL) {
- png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
- pm_closer (ifp);
- pm_error ("couldn't allocate space for image");
- }
-
-- if (info_ptr->bit_depth == 16)
-- linesize = 2 * info_ptr->width;
-+ if (png_get_bit_depth(png_ptr, info_ptr) == 16)
-+ linesize = 2 * png_get_image_width(png_ptr, info_ptr);
- else
-- linesize = info_ptr->width;
-+ linesize = png_get_image_width(png_ptr, info_ptr);
-
-- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
- linesize *= 2;
- else
-- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB)
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB)
- linesize *= 3;
- else
-- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
- linesize *= 4;
-
-- for (y = 0 ; y < info_ptr->height ; y++) {
-+ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++) {
- png_image[y] = malloc (linesize);
- if (png_image[y] == NULL) {
- for (x = 0 ; x < y ; x++)
-@@ -1029,7 +1120,7 @@ convertpng(FILE * const ifp,
- }
- }
-
-- if (info_ptr->bit_depth < 8)
-+ if (png_get_bit_depth(png_ptr, info_ptr) < 8)
- png_set_packing (png_ptr);
-
- setupGammaCorrection(png_ptr, info_ptr, cmdline.gamma, &totalgamma);
-@@ -1037,8 +1128,8 @@ convertpng(FILE * const ifp,
- setupSignificantBits(png_ptr, info_ptr, cmdline.alpha,
- &maxval, errorlevelP);
-
-- getBackgroundColor(info_ptr, cmdline.background, totalgamma, maxval,
-- &bgColor);
-+ getBackgroundColor(png_ptr, info_ptr, cmdline.background, totalgamma,
-+ maxval, &bgColor);
-
- png_read_image (png_ptr, png_image);
- png_read_end (png_ptr, info_ptr);
-@@ -1048,16 +1139,17 @@ convertpng(FILE * const ifp,
- completes. That's because it comes from chunks that are at the
- end of the stream.
- */
-- dump_png_info(info_ptr);
-+ dump_png_info(png_ptr, info_ptr);
-
- if (mtime)
-- show_time (info_ptr);
-+ show_time (png_ptr, info_ptr);
- if (tfp)
-- save_text (info_ptr, tfp);
-+ save_text (png_ptr, info_ptr, tfp);
-
-- if (info_ptr->valid & PNG_INFO_pHYs) {
-+ if (png_get_pHYs(png_ptr, info_ptr,
-+ &res_x, &res_y, &unit_type) & PNG_INFO_pHYs) {
- float r;
-- r = (float)info_ptr->x_pixels_per_unit / info_ptr->y_pixels_per_unit;
-+ r = (float)res_x / res_y;
- if (r != 1.0) {
- pm_message ("warning - non-square pixels; "
- "to fix do a 'pamscale -%cscale %g'",
-@@ -1067,13 +1159,13 @@ convertpng(FILE * const ifp,
- }
- }
-
-- determineOutputType(info_ptr, cmdline.alpha, bgColor, maxval, &pnm_type);
-+ determineOutputType(png_ptr, info_ptr, cmdline.alpha, bgColor, maxval, &pnm_type);
-
-- writePnm(stdout, maxval, pnm_type, info_ptr, png_image, bgColor,
-+ writePnm(stdout, maxval, pnm_type, png_ptr, info_ptr, png_image, bgColor,
- cmdline.alpha, totalgamma);
-
- fflush(stdout);
-- for (y = 0 ; y < info_ptr->height ; y++)
-+ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++)
- free (png_image[y]);
- free (png_image);
- png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL);
diff --git a/graphics/netpbm/patches/patch-converter_other_pstopnm.c b/graphics/netpbm/patches/patch-converter_other_pstopnm.c
new file mode 100644
index 00000000000..27cabe33491
--- /dev/null
+++ b/graphics/netpbm/patches/patch-converter_other_pstopnm.c
@@ -0,0 +1,50 @@
+$NetBSD: patch-converter_other_pstopnm.c,v 1.1 2014/09/08 21:22:29 wiz Exp $
+
+stdout is a special word.
+Fix some whitespace issues while here.
+
+--- converter/other/pstopnm.c.orig 2014-09-01 21:22:30.000000000 +0000
++++ converter/other/pstopnm.c
+@@ -79,7 +79,7 @@ struct CmdlineInfo {
+ unsigned int ysize; /* zero means unspecified */
+ unsigned int dpi; /* zero means unspecified */
+ enum Orientation orientation;
+- unsigned int stdout;
++ unsigned int istdout;
+ unsigned int textalphabits;
+ };
+
+@@ -114,9 +114,9 @@ parseCommandLine(int argc, char ** argv,
+ OPTENT3(0, "urx", OPT_FLOAT, &urx, &urxSpec, 0);
+ OPTENT3(0, "ury", OPT_FLOAT, &ury, &urySpec, 0);
+ OPTENT3(0, "nocrop", OPT_FLAG, NULL, &cmdlineP->nocrop, 0);
+- OPTENT3(0, "pbm", OPT_FLAG, NULL, &pbmOpt , 0);
++ OPTENT3(0, "pbm", OPT_FLAG, NULL, &pbmOpt, 0);
+ OPTENT3(0, "pgm", OPT_FLAG, NULL, &pgmOpt, 0);
+- OPTENT3(0, "ppm", OPT_FLAG, NULL, &ppmOpt, 0);
++ OPTENT3(0, "ppm", OPT_FLAG, NULL, &ppmOpt, 0);
+ OPTENT3(0, "verbose", OPT_FLAG, NULL, &cmdlineP->verbose, 0);
+ OPTENT3(0, "xborder", OPT_FLOAT, &cmdlineP->xborder, NULL, 0);
+ OPTENT3(0, "xmax", OPT_UINT, &cmdlineP->xmax, &xmaxSpec, 0);
+@@ -125,9 +125,9 @@ parseCommandLine(int argc, char ** argv,
+ OPTENT3(0, "ymax", OPT_UINT, &cmdlineP->ymax, &ymaxSpec, 0);
+ OPTENT3(0, "ysize", OPT_UINT, &cmdlineP->ysize, &ysizeSpec, 0);
+ OPTENT3(0, "dpi", OPT_UINT, &cmdlineP->dpi, &dpiSpec, 0);
+- OPTENT3(0, "portrait", OPT_FLAG, NULL, &portraitOpt, 0);
+- OPTENT3(0, "landscape", OPT_FLAG, NULL, &landscapeOpt, 0);
+- OPTENT3(0, "stdout", OPT_FLAG, NULL, &cmdlineP->stdout, 0);
++ OPTENT3(0, "portrait", OPT_FLAG, NULL, &portraitOpt, 0);
++ OPTENT3(0, "landscape", OPT_FLAG, NULL, &landscapeOpt, 0);
++ OPTENT3(0, "stdout", OPT_FLAG, NULL, &cmdlineP->istdout, 0);
+ OPTENT3(0, "textalphabits", OPT_UINT,
+ &cmdlineP->textalphabits, &textalphabitsSpec, 0);
+
+@@ -664,7 +664,7 @@ computeOutfileArg(struct CmdlineInfo con
+ -----------------------------------------------------------------------------*/
+ const char * retval; /* malloc'ed */
+
+- if (cmdline.stdout)
++ if (cmdline.istdout)
+ retval = strdup("-");
+ else if (streq(cmdline.inputFileName, "-"))
+ retval = strdup("-");
diff --git a/graphics/netpbm/patches/patch-converter_ppm_ppmtompeg_psocket.c b/graphics/netpbm/patches/patch-converter_ppm_ppmtompeg_psocket.c
deleted file mode 100644
index 1239b6b8a37..00000000000
--- a/graphics/netpbm/patches/patch-converter_ppm_ppmtompeg_psocket.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-converter_ppm_ppmtompeg_psocket.c,v 1.1 2014/07/17 15:52:26 ryoon Exp $
-
---- converter/ppm/ppmtompeg/psocket.c.orig 2006-08-19 03:12:28.000000000 +0000
-+++ converter/ppm/ppmtompeg/psocket.c
-@@ -9,7 +9,10 @@
-
- ============================================================================*/
-
-+/* SCO OpenServer 5.0.7/3.2 does not typedef u_long, when _XOPEN_SOURCE is defined. */
-+#if !defined(_SCO_DS)
- #define _XOPEN_SOURCE 500 /* Make sure stdio.h contains pclose() */
-+#endif
- /* _ALL_SOURCE is needed on AIX to make the C library include the
- socket services (e.g. define struct sockaddr)
-
-@@ -44,6 +47,11 @@
- #undef _XOPEN_SOURCE
- #endif
-
-+/* Avoid vogus error under SCO OpenServer 5.0.7/3.2 with GCC 4.2.4. */
-+#if defined(_SCO_DS)
-+#define BSD 0
-+#endif
-+
- #include <stdarg.h>
- #include <netinet/in.h>
- #include <unistd.h>
diff --git a/graphics/netpbm/patches/patch-da b/graphics/netpbm/patches/patch-da
deleted file mode 100644
index 66f31aad26c..00000000000
--- a/graphics/netpbm/patches/patch-da
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-da,v 1.3 2010/03/04 11:01:01 tnn Exp $
-
---- converter/other/jpeg2000/jpeg2ktopam.c.orig 2007-12-27 22:32:59.000000000 +0000
-+++ converter/other/jpeg2000/jpeg2ktopam.c
-@@ -10,7 +10,11 @@
-
- #define _BSD_SOURCE 1 /* Make sure strdup() is in string.h */
- /* Make sure strdup() is in string.h and int_fast32_t is in inttypes.h */
--#define _XOPEN_SOURCE 600
-+#ifdef __osf__
-+#define _OSF_SOURCE
-+#else
-+#define _XOPEN_SOURCE 500
-+#endif /* __osf__ */
- #include <string.h>
-
- #include "pam.h"
diff --git a/graphics/netpbm/patches/patch-db b/graphics/netpbm/patches/patch-db
deleted file mode 100644
index f09b1e70821..00000000000
--- a/graphics/netpbm/patches/patch-db
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-db,v 1.3 2010/03/04 11:01:01 tnn Exp $
-
---- converter/other/jpeg2000/pamtojpeg2k.c.orig 2007-12-27 22:32:59.000000000 +0000
-+++ converter/other/jpeg2000/pamtojpeg2k.c
-@@ -10,7 +10,11 @@
-
- #define _BSD_SOURCE 1 /* Make sure strdup() is in string.h */
- /* Make sure strdup() is in string.h and int_fast32_t is in inttypes.h */
--#define _XOPEN_SOURCE 600
-+#ifdef __osf__
-+#define _OSF_SOURCE
-+#else
-+#define _XOPEN_SOURCE 500
-+#endif /* __osf__ */
- #include <string.h>
-
- #include "pam.h"
diff --git a/graphics/netpbm/patches/patch-dc b/graphics/netpbm/patches/patch-dc
deleted file mode 100644
index 82b4ec41fbd..00000000000
--- a/graphics/netpbm/patches/patch-dc
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-dc,v 1.2 2014/08/21 20:58:23 wiz Exp $
-
---- converter/other/cameratopam/camera.c.orig 2006-08-19 03:12:28.000000000 +0000
-+++ converter/other/cameratopam/camera.c
-@@ -1,7 +1,11 @@
- #define _BSD_SOURCE
- /* Make sure strcasecmp is in string.h */
-+#ifdef __osf__
-+#define _OSF_SOURCE
-+#else
- #define _XOPEN_SOURCE
- /* Make sure putenv is in stdlib.h */
-+#endif /* __osf__ */
-
- #include <stdlib.h>
- #include <string.h>
diff --git a/graphics/netpbm/patches/patch-dd b/graphics/netpbm/patches/patch-dd
deleted file mode 100644
index 6a9cc63ec51..00000000000
--- a/graphics/netpbm/patches/patch-dd
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-dd,v 1.3 2012/01/19 20:17:47 is Exp $
-
---- converter/other/cameratopam/cameratopam.c.orig 2006-08-19 03:12:28.000000000 +0000
-+++ converter/other/cameratopam/cameratopam.c
-@@ -8,7 +8,11 @@
-
-
- #define _BSD_SOURCE 1 /* Make sure string.h contains strcasecmp() */
-+#if defined(__osf__) || defined(__sgi)
-+#define _OSF_SOURCE
-+#else
- #define _XOPEN_SOURCE /* Make sure unistd.h contains swab() */
-+#endif /* defined(__osf__) || defined(__sgi) */
-
- #include <ctype.h>
- #include <unistd.h>
diff --git a/graphics/netpbm/patches/patch-lib_libpbm3.c b/graphics/netpbm/patches/patch-lib_libpbm3.c
deleted file mode 100644
index 0193b4cbd96..00000000000
--- a/graphics/netpbm/patches/patch-lib_libpbm3.c
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-lib_libpbm3.c,v 1.2 2014/08/25 08:23:22 wiz Exp $
-
-Clang does not support SSE extensions at the moment.
-Different patch having same effect already in current Advanced release.
-
---- lib/libpbm3.c.orig 2011-03-29 09:31:31.000000000 +0000
-+++ lib/libpbm3.c
-@@ -23,7 +23,7 @@
- #if defined(__GNUC__) && \
- (__GNUC__ * 100 + __GNUC_MINOR__ >= 301) && \
- (__GNUC__ * 100 + __GNUC_MINOR__ < 403) && \
-- defined (__SSE__)
-+ defined (__SSE__) && !defined(__clang__)
- /* GCC 4.3 does have the facility, but it is different from what this
- code knows how to use. In particular, the calls to
- __builtin_ia32_pcmpeqb() and __builtin_ia32_pmovmskb() fail to
diff --git a/graphics/netpbm/patches/patch-lib_libsystem.c b/graphics/netpbm/patches/patch-lib_libsystem.c
deleted file mode 100644
index b9ee012f35f..00000000000
--- a/graphics/netpbm/patches/patch-lib_libsystem.c
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD: patch-lib_libsystem.c,v 1.3 2014/08/25 08:23:22 wiz Exp $
-
-* For SIGWINCH and SIGIO, _XOPEN_SOURCE should not be defined under OpenBSD 5.5
-* SCO OpenServer 5.0.7/3.2 has no SIGURG and SIGIO.
- This chunk will be included in next Super Stable release.
-
---- lib/libsystem.c.orig 2010-07-10 01:38:01.000000000 +0000
-+++ lib/libsystem.c
-@@ -12,7 +12,10 @@
-
- Contributed to the public domain.
- =============================================================================*/
-+/* for SIGWINCH and SIGIO */
-+#if !defined(__OpenBSD__)
- #define _XOPEN_SOURCE
-+#endif
-
- #include <unistd.h>
- #include <stdlib.h>
-@@ -201,8 +204,10 @@ signalName(unsigned int const signalClas
- return "SIGTTIN";
- case SIGTTOU: /* POSIX.1 */
- return "SIGTTOU";
-+#if defined(SIGURG)
- case SIGURG:
- return "SIGURG";
-+#endif
- case SIGXCPU:
- return "SIGXCPU";
- case SIGXFSZ:
-@@ -213,8 +218,10 @@ signalName(unsigned int const signalClas
- return "SIGPROF";
- case SIGWINCH:
- return "SIGWINCH";
-+#if defined(SIGIO)
- case SIGIO:
- return "SIGIO";
-+#endif
- case SIGSYS:
- return "SIGSYS";
- default:
diff --git a/graphics/netpbm/patches/patch-ppmdraw b/graphics/netpbm/patches/patch-ppmdraw
deleted file mode 100644
index 5aa212a3b23..00000000000
--- a/graphics/netpbm/patches/patch-ppmdraw
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ppmdraw,v 1.1 2007/02/19 02:25:19 rillig Exp $
-
---- editor/ppmdraw.c.orig Sun Apr 23 21:01:54 2006
-+++ editor/ppmdraw.c Sun Feb 18 20:35:09 2007
-@@ -1,4 +1,8 @@
-+#if defined(__sgi)
-+#define _XOPEN_SOURCE 500 /* Needed for strdup(3) */
-+#else
- #define _XOPEN_SOURCE /* Make sure M_PI is in math.h */
-+#endif
- #define _BSD_SOURCE /* Make sure strdup is in string.h */
-
- #include <string.h>