Gentoo Archives: gentoo-commits

From: Bernard Cafarelli <voyageur@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/argyllcms/files/, media-gfx/argyllcms/
Date: Tue, 05 May 2020 22:45:31
Message-Id: 1588718705.5eaf7f40ff4f9dfd2fb006c9b08d929e04c82703.voyageur@gentoo
1 commit: 5eaf7f40ff4f9dfd2fb006c9b08d929e04c82703
2 Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 5 22:45:05 2020 +0000
4 Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
5 CommitDate: Tue May 5 22:45:05 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5eaf7f40
7
8 media-gfx/argyllcms: fix build with -fno-common
9
10 Patch from openSUSE
11 Also set BDEPEND for ftjam/unzip
12
13 Closes: https://bugs.gentoo.org/706842
14 Package-Manager: Portage-2.3.99, Repoman-2.3.22
15 Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org>
16
17 media-gfx/argyllcms/argyllcms-2.1.2-r1.ebuild | 93 ++++++++++++++
18 .../files/argyllcms-2.1.2-fno-common.patch | 134 +++++++++++++++++++++
19 2 files changed, 227 insertions(+)
20
21 diff --git a/media-gfx/argyllcms/argyllcms-2.1.2-r1.ebuild b/media-gfx/argyllcms/argyllcms-2.1.2-r1.ebuild
22 new file mode 100644
23 index 00000000000..25461f6d175
24 --- /dev/null
25 +++ b/media-gfx/argyllcms/argyllcms-2.1.2-r1.ebuild
26 @@ -0,0 +1,93 @@
27 +# Copyright 1999-2020 Gentoo Authors
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI=7
31 +
32 +inherit flag-o-matic multiprocessing toolchain-funcs udev
33 +
34 +MY_P="Argyll_V${PV}"
35 +
36 +DESCRIPTION="Open source, ICC compatible color management system"
37 +HOMEPAGE="http://www.argyllcms.com/"
38 +SRC_URI="http://www.argyllcms.com/${MY_P}_src.zip"
39 +
40 +LICENSE="AGPL-3"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~arm64 ~hppa ~x86"
43 +IUSE="doc libressl"
44 +
45 +RDEPEND="
46 + media-libs/tiff:0
47 + sys-libs/zlib
48 + virtual/jpeg:0
49 + x11-libs/libX11
50 + x11-libs/libXau
51 + x11-libs/libXdmcp
52 + x11-libs/libXext
53 + x11-libs/libXinerama
54 + x11-libs/libXrandr
55 + x11-libs/libXxf86vm
56 + x11-libs/libXScrnSaver
57 + !libressl? ( dev-libs/openssl:0= )
58 + libressl? ( dev-libs/libressl:0= )"
59 +DEPEND="${RDEPEND}"
60 +BDEPEND="app-arch/unzip
61 + dev-util/ftjam"
62 +
63 +PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
64 +
65 +S="${WORKDIR}/${MY_P}"
66 +
67 +src_compile() {
68 + # Make it respect LDFLAGS
69 + echo "LINKFLAGS += ${LDFLAGS} ;" >> Jamtop
70 +
71 + # Evil hack to get --as-needed working. The build system unfortunately lists all
72 + # the shared libraries by default on the command line _before_ the object to be built...
73 + echo "STDLIBS += -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss -ltiff -ljpeg ;" >> Jamtop
74 +
75 + append-cflags -DUNIX -D_THREAD_SAFE
76 +
77 + sed \
78 + -e 's:CCFLAGS:CFLAGS:g' \
79 + -e "s:ar rusc:$(tc-getAR) rusc:g" \
80 + -i Jambase || die
81 +
82 + tc-export CC RANLIB
83 +
84 + jam -dx -fJambase "-j$(makeopts_jobs)" || die
85 +}
86 +
87 +src_install() {
88 + jam -dx -fJambase install || die
89 +
90 + rm bin/License.txt || die
91 +
92 + pushd bin > /dev/null
93 + local binname
94 + for binname in * ; do
95 + newbin ${binname} argyll-${binname}
96 + done
97 + popd > /dev/null
98 +
99 + dodoc log.txt Readme.txt ttbd.txt notes.txt
100 + if use doc; then
101 + docinto html
102 + dodoc doc/*html doc/*jpg doc/*gif
103 + fi
104 +
105 + insinto /usr/share/${PN}
106 + doins -r ref
107 +
108 + udev_dorules usb/55-Argyll.rules
109 +}
110 +
111 +pkg_postinst() {
112 + elog "If you have a Spyder2 you need to extract the firmware"
113 + elog "from the CVSpyder.dll of the windows driver package"
114 + elog "and store it as /usr/share/color/spyd2PLD.bin"
115 + echo
116 + elog "For further info on setting up instrument access read"
117 + elog "http://www.argyllcms.com/doc/Installing_Linux.html"
118 + echo
119 +}
120
121 diff --git a/media-gfx/argyllcms/files/argyllcms-2.1.2-fno-common.patch b/media-gfx/argyllcms/files/argyllcms-2.1.2-fno-common.patch
122 new file mode 100644
123 index 00000000000..36bf87d1255
124 --- /dev/null
125 +++ b/media-gfx/argyllcms/files/argyllcms-2.1.2-fno-common.patch
126 @@ -0,0 +1,134 @@
127 +argyllcms: Fix compilation with GCC 10
128 +
129 +A common mistake in C is omitting extern when declaring a global variable
130 +in a header file. If the header is included by several files it results
131 +in multiple definitions of the same variable. In previous GCC versions
132 +this error is ignored. GCC 10 defaults to -fno-common, which means a
133 +linker error will now be reported. To fix this, use extern in header
134 +files when declaring global variables, and ensure each global is defined
135 +in exactly one C file. As a workaround, legacy C code can be compiled
136 +with -fcommon.
137 +
138 + int x; // tentative definition - avoid in header files
139 + extern int y; // correct declaration in a header file
140 +
141 +References:
142 +https://bugzilla.opensuse.org/show_bug.cgi?id=1160244
143 +https://bugzilla.opensuse.org/show_bug.cgi?id=1160256
144 +
145 +In case of vinflate.c and inflate.c, both files define local variables
146 +with the same name as global. It is no more possible with GCC 10. To
147 +prevent sharing variables across files, add "static" to all local
148 +variables.
149 +
150 +Index: Argyll_V2.1.2/gamut/gamut.h
151 +===================================================================
152 +--- Argyll_V2.1.2.orig/gamut/gamut.h
153 ++++ Argyll_V2.1.2/gamut/gamut.h
154 +@@ -36,7 +36,7 @@
155 + #define MAXGAMN 10 /* Maximum gamut point neighbors returned */
156 + #define NSLOTS 6 /* Number of maximum direction slots */
157 +
158 +-struct _vrml *wrl; /* Declared in vrml.h, which may be #included after this */
159 ++struct _vrml; /* Declared in vrml.h, which may be #included after this */
160 +
161 + /* ------------------------------------ */
162 + #define NODE_STRUCT \
163 +Index: Argyll_V2.1.2/spectro/vinflate.c
164 +===================================================================
165 +--- Argyll_V2.1.2.orig/spectro/vinflate.c
166 ++++ Argyll_V2.1.2/spectro/vinflate.c
167 +@@ -92,7 +92,7 @@ int vinflate(void);
168 + */
169 +
170 + #define WSIZE 0x8000
171 +-unsigned int wp; /* current position in slide */
172 ++static unsigned int wp; /* current position in slide */
173 + uch slide[32768];
174 +
175 + static int vflush_output(unsigned int w) {
176 +@@ -160,8 +160,8 @@ static ush cpdext[] = { /* Extra
177 + the stream.
178 + */
179 +
180 +-ulg bb; /* bit buffer */
181 +-unsigned bk; /* bits in bit buffer */
182 ++static ulg bb; /* bit buffer */
183 ++static unsigned bk; /* bits in bit buffer */
184 +
185 + ush vmask_bits[] = {
186 + 0x0000,
187 +@@ -230,8 +230,8 @@ ush vmask_bits[] = {
188 + */
189 +
190 +
191 +-int vlbits = 9; /* bits in base literal/length lookup table */
192 +-int vdbits = 6; /* bits in base distance lookup table */
193 ++static int vlbits = 9; /* bits in base literal/length lookup table */
194 ++static int vdbits = 6; /* bits in base distance lookup table */
195 +
196 +
197 + /* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
198 +@@ -239,7 +239,7 @@ int vdbits = 6; /* bits in base
199 + #define N_MAX 288 /* maximum number of codes in any set */
200 +
201 +
202 +-unsigned hufts; /* track memory usage */
203 ++static unsigned hufts; /* track memory usage */
204 +
205 + /* Given a list of code lengths and a maximum table size, make a set of
206 + tables to decode that set of codes. Return zero on success, one if
207 +Index: Argyll_V2.1.2/spectro/inflate.c
208 +===================================================================
209 +--- Argyll_V2.1.2.orig/spectro/inflate.c
210 ++++ Argyll_V2.1.2/spectro/inflate.c
211 +@@ -49,7 +49,7 @@ typedef unsigned int ulg;
212 + the next table, which codes e - 16 bits, and lastly e == 99 indicates
213 + an unused code. If a code with e == 99 is looked up, this implies an
214 + error in the data. */
215 +-struct huft {
216 ++static struct huft {
217 + uch e; /* number of extra bits or operation */
218 + uch b; /* number of bits in this code or subcode */
219 + union {
220 +@@ -87,7 +87,7 @@ int inflate(void);
221 + /* unsigned wp; current position in slide */
222 +
223 + #define WSIZE 0x8000
224 +-unsigned int wp; /* current position in slide */
225 ++static unsigned int wp; /* current position in slide */
226 + uch slide[32768];
227 +
228 + static int flush_output(unsigned int w) {
229 +@@ -155,8 +155,8 @@ static ush cpdext[] = { /* Extra
230 + the stream.
231 + */
232 +
233 +-ulg bb; /* bit buffer */
234 +-unsigned bk; /* bits in bit buffer */
235 ++static ulg bb; /* bit buffer */
236 ++static unsigned bk; /* bits in bit buffer */
237 +
238 + ush mask_bits[] = {
239 + 0x0000,
240 +@@ -201,8 +201,8 @@ ush mask_bits[] = {
241 + */
242 +
243 +
244 +-int lbits = 9; /* bits in base literal/length lookup table */
245 +-int dbits = 6; /* bits in base distance lookup table */
246 ++static int lbits = 9; /* bits in base literal/length lookup table */
247 ++static int dbits = 6; /* bits in base distance lookup table */
248 +
249 +
250 + /* If BMAX needs to be larger than 16, then h and x[] should be ulg. */
251 +@@ -210,7 +210,7 @@ int dbits = 6; /* bits in base
252 + #define N_MAX 288 /* maximum number of codes in any set */
253 +
254 +
255 +-unsigned hufts; /* track memory usage */
256 ++static unsigned hufts; /* track memory usage */
257 +
258 +
259 + static int huft_build(b, n, s, d, e, t, m)
260 +