commit: 9891549eb3e5edac8914e3643ccf02c9f71cd13b Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Mon Mar 25 08:03:46 2019 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Mon Mar 25 08:03:46 2019 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=9891549e
media-libs/netpbm: sync Package-Manager: Portage-2.3.62-prefix, Repoman-2.3.12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> media-libs/netpbm/Manifest | 1 + .../netpbm/files/netpbm-10.76.00-build.patch | 38 ++++ .../netpbm/files/netpbm-10.76.00-misc-deps.patch | 68 ++++++ .../files/netpbm-10.76.00-pbmtext-test.patch | 22 ++ .../netpbm/files/netpbm-10.76.00-solaris.patch | 24 ++ media-libs/netpbm/files/netpbm-10.76.00-test.patch | 248 +++++++++++++++++++++ media-libs/netpbm/netpbm-10.76.00.ebuild | 195 ++++++++++++++++ 7 files changed, 596 insertions(+) diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest index 832b74ca1a..3a5dd5f2e2 100644 --- a/media-libs/netpbm/Manifest +++ b/media-libs/netpbm/Manifest @@ -2,3 +2,4 @@ DIST netpbm-10.51.00-libpng-1.5.patch.bz2 8120 BLAKE2B 47b9e3f85f2d959ca56dd4ff8 DIST netpbm-10.51.00.tar.xz 1834148 BLAKE2B 07a038c139407f5b5929464ee0e607091f809c70e858105e0b279673167cd22f2500c9c16a03dc80ce62bebde70464bf0f3add4bd44161cb9d25f5baa687b399 SHA512 07b621bfebbd051a80eff09886bc2b3b4f82b01fa9087d6a76ed70a042493b69fb3295d471640a4576101ba19352a57eadf69c5721d9cc416d25ff563ee07c76 DIST netpbm-10.57.00.tar.xz 1884452 BLAKE2B 9a1f1ccd860aae9a29510dbe79bfbf35001bd3325a0eb671c2bec5ab1af4e1ff9eee1e3c623c55f87640fd7ca602302deceab9c268b8a3fadf4dd8ec76af98a3 SHA512 24dea478599b189d7ed845d62f4b4de5a6c18e3cdf00c35edeb71f179a68a69233a7ce43d6a1be50c218dd32cedbe546e2344f2201e335f9d6d64475510dbb30 DIST netpbm-10.59.00.tar.xz 2526328 BLAKE2B 7afe992d00ba7b09c483fde157dc25cdc2df592a6b20e83c3b74c2151f2dc86536b24d9678b19fcb115c22df00147fb52b044ae56f754b849cba4dbed5d253d0 SHA512 789095667b0adaaf4ae768dbc52226106caf35dc7fd01a3d352c88dfb699f90e74c5f0a6c002768acb673bcf9e36830b1f2951bfbe27a0159c1c73453b74efc5 +DIST netpbm-10.76.00.tar.xz 2657184 BLAKE2B b8d82268ba50881fab10bca00ea408afa39096f4f9c079b523d8e28ce62301797ee50f55c84f85a6d832b723da7449531e725bf60a4a89975c51382b2cbc4a94 SHA512 234a5616a7631a8eb70817bb88ed509ddddfce93f71739654ef78a2735245b268c391adb49b514ed883569c9fc6ea9c3eeed10aa7898c02b797fee5249b11cf3 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 0000000000..231da54467 --- /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 0000000000..392eae0f40 --- /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 0000000000..cdc075e529 --- /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-solaris.patch b/media-libs/netpbm/files/netpbm-10.76.00-solaris.patch new file mode 100644 index 0000000000..f294c7de27 --- /dev/null +++ b/media-libs/netpbm/files/netpbm-10.76.00-solaris.patch @@ -0,0 +1,24 @@ +--- converter/other/jpeg2000/jpeg2ktopam.c ++++ converter/other/jpeg2000/jpeg2ktopam.c +@@ -9,7 +9,9 @@ + *****************************************************************************/ + + #define _BSD_SOURCE 1 /* Make sure strdup() is in string.h */ ++#if 0 + #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */ ++#endif + /* In 2014.09, this was _XOPEN_SOURCE 600, with a comment saying it was + necessary to make <inttypes.h> define int_fast32_t, etc. on AIX. + <jasper/jasper.h> does use int_fast32_t and does include <inttypes.h>, +--- converter/other/jpeg2000/pamtojpeg2k.c ++++ converter/other/jpeg2000/pamtojpeg2k.c +@@ -9,7 +9,9 @@ + *****************************************************************************/ + + #define _BSD_SOURCE 1 /* Make sure strdup() is in string.h */ ++#if 0 + #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */ ++#endif + /* In 2014.09, this was _XOPEN_SOURCE 600, with a comment saying it was + necessary to make <inttypes.h> define int_fast32_t, etc. on AIX. + <jasper/jasper.h> does use int_fast32_t and does include <inttypes.h>, 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 0000000000..870998bc98 --- /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/netpbm-10.76.00.ebuild b/media-libs/netpbm/netpbm-10.76.00.ebuild new file mode 100644 index 0000000000..8d33c25e68 --- /dev/null +++ b/media-libs/netpbm/netpbm-10.76.00.ebuild @@ -0,0 +1,195 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit toolchain-funcs eutils multilib prefix + +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="~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +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() { + # ultra dirty Darwin hack, but hey... in the end this is all it needs... + case ${CHOST} in + *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name ${EPREFIX}/usr/lib/libnetpbm.$(MAJ).dylib';; + *) 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 + + epatch "${FILESDIR}"/${PN}-10.46.00-solaris.patch + epatch "${FILESDIR}"/${PN}-10.76.00-solaris.patch + epatch "${FILESDIR}"/${PN}-10.60.01-strcaseeq-strcasecmp.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 + + # 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() { + # Solaris doesn't have vasprintf, libiberty does have it, for gethostbyname + # we need -lnsl, for connect -lsocket + [[ ${CHOST} == *-solaris* ]] && extlibs="-liberty -lnsl -lsocket" + + emake LIBS="${extlibs}" -j1 pm_config.h version.h manual_importinc #149843 + emake LIBS="${extlibs}" +} + +src_test() { + # The code wants to install everything first and then test the result. + emake install.{bin,lib,data} + emake check +} + +src_install() { + mkdir -p "${ED}" + # 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 . +}