Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/netpbm/files/, media-libs/netpbm/
Date: Sun, 27 Nov 2016 03:27:31
Message-Id: 1480217179.40ba0e169581d2998fa43b3462a397e21bea6cec.vapier@gentoo
1 commit: 40ba0e169581d2998fa43b3462a397e21bea6cec
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 27 03:26:00 2016 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 27 03:26:19 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40ba0e16
7
8 media-libs/netpbm: rework how we skip tests of disabled tools
9
10 media-libs/netpbm/files/netpbm-10.76.00-test.patch | 179 ++++++++++++++++++---
11 media-libs/netpbm/netpbm-10.76.00.ebuild | 23 ---
12 2 files changed, 158 insertions(+), 44 deletions(-)
13
14 diff --git a/media-libs/netpbm/files/netpbm-10.76.00-test.patch b/media-libs/netpbm/files/netpbm-10.76.00-test.patch
15 index 65f30d5..868358c 100644
16 --- a/media-libs/netpbm/files/netpbm-10.76.00-test.patch
17 +++ b/media-libs/netpbm/files/netpbm-10.76.00-test.patch
18 @@ -1,22 +1,159 @@
19 -https://bugs.gentoo.org/450530
20 +automatically skip tests of disabled tools
21
22 -we disable fiascotopnm all the time, so delete the test too
23 -
24 ---- a/test/all-in-place.test
25 -+++ b/test/all-in-place.test
26 -@@ -53,7 +53,6 @@ ordinary_testprogs="\
27 - ddbugtopbm \
28 - escp2topbm \
29 - eyuvtoppm \
30 -- fiascotopnm \
31 - fitstopnm \
32 - fstopgm \
33 - g3topbm \
34 ---- a/test/Test-Order
35 -+++ b/test/Test-Order
36 -@@ -153,5 +153,4 @@
37 -
38 - # Round-trip tests : lossy converters
39 -
40 --fiasco-roundtrip.test
41 - yuv-roundtrip.test
42 +--- GNUmakefile
43 ++++ GNUmakefile
44 +@@ -455,6 +455,17 @@ deb:
45 + .PHONY: check-package
46 + .PHONY: check-install
47 +
48 ++# Variables from the make env we pass down to the test scripts.
49 ++CHECK_VARS = \
50 ++ BUILDDIR=$(BUILDDIR) \
51 ++ RGBDEF=$(RGBDEF) \
52 ++ BUILD_FIASCO=$(BUILD_FIASCO) \
53 ++ JASPERLIB="$(JASPERLIB)" \
54 ++ JBIGLIB="$(JBIGLIB)" \
55 ++ JPEGLIB="$(JPEGLIB)" \
56 ++ TIFFLIB="$(TIFFLIB)" \
57 ++ URTLIB="$(URTLIB)"
58 ++
59 + # Test files in source tree.
60 +
61 + check-tree : BUILDBINDIRS :=./analyzer \
62 +@@ -525,10 +536,10 @@ resultdir-backup: FORCE
63 +
64 + check-tree: $(TESTRANDOM) resultdir-backup
65 + cd $(RESULTDIR); \
66 ++ $(CHECK_VARS) \
67 + CHECK_TYPE=tree \
68 +- PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
69 ++ PBM_TEST_PATH=$(PBM_TEST_PATH) \
70 + LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
71 +- RGBDEF=$(RGBDEF) \
72 + $(SRCDIR)/test/Execute-Tests 2>&1
73 +
74 + # Execute-Tests needs to know BUILDDIR in order to locate testrandom.
75 +@@ -545,19 +556,18 @@ check: check-package
76 +
77 + check-package: $(TESTRANDOM) resultdir-backup
78 + cd $(RESULTDIR); \
79 ++ $(CHECK_VARS) \
80 + CHECK_TYPE=package \
81 +- PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
82 ++ PBM_TEST_PATH=$(PBM_TEST_PATH) \
83 + LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
84 +- RGBDEF=$(RGBDEF) \
85 + $(SRCDIR)/test/Execute-Tests 2>&1
86 +
87 +
88 + # Check after install
89 + check-install: $(TESTRANDOM) resultdir-backup
90 + cd $(RESULTDIR); \
91 ++ $(CHECK_VARS) \
92 + CHECK_TYPE=install \
93 +- BUILDDIR=$(BUILDDIR) \
94 +- RGBDEF=$(RGBDEF) \
95 + $(SRCDIR)/test/Execute-Tests 2>&1
96 +
97 +
98 +--- test/all-in-place.test
99 ++++ test/all-in-place.test
100 +@@ -367,11 +367,49 @@ ordinary_testprogs="\
101 + zeisstopnm \
102 + "
103 +
104 ++enabled_testprog() {
105 ++ case $1 in
106 ++ fiascotopnm|\
107 ++ pnmtofiasco)
108 ++ [ "${BUILD_FIASCO}" = "N" ] && return 1 ;;
109 ++
110 ++ jpeg2ktopam|\
111 ++ pamtojpeg2k)
112 ++ [ "${JASPERLIB}" = "NONE" ] && return 1 ;;
113 ++
114 ++ jbigtopnm|\
115 ++ pnmtojbig)
116 ++ [ "${JBIGLIB}" = "NONE" ] && return 1 ;;
117 ++
118 ++ jpegtopnm|\
119 ++ pnmtojpeg|\
120 ++ ppmtojpeg)
121 ++ [ "${JPEGLIB}" = "NONE" ] && return 1 ;;
122 ++
123 ++ pamtotiff|\
124 ++ pnmtotiffcmyk|\
125 ++ tifftopnm)
126 ++ [ "${TIFFLIB}" = "NONE" ] && return 1 ;;
127 ++
128 ++ pnmtorle|\
129 ++ rletopnm)
130 ++ [ "${URTLIB}" = "NONE" ] && return 1 ;;
131 ++ esac
132 ++
133 ++ return 0
134 ++}
135 ++
136 + # The string "fiascotopnm" has to be filtered out by egrep for fiascotopnm
137 + # has a slightly different version report format.
138 +
139 + for i in $ordinary_testprogs
140 + do
141 ++ # Stub out programs that aren't built.
142 ++ if ! enabled_testprog "$i"; then
143 ++ echo "$i: ok"
144 ++ continue
145 ++ fi
146 ++
147 + $i --version 2>&1 | \
148 + egrep -v -e fiascotopnm -e \
149 + "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
150 +--- test/fiasco-roundtrip.test
151 ++++ test/fiasco-roundtrip.test
152 +@@ -2,6 +2,10 @@
153 + # This script tests: pnmtofiasco fiascotopnm
154 + # Also requires: pnmpad
155 +
156 ++if [ "${BUILD_FIASCO}" = "N" ]; then
157 ++ exit 80
158 ++fi
159 ++
160 + # Should print 215556145 102615
161 +
162 + pnmpad --black --bottom 1 --left 1 testimg.ppm | \
163 +--- test/jbig-roundtrip.test
164 ++++ test/jbig-roundtrip.test
165 +@@ -2,6 +2,9 @@
166 + # This script tests: pnmtojbig jbigtopnm
167 + # Also requires: pamchannel pamtopnm
168 +
169 ++if [ "${JBIGLIB}" = "NONE" ]; then
170 ++ exit 80
171 ++fi
172 +
173 + # Test 1. Should print 2425386270 41
174 + pnmtojbig testgrid.pbm | jbigtopnm | cksum
175 +--- test/tiff-roundtrip.test
176 ++++ test/tiff-roundtrip.test
177 +@@ -2,6 +2,9 @@
178 + # This script tests: pamtotiff tifftopnm
179 + # Also requires:
180 +
181 ++if [ "${TIFFLIB}" = "NONE" ]; then
182 ++ exit 80
183 ++fi
184 +
185 + # Failure message
186 + ## Second test fails if Netpbm was built without the flate library
187 +--- test/utahrle-roundtrip.test
188 ++++ test/utahrle-roundtrip.test
189 +@@ -2,6 +2,9 @@
190 + # This script tests: pnmtorle rletopnm
191 + # Also requires: pamchannel pamtopnm
192 +
193 ++if [ "${URTLIB}" = "NONE" ]; then
194 ++ exit 80
195 ++fi
196 +
197 + #Test 1. Should produce 1571496937 33838, cksum of testimg.red
198 + pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \
199
200 diff --git a/media-libs/netpbm/netpbm-10.76.00.ebuild b/media-libs/netpbm/netpbm-10.76.00.ebuild
201 index 225eb63..a63466f 100644
202 --- a/media-libs/netpbm/netpbm-10.76.00.ebuild
203 +++ b/media-libs/netpbm/netpbm-10.76.00.ebuild
204 @@ -60,29 +60,6 @@ src_prepare() {
205 sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
206 rm -r urt converter/other/jbig/libjbig converter/other/jpeg2000/libjasper || die
207
208 - # disable certain tests based on active USE flags
209 - local del=(
210 - $(usex jbig '' 'jbigtopnm pnmtojbig jbig-roundtrip')
211 - $(usex rle '' 'utahrle-roundtrip')
212 - $(usex tiff '' 'tiff-roundtrip')
213 - )
214 - if [[ ${#del[@]} -gt 0 ]] ; then
215 - sed -i -r $(printf -- ' -e /%s.test/d' "${del[@]}") test/Test-Order || die
216 - fi
217 - del=(
218 - pnmtofiasco fiascotopnm # We always disable fiasco
219 - $(usex jpeg '' 'jpegtopnm pnmtojpeg ppmtojpeg')
220 - $(usex jbig '' 'jbigtopnm pnmtojbig')
221 - $(usex jpeg2k '' 'jpeg2ktopam pamtojpeg2k')
222 - $(usex rle '' 'pnmtorle rletopnm')
223 - $(usex tiff '' 'pamtotiff pnmtotiff pnmtotiffcmyk tifftopnm')
224 - )
225 - if [[ ${#del[@]} -gt 0 ]] ; then
226 - sed -i -r $(printf -- ' -e s/\<%s\>(:.ok)?//' "${del[@]}") \
227 - test/{all-in-place,legacy-names}.{ok,test} || die
228 - sed -i '/^$/d' test/{all-in-place,legacy-names}.ok || die
229 - fi
230 -
231 # take care of the importinc stuff ourselves by only doing it once
232 # at the top level and having all subdirs use that one set #149843
233 sed -i \