summaryrefslogtreecommitdiff
path: root/media-libs/netpbm
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-libs/netpbm
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/netpbm')
-rw-r--r--media-libs/netpbm/Manifest23
-rwxr-xr-xmedia-libs/netpbm/files/make-tarball.sh67
-rw-r--r--media-libs/netpbm/files/netpbm-10.31-build.patch50
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-failing-tests.patch28
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-jasper-hack.patch41
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-jbig-2.patch19
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-jpeg-dirs.patch28
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-options-case.patch105
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-test.patch17
-rw-r--r--media-libs/netpbm/files/netpbm-10.66-wordaccess_be_aligned.patch23
-rw-r--r--media-libs/netpbm/files/netpbm-10.70-system-libs.patch40
-rw-r--r--media-libs/netpbm/files/netpbm-10.76.00-build.patch38
-rw-r--r--media-libs/netpbm/files/netpbm-10.76.00-misc-deps.patch68
-rw-r--r--media-libs/netpbm/files/netpbm-10.76.00-pbmtext-test.patch22
-rw-r--r--media-libs/netpbm/files/netpbm-10.76.00-test.patch248
-rw-r--r--media-libs/netpbm/metadata.xml14
-rw-r--r--media-libs/netpbm/netpbm-10.66.00.ebuild196
-rw-r--r--media-libs/netpbm/netpbm-10.70.00.ebuild189
-rw-r--r--media-libs/netpbm/netpbm-10.76.00.ebuild185
19 files changed, 1401 insertions, 0 deletions
diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest
new file mode 100644
index 000000000000..e76792599b44
--- /dev/null
+++ b/media-libs/netpbm/Manifest
@@ -0,0 +1,23 @@
+AUX make-tarball.sh 1364 SHA256 71c361f721bd4a87e2e15a6944243706ba300fc22544386891423344e37632f6 SHA512 89b0ebfe6f5a82c3e3fc678ec4599d7281a0978c3a53437f0fbcfcb33607f8087bca1263d8a52c5b25cb1ab91a6635385cf423213464af858fc2f9663d5446a7 WHIRLPOOL f048c27757c418227649062023ec971fa2a684d4cda88a26af212531da47021d71962296e7d9031de62f5416a3be78b1b3ccc6ad32b56e55847c09c2000f3577
+AUX netpbm-10.31-build.patch 1629 SHA256 eaf363941337718390856c318c8e69114c8fb9dbcea8b07755350dbdabce6323 SHA512 53e88bd1c85aa04d60ca2de7a32e5d00d9f959f3443e0c951c0694c814f6956708d8d12427a0fa8a8f76a1613d2982c3aa9b0c6ddd12b9cad3419ced1e5bb59e WHIRLPOOL 15a6b682813bfac808ccff8e16be492fd78defd59f82d5960d9a344452d8c761ea64ebbdc460c005c7d7669a3f26aa3704850487b43f4732bccb742b15709c28
+AUX netpbm-10.66-failing-tests.patch 535 SHA256 bce4b9243d2cb9ba41428a927ff5275fd34bee4e67ed6203efb9b4a503d4d3f5 SHA512 33101e745fdeb9159da48393622edf9163c85f2c133951ba33d48f80758179f18ce36e60e3357bb978c101a7a0e1688aa6dbbc1a1c646782089760908dfe2b04 WHIRLPOOL 4db4c9002f30ac77c3fcd7c19dc7d659bf8d5548e02fd31aa14f57fc99344ebbc8b0e0b212c8bef6cc1d9419cf45a824bdf2f5ce09da1e64a19039adb48ed12d
+AUX netpbm-10.66-jasper-hack.patch 924 SHA256 9c8b32539402b16ced4c83f4c300b742736a9c3eb5bba8f8e5b1758e9de6f7cb SHA512 e58a5f6800e2ab511080d505e9286e4831cb498f9a02cd5823bd52bb8e267c780f4b792388ccc29023afe18005c753b6ea32a3e277b8b1e3ceb8e4b997afe359 WHIRLPOOL 4757e9bab145dfae5837281d645a98906da9d5b16960d6dca2562feecdfb81d4439d6ee52bb41c45ac164dc15cc21de1cd541ba14daef775c9f57a1c737b749f
+AUX netpbm-10.66-jbig-2.patch 725 SHA256 defe6bd506c73c48eeb94c7a0dd2a2e471823c44ca6d57d562151ff1188acd4a SHA512 5d7a90c982c67c17b37dc91b7b4668ddcbd67434873cfde86e04bac7d057d6e6cd8ace52c3fc6e0ce36f767333bb00bdfc4fb3f29f54427285214cbd2f41c42f WHIRLPOOL a00fc6a9001db640dda10e2709e03c41be184db886d6b516ed6ab9013dd7c6b37c8e66e4b7630787647419910db871506850c7e524fe182a559dd2412a1473dd
+AUX netpbm-10.66-jpeg-dirs.patch 722 SHA256 8cca55c06fd4f678c069a0ae3e63997a408d54bba9c44150c126d94fd6cce424 SHA512 95a4ab08702faa3d25c75b71329ea28e5eb5f4f0b200d34d7350633e9a999160fe58e8f57fadab30e273c61a06c8d148fdebecbffa5c0b5023c59647f6d4c3ae WHIRLPOOL 877efe30dea24809593bfa214509b69768e443a5f59c6441d94d63e80855e34b6725fbb79658cfb76accdff8acbb6b9a140f99864b82270146fad6e73e754d02
+AUX netpbm-10.66-options-case.patch 3417 SHA256 1d286fc9da28b7cc264b6d227871e3d77f09cfa57fd680972c5147344930ae22 SHA512 2895b71269d321f84e79808a2fe65a8886ce3e173550051ca40563636b3e8561d5c812a3bb9f2e607c2dc7244b56492332a4299d165059d866ca00701adefe23 WHIRLPOOL 6afb3df9509357060879394f3d0c175bdf5db04719280aa5f98b2bb17dee1fb29b70e8594eaa0819cb905b2d00a4b32a61822f48deb60c541942e0e593fdba35
+AUX netpbm-10.66-test.patch 347 SHA256 fb95a101811a6e8b983d6f82130e511658831e6ad2e873fa4632c4049a00bac2 SHA512 bb271d77794fa8b3d5d4632e32d6bd2b5f9522853c6b96c7056fe9817da47b89153eba2653cf3a5a29f597e3fa616e1f6c810bd986651e610176d69b428afb74 WHIRLPOOL 5f59c43abf70d6bc74e6ac6050e25137421f0f3fd5e75e6fb8e77c54f2fc447f26c1a0aeb23ea70dca27bd44b11fdc88fbbd8bcbc1be338acb6f601b9fdcb943
+AUX netpbm-10.66-wordaccess_be_aligned.patch 942 SHA256 3a0c8120c69cd6f6f53dc51ec15944d17486e7d6d7a4cffc5a69fb2b94f863b1 SHA512 b3b33b0e32c7bcb126104f0f100b56cb811c1ce5051be854a93d0227d9a684e440dd9e0787dfe3f4cb12df1fef5b2e6d1ecb6c3a49d630a32595a026ae1fb482 WHIRLPOOL 2288bf481ae97df10b56d89a022b16659dadafdf0c207bc4a5ac501f029d0b4633999691f2849f8f1692be5d9370944e6e1a501dcb082482f0b8bb9cb843ea97
+AUX netpbm-10.70-system-libs.patch 1016 SHA256 1045dd7517eceaa97d4de4547502aaa9c70bb1430dec9af3da7e842a0411b915 SHA512 156e668ff209ca42dc3bf7e9b89232065d1f5ed3284885beeb67c8c9728eb7f142aceb98898c8d8e2c2a90dd9fab927a698b4372f2f3bcbf06f6df44d1a81629 WHIRLPOOL 6f70ec23d478669d50bf3716bb0d90c51f447c2ae8b3f3632edc3c6600dd696db92ae98d3d94912c0405b9fa97fcd0dfda3aeaa6e49cb88712275e33c43d6de6
+AUX netpbm-10.76.00-build.patch 1295 SHA256 7eb01b99b3a910dd490ec5c8879681079970eb2627904f58ca7878d82f3cdbea SHA512 db1d0593db6987933d7c937beeac65716866adaa079fb5329f8597b208c7dea9f6dd40b803f9dc4b3ef6cf61189c45dde9e139435b7d8e224bb83e037a7f076b WHIRLPOOL 934676097729ab38a3b19024697f7bacbc8fb6428ccdc669c700eace542007465df218d5844a6d9f2b3a0ac5842f6ce7efbdc088c35a39f0f14d92564f3d4a1a
+AUX netpbm-10.76.00-misc-deps.patch 1665 SHA256 cca3f7703501448e2042c6fb8ac4ffd5f3309ce40d4e504e992bc6d147dbbda1 SHA512 81afe7189ac0d3cf24ec691eee89dc8fa1a1f6503c9d2e530dcdbbcf1c67c6a834b6b205c99ef633461e090baf6e8b4179954482c09b68370bea9eceabd1d3bd WHIRLPOOL 4e98bab86e1bb30a630976f473cc018fd6ff05515bd15e1048e20e98dc677e30acaecffc5991495728d010b90f110ad85cb8504e3962ef3527ce695f0c1bada2
+AUX netpbm-10.76.00-pbmtext-test.patch 707 SHA256 d64d476ba566b29f7b1ece80d810703845623f69e2e0c6535d75438b9500f7c2 SHA512 d43a59bd92bbe7ebb8fcf60bf13fb4095beb546cb964108da740dd23c564beb2f97422535067189d49255a2ce8b7a89c01f8f98c807e6e37bfadf32e01f30bde WHIRLPOOL 7b1fb35ae12ec05d138eb1d4e2f9b78c32de021bc3750225a74d8d053831220dba813a2facd18c7dbbc6d30609c22894cb79c3bc04f5180b18fb220874d61db0
+AUX netpbm-10.76.00-test.patch 6005 SHA256 7d501e27ad4380a30e1c5eca1d0b2137e79d4a2a7e6c69781ccf2f7f9bdc5b6b SHA512 49ee2306173e9cf39052e567aedf313ca7c7dd31a090defcd838a08a062d26e1320573a0ad6555e752edc8d0e8fd2e071016e2b075b20ac7e61ee3d60a3b7f14 WHIRLPOOL db12b4b03b83c85a47a1c5a71e47c9b2d079a95be7fe5adafe369de546576026c573b586dad68ee08a282994bd7dc62be632a9639816153cd71337ca9dbee2f1
+DIST netpbm-10.66.00.tar.xz 2575356 SHA256 7fe94f38e139be194e9e384e8d9c9747f2fe08c18295bba93c55a41c5bbf63fc SHA512 44348eb1155353d5cd5a2ce025bc6d9301cc3239acea6b68418c14432f4bd61fc5a8669bb51b3e86b96abaf5b02cc20115c662e40fa5b41aee202b0c2ae605af WHIRLPOOL fa937fccd2da9068a268d6a5729c8093baacc3025ab2382902611dadab985247fdacf3433f6e15407b081478b93b772237c41363f37340ea6c93c169357dd0cf
+DIST netpbm-10.70.00.tar.xz 2621612 SHA256 1268cb6801790619f6d057b964305355011dfe66247f2b71fe9978cdd7af7d93 SHA512 f70d6dd79ce813f9fc4935d382b50bd3cecdf02c324b0f012056e56e33f24b621e8c1b3d054c6f470d437d0d793593de95eaa9724055d59c342228398a40f0b4 WHIRLPOOL 8810a2e8d4ed6a834d6fbc2861079b4e2664f85ff2548d00f95a9c26f92d02dcebcb8d1b9c26226caba067accc41eabbe1211322607de77d61827b34a8b4c82a
+DIST netpbm-10.76.00.tar.xz 2657184 SHA256 b7fce2b1f43dcc821c3928ccc32dbee89e2d75cf22a76c38bc9c9ab4d91ea27a SHA512 234a5616a7631a8eb70817bb88ed509ddddfce93f71739654ef78a2735245b268c391adb49b514ed883569c9fc6ea9c3eeed10aa7898c02b797fee5249b11cf3 WHIRLPOOL 9082df9e257e247f3dd49119f925a11a0082905a78d3c57259328e13ba231608b81bfa2f1f1bcb9518ad94d8326aed82b7fff78a6b4f3befc00a34a2c2b0e70c
+EBUILD netpbm-10.66.00.ebuild 5635 SHA256 c48365b8bcd15c8ba5756e1cdf8bb80512ae1a9ca8d4c9efe92f7f2269dc1d11 SHA512 768b550d7dd600b849fd31ce60204c76194eaebca4de61709e1c214d7e13841f701096915d4d1357148d7533a40946598a77799378216242f9da7645113b9a15 WHIRLPOOL 9b940cae0cd2810ec036289bce1aed025f399c6c0c28fecac05cb8a3f81da40e45a8ef9dd0ae39ec62b5bd188a182108453b516753dad92336fac848aa16b451
+EBUILD netpbm-10.70.00.ebuild 5377 SHA256 0d9a5786b2a9143bc1b90355c89c709e361fce43738f33c36c7a5c192557ac3c SHA512 6d93b0fb8abcd24388b902c31bb2ebb495cb21294c5f6796e71a9c917e2c872876c92253e8f2b032c00ebdea3c19a51c318e0320d76f71ca00088745666a6250 WHIRLPOOL b0a4d95e5097703b07da7efa1d1cfbf4afb948c2c703debbc9ee206cc0438121dbb2a6185baed50ff504894327a1a6eae2e08460eec62ead7d8f10267da3bde2
+EBUILD netpbm-10.76.00.ebuild 5278 SHA256 6fb8aea5b561f96d2428aa54381459eb4cfccd66b5bb472e723ad796cb414b6a SHA512 b4f931e5246070f443fbc9b2c79032770f0ddde7f7cc5aeefecf671d4f741bbc5a30cb7a2be1cc77bb56ee89fa22221ade474b7e55a00a3d49501635e3724bc8 WHIRLPOOL fa4abdc8ea35fe274c5fd7d672d4b2249a1a7b211b9f995ac16063a41201539ea8fee79ad3da9687be983e11972af3c18577b6a84c5f9f0fa92b538cd808493b
+MISC ChangeLog 4591 SHA256 8a422f00bdf2eb5c4976e75a646e18a5a346c2c9c75376b56ee52eea1eb1c3bf SHA512 4791e4cd5125e79f9b12e5dbfed6061bf143598fa4ee54cea7863d6da6fcab0054234f95300ba978710e76c85954da26fb582a3fa359397c0f286b3b5a50555d WHIRLPOOL f3edd811903b9e8096bebe2a49b446c4fd35f07a3f8230682ca1cd567b2f9f97d943ea2d530ed59e66bf4c5584e3ec5ac4bed5519c3983b7da1fc2414fd7bb3c
+MISC ChangeLog-2015 41234 SHA256 3aa5c5084b494810e4b3ec97a07241c7ca05b576f23137752bee9436ef5a4f24 SHA512 88e408bfb6ed6234e110b417b4a2d29d19e155ff42da92fee69daf2c1d0f43723d51c861a28c732a40dd287b977b78f9e0d43ebc7f0f6c251e067df61f22c033 WHIRLPOOL 899417e8214057c6e16d9e2bcefed3958977eb43fc37608d0ecebf109ed8fa06726c16f643603dd862e701df8118d7c5fe4134ffd97351a1564b35c204e0bc3f
+MISC metadata.xml 434 SHA256 c4381dbe1764d8ce6fdc2fbc9630eb0d5d769f1fe39847dadbfeb8109dc218b7 SHA512 41fe0623d1efe7cff26ed9307756f045bd40f275abd38095affc9394efc2c940e63978c79328e43583d5bb466fad0d5339d158422037587cebd3b1f4c22a459f WHIRLPOOL d41b9d9b4a1d9a438e94bf2e3bbac905f142ca6b718d0020db37af25bdaaaff9899729fb82dd3f266b19ee949b850d521cb8995833201b64607ff49708dd3e6c
diff --git a/media-libs/netpbm/files/make-tarball.sh b/media-libs/netpbm/files/make-tarball.sh
new file mode 100755
index 000000000000..90a64ffb34d7
--- /dev/null
+++ b/media-libs/netpbm/files/make-tarball.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+. /etc/init.d/functions.sh
+
+PV=$1
+SVN_ROOT=${2:-/usr/local/src}
+
+if [[ $# -eq 0 ]] ; then
+ ebegin "Detecting latest version"
+ cd "${SVN_ROOT}/netpbm/release_number"
+ svn up -q || die
+ PV=$(svn ls | sort -V | tail -1) || die
+ [[ -z ${PV} ]] && die
+ PV=${PV%/}
+ eend
+ einfo "Using PV=${PV}"
+
+ if [[ ! -d ${PV} ]] ; then
+ ebegin "Checking out ${PV}"
+ svn up -q ${PV}
+ eend || die
+ fi
+fi
+
+if [[ $# -gt 2 ]] ; then
+ exec echo "Usage: $0 [version] [netpbm svn root]"
+fi
+
+PN=netpbm
+P=${PN}-${PV}
+
+T=/tmp
+
+maint_pkg_create() {
+ local base="/usr/local/src"
+ local srcdir="${base}/netpbm/release_number"
+ local htmldir="${base}/netpbm/userguide"
+ if [[ -d ${srcdir} ]] ; then
+ cd "${T}" || die
+
+ rm -rf ${P}
+
+ ebegin "Exporting ${srcdir}/${PV} to ${P}"
+ svn export -q "${srcdir}/${PV}" ${P}
+ eend $? || return 1
+
+ ebegin "Exporting ${htmldir} to ${P}/userguide"
+ svn export -q "${htmldir}" ${P}/userguide
+ eend $? || return 1
+
+ ebegin "Generating manpages from html"
+ (cd "${P}/userguide" && ../buildtools/makeman *.html)
+ eend $? || return 1
+
+ ebegin "Creating ${P}.tar.xz"
+ tar cf - ${P} | xz > ${P}.tar.xz
+ eend $?
+
+ einfo "Tarball now ready at: ${T}/${P}.tar.xz"
+ else
+ einfo "You need to run:"
+ einfo " cd ${base}"
+ einfo " svn co https://netpbm.svn.sourceforge.net/svnroot/netpbm"
+ die "need svn checkout dir"
+ fi
+}
+maint_pkg_create
diff --git a/media-libs/netpbm/files/netpbm-10.31-build.patch b/media-libs/netpbm/files/netpbm-10.31-build.patch
new file mode 100644
index 000000000000..cd744743636c
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.31-build.patch
@@ -0,0 +1,50 @@
+- Don't install libnetpbm.a and libnetpbm.so into a sep link dir
+- Try to fix parallel building
+- Make the libopt tool less 'helpful'
+
+--- lib/Makefile
++++ lib/Makefile
+@@ -249,7 +249,7 @@
+ .PHONY: install.staticlib
+ install.staticlib: $(PKGDIR)/link
+ $(INSTALL) -c -m $(INSTALL_PERM_LIBS) libnetpbm.$(STATICLIBSUFFIX) \
+- $(PKGDIR)/link
++ $(PKGDIR)/lib
+
+ # Install a shared library stub -- the ".so" file used at link time to
+ # prepare a program for dynamically linking a library at run time
+@@ -257,9 +257,9 @@
+ install.sharedlibstub: $(PKGDIR)/link
+ ifeq ($(NETPBMLIBTYPE),unixshared)
+ # install the link-time (.so) links to the runtime libraries
+- cd $(PKGDIR)/link ; \
++ cd $(PKGDIR)/lib ; \
+ rm -f libnetpbm.$(NETPBMLIBSUFFIX); \
+- $(SYMLINK) ../lib/libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
++ $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
+ libnetpbm.$(NETPBMLIBSUFFIX)
+ endif
+ ifeq ($(NETPBMLIBTYPE),dll)
+--- GNUmakefile
++++ GNUmakefile
+@@ -87,6 +87,9 @@
+
+ .PHONY: nonmerge
+ nonmerge: $(PRODUCT_SUBDIRS:%=%/all)
++
++$(PRODUCT_SUBDIRS:%=%/all): buildtools/all
++converter/all analyzer/all editor/all generator/all other/all: lib/all
+
+ OMIT_CONFIG_RULE = 1
+ include $(SRCDIR)/Makefile.common
+--- buildtools/libopt.c
++++ buildtools/libopt.c
+@@ -502,7 +502,7 @@
+
+ strcpy(outputLine, ""); /* initial value */
+ runtime = FALSE; /* initial value */
+- quiet = FALSE; /* initial value */
++ quiet = TRUE; /* initial value */
+ error = FALSE; /* no error yet */
+ for (arg = 1; arg < argc && !error; arg++) {
+ if (strcmp(argv[arg], "-runtime") == 0)
diff --git a/media-libs/netpbm/files/netpbm-10.66-failing-tests.patch b/media-libs/netpbm/files/netpbm-10.66-failing-tests.patch
new file mode 100644
index 000000000000..63260de2e490
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-failing-tests.patch
@@ -0,0 +1,28 @@
+punt failing tests; already notified upstream
+
+--- a/test/Test-Order
++++ b/test/Test-Order
+@@ -50,7 +50,6 @@ pamditherbw.test
+ pbmclean.test
+ pamcut.test
+ pnmcat.test
+-pamflip.test
+ pamenlarge.test
+ pnminvert.test
+ pamchannel.test
+@@ -70,7 +69,6 @@ ppmmix.test
+
+ # Symmetry test
+
+-symmetry.test
+
+ # Format converter tests
+
+@@ -87,7 +85,6 @@ ppmdfont.test
+ pnm-plain-roundtrip.test
+ pnm-pam-roundtrip.test
+ pnminvert-roundtrip.test
+-pamflip-roundtrip.test
+ pamdepth-roundtrip.test
+ pad-crop-roundtrip.test
+ cut-paste-roundtrip.test
diff --git a/media-libs/netpbm/files/netpbm-10.66-jasper-hack.patch b/media-libs/netpbm/files/netpbm-10.66-jasper-hack.patch
new file mode 100644
index 000000000000..285475dab062
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-jasper-hack.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/513240
+
+the jasper headers are horribly broken and break things like stdbool.h.
+re-order the includes to work around this.
+
+--- a/converter/other/jpeg2000/jpeg2ktopam.c
++++ b/converter/other/jpeg2000/jpeg2ktopam.c
+@@ -13,13 +13,14 @@
+ #define _XOPEN_SOURCE 600
+ #include <string.h>
+
++#include <jasper/jasper.h>
++
+ #include "pm_c_util.h"
+ #include "pam.h"
+ #include "shhopt.h"
+ #include "nstring.h"
+ #include "mallocvar.h"
+
+-#include <jasper/jasper.h>
+ #include "libjasper_compat.h"
+
+ enum compmode {COMPMODE_INTEGER, COMPMODE_REAL};
+--- a/converter/other/jpeg2000/pamtojpeg2k.c
++++ b/converter/other/jpeg2000/pamtojpeg2k.c
+@@ -13,13 +13,14 @@
+ #define _XOPEN_SOURCE 600
+ #include <string.h>
+
++#include <jasper/jasper.h>
++
+ #include "pm_c_util.h"
+ #include "pam.h"
+ #include "shhopt.h"
+ #include "nstring.h"
+ #include "mallocvar.h"
+
+-#include <jasper/jasper.h>
+ #include "libjasper_compat.h"
+
+
diff --git a/media-libs/netpbm/files/netpbm-10.66-jbig-2.patch b/media-libs/netpbm/files/netpbm-10.66-jbig-2.patch
new file mode 100644
index 000000000000..f7e8cf80d6c4
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-jbig-2.patch
@@ -0,0 +1,19 @@
+fix building w/jbig-2.x
+
+--- a/converter/other/jbig/jbigtopnm.c
++++ b/converter/other/jbig/jbigtopnm.c
+@@ -230,8 +230,12 @@ int main (int argc, char **argv)
+ if (ferror(fin))
+ pm_error("Problem while reading input file '%s", fnin);
+ if (result != JBG_EOK && result != JBG_EOK_INTR)
+- pm_error("Problem with input file '%s': %s\n",
+- fnin, jbg_strerror(result, JBG_EN));
++ pm_error("Problem with input file '%s': %s\n", fnin,
++#ifdef JBG_EN
++ jbg_strerror(result, JBG_EN));
++#else
++ jbg_strerror(result));
++#endif
+ if (plane >= 0 && jbg_dec_getplanes(&s) <= plane)
+ pm_error("Image has only %d planes!\n", jbg_dec_getplanes(&s));
+
diff --git a/media-libs/netpbm/files/netpbm-10.66-jpeg-dirs.patch b/media-libs/netpbm/files/netpbm-10.66-jpeg-dirs.patch
new file mode 100644
index 000000000000..fcf98211ba01
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-jpeg-dirs.patch
@@ -0,0 +1,28 @@
+use same -I style as converter/other/Makefile so people can disable these
+
+--- a/converter/other/jbig/Makefile
++++ b/converter/other/jbig/Makefile
+@@ -11,7 +11,9 @@ LIBJBIG_OBJECTS = jbig.o jbig_tab.o
+
+ EXTERN_INCLUDES =
+ ifneq ($(JBIGHDR_DIR),NONE)
+- EXTERN_INCLUDES += -I$(JBIGHDR_DIR)
++ ifneq ($(JBIGHDR_DIR)x,x)
++ EXTERN_INCLUDES += -I$(JBIGHDR_DIR)
++ endif
+ endif
+
+ ifneq ($(JBIGHDR_DIR),NONE)
+--- a/converter/other/jpeg2000/Makefile
++++ b/converter/other/jpeg2000/Makefile
+@@ -11,7 +11,9 @@ include $(BUILDDIR)/config.mk
+
+ EXTERN_INCLUDES =
+ ifneq ($(JASPERHDR_DIR),NONE)
+- EXTERN_INCLUDES += -I$(JASPERHDR_DIR)
++ ifneq ($(JASPERHDR_DIR)x,x)
++ EXTERN_INCLUDES += -I$(JASPERHDR_DIR)
++ endif
+ endif
+
+
diff --git a/media-libs/netpbm/files/netpbm-10.66-options-case.patch b/media-libs/netpbm/files/netpbm-10.66-options-case.patch
new file mode 100644
index 000000000000..a865bc1f4514
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-options-case.patch
@@ -0,0 +1,105 @@
+r2175 | giraffedata | 2014-04-01 22:28:23 -0400 (Tue, 01 Apr 2014) | 1 line
+
+Fix bug: inconsistent use of upper and lower case Y and N in make file variables. Make it consistently upper case
+
+--- buildtools/configure.pl (revision 2174)
++++ buildtools/configure.pl (revision 2175)
+@@ -835,16 +835,16 @@ sub getLibTypes($$$$$$$$) {
+ my $response = prompt("(y)es or (n)o", $default);
+
+ if (uc($response) =~ /^(Y|YES)$/) {
+- $staticlib_too = "y";
++ $staticlib_too = "Y";
+ } elsif (uc($response) =~ /^(N|NO)$/) {
+- $staticlib_too = "n";
++ $staticlib_too = "N";
+ } else {
+ print("'$response' isn't one of the choices. \n" .
+ "You must choose 'yes' or 'no' (or 'y' or 'n').\n");
+ exit 12;
+ }
+ } else {
+- $staticlib_too = "n";
++ $staticlib_too = "N";
+ }
+ print("\n");
+
+--- config.mk.in (revision 2174)
++++ config.mk.in (revision 2175)
+@@ -503,7 +503,7 @@ LINUXSVGAHDR_DIR =
+ #LINUXSVGALIB = /usr/lib/libvga.so
+ #LINUXSVGAHDR_DIR = /usr/include/vgalib
+
+-# If you don't want any network functions, set OMIT_NETWORK to "y".
++# If you don't want any network functions, set OMIT_NETWORK to "Y".
+ # The only thing that requires network functions is the option in
+ # ppmtompeg to run it on multiple computers simultaneously. On some
+ # systems network functions don't work or we haven't figured out how to
+@@ -512,11 +512,11 @@ OMIT_NETWORK =
+ #DJGPP/Windows, Tru64:
+ # (there's some minor header problem that prevents network functions from
+ # building on Tru64 2000.10.06)
+-#OMIT_NETWORK = y
++#OMIT_NETWORK = Y
+
+ # These are -l options to link in the network libraries. Often, these are
+ # built into the standard C library, so this can be null. This is irrelevant
+-# if OMIT_NETWORK is "y".
++# if OMIT_NETWORK is "Y".
+
+ NETWORKLD =
+ # Solaris, SunOS:
+@@ -602,12 +602,12 @@ NETPBMLIBSUFFIX = so
+ # Windows shared library:
+ #NETPBMLIBSUFFIX = dll
+
+-#STATICLIB_TOO is "y" to signify that you want a static library built
++#STATICLIB_TOO is "Y" to signify that you want a static library built
+ #and installed in addition to whatever library type you specified by
+ #NETPBMLIBTYPE. If NETPBMLIBTYPE specified a static library,
+ #STATICLIB_TOO simply has no effect.
+-STATICLIB_TOO = y
+-#STATICLIB_TOO = n
++STATICLIB_TOO = Y
++#STATICLIB_TOO = N
+
+ #STATICLIBSUFFIX is the suffix that static libraries have. It's
+ #meaningless if you aren't building static libraries.
+--- GNUmakefile (revision 2174)
++++ GNUmakefile (revision 2175)
+@@ -396,19 +396,19 @@ lib/install.hdr:
+ $(MAKE) -C $(dir $@) -f $(SRCDIR)/lib/Makefile \
+ SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@)
+
+-ifeq ($(STATICLIB_TOO),y)
+-BUILD_STATIC = y
++ifeq ($(STATICLIB_TOO),Y)
++BUILD_STATIC = Y
+ else
+ ifeq ($(NETPBMLIBTYPE),unixstatic)
+- BUILD_STATIC = y
++ BUILD_STATIC = Y
+ else
+- BUILD_STATIC = n
++ BUILD_STATIC = N
+ endif
+ endif
+
+ .PHONY: install.staticlib
+ install.staticlib:
+-ifeq ($(BUILD_STATIC),y)
++ifeq ($(BUILD_STATIC),Y)
+ $(MAKE) -C lib -f $(SRCDIR)/lib/Makefile \
+ SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) install.staticlib
+ endif
+--- lib/Makefile (revision 2174)
++++ lib/Makefile (revision 2175)
+@@ -175,7 +175,7 @@ else
+ ifeq ($(STATICLIB_TOO),Y)
+ BUILD_STATICLIB = Y
+ else
+- BUILD_STATICLIB = n
++ BUILD_STATICLIB = N
+ endif
+ endif
+
diff --git a/media-libs/netpbm/files/netpbm-10.66-test.patch b/media-libs/netpbm/files/netpbm-10.66-test.patch
new file mode 100644
index 000000000000..7c80648bafab
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-test.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/450530
+
+we disable fiascotopnm all the time, so delete the test too
+
+--- a/test/all-in-place.test
++++ b/test/all-in-place.test
+@@ -387,10 +387,6 @@ for i in $ordinary_testprogs
+
+
+
+-# Test fiascotopnm, which has a unique -v flag.
+-
+-${PBM_TESTPREFIX}fiascotopnm -v 2> /dev/null
+- testExitStatus fiascotopnm 2 $?
+
+
+
diff --git a/media-libs/netpbm/files/netpbm-10.66-wordaccess_be_aligned.patch b/media-libs/netpbm/files/netpbm-10.66-wordaccess_be_aligned.patch
new file mode 100644
index 000000000000..0da719ae07d4
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.66-wordaccess_be_aligned.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/547252
+
+------------------------------------------------------------------------
+r2395 | giraffedata | 2015-01-23 13:51:17 -0500 (Fri, 23 Jan 2015) | 1 line
+
+Fix syntax error
+
+build: fix compile failure in wordint_access_be.h with
+Bigendian target platforms.
+
+Index: trunk/lib/util/wordaccess_be_aligned.h
+===================================================================
+--- trunk/lib/util/wordaccess_be_aligned.h (revision 2394)
++++ trunk/lib/util/wordaccess_be_aligned.h (revision 2395)
+@@ -24,7 +24,7 @@ bytesToWordint(wordintBytes bytes) {
+ static __inline__ void
+ wordintToBytes(wordintBytes * const bytesP,
+ wordint const wordInt) {
+- uint16_t const hi = ((wordInt >> 48) & 0xFF)
++ uint16_t const hi = ((wordInt >> 48) & 0xFF);
+ uint16_t const mh = ((wordInt >> 32) & 0xFF);
+ uint16_t const ml = ((wordInt >> 24) & 0xFF);
+ uint16_t const lo = ((wordInt >> 0) & 0xFF);
diff --git a/media-libs/netpbm/files/netpbm-10.70-system-libs.patch b/media-libs/netpbm/files/netpbm-10.70-system-libs.patch
new file mode 100644
index 000000000000..ef50ff2435dd
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.70-system-libs.patch
@@ -0,0 +1,40 @@
+when we disable the bundled libs, make sure we don't try to run install in them
+
+--- converter/other/jbig/Makefile
++++ converter/other/jbig/Makefile
+@@ -5,7 +5,7 @@ endif
+ SUBDIR = converter/other/jbig
+ VPATH=.:$(SRCDIR)/$(SUBDIR)
+
+-SUBDIRS = libjbig
++SUBDIRS =
+
+ include $(BUILDDIR)/config.mk
+
+@@ -35,6 +35,7 @@ SCRIPTS =
+
+ ifeq ($(JBIGLIB),$(INTERNAL_JBIGLIB))
+ JBIGLIB_DEP = $(JBIGLIB)
++ SUBDIRS += libjbig
+ else
+ # It's not our internal version; user's on his own to make sure it's built
+ endif
+--- converter/other/jpeg2000/Makefile
++++ converter/other/jpeg2000/Makefile
+@@ -5,7 +5,7 @@ endif
+ SUBDIR = converter/other/jpeg2000
+ VPATH=.:$(SRCDIR)/$(SUBDIR)
+
+-SUBDIRS = libjasper
++SUBDIRS =
+
+ include $(BUILDDIR)/config.mk
+
+@@ -52,6 +52,7 @@ ifeq ($(JASPERLIB),$(INTERNAL_JASPERLIB)
+ # MERGE_OBJECTS contains relative paths, so $(INTERNAL_JASPERLIB) had better
+ # be relative to the current directory.
+ MERGE_OBJECTS += $(JASPERLIB)
++ SUBDIRS += libjasper
+ endif
+ MERGEBINARIES = $(BINARIES)
+
diff --git a/media-libs/netpbm/files/netpbm-10.76.00-build.patch b/media-libs/netpbm/files/netpbm-10.76.00-build.patch
new file mode 100644
index 000000000000..231da5446719
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.76.00-build.patch
@@ -0,0 +1,38 @@
+- Don't install libnetpbm.a and libnetpbm.so into a sep link dir
+- Try to fix parallel building
+
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -249,7 +249,7 @@
+ .PHONY: install.staticlib
+ install.staticlib: $(PKGDIR)/link
+ $(INSTALL) -c -m $(INSTALL_PERM_LIBS) libnetpbm.$(STATICLIBSUFFIX) \
+- $(PKGDIR)/link
++ $(PKGDIR)/lib
+
+ # Install a shared library stub -- the ".so" file used at link time to
+ # prepare a program for dynamically linking a library at run time
+@@ -257,9 +257,9 @@
+ install.sharedlibstub: $(PKGDIR)/link
+ ifeq ($(NETPBMLIBTYPE),unixshared)
+ # install the link-time (.so) links to the runtime libraries
+- cd $(PKGDIR)/link ; \
++ cd $(PKGDIR)/lib ; \
+ rm -f libnetpbm.$(NETPBMLIBSUFFIX); \
+- $(SYMLINK) ../lib/libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
++ $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
+ libnetpbm.$(NETPBMLIBSUFFIX)
+ endif
+ ifeq ($(NETPBMLIBTYPE),dll)
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -87,6 +87,9 @@
+
+ .PHONY: nonmerge
+ nonmerge: $(PRODUCT_SUBDIRS:%=%/all)
++
++$(PRODUCT_SUBDIRS:%=%/all): buildtools/all
++converter/all analyzer/all editor/all generator/all other/all: lib/all
+
+ # Parallel make (make --jobs) is not smart enough to coordinate builds
+ # between submakes, so a naive parallel make would cause certain
diff --git a/media-libs/netpbm/files/netpbm-10.76.00-misc-deps.patch b/media-libs/netpbm/files/netpbm-10.76.00-misc-deps.patch
new file mode 100644
index 000000000000..392eae0f40e4
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.76.00-misc-deps.patch
@@ -0,0 +1,68 @@
+do not autoprobe deps when we disabled them
+
+--- GNUmakefile
++++ GNUmakefile
+@@ -74,7 +74,10 @@ include $(BUILDDIR)/config.mk
+
+ PROG_SUBDIRS = converter analyzer editor generator other
+ PRODUCT_SUBDIRS = lib $(PROG_SUBDIRS)
+-SUPPORT_SUBDIRS = urt icon buildtools test
++SUPPORT_SUBDIRS = icon buildtools test
++ifeq ($(URTLIB),$(BUNDLED_URTLIB))
++SUPPORT_SUBDIRS += urt
++endif
+
+ SUBDIRS = $(PRODUCT_SUBDIRS) $(SUPPORT_SUBDIRS)
+
+--- converter/other/Makefile
++++ converter/other/Makefile
+@@ -7,6 +7,7 @@ VPATH=.:$(SRCDIR)/$(SUBDIR)
+
+ include $(BUILDDIR)/config.mk
+
++ifneq ($(XML2_LIBS),NONE)
+ TEST_PKGCONFIG_LIBXML2 = if pkg-config libxml-2.0; then echo exists; fi
+
+ ifneq ($(shell $(TEST_PKGCONFIG_LIBXML2)),)
+@@ -22,6 +23,7 @@ else
+ XML2_CFLAGS=$(shell xml2-config --cflags)
+ endif
+ endif
++endif
+
+ SUBDIRS = jbig pnmtopalm jpeg2000 cameratopam pamtosvg
+ ifneq ($(BUILD_FIASCO), N)
+@@ -34,6 +36,7 @@ ifneq ($(TIFFLIB),NONE)
+ endif
+ endif
+
++ifneq ($(PNGLIB),NONE)
+ TEST_PKGCONFIG_LIBPNG = if pkg-config libpng$(PNGVER); then echo exists; fi
+
+ ifneq ($(shell $(TEST_PKGCONFIG_LIBPNG)),)
+@@ -58,6 +61,7 @@ else
+ endif
+ endif
+ endif
++endif
+
+ ifneq ($(JPEGLIB),NONE)
+ ifneq ($(JPEGHDR_DIR)x,x)
+--- other/pamx/Makefile
++++ other/pamx/Makefile
+@@ -9,6 +9,7 @@ include $(BUILDDIR)/config.mk
+
+ EXTERN_INCLUDE =
+
++ifneq ($(X11LIB),NONE)
+ ifeq ($(shell pkg-config x11 --modversion --silence-errors),)
+ # Pkg-config has never heard of X11, or doesn't even exist
+
+@@ -23,6 +24,7 @@ else
+ X11LIB = $(shell pkg-config x11 --libs)
+ EXTERN_INCLUDES += $(shell pkg-config x11 --cflags)
+ endif
++endif
+
+ ifeq ($(HAVE_X11LIB),Y)
+ PORTBINARIES += pamx
diff --git a/media-libs/netpbm/files/netpbm-10.76.00-pbmtext-test.patch b/media-libs/netpbm/files/netpbm-10.76.00-pbmtext-test.patch
new file mode 100644
index 000000000000..cdc075e5293f
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.76.00-pbmtext-test.patch
@@ -0,0 +1,22 @@
+the tool tries to generate binary output, but the current locale might change
+what awk generates. force it to C/ASCII to avoid that.
+
+https://bugs.gentoo.org/601012
+
+--- test/pbmtext.test
++++ test/pbmtext.test
+@@ -81,12 +81,14 @@ rm ${fontRectangle_txt} ${font_pbm}
+
+ # One long row
+ # Should print 3233136020 4535
++LC_CTYPE=C \
+ awk 'BEGIN { for (i=32; i<=125;++i) printf("%c",i);
+ for (i=160;i<=255;++i) printf("%c",i); }' | \
+ pbmtext -builtin bdf | cksum
+
+ # One tall column
+ # Should print 1216262214 5711
++LC_CTYPE=C \
+ awk 'BEGIN { for (i=32; i<=125;++i) printf("%c\n",i);
+ for (i=160;i<=255;++i) printf("%c\n",i); }' | \
+ pbmtext -nomargins -builtin bdf | cksum
diff --git a/media-libs/netpbm/files/netpbm-10.76.00-test.patch b/media-libs/netpbm/files/netpbm-10.76.00-test.patch
new file mode 100644
index 000000000000..870998bc98a8
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.76.00-test.patch
@@ -0,0 +1,248 @@
+automatically skip tests of disabled tools
+
+--- GNUmakefile
++++ GNUmakefile
+@@ -455,6 +458,21 @@ deb:
+ .PHONY: check-package
+ .PHONY: check-install
+
++# Variables from the make env we pass down to the test scripts.
++CHECK_VARS = \
++ BUILDDIR=$(BUILDDIR) \
++ RGBDEF=$(RGBDEF) \
++ BUILD_FIASCO=$(BUILD_FIASCO) \
++ JASPERLIB="$(JASPERLIB)" \
++ JBIGLIB="$(JBIGLIB)" \
++ JPEGLIB="$(JPEGLIB)" \
++ PNGLIB="$(PNGLIB)" \
++ TIFFLIB="$(TIFFLIB)" \
++ URTLIB="$(URTLIB)" \
++ X11LIB="$(X11LIB)" \
++ XML2_LIBS="$(XML2_LIBS)" \
++ ZLIB="$(ZLIB)"
++
+ # Test files in source tree.
+
+ check-tree : BUILDBINDIRS :=./analyzer \
+@@ -525,10 +543,10 @@ resultdir-backup: FORCE
+
+ check-tree: $(TESTRANDOM) resultdir-backup
+ cd $(RESULTDIR); \
++ $(CHECK_VARS) \
+ CHECK_TYPE=tree \
+- PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
++ PBM_TEST_PATH=$(PBM_TEST_PATH) \
+ LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
+- RGBDEF=$(RGBDEF) \
+ $(SRCDIR)/test/Execute-Tests 2>&1
+
+ # Execute-Tests needs to know BUILDDIR in order to locate testrandom.
+@@ -545,19 +563,18 @@ check: check-package
+
+ check-package: $(TESTRANDOM) resultdir-backup
+ cd $(RESULTDIR); \
++ $(CHECK_VARS) \
+ CHECK_TYPE=package \
+- PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
++ PBM_TEST_PATH=$(PBM_TEST_PATH) \
+ LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
+- RGBDEF=$(RGBDEF) \
+ $(SRCDIR)/test/Execute-Tests 2>&1
+
+
+ # Check after install
+ check-install: $(TESTRANDOM) resultdir-backup
+ cd $(RESULTDIR); \
++ $(CHECK_VARS) \
+ CHECK_TYPE=install \
+- BUILDDIR=$(BUILDDIR) \
+- RGBDEF=$(RGBDEF) \
+ $(SRCDIR)/test/Execute-Tests 2>&1
+
+
+--- test/all-in-place.test
++++ test/all-in-place.test
+@@ -367,11 +367,62 @@ ordinary_testprogs="\
+ zeisstopnm \
+ "
+
++enabled_testprog() {
++ case $1 in
++ fiascotopnm|\
++ pnmtofiasco)
++ [ "${BUILD_FIASCO}" = "N" ] && return 1 ;;
++
++ jpeg2ktopam|\
++ pamtojpeg2k)
++ [ "${JASPERLIB}" = "NONE" ] && return 1 ;;
++
++ jbigtopnm|\
++ pnmtojbig)
++ [ "${JBIGLIB}" = "NONE" ] && return 1 ;;
++
++ jpegtopnm|\
++ pnmtojpeg|\
++ ppmtojpeg)
++ [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
++
++ pamtopng|\
++ pngtopam|\
++ pnmtopng)
++ [ "${PNGLIB}" = "NONE" ] && return 1 ;;
++
++ svgtopam)
++ [ "${PNGLIB}" = "NONE" ] && return 1
++ [ "${XML2_LIBS}" = "NONE" ] && return 1
++ ;;
++
++ pamtotiff|\
++ pnmtotiffcmyk|\
++ tifftopnm)
++ [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
++
++ pnmtorle|\
++ rletopnm)
++ [ "${URTLIB}" = "NONE" ] && return 1 ;;
++
++ pamx)
++ [ "${X11LIB}" = "NONE" ] && return 1 ;;
++ esac
++
++ return 0
++}
++
+ # The string "fiascotopnm" has to be filtered out by egrep for fiascotopnm
+ # has a slightly different version report format.
+
+ for i in $ordinary_testprogs
+ do
++ # Stub out programs that aren't built.
++ if ! enabled_testprog "$i"; then
++ echo "$i: ok"
++ continue
++ fi
++
+ $i --version 2>&1 | \
+ egrep -v -e fiascotopnm -e \
+ "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
+--- test/fiasco-roundtrip.test
++++ test/fiasco-roundtrip.test
+@@ -2,6 +2,10 @@
+ # This script tests: pnmtofiasco fiascotopnm
+ # Also requires: pnmpad
+
++if [ "${BUILD_FIASCO}" = "N" ]; then
++ exit 80
++fi
++
+ # Should print 215556145 102615
+
+ pnmpad --black --bottom 1 --left 1 testimg.ppm | \
+--- test/jbig-roundtrip.test
++++ test/jbig-roundtrip.test
+@@ -2,6 +2,9 @@
+ # This script tests: pnmtojbig jbigtopnm
+ # Also requires: pamchannel pamtopnm
+
++if [ "${JBIGLIB}" = "NONE" ]; then
++ exit 80
++fi
+
+ # Test 1. Should print 2425386270 41
+ pnmtojbig testgrid.pbm | jbigtopnm | cksum
+--- test/legacy-names.test
++++ test/legacy-names.test
+@@ -94,8 +94,30 @@ ordinary_testprogs="\
+ ppmtouil \
+ "
+
++enabled_testprog() {
++ case $1 in
++ ppmtojpeg)
++ [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
++
++ pamrgbatopng|\
++ pngtopnm)
++ [ "${PNGLIB}" = "NONE" ] && return 1 ;;
++
++ pnmtotiff)
++ [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
++ esac
++
++ return 0
++}
++
+ for i in $ordinary_testprogs
+ do
++ # Stub out programs that aren't built.
++ if ! enabled_testprog "$i"; then
++ echo "$i: ok"
++ continue
++ fi
++
+ $i --version 2>&1 | \
+ egrep -v \
+ "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
+--- test/png-roundtrip.test
++++ test/png-roundtrip.test
+@@ -6,6 +6,10 @@
+ ## If this test fails and pnm-roundtrip2.test succeeds, it indicates
+ ## some problem with pnmtopng.
+
++if [ "${PNGLIB}" = "NONE" ]; then
++ exit 80
++fi
++
+ # Test 1. Should print 1926073387 101484 18 times
+ for flags in "" -interlace \
+ -gamma=.45 \
+--- test/png-roundtrip2.test
++++ test/png-roundtrip2.test
+@@ -9,6 +9,10 @@
+ ## If both tests fail, the likely cause is a problem with pngtopam.
+ ## It is also possible that there is some problem in libpng.
+
++if [ "${PNGLIB}" = "NONE" ]; then
++ exit 80
++fi
++
+ # Test 1. Should print 1926073387 101484 twice
+ for flags in "" -gamma=.45
+ do
+--- test/ps-roundtrip.test
++++ test/ps-roundtrip.test
+@@ -8,6 +8,10 @@
+ ## (1) zlib was not linked.
+ ## (2) ghostscript is not available.
+
++if [ "${ZLIB}" = "NONE" ]; then
++ exit 80
++fi
++
+ tmpdir=${tmpdir:-/tmp}
+
+ # pstopnm does not use libnetpbm functions for output.
+--- test/tiff-roundtrip.test
++++ test/tiff-roundtrip.test
+@@ -2,6 +2,9 @@
+ # This script tests: pamtotiff tifftopnm
+ # Also requires:
+
++if [ "${TIFFLIB}" = "NONE" ]; then
++ exit 80
++fi
+
+ # Failure message
+ ## Second test fails if Netpbm was built without the flate library
+--- test/utahrle-roundtrip.test
++++ test/utahrle-roundtrip.test
+@@ -2,6 +2,9 @@
+ # This script tests: pnmtorle rletopnm
+ # Also requires: pamchannel pamtopnm
+
++if [ "${URTLIB}" = "NONE" ]; then
++ exit 80
++fi
+
+ #Test 1. Should produce 1571496937 33838, cksum of testimg.red
+ pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \
diff --git a/media-libs/netpbm/metadata.xml b/media-libs/netpbm/metadata.xml
new file mode 100644
index 000000000000..ca3e23b04d54
--- /dev/null
+++ b/media-libs/netpbm/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>graphics@gentoo.org</email>
+ <name>Gentoo Graphics Project</name>
+ </maintainer>
+ <use>
+ <flag name="rle">Build converters for the RLE format (utah raster toolkit)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">netpbm</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-libs/netpbm/netpbm-10.66.00.ebuild b/media-libs/netpbm/netpbm-10.66.00.ebuild
new file mode 100644
index 000000000000..9beba62062d6
--- /dev/null
+++ b/media-libs/netpbm/netpbm-10.66.00.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs eutils multilib
+
+DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
+HOMEPAGE="http://netpbm.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="doc jbig jpeg jpeg2k png rle cpu_flags_x86_sse2 static-libs svga tiff X xml zlib"
+
+RDEPEND="jbig? ( media-libs/jbigkit )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ png? ( >=media-libs/libpng-1.4:0 )
+ rle? ( media-libs/urt )
+ svga? ( media-libs/svgalib )
+ tiff? ( >=media-libs/tiff-3.5.5:0 )
+ xml? ( dev-libs/libxml2 )
+ zlib? ( sys-libs/zlib )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-devel/flex"
+
+netpbm_libtype() {
+ case ${CHOST} in
+ *-darwin*) echo dylib;;
+ *) echo unixshared;;
+ esac
+}
+netpbm_libsuffix() {
+ local suffix=$(get_libname)
+ echo ${suffix//\.}
+}
+netpbm_ldshlib() {
+ case ${CHOST} in
+ *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';;
+ *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';;
+ esac
+}
+netpbm_config() {
+ if use $1 ; then
+ [[ $2 != "!" ]] && echo -l${2:-$1}
+ else
+ echo NONE
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/netpbm-10.31-build.patch
+ epatch "${FILESDIR}"/netpbm-10.66-test.patch #450530
+ epatch "${FILESDIR}"/netpbm-10.66-jasper-hack.patch #513240
+ epatch "${FILESDIR}"/netpbm-10.66-options-case.patch
+ epatch "${FILESDIR}"/netpbm-10.66-jpeg-dirs.patch
+ epatch "${FILESDIR}"/netpbm-10.66-jbig-2.patch
+ epatch "${FILESDIR}"/netpbm-10.66-failing-tests.patch
+ epatch "${FILESDIR}"/netpbm-10.66-wordaccess_be_aligned.patch #547252
+
+ # make sure we use system urt
+ sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
+ rm -rf urt
+
+ # avoid mixing the local copy of jbig with the system
+ rm converter/other/jbig/jbig.h || die
+
+ # disable certain tests based on active USE flags
+ local del=(
+ $(usex jbig '' 'jbigtopnm pnmtojbig jbig-roundtrip')
+ $(usex rle '' 'utahrle-roundtrip')
+ $(usex tiff '' 'tiff-roundtrip')
+ )
+ if [[ ${#del[@]} -gt 0 ]] ; then
+ sed -i -r $(printf -- ' -e /%s.test/d' "${del[@]}") test/Test-Order || die
+ fi
+ del=(
+ pnmtofiasco fiascotopnm # We always disable fiasco
+ $(usex jbig '' 'jbigtopnm pnmtojbig')
+ $(usex jpeg2k '' 'jpeg2ktopam pamtojpeg2k')
+ $(usex rle '' 'pnmtorle rletopnm')
+ $(usex tiff '' 'pamtotiff pnmtotiff pnmtotiffcmyk tifftopnm')
+ )
+ if [[ ${#del[@]} -gt 0 ]] ; then
+ sed -i -r $(printf -- ' -e s/\<%s\>(:.ok)?//' "${del[@]}") test/all-in-place.{ok,test} || die
+ sed -i '/^$/d' test/all-in-place.ok || die
+ fi
+
+ # take care of the importinc stuff ourselves by only doing it once
+ # at the top level and having all subdirs use that one set #149843
+ sed -i \
+ -e '/^importinc:/s|^|importinc:\nmanual_|' \
+ -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\
+ common.mk || die
+ sed -i \
+ -e '/%.c/s: importinc$::' \
+ common.mk lib/Makefile lib/util/Makefile || die
+
+ # avoid ugly depend.mk warnings
+ touch $(find . -name Makefile | sed s:Makefile:depend.mk:g)
+}
+
+src_configure() {
+ cat config.mk.in - >> config.mk <<-EOF
+ # Misc crap
+ BUILD_FIASCO = N
+ SYMLINK = ln -sf
+
+ # These vars let src_test work by default
+ PKGDIR_DEFAULT = ${T}/netpbm
+ RESULTDIR_DEFAULT = ${T}/netpbm-test
+
+ # Toolchain options
+ CC = $(tc-getCC) -Wall
+ LD = \$(CC)
+ CC_FOR_BUILD = $(tc-getBUILD_CC)
+ LD_FOR_BUILD = \$(CC_FOR_BUILD)
+ AR = $(tc-getAR)
+ RANLIB = $(tc-getRANLIB)
+
+ STRIPFLAG =
+ CFLAGS_SHLIB = -fPIC
+
+ LDRELOC = \$(LD) -r
+ LDSHLIB = $(netpbm_ldshlib)
+ LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to
+ LINKERISCOMPILER = Y
+ NETPBMLIBSUFFIX = $(netpbm_libsuffix)
+ NETPBMLIBTYPE = $(netpbm_libtype)
+ STATICLIB_TOO = $(usex static-libs Y N)
+
+ # The var is called SSE, but the code is actually SSE2.
+ WANT_SSE = $(usex cpu_flags_x86_sse2 Y N)
+
+ # Gentoo build options
+ TIFFLIB = $(netpbm_config tiff)
+ # Let tiff worry about its own dependencies #395753
+ TIFFLIB_NEEDS_JPEG = N
+ TIFFLIB_NEEDS_Z = N
+ JPEGLIB = $(netpbm_config jpeg)
+ PNGLIB = $(netpbm_config png)
+ ZLIB = $(netpbm_config zlib z)
+ LINUXSVGALIB = $(netpbm_config svga vga)
+ XML2_LIBS = $(netpbm_config xml xml2)
+ JBIGLIB = $(netpbm_config jbig)
+ JBIGHDR_DIR =
+ JASPERLIB = $(netpbm_config jpeg2k jasper)
+ JASPERHDR_DIR =
+ URTLIB = $(netpbm_config rle)
+ URTHDR_DIR =
+ X11LIB = $(netpbm_config X X11)
+ X11HDR_DIR =
+ EOF
+ # cannot chain the die with the heredoc above as bash-3
+ # has a parser bug in that setup #282902
+ [ $? -eq 0 ] || die "writing config.mk failed"
+}
+
+src_compile() {
+ emake -j1 pm_config.h version.h manual_importinc #149843
+ emake
+}
+
+src_test() {
+ # The code wants to install everything first and then test the result.
+ emake install.{bin,lib}
+ emake check
+}
+
+src_install() {
+ # Subdir make targets like to use `mkdir` all over the place
+ # without any actual dependencies, thus the -j1.
+ emake -j1 package pkgdir="${ED}"/usr
+
+ [[ $(get_libdir) != "lib" ]] && mv "${ED}"/usr/lib "${ED}"/usr/$(get_libdir)
+
+ # Remove cruft that we don't need, and move around stuff we want
+ rm "${ED}"/usr/bin/{doc.url,manweb} || die
+ rm -r "${ED}"/usr/man/web || die
+ rm -r "${ED}"/usr/link || die
+ rm "${ED}"/usr/{README,VERSION,{pkgconfig,config}_template,pkginfo} || die
+ dodir /usr/share
+ mv "${ED}"/usr/man "${ED}"/usr/share/ || die
+ mv "${ED}"/usr/misc "${ED}"/usr/share/netpbm || die
+
+ doman userguide/*.[0-9]
+ use doc && dohtml -r userguide
+ dodoc README
+ cd doc
+ dodoc HISTORY Netpbm.programming USERDOC
+ dohtml -r .
+}
diff --git a/media-libs/netpbm/netpbm-10.70.00.ebuild b/media-libs/netpbm/netpbm-10.70.00.ebuild
new file mode 100644
index 000000000000..744a1e4d644b
--- /dev/null
+++ b/media-libs/netpbm/netpbm-10.70.00.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs eutils multilib
+
+DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
+HOMEPAGE="http://netpbm.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="doc jbig jpeg jpeg2k png rle cpu_flags_x86_sse2 static-libs svga tiff X xml zlib"
+
+RDEPEND="jbig? ( media-libs/jbigkit )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ png? ( >=media-libs/libpng-1.4:0 )
+ rle? ( media-libs/urt )
+ svga? ( media-libs/svgalib )
+ tiff? ( >=media-libs/tiff-3.5.5:0 )
+ xml? ( dev-libs/libxml2 )
+ zlib? ( sys-libs/zlib )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-devel/flex"
+
+netpbm_libtype() {
+ case ${CHOST} in
+ *-darwin*) echo dylib;;
+ *) echo unixshared;;
+ esac
+}
+netpbm_libsuffix() {
+ local suffix=$(get_libname)
+ echo ${suffix//\.}
+}
+netpbm_ldshlib() {
+ case ${CHOST} in
+ *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';;
+ *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';;
+ esac
+}
+netpbm_config() {
+ if use $1 ; then
+ [[ $2 != "!" ]] && echo -l${2:-$1}
+ else
+ echo NONE
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/netpbm-10.31-build.patch
+ epatch "${FILESDIR}"/netpbm-10.66-test.patch #450530
+ epatch "${FILESDIR}"/netpbm-10.70-system-libs.patch
+
+ # make sure we use system libs
+ sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
+ rm -r urt converter/other/jbig/libjbig converter/other/jpeg2000/libjasper || die
+
+ # disable certain tests based on active USE flags
+ local del=(
+ $(usex jbig '' 'jbigtopnm pnmtojbig jbig-roundtrip')
+ $(usex rle '' 'utahrle-roundtrip')
+ $(usex tiff '' 'tiff-roundtrip')
+ )
+ if [[ ${#del[@]} -gt 0 ]] ; then
+ sed -i -r $(printf -- ' -e /%s.test/d' "${del[@]}") test/Test-Order || die
+ fi
+ del=(
+ pnmtofiasco fiascotopnm # We always disable fiasco
+ $(usex jpeg '' 'jpegtopnm pnmtojpeg ppmtojpeg')
+ $(usex jbig '' 'jbigtopnm pnmtojbig')
+ $(usex jpeg2k '' 'jpeg2ktopam pamtojpeg2k')
+ $(usex rle '' 'pnmtorle rletopnm')
+ $(usex tiff '' 'pamtotiff pnmtotiff pnmtotiffcmyk tifftopnm')
+ )
+ if [[ ${#del[@]} -gt 0 ]] ; then
+ sed -i -r $(printf -- ' -e s/\<%s\>(:.ok)?//' "${del[@]}") test/all-in-place.{ok,test} || die
+ sed -i '/^$/d' test/all-in-place.ok || die
+ fi
+
+ # take care of the importinc stuff ourselves by only doing it once
+ # at the top level and having all subdirs use that one set #149843
+ sed -i \
+ -e '/^importinc:/s|^|importinc:\nmanual_|' \
+ -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\
+ common.mk || die
+ sed -i \
+ -e '/%.c/s: importinc$::' \
+ common.mk lib/Makefile lib/util/Makefile || die
+
+ # avoid ugly depend.mk warnings
+ touch $(find . -name Makefile | sed s:Makefile:depend.mk:g)
+}
+
+src_configure() {
+ cat config.mk.in - >> config.mk <<-EOF
+ # Misc crap
+ BUILD_FIASCO = N
+ SYMLINK = ln -sf
+
+ # These vars let src_test work by default
+ PKGDIR_DEFAULT = ${T}/netpbm
+ RESULTDIR_DEFAULT = ${T}/netpbm-test
+
+ # Toolchain options
+ CC = $(tc-getCC) -Wall
+ LD = \$(CC)
+ CC_FOR_BUILD = $(tc-getBUILD_CC)
+ LD_FOR_BUILD = \$(CC_FOR_BUILD)
+ AR = $(tc-getAR)
+ RANLIB = $(tc-getRANLIB)
+
+ STRIPFLAG =
+ CFLAGS_SHLIB = -fPIC
+
+ LDRELOC = \$(LD) -r
+ LDSHLIB = $(netpbm_ldshlib)
+ LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to
+ LINKERISCOMPILER = Y
+ NETPBMLIBSUFFIX = $(netpbm_libsuffix)
+ NETPBMLIBTYPE = $(netpbm_libtype)
+ STATICLIB_TOO = $(usex static-libs Y N)
+
+ # The var is called SSE, but the code is actually SSE2.
+ WANT_SSE = $(usex cpu_flags_x86_sse2 Y N)
+
+ # Gentoo build options
+ TIFFLIB = $(netpbm_config tiff)
+ # Let tiff worry about its own dependencies #395753
+ TIFFLIB_NEEDS_JPEG = N
+ TIFFLIB_NEEDS_Z = N
+ JPEGLIB = $(netpbm_config jpeg)
+ PNGLIB = $(netpbm_config png)
+ ZLIB = $(netpbm_config zlib z)
+ LINUXSVGALIB = $(netpbm_config svga vga)
+ XML2_LIBS = $(netpbm_config xml xml2)
+ JBIGLIB = $(netpbm_config jbig)
+ JBIGHDR_DIR =
+ JASPERLIB = $(netpbm_config jpeg2k jasper)
+ JASPERHDR_DIR =
+ URTLIB = $(netpbm_config rle)
+ URTHDR_DIR =
+ X11LIB = $(netpbm_config X X11)
+ X11HDR_DIR =
+ EOF
+ # cannot chain the die with the heredoc above as bash-3
+ # has a parser bug in that setup #282902
+ [ $? -eq 0 ] || die "writing config.mk failed"
+}
+
+src_compile() {
+ emake -j1 pm_config.h version.h manual_importinc #149843
+ emake
+}
+
+src_test() {
+ # The code wants to install everything first and then test the result.
+ emake install.{bin,lib}
+ emake check
+}
+
+src_install() {
+ # Subdir make targets like to use `mkdir` all over the place
+ # without any actual dependencies, thus the -j1.
+ emake -j1 package pkgdir="${ED}"/usr
+
+ [[ $(get_libdir) != "lib" ]] && mv "${ED}"/usr/lib "${ED}"/usr/$(get_libdir)
+
+ # Remove cruft that we don't need, and move around stuff we want
+ rm "${ED}"/usr/bin/{doc.url,manweb} || die
+ rm -r "${ED}"/usr/man/web || die
+ rm -r "${ED}"/usr/link || die
+ rm "${ED}"/usr/{README,VERSION,{pkgconfig,config}_template,pkginfo} || die
+ dodir /usr/share
+ mv "${ED}"/usr/man "${ED}"/usr/share/ || die
+ mv "${ED}"/usr/misc "${ED}"/usr/share/netpbm || die
+
+ doman userguide/*.[0-9]
+ use doc && dohtml -r userguide
+ dodoc README
+ cd doc
+ dodoc HISTORY Netpbm.programming USERDOC
+ dohtml -r .
+}
diff --git a/media-libs/netpbm/netpbm-10.76.00.ebuild b/media-libs/netpbm/netpbm-10.76.00.ebuild
new file mode 100644
index 000000000000..29f12e7f28b3
--- /dev/null
+++ b/media-libs/netpbm/netpbm-10.76.00.ebuild
@@ -0,0 +1,185 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-funcs eutils multilib
+
+DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
+HOMEPAGE="http://netpbm.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="doc jbig jpeg jpeg2k png postscript rle cpu_flags_x86_sse2 static-libs svga tiff X xml zlib"
+
+RDEPEND="jbig? ( media-libs/jbigkit )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ png? ( >=media-libs/libpng-1.4:0 )
+ postscript? ( app-text/ghostscript-gpl )
+ rle? ( media-libs/urt )
+ svga? ( media-libs/svgalib )
+ tiff? ( >=media-libs/tiff-3.5.5:0 )
+ xml? ( dev-libs/libxml2 )
+ zlib? ( sys-libs/zlib )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-devel/flex"
+
+netpbm_libtype() {
+ case ${CHOST} in
+ *-darwin*) echo dylib;;
+ *) echo unixshared;;
+ esac
+}
+netpbm_libsuffix() {
+ local suffix=$(get_libname)
+ echo ${suffix//\.}
+}
+netpbm_ldshlib() {
+ case ${CHOST} in
+ *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';;
+ *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';;
+ esac
+}
+netpbm_config() {
+ if use $1 ; then
+ [[ $2 != "!" ]] && echo -l${2:-$1}
+ else
+ echo NONE
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/netpbm-10.76.00-build.patch
+ epatch "${FILESDIR}"/netpbm-10.76.00-test.patch #450530
+ epatch "${FILESDIR}"/netpbm-10.76.00-misc-deps.patch
+ epatch "${FILESDIR}"/netpbm-10.76.00-pbmtext-test.patch #601012
+
+ # make sure we use system libs
+ sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
+ rm -r urt converter/other/jbig/libjbig converter/other/jpeg2000/libjasper || die
+
+ # take care of the importinc stuff ourselves by only doing it once
+ # at the top level and having all subdirs use that one set #149843
+ sed -i \
+ -e '/^importinc:/s|^|importinc:\nmanual_|' \
+ -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\
+ common.mk || die
+ sed -i \
+ -e '/%.c/s: importinc$::' \
+ common.mk lib/Makefile lib/util/Makefile || die
+ sed -i \
+ -e 's:pkg-config:$(PKG_CONFIG):' \
+ GNUmakefile converter/other/Makefile other/pamx/Makefile || die
+
+ # The postscript knob is currently bound up with a fork test.
+ if ! use postscript ; then
+ sed -i \
+ -e 's:$(DONT_HAVE_PROCESS_MGMT):Y:' \
+ converter/other/Makefile generator/Makefile || die
+ sed -i -r \
+ -e 's:(pbmtextps|pnmtops|pstopnm).*::' \
+ test/all-in-place.{ok,test} || die
+ sed -i -e '/^$/d' test/all-in-place.ok || die
+ sed -i '2iexit 80' test/ps-{alt-,}roundtrip.test || die
+ fi
+
+ # avoid ugly depend.mk warnings
+ touch $(find . -name Makefile | sed s:Makefile:depend.mk:g)
+}
+
+src_configure() {
+ cat config.mk.in - >> config.mk <<-EOF
+ # Misc crap
+ BUILD_FIASCO = N
+ SYMLINK = ln -sf
+
+ # These vars let src_test work by default
+ PKGDIR_DEFAULT = ${T}/netpbm
+ RESULTDIR_DEFAULT = ${T}/netpbm-test
+
+ # Toolchain options
+ CC = $(tc-getCC) -Wall
+ LD = \$(CC)
+ CC_FOR_BUILD = $(tc-getBUILD_CC)
+ LD_FOR_BUILD = \$(CC_FOR_BUILD)
+ AR = $(tc-getAR)
+ RANLIB = $(tc-getRANLIB)
+ PKG_CONFIG = $(tc-getPKG_CONFIG)
+
+ STRIPFLAG =
+ CFLAGS_SHLIB = -fPIC
+
+ LDRELOC = \$(LD) -r
+ LDSHLIB = $(netpbm_ldshlib)
+ LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to
+ LINKERISCOMPILER = Y
+ NETPBMLIBSUFFIX = $(netpbm_libsuffix)
+ NETPBMLIBTYPE = $(netpbm_libtype)
+ STATICLIB_TOO = $(usex static-libs Y N)
+
+ # The var is called SSE, but the code is actually SSE2.
+ WANT_SSE = $(usex cpu_flags_x86_sse2 Y N)
+
+ # Gentoo build options
+ TIFFLIB = $(netpbm_config tiff)
+ # Let tiff worry about its own dependencies #395753
+ TIFFLIB_NEEDS_JPEG = N
+ TIFFLIB_NEEDS_Z = N
+ JPEGLIB = $(netpbm_config jpeg)
+ PNGLIB = $(netpbm_config png)
+ ZLIB = $(netpbm_config zlib z)
+ LINUXSVGALIB = $(netpbm_config svga vga)
+ XML2_LIBS = $(netpbm_config xml xml2)
+ JBIGLIB = $(netpbm_config jbig)
+ JBIGHDR_DIR =
+ JASPERLIB = $(netpbm_config jpeg2k jasper)
+ JASPERHDR_DIR =
+ URTLIB = $(netpbm_config rle)
+ URTHDR_DIR =
+ X11LIB = $(netpbm_config X X11)
+ X11HDR_DIR =
+ EOF
+ # cannot chain the die with the heredoc above as bash-3
+ # has a parser bug in that setup #282902
+ [ $? -eq 0 ] || die "writing config.mk failed"
+}
+
+src_compile() {
+ emake -j1 pm_config.h version.h manual_importinc #149843
+ emake
+}
+
+src_test() {
+ # The code wants to install everything first and then test the result.
+ emake install.{bin,lib,data}
+ emake check
+}
+
+src_install() {
+ # Subdir make targets like to use `mkdir` all over the place
+ # without any actual dependencies, thus the -j1.
+ emake -j1 package pkgdir="${ED}"/usr
+
+ [[ $(get_libdir) != "lib" ]] && mv "${ED}"/usr/lib "${ED}"/usr/$(get_libdir)
+
+ # Remove cruft that we don't need, and move around stuff we want
+ rm "${ED}"/usr/bin/{doc.url,manweb} || die
+ rm -r "${ED}"/usr/man/web || die
+ rm -r "${ED}"/usr/link || die
+ rm "${ED}"/usr/{README,VERSION,{pkgconfig,config}_template,pkginfo} || die
+ dodir /usr/share
+ mv "${ED}"/usr/man "${ED}"/usr/share/ || die
+ mv "${ED}"/usr/misc "${ED}"/usr/share/netpbm || die
+
+ doman userguide/*.[0-9]
+ use doc && dohtml -r userguide
+ dodoc README
+ cd doc
+ dodoc HISTORY Netpbm.programming USERDOC
+ dohtml -r .
+}