Gentoo Archives: gentoo-commits

From: NP Hardass <np-hardass@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/wine-d3d9/files/, app-emulation/wine-d3d9/
Date: Mon, 10 Apr 2017 17:23:38
Message-Id: 1491844919.a5b7b36cffeea8a87ab3a1badb455c59019d1b1a.np-hardass@gentoo
1 commit: a5b7b36cffeea8a87ab3a1badb455c59019d1b1a
2 Author: NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 10 17:14:39 2017 +0000
4 Commit: NP Hardass <np-hardass <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 10 17:21:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5b7b36c
7
8 app-emulation/wine-d3d9: Wine with the Gallium Nine patchset, multislot
9
10 Imported from wine-a-holics overlay
11
12 Package-Manager: Portage-2.3.3, Repoman-2.3.1
13
14 app-emulation/wine-d3d9/Manifest | 11 +
15 app-emulation/wine-d3d9/files/builtin_ms_va_list.c | 9 +
16 app-emulation/wine-d3d9/files/pr66838.c | 36 ++
17 app-emulation/wine-d3d9/files/pr69140.c | 37 ++
18 .../wine-d3d9/files/wine-1.5.26-winegcc.patch | 59 +++
19 .../wine-d3d9/files/wine-1.6-memset-O3.patch | 21 +
20 .../wine-d3d9/files/wine-1.7.12-osmesa-check.patch | 38 ++
21 .../files/wine-1.9.5-multilib-portage.patch | 31 ++
22 .../files/wine-2.0-multislot-apploader.patch | 14 +
23 app-emulation/wine-d3d9/metadata.xml | 43 ++
24 app-emulation/wine-d3d9/wine-d3d9-2.0.ebuild | 549 +++++++++++++++++++++
25 app-emulation/wine-d3d9/wine-d3d9-2.1.ebuild | 549 +++++++++++++++++++++
26 app-emulation/wine-d3d9/wine-d3d9-2.2.ebuild | 549 +++++++++++++++++++++
27 app-emulation/wine-d3d9/wine-d3d9-2.3.ebuild | 549 +++++++++++++++++++++
28 app-emulation/wine-d3d9/wine-d3d9-2.4.ebuild | 549 +++++++++++++++++++++
29 app-emulation/wine-d3d9/wine-d3d9-9999.ebuild | 549 +++++++++++++++++++++
30 16 files changed, 3593 insertions(+)
31
32 diff --git a/app-emulation/wine-d3d9/Manifest b/app-emulation/wine-d3d9/Manifest
33 new file mode 100644
34 index 00000000000..560ac987705
35 --- /dev/null
36 +++ b/app-emulation/wine-d3d9/Manifest
37 @@ -0,0 +1,11 @@
38 +DIST wine-2.0.tar.bz2 23662707 SHA256 9756f5a2129b6a83ba701e546173cbff86caa671b0af73eb8f72c03b20c066c6 SHA512 b0a57ba8202d9fc396e5bfb7a7718d6bababbed8f3351e7fdc36afa37f35a871e04903757618f73427aeb71a52b2d323977d79e48f8b38d636f23fd404441186 WHIRLPOOL fa9f774d87dae73c7d1f3b86dc3b03ea27065eb6140f1cac13c82fe16f7ebff8f8365ed447220cf5c2788b9f4aae7c482e4f9e2e69f47e5435209e148f5dbdfe
39 +DIST wine-2.1.tar.xz 18887032 SHA256 bfb9abf63691c93df28d9599aaa866dc2b4e27209b3b7b546df8a37d7d9d1e6e SHA512 03d678ee6e89c2804813f2827255fcf59e96ca9a45b7d8ac441cfc84f835e5e5689c70a79a41a04c631e1add7807fa4a5758acef3bd7aadfb2e92e68958c6ef6 WHIRLPOOL 063d935f1ff0922100641f2f53cdac23d2993a83182d45e028e485fd7d0a13bc5cfb77bca76550b1537b3f42fecacef7fd64785adbf6425af823f56f96973b54
40 +DIST wine-2.2.tar.xz 18916364 SHA256 64cb57e1d8aa07f5c89ef26743b494f2d3ef9c0f4e50d3ee896a93535f7751f4 SHA512 0700868244d397c1442948716321e5ff030c667edce464570f76aa4340199489a422872aa3975bc0a57b8285c9d59fc04e223a4bde094169fc6db460acb626c4 WHIRLPOOL ffc3d357a76592651b589c6ac6608720d0258474890faf8fe3e20ac29cdd1496d569721256f9389d347bf2734a556099154fd18ef1b56f45bb46c4c15771d6ca
41 +DIST wine-2.3.tar.xz 18931732 SHA256 afc95c7a87cc8f0730b462c50a5dfc9c462eb02c6bf5874b4fa99946f49e067e SHA512 bea78e8468555ff9e08dedf3918da5ea82721549c43984869989bbdafeea00e454820ff9558aa29925c97a165a9b01e5cd1fd397f133833c58824984a6686171 WHIRLPOOL 1f5ec8e5c32d124277e4c71d95726d3a5337575757c3029567c77165d65fcfec2ddf33d3863b4bf55c9eff7c3582c1ec7dbd76d84ed8bbbe89dd16db6b0128c1
42 +DIST wine-2.4.tar.xz 18953748 SHA256 87b5df07e4781fecce2f92415a4717208ea253a20a0df8b36b9f90b69b72748e SHA512 15ae7e97dc72a8636b2c15c93803ed430fa456d673add61457cf3e479e769559c682b40949b5d38828f6681f13183e560fcb4a2eb0f0ba25e6eade46f7d3d7c0 WHIRLPOOL 558ab7b7517ad5e03366b4db974047eba776585e958a5b71bb2e93993e21bc725ea7a8bcf2a4354f34ca38c94ba99ccd15f2f8b5e4b58066bf339d3517eec56c
43 +DIST wine-d3d9-2.0.tar.gz 48373 SHA256 7bfac23706723c6d51a7a95e416e47fb2678cd4d0945b990f74eba2b059e6206 SHA512 a9e2d1c9f2784128e4c53a8dc923070a5057b5ff3d83c2b536a2d2df0bc8433ac92b8ab1c3cdf34158c0e7bfe497ddb5974605fbc1736a92307639d59450c7a1 WHIRLPOOL 53044c0a4b7159c3af75fc935d1ac45030e80dbfd70d787f64885ddc025cfcd62f724c3256e389a7fde680670e594101955f52301cf6b9bbf23ebc64552790c2
44 +DIST wine-d3d9-2.1.tar.gz 48385 SHA256 9fd80e3e2ea905272c42dbc14679e94c8e2f955101ae098c84060d4c62ffc9c6 SHA512 9234d8227412d940a6befcf79433f1d5ab0634d5e829f3771ffeea235af05be29ffc40438818b1976c77d1e2e79da8a67c4dab2b7d2e822b502fb6e4a1a7f8b7 WHIRLPOOL 790e482850a13c5bf0967e900620c36d71c4d6673106f8f5c2848550ed574d326d3945d9906de88d847bb5644a520aab7fe6d460b3c3afd49a396798dd253392
45 +DIST wine-d3d9-2.2.tar.gz 48387 SHA256 203ed60980ec584c09b413266728e3a93e2d980dbff9b4f65375a4e9744b5042 SHA512 6e9e031b51afc8ec200bbd252ff0d768c29af23907f782409834de593f896afb128f86fe012c95dc18e5f3c7267f170eb343d2a2c53d639933a337f0c1e04fab WHIRLPOOL 6b32c0dfd3068e87d94bbcd83718dd75a14b36d69b151e9257e04793d2d3ae78ce7da10b80cbc824ccefb6c11666241593f91963ddee6a58301f95bbde35285d
46 +DIST wine-d3d9-2.3.tar.gz 48510 SHA256 fc17488a782def19fc02bf967128ab43236db49509e31771361a60fa3d17dd60 SHA512 58449f6b7ed7fd8182e2cce92e1d1195bf64a567c1cc92fd3f46af195e7e4039c3b2a128be9d3572d9067be6c1bb020f417c6d558bb551c60096c107067177b8 WHIRLPOOL f648a921cf4cd257a3a7dfbd3abf45d58c07782f329ec11c3a1eff3afe32e8040adb351d4a60e1b1f78c7cae0379f23468764ad162a101179d0f5b0e2c6d9413
47 +DIST wine-d3d9-2.4.tar.gz 48502 SHA256 4c7084e733d95545b894b152b2c6c9564dfb8df594cfeb1512dad80743b39ae0 SHA512 623b1720b8cd79ab6ad2a177b9beb174f31e6fc402d6885fa2006223c855919c6f5d4267c64212ecf8cf1746430c9715c506343fb740828fc99910f916b10ebe WHIRLPOOL 9c0ea34dedc2e39ce36f1539a6d761ba07429b316a1f7fad49067eec5c28a5c60b33b3d2473cbf66b009d9772c1fb123414bfa201eb8df3e61f8efc38aa1f3fa
48 +DIST wine-desktop-common-20150204.tar.gz 99491 SHA256 444ad6b52b5290ec7d160e2cc40e4ba0910b4c4983dba1ceb054b81b09b24b5e SHA512 1f3d7022c5cff87ed3b8fd3b7cd14397c6f23b98fe6a7c583ac0d2f439ff29d943f57375f23687aa6519ff1d84ff07624a9a712d6f19fa207fd26d01edcb6688 WHIRLPOOL e9810b2952d25c05d831000e00e423de86809ec31b9a033fd4c64a70709da7338a9afc9e632e678f49c789a8a3702fbd0113226770cdb806623f2de371a16f54
49
50 diff --git a/app-emulation/wine-d3d9/files/builtin_ms_va_list.c b/app-emulation/wine-d3d9/files/builtin_ms_va_list.c
51 new file mode 100644
52 index 00000000000..f36fc2609a0
53 --- /dev/null
54 +++ b/app-emulation/wine-d3d9/files/builtin_ms_va_list.c
55 @@ -0,0 +1,9 @@
56 +/* Taken from Wine's configure script. LGPL 2.1+ */
57 +
58 +#include <stdarg.h>
59 +
60 +int main(void)
61 +{
62 + void func(__builtin_ms_va_list *args);
63 + return 0;
64 +}
65
66 diff --git a/app-emulation/wine-d3d9/files/pr66838.c b/app-emulation/wine-d3d9/files/pr66838.c
67 new file mode 100644
68 index 00000000000..cd616859427
69 --- /dev/null
70 +++ b/app-emulation/wine-d3d9/files/pr66838.c
71 @@ -0,0 +1,36 @@
72 +/* From gcc svn, /branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66838.c */
73 +/* Copyrighted and distributed under the same terms as gcc */
74 +
75 +void abort (void);
76 +
77 +char global;
78 +
79 +__attribute__((sysv_abi, noinline, noclone))
80 +void sysv_abi_func(char const *desc, void *local)
81 +{
82 + register int esi asm ("esi");
83 + register int edi asm ("edi");
84 +
85 + if (local != &global)
86 + abort ();
87 +
88 + /* Clobber some of the extra SYSV ABI registers. */
89 + asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
90 + : "=r" (esi), "=r" (edi)
91 + : "i" (0xdeadbeef));
92 +}
93 +
94 +__attribute__((ms_abi, noinline, noclone))
95 +void ms_abi_func ()
96 +{
97 + sysv_abi_func ("1st call", &global);
98 + sysv_abi_func ("2nd call", &global);
99 + sysv_abi_func ("3rd call", &global);
100 +}
101 +
102 +int
103 +main(void)
104 +{
105 + ms_abi_func();
106 + return 0;
107 +}
108
109 diff --git a/app-emulation/wine-d3d9/files/pr69140.c b/app-emulation/wine-d3d9/files/pr69140.c
110 new file mode 100644
111 index 00000000000..7c9e001f301
112 --- /dev/null
113 +++ b/app-emulation/wine-d3d9/files/pr69140.c
114 @@ -0,0 +1,37 @@
115 +/* { dg-do compile { target lp64 } } */
116 +/* { dg-options "-O2 -mincoming-stack-boundary=3" } */
117 +
118 +typedef struct {
119 + unsigned int buf[4];
120 + unsigned char in[64];
121 +} MD4_CTX;
122 +
123 +static void
124 +MD4Transform (unsigned int buf[4], const unsigned int in[16])
125 +{
126 + unsigned int a, b, c, d;
127 + (b) += ((((c)) & ((d))) | ((~(c)) & ((a)))) + (in[7]);
128 + (a) += ((((b)) & ((c))) | ((~(b)) & ((d)))) + (in[8]);
129 + (d) += ((((a)) & ((b))) | ((~(a)) & ((c)))) + (in[9]);
130 + buf[3] += d;
131 +}
132 +
133 +void __attribute__((ms_abi))
134 +MD4Update (MD4_CTX *ctx, const unsigned char *buf)
135 +{
136 + MD4Transform( ctx->buf, (unsigned int *)ctx->in);
137 + MD4Transform( ctx->buf, (unsigned int *)ctx->in);
138 +}
139 +
140 +int
141 +main(void)
142 +{
143 + MD4_CTX ctx_test =
144 + {
145 + { 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 },
146 + { 0, 0 }
147 + };
148 + unsigned char buf[64];
149 +
150 + MD4Update(&ctx_test, (const unsigned char *) &buf);
151 +}
152
153 diff --git a/app-emulation/wine-d3d9/files/wine-1.5.26-winegcc.patch b/app-emulation/wine-d3d9/files/wine-1.5.26-winegcc.patch
154 new file mode 100644
155 index 00000000000..2045e343401
156 --- /dev/null
157 +++ b/app-emulation/wine-d3d9/files/wine-1.5.26-winegcc.patch
158 @@ -0,0 +1,59 @@
159 +http://bugs.gentoo.org/260726
160 +
161 +diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
162 +index 16b4165..5c77267 100644
163 +--- a/tools/winebuild/main.c
164 ++++ b/tools/winebuild/main.c
165 +@@ -48,10 +48,13 @@ int link_ext_symbols = 0;
166 + int force_pointer_size = 0;
167 + int unwind_tables = 0;
168 +
169 ++#undef FORCE_POINTER_SIZE
170 + #ifdef __i386__
171 + enum target_cpu target_cpu = CPU_x86;
172 ++#define FORCE_POINTER_SIZE
173 + #elif defined(__x86_64__)
174 + enum target_cpu target_cpu = CPU_x86_64;
175 ++#define FORCE_POINTER_SIZE
176 + #elif defined(__powerpc__)
177 + enum target_cpu target_cpu = CPU_POWERPC;
178 + #elif defined(__arm__)
179 +@@ -611,6 +614,10 @@ int main(int argc, char **argv)
180 + signal( SIGTERM, exit_on_signal );
181 + signal( SIGINT, exit_on_signal );
182 +
183 ++#ifdef FORCE_POINTER_SIZE
184 ++ force_pointer_size = sizeof(size_t);
185 ++#endif
186 ++
187 + output_file = stdout;
188 + argv = parse_options( argc, argv, spec );
189 +
190 +diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
191 +index 06aa200..c44d2e3 100644
192 +--- a/tools/winegcc/winegcc.c
193 ++++ b/tools/winegcc/winegcc.c
194 +@@ -213,10 +213,13 @@ struct options
195 + strarray* files;
196 + };
197 +
198 ++#undef FORCE_POINTER_SIZE
199 + #ifdef __i386__
200 + static const enum target_cpu build_cpu = CPU_x86;
201 ++#define FORCE_POINTER_SIZE
202 + #elif defined(__x86_64__)
203 + static const enum target_cpu build_cpu = CPU_x86_64;
204 ++#define FORCE_POINTER_SIZE
205 + #elif defined(__powerpc__)
206 + static const enum target_cpu build_cpu = CPU_POWERPC;
207 + #elif defined(__arm__)
208 +@@ -1258,6 +1261,9 @@ int main(int argc, char **argv)
209 + opts.linker_args = strarray_alloc();
210 + opts.compiler_args = strarray_alloc();
211 + opts.winebuild_args = strarray_alloc();
212 ++#ifdef FORCE_POINTER_SIZE
213 ++ opts.force_pointer_size = sizeof(size_t);
214 ++#endif
215 +
216 + /* determine the processor type */
217 + if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp;
218
219 diff --git a/app-emulation/wine-d3d9/files/wine-1.6-memset-O3.patch b/app-emulation/wine-d3d9/files/wine-1.6-memset-O3.patch
220 new file mode 100644
221 index 00000000000..75372f86914
222 --- /dev/null
223 +++ b/app-emulation/wine-d3d9/files/wine-1.6-memset-O3.patch
224 @@ -0,0 +1,21 @@
225 +Avoid "undefined reference to `memset'" error when building with
226 +USE=custom-cflags and -O3 in CFLAGS with gcc-4.8.
227 +
228 +See:
229 +
230 +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
231 +http://bugs.winehq.org/show_bug.cgi?id=33521
232 +https://bugs.gentoo.org/show_bug.cgi?id=480508
233 +
234 +diff --git a/configure.ac b/configure.ac
235 +index d8033cf..fe7cc7d 100644
236 +--- a/configure.ac
237 ++++ b/configure.ac
238 +@@ -1767,6 +1767,7 @@ then
239 +
240 + dnl Check for some compiler flags
241 + WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
242 ++ WINE_TRY_CFLAGS([-fno-tree-loop-distribute-patterns])
243 + WINE_TRY_CFLAGS([-fno-strict-aliasing])
244 + dnl clang needs to be told to fail on unknown options
245 + saved_CFLAGS=$CFLAGS
246
247 diff --git a/app-emulation/wine-d3d9/files/wine-1.7.12-osmesa-check.patch b/app-emulation/wine-d3d9/files/wine-1.7.12-osmesa-check.patch
248 new file mode 100644
249 index 00000000000..7cafcd4e6dc
250 --- /dev/null
251 +++ b/app-emulation/wine-d3d9/files/wine-1.7.12-osmesa-check.patch
252 @@ -0,0 +1,38 @@
253 +From 6932b9a17c4f64c13f7060895d46334bc7022430 Mon Sep 17 00:00:00 2001
254 +From: Alexandre Rostovtsev <tetromino@g.o>
255 +Date: Tue, 7 Aug 2012 01:29:01 -0400
256 +Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa
257 +
258 +If mesa had been built with shared glapi, glAccum is not available in
259 +libOSMesa without explicitly linking to libGL. In addition, in
260 +mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to
261 +libglapi if mesa was built with shared glapi, see
262 +https://bugs.gentoo.org/show_bug.cgi?id=399813
263 +And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and
264 +libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832
265 +---
266 + configure.ac | 8 +++++++-
267 + 1 file changed, 7 insertions(+), 1 deletion(-)
268 +
269 +diff --git a/configure.ac b/configure.ac
270 +index de807d2..a2e8684 100644
271 +--- a/configure.ac
272 ++++ b/configure.ac
273 +@@ -1233,7 +1233,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
274 +
275 + if test "x$with_osmesa" != "xno"
276 + then
277 +- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS -lm $X_EXTRA_LIBS])
278 ++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS -lm $X_EXTRA_LIBS])
279 ++ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then
280 ++ osmesa_save_CC=$CC
281 ++ CC=$CXX
282 ++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS -lm $X_EXTRA_LIBS])
283 ++ CC=$osmesa_save_CC
284 ++ fi
285 + WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
286 + [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
287 + fi
288 +--
289 +1.8.5.3
290 +
291
292 diff --git a/app-emulation/wine-d3d9/files/wine-1.9.5-multilib-portage.patch b/app-emulation/wine-d3d9/files/wine-1.9.5-multilib-portage.patch
293 new file mode 100644
294 index 00000000000..c19d0d8a0b0
295 --- /dev/null
296 +++ b/app-emulation/wine-d3d9/files/wine-1.9.5-multilib-portage.patch
297 @@ -0,0 +1,31 @@
298 +https://bugs.gentoo.org/show_bug.cgi?id=395615
299 +
300 +Explicitly add the required -m32/m64 to *FLAGS; this overrides any
301 +arch-specific -m* flags that may have been appended by multilib-portage.
302 +
303 +Even though -m32/m64 is now added to *FLAGS, -m32/m64 still has to be
304 +explicitly added to CC and CXX due to wine's build system. For example,
305 +winegcc saves the build-time value of CC and uses it at runtime.
306 +
307 +--- a/configure.ac 2016-03-05 20:53:50.574628728 -0500
308 ++++ b/configure.ac 2016-03-05 20:57:54.945617833 -0500
309 +@@ -141,6 +141,9 @@
310 + then
311 + CC="$CC -m32"
312 + CXX="$CXX -m32"
313 ++ CFLAGS="$CFLAGS -m32"
314 ++ LDFLAGS="$LDFLAGS -m32"
315 ++ CXXFLAGS="$CXXFLAGS -m32"
316 + AC_MSG_CHECKING([whether $CC works])
317 + AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]),
318 + [AC_MSG_RESULT([no])
319 +@@ -160,6 +163,9 @@
320 + fi
321 + CC="$CC -m64"
322 + CXX="$CXX -m64"
323 ++ CFLAGS="$CFLAGS -m64"
324 ++ LDFLAGS="$LDFLAGS -m64"
325 ++ CXXFLAGS="$CXXFLAGS -m64"
326 + host_cpu="x86_64"
327 + notice_platform="64-bit "
328 + AC_SUBST(TARGETFLAGS,"-m64")
329
330 diff --git a/app-emulation/wine-d3d9/files/wine-2.0-multislot-apploader.patch b/app-emulation/wine-d3d9/files/wine-2.0-multislot-apploader.patch
331 new file mode 100644
332 index 00000000000..b336c4f51e8
333 --- /dev/null
334 +++ b/app-emulation/wine-d3d9/files/wine-2.0-multislot-apploader.patch
335 @@ -0,0 +1,14 @@
336 +diff --git a/tools/wineapploader.in b/tools/wineapploader.in
337 +index f48d552..14001a0 100755
338 +--- a/tools/wineapploader.in
339 ++++ b/tools/wineapploader.in
340 +@@ -20,7 +20,8 @@
341 + #
342 +
343 + # determine the app Winelib library name
344 +-appname=`basename "$0" .exe`.exe
345 ++appname=${0##*/}
346 ++appname="${appname%%-*}.exe"
347 +
348 + # first try explicit WINELOADER
349 + if [ -x "$WINELOADER" ]; then exec "$WINELOADER" "$appname" "$@"; fi
350
351 diff --git a/app-emulation/wine-d3d9/metadata.xml b/app-emulation/wine-d3d9/metadata.xml
352 new file mode 100644
353 index 00000000000..84d101a88d5
354 --- /dev/null
355 +++ b/app-emulation/wine-d3d9/metadata.xml
356 @@ -0,0 +1,43 @@
357 +<?xml version="1.0" encoding="UTF-8"?>
358 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
359 +<pkgmetadata>
360 + <maintainer type="project">
361 + <email>wine@g.o</email>
362 + <name>Wine</name>
363 + </maintainer>
364 + <maintainer type="person">
365 + <email>commendsarnex@×××××.com</email>
366 + <name>Nick Sarnie</name>
367 + </maintainer>
368 + <longdescription>
369 +Wine is an Open Source implementation of the Windows API on top of X and Unix.
370 +
371 +Think of Wine as a compatibility layer for running Windows programs. Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available. Wine provides both a development toolkit for porting Windows source code to Unix as well as a program loader, allowing many unmodified Windows programs to run on x86-based Unixes, including Linux, FreeBSD, and Solaris.
372 + </longdescription>
373 + <use>
374 + <flag name="capi">Enable ISDN support via CAPI</flag>
375 + <flag name="custom-cflags">Bypass strip-flags; use at your own peril</flag>
376 + <flag name="d3d9">Apply highly experimental patches for Gallium Nine support.
377 + This patch may break some applications.</flag>
378 + <flag name="dos">Pull in <pkg>games-emulation/dosbox</pkg> to run DOS applications</flag>
379 + <flag name="gecko">Add support for the Gecko engine when using iexplore</flag>
380 + <flag name="gstreamer">Use <pkg>media-libs/gstreamer</pkg> to provide DirectShow functionality;</flag>
381 + <flag name="mono">Add support for .NET using Wine's Mono add-on</flag>
382 + <flag name="netapi">Use libnetapi from <pkg>net-fs/samba</pkg> to support Windows networks in netapi32.dll</flag>
383 + <flag name="opencl">Enable OpenCL support</flag>
384 + <flag name="osmesa">Add support for OpenGL in bitmaps using libOSMesa</flag>
385 + <flag name="pcap">Support packet capture software (e.g. wireshark)</flag>
386 + <flag name="perl">Install helpers written in perl (winedump/winemaker)</flag>
387 + <flag name="prelink">Run prelink on DLLs during build;
388 + For versions before wine-1.7.55 or hardened, do not disable if you do not know what this means as it can break things at runtime</flag>
389 + <flag name="realtime">Pull in <pkg>sys-auth/rtkit</pkg> for low-latency pulseaudio support</flag>
390 + <flag name="run-exes">Use Wine to open and run .EXE and .MSI files</flag>
391 + <flag name="samba">Add support for NTLM auth. see
392 + http://wiki.winehq.org/NtlmAuthSetupGuide and
393 + http://wiki.winehq.org/NtlmSigningAndSealing</flag>
394 + <flag name="udev">Use <pkg>virtual/libudev</pkg> to provide plug and play support</flag>
395 + </use>
396 + <upstream>
397 + <remote-id type="sourceforge">wine</remote-id>
398 + </upstream>
399 +</pkgmetadata>
400
401 diff --git a/app-emulation/wine-d3d9/wine-d3d9-2.0.ebuild b/app-emulation/wine-d3d9/wine-d3d9-2.0.ebuild
402 new file mode 100644
403 index 00000000000..2d32ef35e24
404 --- /dev/null
405 +++ b/app-emulation/wine-d3d9/wine-d3d9-2.0.ebuild
406 @@ -0,0 +1,549 @@
407 +# Copyright 1999-2017 Gentoo Foundation
408 +# Distributed under the terms of the GNU General Public License v2
409 +
410 +EAPI=6
411 +
412 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
413 +PLOCALE_BACKUP="en"
414 +
415 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
416 +
417 +MY_PN="${PN%%-*}"
418 +MY_P="${MY_PN}-${PV}"
419 +
420 +if [[ ${PV} == "9999" ]] ; then
421 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
422 + EGIT_BRANCH="master"
423 + inherit git-r3
424 + SRC_URI=""
425 + #KEYWORDS=""
426 +else
427 + MAJOR_V=$(get_version_component_range 1)
428 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.bz2"
429 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
430 +fi
431 +S="${WORKDIR}/${MY_P}"
432 +
433 +D3D9_P="wine-d3d9-${PV}"
434 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
435 +WDC_V="20150204"
436 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
437 +
438 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
439 +HOMEPAGE="http://www.winehq.org/"
440 +SRC_URI="${SRC_URI}
441 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
442 +"
443 +
444 +if [[ ${PV} == "9999" ]] ; then
445 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
446 +else
447 + SRC_URI="${SRC_URI}
448 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
449 +fi
450 +
451 +LICENSE="LGPL-2.1"
452 +SLOT="${PV}"
453 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
454 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
455 + X? ( truetype )
456 + elibc_glibc? ( threads )
457 + osmesa? ( opengl )
458 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
459 +
460 +# FIXME: the test suite is unsuitable for us; many tests require net access
461 +# or fail due to Xvfb's opengl limitations.
462 +RESTRICT="test"
463 +
464 +COMMON_DEPEND="
465 + X? (
466 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
467 + x11-libs/libXext[${MULTILIB_USEDEP}]
468 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
469 + x11-libs/libXi[${MULTILIB_USEDEP}]
470 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
471 + )
472 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
473 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
474 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
475 + d3d9? (
476 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
477 + x11-libs/libX11[${MULTILIB_USEDEP}]
478 + x11-libs/libXext[${MULTILIB_USEDEP}]
479 + x11-libs/libxcb[${MULTILIB_USEDEP}]
480 + )
481 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
482 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
483 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
484 + gstreamer? (
485 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
486 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
487 + )
488 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
489 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
490 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
491 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
492 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
493 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
494 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
495 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
496 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
497 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
498 + opengl? (
499 + virtual/glu[${MULTILIB_USEDEP}]
500 + virtual/opengl[${MULTILIB_USEDEP}]
501 + )
502 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
503 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
504 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
505 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
506 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
507 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
508 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
509 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
510 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
511 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
512 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
513 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
514 + xml? (
515 + dev-libs/libxml2[${MULTILIB_USEDEP}]
516 + dev-libs/libxslt[${MULTILIB_USEDEP}]
517 + )
518 + abi_x86_32? (
519 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
520 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
521 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
522 + !<app-emulation/emul-linux-x86-db-20140508-r3
523 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
524 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
525 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
526 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
527 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
528 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
529 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
530 + !<app-emulation/emul-linux-x86-soundlibs-20140508
531 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
532 + !<app-emulation/emul-linux-x86-xlibs-20140508
533 + )"
534 +
535 +RDEPEND="${COMMON_DEPEND}
536 + app-emulation/wine-desktop-common
537 + >app-eselect/eselect-wine-0.3
538 + !app-emulation/wine:0
539 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
540 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
541 + mono? ( app-emulation/wine-mono:4.6.4 )
542 + perl? (
543 + dev-lang/perl
544 + dev-perl/XML-Simple
545 + )
546 + pulseaudio? (
547 + realtime? ( sys-auth/rtkit )
548 + )
549 + samba? ( >=net-fs/samba-3.0.25[winbind] )
550 + selinux? ( sec-policy/selinux-wine )
551 + udisks? ( sys-fs/udisks:2 )"
552 +
553 +# tools/make_requests requires perl
554 +DEPEND="${COMMON_DEPEND}
555 + sys-devel/flex
556 + >=sys-kernel/linux-headers-2.6
557 + virtual/pkgconfig
558 + virtual/yacc
559 + X? (
560 + x11-proto/inputproto
561 + x11-proto/xextproto
562 + x11-proto/xf86vidmodeproto
563 + )
564 + prelink? ( sys-devel/prelink )
565 + xinerama? ( x11-proto/xineramaproto )"
566 +
567 +# These use a non-standard "Wine" category, which is provided by
568 +# /etc/xdg/applications-merged/wine.menu
569 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
570 +usr/share/applications/wine-notepad.desktop
571 +usr/share/applications/wine-uninstaller.desktop
572 +usr/share/applications/wine-winecfg.desktop"
573 +
574 +wine_compiler_check() {
575 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
576 +
577 + # GCC-specific bugs
578 + if tc-is-gcc; then
579 + # bug #549768
580 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
581 + ebegin "Checking for gcc-5 ms_abi compiler bug"
582 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
583 + # Run in subshell to prevent "Aborted" message
584 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
585 + if ! eend $?; then
586 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
587 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
588 + eerror "or use gcc-config to select a different compiler version."
589 + eerror "See https://bugs.gentoo.org/549768"
590 + eerror
591 + return 1
592 + fi
593 + fi
594 + # bug #574044
595 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
596 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
597 + # Compile in subshell to prevent "Aborted" message
598 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
599 + if ! eend $?; then
600 + eerror "Wine cannot be built with this version of gcc-5.3"
601 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
602 + eerror "or use gcc-config to select a different compiler version."
603 + eerror "See https://bugs.gentoo.org/574044"
604 + eerror
605 + return 1
606 + fi
607 + fi
608 + fi
609 +
610 + # Ensure compiler support
611 + if use abi_x86_64; then
612 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
613 + # Compile in subshell to prevent "Aborted" message
614 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
615 + if ! eend $?; then
616 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
617 + eerror
618 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
619 + eerror
620 + return 1
621 + fi
622 + fi
623 +}
624 +
625 +wine_build_environment_check() {
626 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
627 +
628 + if use abi_x86_64; then
629 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
630 + eerror "You need gcc-4.4+ to compile 64-bit wine"
631 + die
632 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
633 + eerror "You need clang-3.8+ to compile 64-bit wine"
634 + die
635 + fi
636 + fi
637 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
638 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
639 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
640 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
641 + fi
642 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
643 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
644 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
645 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
646 + ewarn "See package.env in man 5 portage for more information on how to do this."
647 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
648 + fi
649 + fi
650 +
651 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
652 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
653 + eerror "See https://bugs.gentoo.org/487864 for more details."
654 + eerror
655 + return 1
656 + fi
657 +}
658 +
659 +wine_env_vcs_vars() {
660 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
661 + local pn_live_val="${pn_live_var}"
662 + eval pn_live_val='$'${pn_live_val}
663 + if [[ ! -z ${pn_live_val} ]]; then
664 + if use d3d9; then
665 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
666 + eerror "cannot be used to set the commit. Instead, you may use the"
667 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
668 + eerror
669 + return 1
670 + fi
671 + fi
672 + if [[ ! -z ${EGIT_COMMIT} ]]; then
673 + eerror "Commits must now be specified using the environmental variables"
674 + eerror "WINE_COMMIT, and D3D9_COMMIT"
675 + eerror
676 + return 1
677 + fi
678 +}
679 +
680 +pkg_pretend() {
681 + wine_build_environment_check || die
682 +
683 + # Verify OSS support
684 + if use oss && ! use kernel_FreeBSD; then
685 + if ! has_version ">=media-sound/oss-4"; then
686 + eerror "You cannot build wine with USE=oss without having support from a"
687 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
688 + eerror
689 + die
690 + fi
691 + fi
692 +}
693 +
694 +pkg_setup() {
695 + wine_build_environment_check || die
696 + wine_env_vcs_vars || die
697 +
698 + WINE_VARIANT="${PN#wine}-${PV}"
699 + WINE_VARIANT="${WINE_VARIANT#-}"
700 +
701 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
702 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
703 + MY_DATADIR="${MY_DATAROOTDIR}"
704 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
705 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
706 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
707 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
708 + MY_MANDIR="${MY_DATADIR}/man"
709 +}
710 +
711 +src_unpack() {
712 + if [[ ${PV} == "9999" ]] ; then
713 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
714 + if use d3d9; then
715 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
716 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
717 + fi
718 + fi
719 +
720 + default
721 +
722 + l10n_find_plocales_changes "${S}/po" "" ".po"
723 +}
724 +
725 +src_prepare() {
726 + local md5="$(md5sum server/protocol.def)"
727 + local PATCHES=(
728 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
729 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
730 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
731 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
732 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
733 + )
734 + if use d3d9; then
735 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
736 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
737 + fi
738 +
739 + default
740 + eautoreconf
741 +
742 + # Modification of the server protocol requires regenerating the server requests
743 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
744 + einfo "server/protocol.def was patched; running tools/make_requests"
745 + tools/make_requests || die #432348
746 + fi
747 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
748 + if ! use run-exes; then
749 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
750 + fi
751 +
752 + # Edit wine.desktop to work for specific variant
753 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
754 +
755 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
756 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
757 +
758 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
759 +}
760 +
761 +src_configure() {
762 + wine_compiler_check || die
763 +
764 + export LDCONFIG=/bin/true
765 + use custom-cflags || strip-flags
766 +
767 + multilib-minimal_src_configure
768 +}
769 +
770 +multilib_src_configure() {
771 + local myconf=(
772 + --prefix="${MY_PREFIX}"
773 + --datarootdir="${MY_DATAROOTDIR}"
774 + --datadir="${MY_DATADIR}"
775 + --docdir="${MY_DOCDIR}"
776 + --includedir="${MY_INCLUDEDIR}"
777 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
778 + --libexecdir="${MY_LIBEXECDIR}"
779 + --localstatedir="${MY_LOCALSTATEDIR}"
780 + --mandir="${MY_MANDIR}"
781 + --sysconfdir=/etc/wine
782 + $(use_with alsa)
783 + $(use_with capi)
784 + $(use_with lcms cms)
785 + $(use_with cups)
786 + $(use_with ncurses curses)
787 + $(use_with udisks dbus)
788 + $(use_with fontconfig)
789 + $(use_with ssl gnutls)
790 + $(use_enable gecko mshtml)
791 + $(use_with gphoto2 gphoto)
792 + $(use_with gsm)
793 + $(use_with gstreamer)
794 + --without-hal
795 + $(use_with jpeg)
796 + $(use_with ldap)
797 + $(use_enable mono mscoree)
798 + $(use_with mp3 mpg123)
799 + $(use_with netapi)
800 + $(use_with nls gettext)
801 + $(use_with openal)
802 + $(use_with opencl)
803 + $(use_with opengl)
804 + $(use_with osmesa)
805 + $(use_with oss)
806 + $(use_with pcap)
807 + $(use_with png)
808 + $(use_with pulseaudio pulse)
809 + $(use_with threads pthread)
810 + $(use_with scanner sane)
811 + $(use_enable test tests)
812 + $(use_with truetype freetype)
813 + $(use_with udev)
814 + $(use_with v4l)
815 + $(use_with X x)
816 + $(use_with xcomposite)
817 + $(use_with xinerama)
818 + $(use_with xml)
819 + $(use_with xml xslt)
820 + )
821 +
822 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
823 +
824 + local PKG_CONFIG AR RANLIB
825 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
826 + # set AR and RANLIB to make QA scripts happy; #483342
827 + tc-export PKG_CONFIG AR RANLIB
828 +
829 + if use amd64; then
830 + if [[ ${ABI} == amd64 ]]; then
831 + myconf+=( --enable-win64 )
832 + else
833 + myconf+=( --disable-win64 )
834 + fi
835 +
836 + # Note: using --with-wine64 results in problems with multilib.eclass
837 + # CC/LD hackery. We're using separate tools instead.
838 + fi
839 +
840 + ECONF_SOURCE=${S} \
841 + econf "${myconf[@]}"
842 + emake depend
843 +}
844 +
845 +multilib_src_test() {
846 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
847 + if [[ ${ABI} == x86 ]]; then
848 + if [[ $(id -u) == 0 ]]; then
849 + ewarn "Skipping tests since they cannot be run under the root user."
850 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
851 + return
852 + fi
853 +
854 + WINEPREFIX="${T}/.wine-${ABI}" \
855 + Xemake test
856 + fi
857 +}
858 +
859 +multilib_src_install_all() {
860 + local DOCS=( ANNOUNCE AUTHORS README )
861 + local l
862 + add_locale_docs() {
863 + local locale_doc="documentation/README.$1"
864 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
865 + }
866 + l10n_for_each_locale_do add_locale_docs
867 +
868 + einstalldocs
869 + prune_libtool_files --all
870 +
871 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
872 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
873 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
874 + fi
875 +
876 + # Remove wineconsole if neither backend is installed #551124
877 + if ! use X && ! use ncurses; then
878 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
879 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
880 + rm_wineconsole() {
881 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
882 + }
883 + multilib_foreach_abi rm_wineconsole
884 + fi
885 +
886 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
887 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
888 +
889 + if use abi_x86_64 && ! use abi_x86_32; then
890 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
891 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
892 + fi
893 +
894 + # Make wrappers for binaries for handling multiple variants
895 + # Note: wrappers instead of symlinks because some are shell which use basename
896 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
897 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
898 + done
899 +
900 + # respect LINGUAS when installing man pages, #469418
901 + for l in de fr pl; do
902 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
903 + done
904 +
905 + for m in "${D%/}${MY_MANDIR}"/*/*; do
906 + new_man=${m##*/}
907 + new_man=${new_man%%.1}
908 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
909 + done
910 +}
911 +
912 +pkg_postinst() {
913 + eselect wine register ${P}
914 + if [[ ${PN} == "wine-vanilla" ]]; then
915 + eselect wine register --vanilla ${P} || die
916 + else
917 + if use d3d9; then
918 + eselect wine register --d3d9 ${P} || die
919 + fi
920 + fi
921 +
922 + eselect wine update --all --if-unset || die
923 +
924 + fdo-mime_desktop_database_update
925 +
926 + if ! use gecko; then
927 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
928 + ewarn "implementation of iexplore. Many older windows applications"
929 + ewarn "rely upon the existence of an iexplore implementation, so"
930 + ewarn "you will likely need to install an external one, like via winetricks"
931 + fi
932 + if ! use mono; then
933 + ewarn "Without Wine Mono, wine prefixes will not have a default"
934 + ewarn "implementation of .NET. Many windows applications rely upon"
935 + ewarn "the existence of a .NET implementation, so you will likely need"
936 + ewarn "to install an external one, like via winetricks"
937 + fi
938 +}
939 +
940 +pkg_prerm() {
941 + eselect wine deregister ${P}
942 + if [[ ${PN} == "wine-vanilla" ]]; then
943 + eselect wine deregister --vanilla ${P} || die
944 + else
945 + if use d3d9; then
946 + eselect wine deregister --d3d9 ${P} || die
947 + fi
948 + fi
949 +
950 + eselect wine update --all --if-unset || die
951 +}
952 +
953 +pkg_postrm() {
954 + fdo-mime_desktop_database_update
955 +}
956
957 diff --git a/app-emulation/wine-d3d9/wine-d3d9-2.1.ebuild b/app-emulation/wine-d3d9/wine-d3d9-2.1.ebuild
958 new file mode 100644
959 index 00000000000..2b6973341d3
960 --- /dev/null
961 +++ b/app-emulation/wine-d3d9/wine-d3d9-2.1.ebuild
962 @@ -0,0 +1,549 @@
963 +# Copyright 1999-2017 Gentoo Foundation
964 +# Distributed under the terms of the GNU General Public License v2
965 +
966 +EAPI=6
967 +
968 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
969 +PLOCALE_BACKUP="en"
970 +
971 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
972 +
973 +MY_PN="${PN%%-*}"
974 +MY_P="${MY_PN}-${PV}"
975 +
976 +if [[ ${PV} == "9999" ]] ; then
977 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
978 + EGIT_BRANCH="master"
979 + inherit git-r3
980 + SRC_URI=""
981 + #KEYWORDS=""
982 +else
983 + MAJOR_V=$(get_version_component_range 1)
984 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
985 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
986 +fi
987 +S="${WORKDIR}/${MY_P}"
988 +
989 +D3D9_P="wine-d3d9-${PV}"
990 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
991 +WDC_V="20150204"
992 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
993 +
994 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
995 +HOMEPAGE="http://www.winehq.org/"
996 +SRC_URI="${SRC_URI}
997 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
998 +"
999 +
1000 +if [[ ${PV} == "9999" ]] ; then
1001 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
1002 +else
1003 + SRC_URI="${SRC_URI}
1004 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
1005 +fi
1006 +
1007 +LICENSE="LGPL-2.1"
1008 +SLOT="${PV}"
1009 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
1010 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
1011 + X? ( truetype )
1012 + elibc_glibc? ( threads )
1013 + osmesa? ( opengl )
1014 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
1015 +
1016 +# FIXME: the test suite is unsuitable for us; many tests require net access
1017 +# or fail due to Xvfb's opengl limitations.
1018 +RESTRICT="test"
1019 +
1020 +COMMON_DEPEND="
1021 + X? (
1022 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
1023 + x11-libs/libXext[${MULTILIB_USEDEP}]
1024 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
1025 + x11-libs/libXi[${MULTILIB_USEDEP}]
1026 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
1027 + )
1028 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
1029 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
1030 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
1031 + d3d9? (
1032 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
1033 + x11-libs/libX11[${MULTILIB_USEDEP}]
1034 + x11-libs/libXext[${MULTILIB_USEDEP}]
1035 + x11-libs/libxcb[${MULTILIB_USEDEP}]
1036 + )
1037 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
1038 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
1039 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
1040 + gstreamer? (
1041 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
1042 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
1043 + )
1044 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
1045 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
1046 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
1047 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
1048 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
1049 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
1050 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
1051 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
1052 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
1053 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
1054 + opengl? (
1055 + virtual/glu[${MULTILIB_USEDEP}]
1056 + virtual/opengl[${MULTILIB_USEDEP}]
1057 + )
1058 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
1059 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
1060 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
1061 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
1062 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
1063 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
1064 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
1065 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
1066 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
1067 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
1068 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
1069 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
1070 + xml? (
1071 + dev-libs/libxml2[${MULTILIB_USEDEP}]
1072 + dev-libs/libxslt[${MULTILIB_USEDEP}]
1073 + )
1074 + abi_x86_32? (
1075 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
1076 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
1077 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
1078 + !<app-emulation/emul-linux-x86-db-20140508-r3
1079 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
1080 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
1081 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
1082 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
1083 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
1084 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
1085 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
1086 + !<app-emulation/emul-linux-x86-soundlibs-20140508
1087 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
1088 + !<app-emulation/emul-linux-x86-xlibs-20140508
1089 + )"
1090 +
1091 +RDEPEND="${COMMON_DEPEND}
1092 + app-emulation/wine-desktop-common
1093 + >app-eselect/eselect-wine-0.3
1094 + !app-emulation/wine:0
1095 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
1096 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
1097 + mono? ( app-emulation/wine-mono:4.6.4 )
1098 + perl? (
1099 + dev-lang/perl
1100 + dev-perl/XML-Simple
1101 + )
1102 + pulseaudio? (
1103 + realtime? ( sys-auth/rtkit )
1104 + )
1105 + samba? ( >=net-fs/samba-3.0.25[winbind] )
1106 + selinux? ( sec-policy/selinux-wine )
1107 + udisks? ( sys-fs/udisks:2 )"
1108 +
1109 +# tools/make_requests requires perl
1110 +DEPEND="${COMMON_DEPEND}
1111 + sys-devel/flex
1112 + >=sys-kernel/linux-headers-2.6
1113 + virtual/pkgconfig
1114 + virtual/yacc
1115 + X? (
1116 + x11-proto/inputproto
1117 + x11-proto/xextproto
1118 + x11-proto/xf86vidmodeproto
1119 + )
1120 + prelink? ( sys-devel/prelink )
1121 + xinerama? ( x11-proto/xineramaproto )"
1122 +
1123 +# These use a non-standard "Wine" category, which is provided by
1124 +# /etc/xdg/applications-merged/wine.menu
1125 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
1126 +usr/share/applications/wine-notepad.desktop
1127 +usr/share/applications/wine-uninstaller.desktop
1128 +usr/share/applications/wine-winecfg.desktop"
1129 +
1130 +wine_compiler_check() {
1131 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
1132 +
1133 + # GCC-specific bugs
1134 + if tc-is-gcc; then
1135 + # bug #549768
1136 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
1137 + ebegin "Checking for gcc-5 ms_abi compiler bug"
1138 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
1139 + # Run in subshell to prevent "Aborted" message
1140 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
1141 + if ! eend $?; then
1142 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
1143 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
1144 + eerror "or use gcc-config to select a different compiler version."
1145 + eerror "See https://bugs.gentoo.org/549768"
1146 + eerror
1147 + return 1
1148 + fi
1149 + fi
1150 + # bug #574044
1151 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
1152 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
1153 + # Compile in subshell to prevent "Aborted" message
1154 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
1155 + if ! eend $?; then
1156 + eerror "Wine cannot be built with this version of gcc-5.3"
1157 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
1158 + eerror "or use gcc-config to select a different compiler version."
1159 + eerror "See https://bugs.gentoo.org/574044"
1160 + eerror
1161 + return 1
1162 + fi
1163 + fi
1164 + fi
1165 +
1166 + # Ensure compiler support
1167 + if use abi_x86_64; then
1168 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
1169 + # Compile in subshell to prevent "Aborted" message
1170 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
1171 + if ! eend $?; then
1172 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
1173 + eerror
1174 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
1175 + eerror
1176 + return 1
1177 + fi
1178 + fi
1179 +}
1180 +
1181 +wine_build_environment_check() {
1182 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
1183 +
1184 + if use abi_x86_64; then
1185 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
1186 + eerror "You need gcc-4.4+ to compile 64-bit wine"
1187 + die
1188 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
1189 + eerror "You need clang-3.8+ to compile 64-bit wine"
1190 + die
1191 + fi
1192 + fi
1193 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
1194 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
1195 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
1196 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
1197 + fi
1198 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
1199 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
1200 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
1201 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
1202 + ewarn "See package.env in man 5 portage for more information on how to do this."
1203 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
1204 + fi
1205 + fi
1206 +
1207 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
1208 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
1209 + eerror "See https://bugs.gentoo.org/487864 for more details."
1210 + eerror
1211 + return 1
1212 + fi
1213 +}
1214 +
1215 +wine_env_vcs_vars() {
1216 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
1217 + local pn_live_val="${pn_live_var}"
1218 + eval pn_live_val='$'${pn_live_val}
1219 + if [[ ! -z ${pn_live_val} ]]; then
1220 + if use d3d9; then
1221 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
1222 + eerror "cannot be used to set the commit. Instead, you may use the"
1223 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
1224 + eerror
1225 + return 1
1226 + fi
1227 + fi
1228 + if [[ ! -z ${EGIT_COMMIT} ]]; then
1229 + eerror "Commits must now be specified using the environmental variables"
1230 + eerror "WINE_COMMIT, and D3D9_COMMIT"
1231 + eerror
1232 + return 1
1233 + fi
1234 +}
1235 +
1236 +pkg_pretend() {
1237 + wine_build_environment_check || die
1238 +
1239 + # Verify OSS support
1240 + if use oss && ! use kernel_FreeBSD; then
1241 + if ! has_version ">=media-sound/oss-4"; then
1242 + eerror "You cannot build wine with USE=oss without having support from a"
1243 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
1244 + eerror
1245 + die
1246 + fi
1247 + fi
1248 +}
1249 +
1250 +pkg_setup() {
1251 + wine_build_environment_check || die
1252 + wine_env_vcs_vars || die
1253 +
1254 + WINE_VARIANT="${PN#wine}-${PV}"
1255 + WINE_VARIANT="${WINE_VARIANT#-}"
1256 +
1257 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
1258 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
1259 + MY_DATADIR="${MY_DATAROOTDIR}"
1260 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
1261 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
1262 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
1263 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
1264 + MY_MANDIR="${MY_DATADIR}/man"
1265 +}
1266 +
1267 +src_unpack() {
1268 + if [[ ${PV} == "9999" ]] ; then
1269 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
1270 + if use d3d9; then
1271 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
1272 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
1273 + fi
1274 + fi
1275 +
1276 + default
1277 +
1278 + l10n_find_plocales_changes "${S}/po" "" ".po"
1279 +}
1280 +
1281 +src_prepare() {
1282 + local md5="$(md5sum server/protocol.def)"
1283 + local PATCHES=(
1284 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
1285 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
1286 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
1287 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
1288 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
1289 + )
1290 + if use d3d9; then
1291 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
1292 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
1293 + fi
1294 +
1295 + default
1296 + eautoreconf
1297 +
1298 + # Modification of the server protocol requires regenerating the server requests
1299 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
1300 + einfo "server/protocol.def was patched; running tools/make_requests"
1301 + tools/make_requests || die #432348
1302 + fi
1303 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
1304 + if ! use run-exes; then
1305 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
1306 + fi
1307 +
1308 + # Edit wine.desktop to work for specific variant
1309 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
1310 +
1311 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
1312 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
1313 +
1314 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
1315 +}
1316 +
1317 +src_configure() {
1318 + wine_compiler_check || die
1319 +
1320 + export LDCONFIG=/bin/true
1321 + use custom-cflags || strip-flags
1322 +
1323 + multilib-minimal_src_configure
1324 +}
1325 +
1326 +multilib_src_configure() {
1327 + local myconf=(
1328 + --prefix="${MY_PREFIX}"
1329 + --datarootdir="${MY_DATAROOTDIR}"
1330 + --datadir="${MY_DATADIR}"
1331 + --docdir="${MY_DOCDIR}"
1332 + --includedir="${MY_INCLUDEDIR}"
1333 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
1334 + --libexecdir="${MY_LIBEXECDIR}"
1335 + --localstatedir="${MY_LOCALSTATEDIR}"
1336 + --mandir="${MY_MANDIR}"
1337 + --sysconfdir=/etc/wine
1338 + $(use_with alsa)
1339 + $(use_with capi)
1340 + $(use_with lcms cms)
1341 + $(use_with cups)
1342 + $(use_with ncurses curses)
1343 + $(use_with udisks dbus)
1344 + $(use_with fontconfig)
1345 + $(use_with ssl gnutls)
1346 + $(use_enable gecko mshtml)
1347 + $(use_with gphoto2 gphoto)
1348 + $(use_with gsm)
1349 + $(use_with gstreamer)
1350 + --without-hal
1351 + $(use_with jpeg)
1352 + $(use_with ldap)
1353 + $(use_enable mono mscoree)
1354 + $(use_with mp3 mpg123)
1355 + $(use_with netapi)
1356 + $(use_with nls gettext)
1357 + $(use_with openal)
1358 + $(use_with opencl)
1359 + $(use_with opengl)
1360 + $(use_with osmesa)
1361 + $(use_with oss)
1362 + $(use_with pcap)
1363 + $(use_with png)
1364 + $(use_with pulseaudio pulse)
1365 + $(use_with threads pthread)
1366 + $(use_with scanner sane)
1367 + $(use_enable test tests)
1368 + $(use_with truetype freetype)
1369 + $(use_with udev)
1370 + $(use_with v4l)
1371 + $(use_with X x)
1372 + $(use_with xcomposite)
1373 + $(use_with xinerama)
1374 + $(use_with xml)
1375 + $(use_with xml xslt)
1376 + )
1377 +
1378 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
1379 +
1380 + local PKG_CONFIG AR RANLIB
1381 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
1382 + # set AR and RANLIB to make QA scripts happy; #483342
1383 + tc-export PKG_CONFIG AR RANLIB
1384 +
1385 + if use amd64; then
1386 + if [[ ${ABI} == amd64 ]]; then
1387 + myconf+=( --enable-win64 )
1388 + else
1389 + myconf+=( --disable-win64 )
1390 + fi
1391 +
1392 + # Note: using --with-wine64 results in problems with multilib.eclass
1393 + # CC/LD hackery. We're using separate tools instead.
1394 + fi
1395 +
1396 + ECONF_SOURCE=${S} \
1397 + econf "${myconf[@]}"
1398 + emake depend
1399 +}
1400 +
1401 +multilib_src_test() {
1402 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
1403 + if [[ ${ABI} == x86 ]]; then
1404 + if [[ $(id -u) == 0 ]]; then
1405 + ewarn "Skipping tests since they cannot be run under the root user."
1406 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
1407 + return
1408 + fi
1409 +
1410 + WINEPREFIX="${T}/.wine-${ABI}" \
1411 + Xemake test
1412 + fi
1413 +}
1414 +
1415 +multilib_src_install_all() {
1416 + local DOCS=( ANNOUNCE AUTHORS README )
1417 + local l
1418 + add_locale_docs() {
1419 + local locale_doc="documentation/README.$1"
1420 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
1421 + }
1422 + l10n_for_each_locale_do add_locale_docs
1423 +
1424 + einstalldocs
1425 + prune_libtool_files --all
1426 +
1427 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
1428 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
1429 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
1430 + fi
1431 +
1432 + # Remove wineconsole if neither backend is installed #551124
1433 + if ! use X && ! use ncurses; then
1434 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
1435 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
1436 + rm_wineconsole() {
1437 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
1438 + }
1439 + multilib_foreach_abi rm_wineconsole
1440 + fi
1441 +
1442 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
1443 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
1444 +
1445 + if use abi_x86_64 && ! use abi_x86_32; then
1446 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
1447 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
1448 + fi
1449 +
1450 + # Make wrappers for binaries for handling multiple variants
1451 + # Note: wrappers instead of symlinks because some are shell which use basename
1452 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
1453 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
1454 + done
1455 +
1456 + # respect LINGUAS when installing man pages, #469418
1457 + for l in de fr pl; do
1458 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
1459 + done
1460 +
1461 + for m in "${D%/}${MY_MANDIR}"/*/*; do
1462 + new_man=${m##*/}
1463 + new_man=${new_man%%.1}
1464 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
1465 + done
1466 +}
1467 +
1468 +pkg_postinst() {
1469 + eselect wine register ${P}
1470 + if [[ ${PN} == "wine-vanilla" ]]; then
1471 + eselect wine register --vanilla ${P} || die
1472 + else
1473 + if use d3d9; then
1474 + eselect wine register --d3d9 ${P} || die
1475 + fi
1476 + fi
1477 +
1478 + eselect wine update --all --if-unset || die
1479 +
1480 + fdo-mime_desktop_database_update
1481 +
1482 + if ! use gecko; then
1483 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
1484 + ewarn "implementation of iexplore. Many older windows applications"
1485 + ewarn "rely upon the existence of an iexplore implementation, so"
1486 + ewarn "you will likely need to install an external one, like via winetricks"
1487 + fi
1488 + if ! use mono; then
1489 + ewarn "Without Wine Mono, wine prefixes will not have a default"
1490 + ewarn "implementation of .NET. Many windows applications rely upon"
1491 + ewarn "the existence of a .NET implementation, so you will likely need"
1492 + ewarn "to install an external one, like via winetricks"
1493 + fi
1494 +}
1495 +
1496 +pkg_prerm() {
1497 + eselect wine deregister ${P}
1498 + if [[ ${PN} == "wine-vanilla" ]]; then
1499 + eselect wine deregister --vanilla ${P} || die
1500 + else
1501 + if use d3d9; then
1502 + eselect wine deregister --d3d9 ${P} || die
1503 + fi
1504 + fi
1505 +
1506 + eselect wine update --all --if-unset || die
1507 +}
1508 +
1509 +pkg_postrm() {
1510 + fdo-mime_desktop_database_update
1511 +}
1512
1513 diff --git a/app-emulation/wine-d3d9/wine-d3d9-2.2.ebuild b/app-emulation/wine-d3d9/wine-d3d9-2.2.ebuild
1514 new file mode 100644
1515 index 00000000000..2b6973341d3
1516 --- /dev/null
1517 +++ b/app-emulation/wine-d3d9/wine-d3d9-2.2.ebuild
1518 @@ -0,0 +1,549 @@
1519 +# Copyright 1999-2017 Gentoo Foundation
1520 +# Distributed under the terms of the GNU General Public License v2
1521 +
1522 +EAPI=6
1523 +
1524 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
1525 +PLOCALE_BACKUP="en"
1526 +
1527 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
1528 +
1529 +MY_PN="${PN%%-*}"
1530 +MY_P="${MY_PN}-${PV}"
1531 +
1532 +if [[ ${PV} == "9999" ]] ; then
1533 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
1534 + EGIT_BRANCH="master"
1535 + inherit git-r3
1536 + SRC_URI=""
1537 + #KEYWORDS=""
1538 +else
1539 + MAJOR_V=$(get_version_component_range 1)
1540 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
1541 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
1542 +fi
1543 +S="${WORKDIR}/${MY_P}"
1544 +
1545 +D3D9_P="wine-d3d9-${PV}"
1546 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
1547 +WDC_V="20150204"
1548 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
1549 +
1550 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
1551 +HOMEPAGE="http://www.winehq.org/"
1552 +SRC_URI="${SRC_URI}
1553 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
1554 +"
1555 +
1556 +if [[ ${PV} == "9999" ]] ; then
1557 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
1558 +else
1559 + SRC_URI="${SRC_URI}
1560 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
1561 +fi
1562 +
1563 +LICENSE="LGPL-2.1"
1564 +SLOT="${PV}"
1565 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
1566 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
1567 + X? ( truetype )
1568 + elibc_glibc? ( threads )
1569 + osmesa? ( opengl )
1570 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
1571 +
1572 +# FIXME: the test suite is unsuitable for us; many tests require net access
1573 +# or fail due to Xvfb's opengl limitations.
1574 +RESTRICT="test"
1575 +
1576 +COMMON_DEPEND="
1577 + X? (
1578 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
1579 + x11-libs/libXext[${MULTILIB_USEDEP}]
1580 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
1581 + x11-libs/libXi[${MULTILIB_USEDEP}]
1582 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
1583 + )
1584 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
1585 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
1586 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
1587 + d3d9? (
1588 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
1589 + x11-libs/libX11[${MULTILIB_USEDEP}]
1590 + x11-libs/libXext[${MULTILIB_USEDEP}]
1591 + x11-libs/libxcb[${MULTILIB_USEDEP}]
1592 + )
1593 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
1594 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
1595 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
1596 + gstreamer? (
1597 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
1598 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
1599 + )
1600 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
1601 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
1602 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
1603 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
1604 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
1605 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
1606 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
1607 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
1608 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
1609 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
1610 + opengl? (
1611 + virtual/glu[${MULTILIB_USEDEP}]
1612 + virtual/opengl[${MULTILIB_USEDEP}]
1613 + )
1614 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
1615 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
1616 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
1617 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
1618 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
1619 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
1620 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
1621 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
1622 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
1623 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
1624 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
1625 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
1626 + xml? (
1627 + dev-libs/libxml2[${MULTILIB_USEDEP}]
1628 + dev-libs/libxslt[${MULTILIB_USEDEP}]
1629 + )
1630 + abi_x86_32? (
1631 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
1632 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
1633 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
1634 + !<app-emulation/emul-linux-x86-db-20140508-r3
1635 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
1636 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
1637 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
1638 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
1639 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
1640 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
1641 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
1642 + !<app-emulation/emul-linux-x86-soundlibs-20140508
1643 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
1644 + !<app-emulation/emul-linux-x86-xlibs-20140508
1645 + )"
1646 +
1647 +RDEPEND="${COMMON_DEPEND}
1648 + app-emulation/wine-desktop-common
1649 + >app-eselect/eselect-wine-0.3
1650 + !app-emulation/wine:0
1651 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
1652 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
1653 + mono? ( app-emulation/wine-mono:4.6.4 )
1654 + perl? (
1655 + dev-lang/perl
1656 + dev-perl/XML-Simple
1657 + )
1658 + pulseaudio? (
1659 + realtime? ( sys-auth/rtkit )
1660 + )
1661 + samba? ( >=net-fs/samba-3.0.25[winbind] )
1662 + selinux? ( sec-policy/selinux-wine )
1663 + udisks? ( sys-fs/udisks:2 )"
1664 +
1665 +# tools/make_requests requires perl
1666 +DEPEND="${COMMON_DEPEND}
1667 + sys-devel/flex
1668 + >=sys-kernel/linux-headers-2.6
1669 + virtual/pkgconfig
1670 + virtual/yacc
1671 + X? (
1672 + x11-proto/inputproto
1673 + x11-proto/xextproto
1674 + x11-proto/xf86vidmodeproto
1675 + )
1676 + prelink? ( sys-devel/prelink )
1677 + xinerama? ( x11-proto/xineramaproto )"
1678 +
1679 +# These use a non-standard "Wine" category, which is provided by
1680 +# /etc/xdg/applications-merged/wine.menu
1681 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
1682 +usr/share/applications/wine-notepad.desktop
1683 +usr/share/applications/wine-uninstaller.desktop
1684 +usr/share/applications/wine-winecfg.desktop"
1685 +
1686 +wine_compiler_check() {
1687 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
1688 +
1689 + # GCC-specific bugs
1690 + if tc-is-gcc; then
1691 + # bug #549768
1692 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
1693 + ebegin "Checking for gcc-5 ms_abi compiler bug"
1694 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
1695 + # Run in subshell to prevent "Aborted" message
1696 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
1697 + if ! eend $?; then
1698 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
1699 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
1700 + eerror "or use gcc-config to select a different compiler version."
1701 + eerror "See https://bugs.gentoo.org/549768"
1702 + eerror
1703 + return 1
1704 + fi
1705 + fi
1706 + # bug #574044
1707 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
1708 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
1709 + # Compile in subshell to prevent "Aborted" message
1710 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
1711 + if ! eend $?; then
1712 + eerror "Wine cannot be built with this version of gcc-5.3"
1713 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
1714 + eerror "or use gcc-config to select a different compiler version."
1715 + eerror "See https://bugs.gentoo.org/574044"
1716 + eerror
1717 + return 1
1718 + fi
1719 + fi
1720 + fi
1721 +
1722 + # Ensure compiler support
1723 + if use abi_x86_64; then
1724 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
1725 + # Compile in subshell to prevent "Aborted" message
1726 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
1727 + if ! eend $?; then
1728 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
1729 + eerror
1730 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
1731 + eerror
1732 + return 1
1733 + fi
1734 + fi
1735 +}
1736 +
1737 +wine_build_environment_check() {
1738 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
1739 +
1740 + if use abi_x86_64; then
1741 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
1742 + eerror "You need gcc-4.4+ to compile 64-bit wine"
1743 + die
1744 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
1745 + eerror "You need clang-3.8+ to compile 64-bit wine"
1746 + die
1747 + fi
1748 + fi
1749 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
1750 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
1751 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
1752 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
1753 + fi
1754 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
1755 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
1756 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
1757 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
1758 + ewarn "See package.env in man 5 portage for more information on how to do this."
1759 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
1760 + fi
1761 + fi
1762 +
1763 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
1764 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
1765 + eerror "See https://bugs.gentoo.org/487864 for more details."
1766 + eerror
1767 + return 1
1768 + fi
1769 +}
1770 +
1771 +wine_env_vcs_vars() {
1772 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
1773 + local pn_live_val="${pn_live_var}"
1774 + eval pn_live_val='$'${pn_live_val}
1775 + if [[ ! -z ${pn_live_val} ]]; then
1776 + if use d3d9; then
1777 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
1778 + eerror "cannot be used to set the commit. Instead, you may use the"
1779 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
1780 + eerror
1781 + return 1
1782 + fi
1783 + fi
1784 + if [[ ! -z ${EGIT_COMMIT} ]]; then
1785 + eerror "Commits must now be specified using the environmental variables"
1786 + eerror "WINE_COMMIT, and D3D9_COMMIT"
1787 + eerror
1788 + return 1
1789 + fi
1790 +}
1791 +
1792 +pkg_pretend() {
1793 + wine_build_environment_check || die
1794 +
1795 + # Verify OSS support
1796 + if use oss && ! use kernel_FreeBSD; then
1797 + if ! has_version ">=media-sound/oss-4"; then
1798 + eerror "You cannot build wine with USE=oss without having support from a"
1799 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
1800 + eerror
1801 + die
1802 + fi
1803 + fi
1804 +}
1805 +
1806 +pkg_setup() {
1807 + wine_build_environment_check || die
1808 + wine_env_vcs_vars || die
1809 +
1810 + WINE_VARIANT="${PN#wine}-${PV}"
1811 + WINE_VARIANT="${WINE_VARIANT#-}"
1812 +
1813 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
1814 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
1815 + MY_DATADIR="${MY_DATAROOTDIR}"
1816 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
1817 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
1818 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
1819 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
1820 + MY_MANDIR="${MY_DATADIR}/man"
1821 +}
1822 +
1823 +src_unpack() {
1824 + if [[ ${PV} == "9999" ]] ; then
1825 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
1826 + if use d3d9; then
1827 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
1828 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
1829 + fi
1830 + fi
1831 +
1832 + default
1833 +
1834 + l10n_find_plocales_changes "${S}/po" "" ".po"
1835 +}
1836 +
1837 +src_prepare() {
1838 + local md5="$(md5sum server/protocol.def)"
1839 + local PATCHES=(
1840 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
1841 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
1842 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
1843 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
1844 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
1845 + )
1846 + if use d3d9; then
1847 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
1848 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
1849 + fi
1850 +
1851 + default
1852 + eautoreconf
1853 +
1854 + # Modification of the server protocol requires regenerating the server requests
1855 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
1856 + einfo "server/protocol.def was patched; running tools/make_requests"
1857 + tools/make_requests || die #432348
1858 + fi
1859 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
1860 + if ! use run-exes; then
1861 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
1862 + fi
1863 +
1864 + # Edit wine.desktop to work for specific variant
1865 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
1866 +
1867 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
1868 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
1869 +
1870 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
1871 +}
1872 +
1873 +src_configure() {
1874 + wine_compiler_check || die
1875 +
1876 + export LDCONFIG=/bin/true
1877 + use custom-cflags || strip-flags
1878 +
1879 + multilib-minimal_src_configure
1880 +}
1881 +
1882 +multilib_src_configure() {
1883 + local myconf=(
1884 + --prefix="${MY_PREFIX}"
1885 + --datarootdir="${MY_DATAROOTDIR}"
1886 + --datadir="${MY_DATADIR}"
1887 + --docdir="${MY_DOCDIR}"
1888 + --includedir="${MY_INCLUDEDIR}"
1889 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
1890 + --libexecdir="${MY_LIBEXECDIR}"
1891 + --localstatedir="${MY_LOCALSTATEDIR}"
1892 + --mandir="${MY_MANDIR}"
1893 + --sysconfdir=/etc/wine
1894 + $(use_with alsa)
1895 + $(use_with capi)
1896 + $(use_with lcms cms)
1897 + $(use_with cups)
1898 + $(use_with ncurses curses)
1899 + $(use_with udisks dbus)
1900 + $(use_with fontconfig)
1901 + $(use_with ssl gnutls)
1902 + $(use_enable gecko mshtml)
1903 + $(use_with gphoto2 gphoto)
1904 + $(use_with gsm)
1905 + $(use_with gstreamer)
1906 + --without-hal
1907 + $(use_with jpeg)
1908 + $(use_with ldap)
1909 + $(use_enable mono mscoree)
1910 + $(use_with mp3 mpg123)
1911 + $(use_with netapi)
1912 + $(use_with nls gettext)
1913 + $(use_with openal)
1914 + $(use_with opencl)
1915 + $(use_with opengl)
1916 + $(use_with osmesa)
1917 + $(use_with oss)
1918 + $(use_with pcap)
1919 + $(use_with png)
1920 + $(use_with pulseaudio pulse)
1921 + $(use_with threads pthread)
1922 + $(use_with scanner sane)
1923 + $(use_enable test tests)
1924 + $(use_with truetype freetype)
1925 + $(use_with udev)
1926 + $(use_with v4l)
1927 + $(use_with X x)
1928 + $(use_with xcomposite)
1929 + $(use_with xinerama)
1930 + $(use_with xml)
1931 + $(use_with xml xslt)
1932 + )
1933 +
1934 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
1935 +
1936 + local PKG_CONFIG AR RANLIB
1937 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
1938 + # set AR and RANLIB to make QA scripts happy; #483342
1939 + tc-export PKG_CONFIG AR RANLIB
1940 +
1941 + if use amd64; then
1942 + if [[ ${ABI} == amd64 ]]; then
1943 + myconf+=( --enable-win64 )
1944 + else
1945 + myconf+=( --disable-win64 )
1946 + fi
1947 +
1948 + # Note: using --with-wine64 results in problems with multilib.eclass
1949 + # CC/LD hackery. We're using separate tools instead.
1950 + fi
1951 +
1952 + ECONF_SOURCE=${S} \
1953 + econf "${myconf[@]}"
1954 + emake depend
1955 +}
1956 +
1957 +multilib_src_test() {
1958 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
1959 + if [[ ${ABI} == x86 ]]; then
1960 + if [[ $(id -u) == 0 ]]; then
1961 + ewarn "Skipping tests since they cannot be run under the root user."
1962 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
1963 + return
1964 + fi
1965 +
1966 + WINEPREFIX="${T}/.wine-${ABI}" \
1967 + Xemake test
1968 + fi
1969 +}
1970 +
1971 +multilib_src_install_all() {
1972 + local DOCS=( ANNOUNCE AUTHORS README )
1973 + local l
1974 + add_locale_docs() {
1975 + local locale_doc="documentation/README.$1"
1976 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
1977 + }
1978 + l10n_for_each_locale_do add_locale_docs
1979 +
1980 + einstalldocs
1981 + prune_libtool_files --all
1982 +
1983 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
1984 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
1985 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
1986 + fi
1987 +
1988 + # Remove wineconsole if neither backend is installed #551124
1989 + if ! use X && ! use ncurses; then
1990 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
1991 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
1992 + rm_wineconsole() {
1993 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
1994 + }
1995 + multilib_foreach_abi rm_wineconsole
1996 + fi
1997 +
1998 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
1999 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
2000 +
2001 + if use abi_x86_64 && ! use abi_x86_32; then
2002 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
2003 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
2004 + fi
2005 +
2006 + # Make wrappers for binaries for handling multiple variants
2007 + # Note: wrappers instead of symlinks because some are shell which use basename
2008 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
2009 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
2010 + done
2011 +
2012 + # respect LINGUAS when installing man pages, #469418
2013 + for l in de fr pl; do
2014 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
2015 + done
2016 +
2017 + for m in "${D%/}${MY_MANDIR}"/*/*; do
2018 + new_man=${m##*/}
2019 + new_man=${new_man%%.1}
2020 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
2021 + done
2022 +}
2023 +
2024 +pkg_postinst() {
2025 + eselect wine register ${P}
2026 + if [[ ${PN} == "wine-vanilla" ]]; then
2027 + eselect wine register --vanilla ${P} || die
2028 + else
2029 + if use d3d9; then
2030 + eselect wine register --d3d9 ${P} || die
2031 + fi
2032 + fi
2033 +
2034 + eselect wine update --all --if-unset || die
2035 +
2036 + fdo-mime_desktop_database_update
2037 +
2038 + if ! use gecko; then
2039 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
2040 + ewarn "implementation of iexplore. Many older windows applications"
2041 + ewarn "rely upon the existence of an iexplore implementation, so"
2042 + ewarn "you will likely need to install an external one, like via winetricks"
2043 + fi
2044 + if ! use mono; then
2045 + ewarn "Without Wine Mono, wine prefixes will not have a default"
2046 + ewarn "implementation of .NET. Many windows applications rely upon"
2047 + ewarn "the existence of a .NET implementation, so you will likely need"
2048 + ewarn "to install an external one, like via winetricks"
2049 + fi
2050 +}
2051 +
2052 +pkg_prerm() {
2053 + eselect wine deregister ${P}
2054 + if [[ ${PN} == "wine-vanilla" ]]; then
2055 + eselect wine deregister --vanilla ${P} || die
2056 + else
2057 + if use d3d9; then
2058 + eselect wine deregister --d3d9 ${P} || die
2059 + fi
2060 + fi
2061 +
2062 + eselect wine update --all --if-unset || die
2063 +}
2064 +
2065 +pkg_postrm() {
2066 + fdo-mime_desktop_database_update
2067 +}
2068
2069 diff --git a/app-emulation/wine-d3d9/wine-d3d9-2.3.ebuild b/app-emulation/wine-d3d9/wine-d3d9-2.3.ebuild
2070 new file mode 100644
2071 index 00000000000..2b6973341d3
2072 --- /dev/null
2073 +++ b/app-emulation/wine-d3d9/wine-d3d9-2.3.ebuild
2074 @@ -0,0 +1,549 @@
2075 +# Copyright 1999-2017 Gentoo Foundation
2076 +# Distributed under the terms of the GNU General Public License v2
2077 +
2078 +EAPI=6
2079 +
2080 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
2081 +PLOCALE_BACKUP="en"
2082 +
2083 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
2084 +
2085 +MY_PN="${PN%%-*}"
2086 +MY_P="${MY_PN}-${PV}"
2087 +
2088 +if [[ ${PV} == "9999" ]] ; then
2089 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
2090 + EGIT_BRANCH="master"
2091 + inherit git-r3
2092 + SRC_URI=""
2093 + #KEYWORDS=""
2094 +else
2095 + MAJOR_V=$(get_version_component_range 1)
2096 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
2097 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
2098 +fi
2099 +S="${WORKDIR}/${MY_P}"
2100 +
2101 +D3D9_P="wine-d3d9-${PV}"
2102 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
2103 +WDC_V="20150204"
2104 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
2105 +
2106 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
2107 +HOMEPAGE="http://www.winehq.org/"
2108 +SRC_URI="${SRC_URI}
2109 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
2110 +"
2111 +
2112 +if [[ ${PV} == "9999" ]] ; then
2113 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
2114 +else
2115 + SRC_URI="${SRC_URI}
2116 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
2117 +fi
2118 +
2119 +LICENSE="LGPL-2.1"
2120 +SLOT="${PV}"
2121 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
2122 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
2123 + X? ( truetype )
2124 + elibc_glibc? ( threads )
2125 + osmesa? ( opengl )
2126 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
2127 +
2128 +# FIXME: the test suite is unsuitable for us; many tests require net access
2129 +# or fail due to Xvfb's opengl limitations.
2130 +RESTRICT="test"
2131 +
2132 +COMMON_DEPEND="
2133 + X? (
2134 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
2135 + x11-libs/libXext[${MULTILIB_USEDEP}]
2136 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
2137 + x11-libs/libXi[${MULTILIB_USEDEP}]
2138 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
2139 + )
2140 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
2141 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
2142 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
2143 + d3d9? (
2144 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
2145 + x11-libs/libX11[${MULTILIB_USEDEP}]
2146 + x11-libs/libXext[${MULTILIB_USEDEP}]
2147 + x11-libs/libxcb[${MULTILIB_USEDEP}]
2148 + )
2149 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
2150 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
2151 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
2152 + gstreamer? (
2153 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
2154 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
2155 + )
2156 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
2157 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
2158 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
2159 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
2160 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
2161 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
2162 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
2163 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
2164 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
2165 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
2166 + opengl? (
2167 + virtual/glu[${MULTILIB_USEDEP}]
2168 + virtual/opengl[${MULTILIB_USEDEP}]
2169 + )
2170 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
2171 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
2172 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
2173 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
2174 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
2175 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
2176 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
2177 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
2178 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
2179 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
2180 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
2181 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
2182 + xml? (
2183 + dev-libs/libxml2[${MULTILIB_USEDEP}]
2184 + dev-libs/libxslt[${MULTILIB_USEDEP}]
2185 + )
2186 + abi_x86_32? (
2187 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
2188 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
2189 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
2190 + !<app-emulation/emul-linux-x86-db-20140508-r3
2191 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
2192 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
2193 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
2194 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
2195 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
2196 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
2197 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
2198 + !<app-emulation/emul-linux-x86-soundlibs-20140508
2199 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
2200 + !<app-emulation/emul-linux-x86-xlibs-20140508
2201 + )"
2202 +
2203 +RDEPEND="${COMMON_DEPEND}
2204 + app-emulation/wine-desktop-common
2205 + >app-eselect/eselect-wine-0.3
2206 + !app-emulation/wine:0
2207 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
2208 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
2209 + mono? ( app-emulation/wine-mono:4.6.4 )
2210 + perl? (
2211 + dev-lang/perl
2212 + dev-perl/XML-Simple
2213 + )
2214 + pulseaudio? (
2215 + realtime? ( sys-auth/rtkit )
2216 + )
2217 + samba? ( >=net-fs/samba-3.0.25[winbind] )
2218 + selinux? ( sec-policy/selinux-wine )
2219 + udisks? ( sys-fs/udisks:2 )"
2220 +
2221 +# tools/make_requests requires perl
2222 +DEPEND="${COMMON_DEPEND}
2223 + sys-devel/flex
2224 + >=sys-kernel/linux-headers-2.6
2225 + virtual/pkgconfig
2226 + virtual/yacc
2227 + X? (
2228 + x11-proto/inputproto
2229 + x11-proto/xextproto
2230 + x11-proto/xf86vidmodeproto
2231 + )
2232 + prelink? ( sys-devel/prelink )
2233 + xinerama? ( x11-proto/xineramaproto )"
2234 +
2235 +# These use a non-standard "Wine" category, which is provided by
2236 +# /etc/xdg/applications-merged/wine.menu
2237 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
2238 +usr/share/applications/wine-notepad.desktop
2239 +usr/share/applications/wine-uninstaller.desktop
2240 +usr/share/applications/wine-winecfg.desktop"
2241 +
2242 +wine_compiler_check() {
2243 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
2244 +
2245 + # GCC-specific bugs
2246 + if tc-is-gcc; then
2247 + # bug #549768
2248 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
2249 + ebegin "Checking for gcc-5 ms_abi compiler bug"
2250 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
2251 + # Run in subshell to prevent "Aborted" message
2252 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
2253 + if ! eend $?; then
2254 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
2255 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
2256 + eerror "or use gcc-config to select a different compiler version."
2257 + eerror "See https://bugs.gentoo.org/549768"
2258 + eerror
2259 + return 1
2260 + fi
2261 + fi
2262 + # bug #574044
2263 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
2264 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
2265 + # Compile in subshell to prevent "Aborted" message
2266 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
2267 + if ! eend $?; then
2268 + eerror "Wine cannot be built with this version of gcc-5.3"
2269 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
2270 + eerror "or use gcc-config to select a different compiler version."
2271 + eerror "See https://bugs.gentoo.org/574044"
2272 + eerror
2273 + return 1
2274 + fi
2275 + fi
2276 + fi
2277 +
2278 + # Ensure compiler support
2279 + if use abi_x86_64; then
2280 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
2281 + # Compile in subshell to prevent "Aborted" message
2282 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
2283 + if ! eend $?; then
2284 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
2285 + eerror
2286 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
2287 + eerror
2288 + return 1
2289 + fi
2290 + fi
2291 +}
2292 +
2293 +wine_build_environment_check() {
2294 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
2295 +
2296 + if use abi_x86_64; then
2297 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
2298 + eerror "You need gcc-4.4+ to compile 64-bit wine"
2299 + die
2300 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
2301 + eerror "You need clang-3.8+ to compile 64-bit wine"
2302 + die
2303 + fi
2304 + fi
2305 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
2306 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
2307 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
2308 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
2309 + fi
2310 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
2311 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
2312 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
2313 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
2314 + ewarn "See package.env in man 5 portage for more information on how to do this."
2315 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
2316 + fi
2317 + fi
2318 +
2319 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
2320 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
2321 + eerror "See https://bugs.gentoo.org/487864 for more details."
2322 + eerror
2323 + return 1
2324 + fi
2325 +}
2326 +
2327 +wine_env_vcs_vars() {
2328 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
2329 + local pn_live_val="${pn_live_var}"
2330 + eval pn_live_val='$'${pn_live_val}
2331 + if [[ ! -z ${pn_live_val} ]]; then
2332 + if use d3d9; then
2333 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
2334 + eerror "cannot be used to set the commit. Instead, you may use the"
2335 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
2336 + eerror
2337 + return 1
2338 + fi
2339 + fi
2340 + if [[ ! -z ${EGIT_COMMIT} ]]; then
2341 + eerror "Commits must now be specified using the environmental variables"
2342 + eerror "WINE_COMMIT, and D3D9_COMMIT"
2343 + eerror
2344 + return 1
2345 + fi
2346 +}
2347 +
2348 +pkg_pretend() {
2349 + wine_build_environment_check || die
2350 +
2351 + # Verify OSS support
2352 + if use oss && ! use kernel_FreeBSD; then
2353 + if ! has_version ">=media-sound/oss-4"; then
2354 + eerror "You cannot build wine with USE=oss without having support from a"
2355 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
2356 + eerror
2357 + die
2358 + fi
2359 + fi
2360 +}
2361 +
2362 +pkg_setup() {
2363 + wine_build_environment_check || die
2364 + wine_env_vcs_vars || die
2365 +
2366 + WINE_VARIANT="${PN#wine}-${PV}"
2367 + WINE_VARIANT="${WINE_VARIANT#-}"
2368 +
2369 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
2370 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
2371 + MY_DATADIR="${MY_DATAROOTDIR}"
2372 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
2373 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
2374 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
2375 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
2376 + MY_MANDIR="${MY_DATADIR}/man"
2377 +}
2378 +
2379 +src_unpack() {
2380 + if [[ ${PV} == "9999" ]] ; then
2381 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
2382 + if use d3d9; then
2383 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
2384 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
2385 + fi
2386 + fi
2387 +
2388 + default
2389 +
2390 + l10n_find_plocales_changes "${S}/po" "" ".po"
2391 +}
2392 +
2393 +src_prepare() {
2394 + local md5="$(md5sum server/protocol.def)"
2395 + local PATCHES=(
2396 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
2397 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
2398 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
2399 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
2400 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
2401 + )
2402 + if use d3d9; then
2403 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
2404 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
2405 + fi
2406 +
2407 + default
2408 + eautoreconf
2409 +
2410 + # Modification of the server protocol requires regenerating the server requests
2411 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
2412 + einfo "server/protocol.def was patched; running tools/make_requests"
2413 + tools/make_requests || die #432348
2414 + fi
2415 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
2416 + if ! use run-exes; then
2417 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
2418 + fi
2419 +
2420 + # Edit wine.desktop to work for specific variant
2421 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
2422 +
2423 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
2424 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
2425 +
2426 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
2427 +}
2428 +
2429 +src_configure() {
2430 + wine_compiler_check || die
2431 +
2432 + export LDCONFIG=/bin/true
2433 + use custom-cflags || strip-flags
2434 +
2435 + multilib-minimal_src_configure
2436 +}
2437 +
2438 +multilib_src_configure() {
2439 + local myconf=(
2440 + --prefix="${MY_PREFIX}"
2441 + --datarootdir="${MY_DATAROOTDIR}"
2442 + --datadir="${MY_DATADIR}"
2443 + --docdir="${MY_DOCDIR}"
2444 + --includedir="${MY_INCLUDEDIR}"
2445 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
2446 + --libexecdir="${MY_LIBEXECDIR}"
2447 + --localstatedir="${MY_LOCALSTATEDIR}"
2448 + --mandir="${MY_MANDIR}"
2449 + --sysconfdir=/etc/wine
2450 + $(use_with alsa)
2451 + $(use_with capi)
2452 + $(use_with lcms cms)
2453 + $(use_with cups)
2454 + $(use_with ncurses curses)
2455 + $(use_with udisks dbus)
2456 + $(use_with fontconfig)
2457 + $(use_with ssl gnutls)
2458 + $(use_enable gecko mshtml)
2459 + $(use_with gphoto2 gphoto)
2460 + $(use_with gsm)
2461 + $(use_with gstreamer)
2462 + --without-hal
2463 + $(use_with jpeg)
2464 + $(use_with ldap)
2465 + $(use_enable mono mscoree)
2466 + $(use_with mp3 mpg123)
2467 + $(use_with netapi)
2468 + $(use_with nls gettext)
2469 + $(use_with openal)
2470 + $(use_with opencl)
2471 + $(use_with opengl)
2472 + $(use_with osmesa)
2473 + $(use_with oss)
2474 + $(use_with pcap)
2475 + $(use_with png)
2476 + $(use_with pulseaudio pulse)
2477 + $(use_with threads pthread)
2478 + $(use_with scanner sane)
2479 + $(use_enable test tests)
2480 + $(use_with truetype freetype)
2481 + $(use_with udev)
2482 + $(use_with v4l)
2483 + $(use_with X x)
2484 + $(use_with xcomposite)
2485 + $(use_with xinerama)
2486 + $(use_with xml)
2487 + $(use_with xml xslt)
2488 + )
2489 +
2490 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
2491 +
2492 + local PKG_CONFIG AR RANLIB
2493 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
2494 + # set AR and RANLIB to make QA scripts happy; #483342
2495 + tc-export PKG_CONFIG AR RANLIB
2496 +
2497 + if use amd64; then
2498 + if [[ ${ABI} == amd64 ]]; then
2499 + myconf+=( --enable-win64 )
2500 + else
2501 + myconf+=( --disable-win64 )
2502 + fi
2503 +
2504 + # Note: using --with-wine64 results in problems with multilib.eclass
2505 + # CC/LD hackery. We're using separate tools instead.
2506 + fi
2507 +
2508 + ECONF_SOURCE=${S} \
2509 + econf "${myconf[@]}"
2510 + emake depend
2511 +}
2512 +
2513 +multilib_src_test() {
2514 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
2515 + if [[ ${ABI} == x86 ]]; then
2516 + if [[ $(id -u) == 0 ]]; then
2517 + ewarn "Skipping tests since they cannot be run under the root user."
2518 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
2519 + return
2520 + fi
2521 +
2522 + WINEPREFIX="${T}/.wine-${ABI}" \
2523 + Xemake test
2524 + fi
2525 +}
2526 +
2527 +multilib_src_install_all() {
2528 + local DOCS=( ANNOUNCE AUTHORS README )
2529 + local l
2530 + add_locale_docs() {
2531 + local locale_doc="documentation/README.$1"
2532 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
2533 + }
2534 + l10n_for_each_locale_do add_locale_docs
2535 +
2536 + einstalldocs
2537 + prune_libtool_files --all
2538 +
2539 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
2540 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
2541 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
2542 + fi
2543 +
2544 + # Remove wineconsole if neither backend is installed #551124
2545 + if ! use X && ! use ncurses; then
2546 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
2547 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
2548 + rm_wineconsole() {
2549 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
2550 + }
2551 + multilib_foreach_abi rm_wineconsole
2552 + fi
2553 +
2554 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
2555 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
2556 +
2557 + if use abi_x86_64 && ! use abi_x86_32; then
2558 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
2559 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
2560 + fi
2561 +
2562 + # Make wrappers for binaries for handling multiple variants
2563 + # Note: wrappers instead of symlinks because some are shell which use basename
2564 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
2565 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
2566 + done
2567 +
2568 + # respect LINGUAS when installing man pages, #469418
2569 + for l in de fr pl; do
2570 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
2571 + done
2572 +
2573 + for m in "${D%/}${MY_MANDIR}"/*/*; do
2574 + new_man=${m##*/}
2575 + new_man=${new_man%%.1}
2576 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
2577 + done
2578 +}
2579 +
2580 +pkg_postinst() {
2581 + eselect wine register ${P}
2582 + if [[ ${PN} == "wine-vanilla" ]]; then
2583 + eselect wine register --vanilla ${P} || die
2584 + else
2585 + if use d3d9; then
2586 + eselect wine register --d3d9 ${P} || die
2587 + fi
2588 + fi
2589 +
2590 + eselect wine update --all --if-unset || die
2591 +
2592 + fdo-mime_desktop_database_update
2593 +
2594 + if ! use gecko; then
2595 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
2596 + ewarn "implementation of iexplore. Many older windows applications"
2597 + ewarn "rely upon the existence of an iexplore implementation, so"
2598 + ewarn "you will likely need to install an external one, like via winetricks"
2599 + fi
2600 + if ! use mono; then
2601 + ewarn "Without Wine Mono, wine prefixes will not have a default"
2602 + ewarn "implementation of .NET. Many windows applications rely upon"
2603 + ewarn "the existence of a .NET implementation, so you will likely need"
2604 + ewarn "to install an external one, like via winetricks"
2605 + fi
2606 +}
2607 +
2608 +pkg_prerm() {
2609 + eselect wine deregister ${P}
2610 + if [[ ${PN} == "wine-vanilla" ]]; then
2611 + eselect wine deregister --vanilla ${P} || die
2612 + else
2613 + if use d3d9; then
2614 + eselect wine deregister --d3d9 ${P} || die
2615 + fi
2616 + fi
2617 +
2618 + eselect wine update --all --if-unset || die
2619 +}
2620 +
2621 +pkg_postrm() {
2622 + fdo-mime_desktop_database_update
2623 +}
2624
2625 diff --git a/app-emulation/wine-d3d9/wine-d3d9-2.4.ebuild b/app-emulation/wine-d3d9/wine-d3d9-2.4.ebuild
2626 new file mode 100644
2627 index 00000000000..badba49da22
2628 --- /dev/null
2629 +++ b/app-emulation/wine-d3d9/wine-d3d9-2.4.ebuild
2630 @@ -0,0 +1,549 @@
2631 +# Copyright 1999-2017 Gentoo Foundation
2632 +# Distributed under the terms of the GNU General Public License v2
2633 +
2634 +EAPI=6
2635 +
2636 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
2637 +PLOCALE_BACKUP="en"
2638 +
2639 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
2640 +
2641 +MY_PN="${PN%%-*}"
2642 +MY_P="${MY_PN}-${PV}"
2643 +
2644 +if [[ ${PV} == "9999" ]] ; then
2645 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
2646 + EGIT_BRANCH="master"
2647 + inherit git-r3
2648 + SRC_URI=""
2649 + #KEYWORDS=""
2650 +else
2651 + MAJOR_V=$(get_version_component_range 1)
2652 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
2653 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
2654 +fi
2655 +S="${WORKDIR}/${MY_P}"
2656 +
2657 +D3D9_P="wine-d3d9-${PV}"
2658 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
2659 +WDC_V="20150204"
2660 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
2661 +
2662 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
2663 +HOMEPAGE="http://www.winehq.org/"
2664 +SRC_URI="${SRC_URI}
2665 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
2666 +"
2667 +
2668 +if [[ ${PV} == "9999" ]] ; then
2669 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
2670 +else
2671 + SRC_URI="${SRC_URI}
2672 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
2673 +fi
2674 +
2675 +LICENSE="LGPL-2.1"
2676 +SLOT="${PV}"
2677 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
2678 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
2679 + X? ( truetype )
2680 + elibc_glibc? ( threads )
2681 + osmesa? ( opengl )
2682 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
2683 +
2684 +# FIXME: the test suite is unsuitable for us; many tests require net access
2685 +# or fail due to Xvfb's opengl limitations.
2686 +RESTRICT="test"
2687 +
2688 +COMMON_DEPEND="
2689 + X? (
2690 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
2691 + x11-libs/libXext[${MULTILIB_USEDEP}]
2692 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
2693 + x11-libs/libXi[${MULTILIB_USEDEP}]
2694 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
2695 + )
2696 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
2697 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
2698 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
2699 + d3d9? (
2700 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
2701 + x11-libs/libX11[${MULTILIB_USEDEP}]
2702 + x11-libs/libXext[${MULTILIB_USEDEP}]
2703 + x11-libs/libxcb[${MULTILIB_USEDEP}]
2704 + )
2705 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
2706 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
2707 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
2708 + gstreamer? (
2709 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
2710 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
2711 + )
2712 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
2713 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
2714 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
2715 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
2716 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
2717 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
2718 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
2719 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
2720 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
2721 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
2722 + opengl? (
2723 + virtual/glu[${MULTILIB_USEDEP}]
2724 + virtual/opengl[${MULTILIB_USEDEP}]
2725 + )
2726 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
2727 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
2728 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
2729 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
2730 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
2731 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
2732 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
2733 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
2734 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
2735 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
2736 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
2737 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
2738 + xml? (
2739 + dev-libs/libxml2[${MULTILIB_USEDEP}]
2740 + dev-libs/libxslt[${MULTILIB_USEDEP}]
2741 + )
2742 + abi_x86_32? (
2743 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
2744 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
2745 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
2746 + !<app-emulation/emul-linux-x86-db-20140508-r3
2747 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
2748 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
2749 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
2750 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
2751 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
2752 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
2753 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
2754 + !<app-emulation/emul-linux-x86-soundlibs-20140508
2755 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
2756 + !<app-emulation/emul-linux-x86-xlibs-20140508
2757 + )"
2758 +
2759 +RDEPEND="${COMMON_DEPEND}
2760 + app-emulation/wine-desktop-common
2761 + >app-eselect/eselect-wine-0.3
2762 + !app-emulation/wine:0
2763 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
2764 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
2765 + mono? ( app-emulation/wine-mono:4.7.0 )
2766 + perl? (
2767 + dev-lang/perl
2768 + dev-perl/XML-Simple
2769 + )
2770 + pulseaudio? (
2771 + realtime? ( sys-auth/rtkit )
2772 + )
2773 + samba? ( >=net-fs/samba-3.0.25[winbind] )
2774 + selinux? ( sec-policy/selinux-wine )
2775 + udisks? ( sys-fs/udisks:2 )"
2776 +
2777 +# tools/make_requests requires perl
2778 +DEPEND="${COMMON_DEPEND}
2779 + sys-devel/flex
2780 + >=sys-kernel/linux-headers-2.6
2781 + virtual/pkgconfig
2782 + virtual/yacc
2783 + X? (
2784 + x11-proto/inputproto
2785 + x11-proto/xextproto
2786 + x11-proto/xf86vidmodeproto
2787 + )
2788 + prelink? ( sys-devel/prelink )
2789 + xinerama? ( x11-proto/xineramaproto )"
2790 +
2791 +# These use a non-standard "Wine" category, which is provided by
2792 +# /etc/xdg/applications-merged/wine.menu
2793 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
2794 +usr/share/applications/wine-notepad.desktop
2795 +usr/share/applications/wine-uninstaller.desktop
2796 +usr/share/applications/wine-winecfg.desktop"
2797 +
2798 +wine_compiler_check() {
2799 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
2800 +
2801 + # GCC-specific bugs
2802 + if tc-is-gcc; then
2803 + # bug #549768
2804 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
2805 + ebegin "Checking for gcc-5 ms_abi compiler bug"
2806 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
2807 + # Run in subshell to prevent "Aborted" message
2808 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
2809 + if ! eend $?; then
2810 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
2811 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
2812 + eerror "or use gcc-config to select a different compiler version."
2813 + eerror "See https://bugs.gentoo.org/549768"
2814 + eerror
2815 + return 1
2816 + fi
2817 + fi
2818 + # bug #574044
2819 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
2820 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
2821 + # Compile in subshell to prevent "Aborted" message
2822 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
2823 + if ! eend $?; then
2824 + eerror "Wine cannot be built with this version of gcc-5.3"
2825 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
2826 + eerror "or use gcc-config to select a different compiler version."
2827 + eerror "See https://bugs.gentoo.org/574044"
2828 + eerror
2829 + return 1
2830 + fi
2831 + fi
2832 + fi
2833 +
2834 + # Ensure compiler support
2835 + if use abi_x86_64; then
2836 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
2837 + # Compile in subshell to prevent "Aborted" message
2838 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
2839 + if ! eend $?; then
2840 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
2841 + eerror
2842 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
2843 + eerror
2844 + return 1
2845 + fi
2846 + fi
2847 +}
2848 +
2849 +wine_build_environment_check() {
2850 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
2851 +
2852 + if use abi_x86_64; then
2853 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
2854 + eerror "You need gcc-4.4+ to compile 64-bit wine"
2855 + die
2856 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
2857 + eerror "You need clang-3.8+ to compile 64-bit wine"
2858 + die
2859 + fi
2860 + fi
2861 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
2862 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
2863 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
2864 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
2865 + fi
2866 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
2867 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
2868 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
2869 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
2870 + ewarn "See package.env in man 5 portage for more information on how to do this."
2871 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
2872 + fi
2873 + fi
2874 +
2875 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
2876 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
2877 + eerror "See https://bugs.gentoo.org/487864 for more details."
2878 + eerror
2879 + return 1
2880 + fi
2881 +}
2882 +
2883 +wine_env_vcs_vars() {
2884 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
2885 + local pn_live_val="${pn_live_var}"
2886 + eval pn_live_val='$'${pn_live_val}
2887 + if [[ ! -z ${pn_live_val} ]]; then
2888 + if use d3d9; then
2889 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
2890 + eerror "cannot be used to set the commit. Instead, you may use the"
2891 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
2892 + eerror
2893 + return 1
2894 + fi
2895 + fi
2896 + if [[ ! -z ${EGIT_COMMIT} ]]; then
2897 + eerror "Commits must now be specified using the environmental variables"
2898 + eerror "WINE_COMMIT, and D3D9_COMMIT"
2899 + eerror
2900 + return 1
2901 + fi
2902 +}
2903 +
2904 +pkg_pretend() {
2905 + wine_build_environment_check || die
2906 +
2907 + # Verify OSS support
2908 + if use oss && ! use kernel_FreeBSD; then
2909 + if ! has_version ">=media-sound/oss-4"; then
2910 + eerror "You cannot build wine with USE=oss without having support from a"
2911 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
2912 + eerror
2913 + die
2914 + fi
2915 + fi
2916 +}
2917 +
2918 +pkg_setup() {
2919 + wine_build_environment_check || die
2920 + wine_env_vcs_vars || die
2921 +
2922 + WINE_VARIANT="${PN#wine}-${PV}"
2923 + WINE_VARIANT="${WINE_VARIANT#-}"
2924 +
2925 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
2926 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
2927 + MY_DATADIR="${MY_DATAROOTDIR}"
2928 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
2929 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
2930 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
2931 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
2932 + MY_MANDIR="${MY_DATADIR}/man"
2933 +}
2934 +
2935 +src_unpack() {
2936 + if [[ ${PV} == "9999" ]] ; then
2937 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
2938 + if use d3d9; then
2939 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
2940 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
2941 + fi
2942 + fi
2943 +
2944 + default
2945 +
2946 + l10n_find_plocales_changes "${S}/po" "" ".po"
2947 +}
2948 +
2949 +src_prepare() {
2950 + local md5="$(md5sum server/protocol.def)"
2951 + local PATCHES=(
2952 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
2953 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
2954 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
2955 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
2956 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
2957 + )
2958 + if use d3d9; then
2959 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
2960 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
2961 + fi
2962 +
2963 + default
2964 + eautoreconf
2965 +
2966 + # Modification of the server protocol requires regenerating the server requests
2967 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
2968 + einfo "server/protocol.def was patched; running tools/make_requests"
2969 + tools/make_requests || die #432348
2970 + fi
2971 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
2972 + if ! use run-exes; then
2973 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
2974 + fi
2975 +
2976 + # Edit wine.desktop to work for specific variant
2977 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
2978 +
2979 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
2980 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
2981 +
2982 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
2983 +}
2984 +
2985 +src_configure() {
2986 + wine_compiler_check || die
2987 +
2988 + export LDCONFIG=/bin/true
2989 + use custom-cflags || strip-flags
2990 +
2991 + multilib-minimal_src_configure
2992 +}
2993 +
2994 +multilib_src_configure() {
2995 + local myconf=(
2996 + --prefix="${MY_PREFIX}"
2997 + --datarootdir="${MY_DATAROOTDIR}"
2998 + --datadir="${MY_DATADIR}"
2999 + --docdir="${MY_DOCDIR}"
3000 + --includedir="${MY_INCLUDEDIR}"
3001 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
3002 + --libexecdir="${MY_LIBEXECDIR}"
3003 + --localstatedir="${MY_LOCALSTATEDIR}"
3004 + --mandir="${MY_MANDIR}"
3005 + --sysconfdir=/etc/wine
3006 + $(use_with alsa)
3007 + $(use_with capi)
3008 + $(use_with lcms cms)
3009 + $(use_with cups)
3010 + $(use_with ncurses curses)
3011 + $(use_with udisks dbus)
3012 + $(use_with fontconfig)
3013 + $(use_with ssl gnutls)
3014 + $(use_enable gecko mshtml)
3015 + $(use_with gphoto2 gphoto)
3016 + $(use_with gsm)
3017 + $(use_with gstreamer)
3018 + --without-hal
3019 + $(use_with jpeg)
3020 + $(use_with ldap)
3021 + $(use_enable mono mscoree)
3022 + $(use_with mp3 mpg123)
3023 + $(use_with netapi)
3024 + $(use_with nls gettext)
3025 + $(use_with openal)
3026 + $(use_with opencl)
3027 + $(use_with opengl)
3028 + $(use_with osmesa)
3029 + $(use_with oss)
3030 + $(use_with pcap)
3031 + $(use_with png)
3032 + $(use_with pulseaudio pulse)
3033 + $(use_with threads pthread)
3034 + $(use_with scanner sane)
3035 + $(use_enable test tests)
3036 + $(use_with truetype freetype)
3037 + $(use_with udev)
3038 + $(use_with v4l)
3039 + $(use_with X x)
3040 + $(use_with xcomposite)
3041 + $(use_with xinerama)
3042 + $(use_with xml)
3043 + $(use_with xml xslt)
3044 + )
3045 +
3046 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
3047 +
3048 + local PKG_CONFIG AR RANLIB
3049 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
3050 + # set AR and RANLIB to make QA scripts happy; #483342
3051 + tc-export PKG_CONFIG AR RANLIB
3052 +
3053 + if use amd64; then
3054 + if [[ ${ABI} == amd64 ]]; then
3055 + myconf+=( --enable-win64 )
3056 + else
3057 + myconf+=( --disable-win64 )
3058 + fi
3059 +
3060 + # Note: using --with-wine64 results in problems with multilib.eclass
3061 + # CC/LD hackery. We're using separate tools instead.
3062 + fi
3063 +
3064 + ECONF_SOURCE=${S} \
3065 + econf "${myconf[@]}"
3066 + emake depend
3067 +}
3068 +
3069 +multilib_src_test() {
3070 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
3071 + if [[ ${ABI} == x86 ]]; then
3072 + if [[ $(id -u) == 0 ]]; then
3073 + ewarn "Skipping tests since they cannot be run under the root user."
3074 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
3075 + return
3076 + fi
3077 +
3078 + WINEPREFIX="${T}/.wine-${ABI}" \
3079 + Xemake test
3080 + fi
3081 +}
3082 +
3083 +multilib_src_install_all() {
3084 + local DOCS=( ANNOUNCE AUTHORS README )
3085 + local l
3086 + add_locale_docs() {
3087 + local locale_doc="documentation/README.$1"
3088 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
3089 + }
3090 + l10n_for_each_locale_do add_locale_docs
3091 +
3092 + einstalldocs
3093 + prune_libtool_files --all
3094 +
3095 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
3096 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
3097 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
3098 + fi
3099 +
3100 + # Remove wineconsole if neither backend is installed #551124
3101 + if ! use X && ! use ncurses; then
3102 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
3103 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
3104 + rm_wineconsole() {
3105 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
3106 + }
3107 + multilib_foreach_abi rm_wineconsole
3108 + fi
3109 +
3110 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
3111 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
3112 +
3113 + if use abi_x86_64 && ! use abi_x86_32; then
3114 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
3115 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
3116 + fi
3117 +
3118 + # Make wrappers for binaries for handling multiple variants
3119 + # Note: wrappers instead of symlinks because some are shell which use basename
3120 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
3121 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
3122 + done
3123 +
3124 + # respect LINGUAS when installing man pages, #469418
3125 + for l in de fr pl; do
3126 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
3127 + done
3128 +
3129 + for m in "${D%/}${MY_MANDIR}"/*/*; do
3130 + new_man=${m##*/}
3131 + new_man=${new_man%%.1}
3132 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
3133 + done
3134 +}
3135 +
3136 +pkg_postinst() {
3137 + eselect wine register ${P}
3138 + if [[ ${PN} == "wine-vanilla" ]]; then
3139 + eselect wine register --vanilla ${P} || die
3140 + else
3141 + if use d3d9; then
3142 + eselect wine register --d3d9 ${P} || die
3143 + fi
3144 + fi
3145 +
3146 + eselect wine update --all --if-unset || die
3147 +
3148 + fdo-mime_desktop_database_update
3149 +
3150 + if ! use gecko; then
3151 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
3152 + ewarn "implementation of iexplore. Many older windows applications"
3153 + ewarn "rely upon the existence of an iexplore implementation, so"
3154 + ewarn "you will likely need to install an external one, like via winetricks"
3155 + fi
3156 + if ! use mono; then
3157 + ewarn "Without Wine Mono, wine prefixes will not have a default"
3158 + ewarn "implementation of .NET. Many windows applications rely upon"
3159 + ewarn "the existence of a .NET implementation, so you will likely need"
3160 + ewarn "to install an external one, like via winetricks"
3161 + fi
3162 +}
3163 +
3164 +pkg_prerm() {
3165 + eselect wine deregister ${P}
3166 + if [[ ${PN} == "wine-vanilla" ]]; then
3167 + eselect wine deregister --vanilla ${P} || die
3168 + else
3169 + if use d3d9; then
3170 + eselect wine deregister --d3d9 ${P} || die
3171 + fi
3172 + fi
3173 +
3174 + eselect wine update --all --if-unset || die
3175 +}
3176 +
3177 +pkg_postrm() {
3178 + fdo-mime_desktop_database_update
3179 +}
3180
3181 diff --git a/app-emulation/wine-d3d9/wine-d3d9-9999.ebuild b/app-emulation/wine-d3d9/wine-d3d9-9999.ebuild
3182 new file mode 100644
3183 index 00000000000..badba49da22
3184 --- /dev/null
3185 +++ b/app-emulation/wine-d3d9/wine-d3d9-9999.ebuild
3186 @@ -0,0 +1,549 @@
3187 +# Copyright 1999-2017 Gentoo Foundation
3188 +# Distributed under the terms of the GNU General Public License v2
3189 +
3190 +EAPI=6
3191 +
3192 +PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
3193 +PLOCALE_BACKUP="en"
3194 +
3195 +inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
3196 +
3197 +MY_PN="${PN%%-*}"
3198 +MY_P="${MY_PN}-${PV}"
3199 +
3200 +if [[ ${PV} == "9999" ]] ; then
3201 + EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
3202 + EGIT_BRANCH="master"
3203 + inherit git-r3
3204 + SRC_URI=""
3205 + #KEYWORDS=""
3206 +else
3207 + MAJOR_V=$(get_version_component_range 1)
3208 + SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.x/${MY_P}.tar.xz"
3209 + KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
3210 +fi
3211 +S="${WORKDIR}/${MY_P}"
3212 +
3213 +D3D9_P="wine-d3d9-${PV}"
3214 +D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
3215 +WDC_V="20150204"
3216 +WINE_DESKTOP_COMMON_P="wine-desktop-common-${WDC_V}"
3217 +
3218 +DESCRIPTION="Free implementation of Windows(tm) on Unix"
3219 +HOMEPAGE="http://www.winehq.org/"
3220 +SRC_URI="${SRC_URI}
3221 + https://github.com/NP-Hardass/wine-desktop-common/archive/${WDC_V}.tar.gz -> ${WINE_DESKTOP_COMMON_P}.tar.gz
3222 +"
3223 +
3224 +if [[ ${PV} == "9999" ]] ; then
3225 + D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
3226 +else
3227 + SRC_URI="${SRC_URI}
3228 + d3d9? ( https://github.com/sarnex/wine-d3d9-patches/archive/${D3D9_P}.tar.gz )"
3229 +fi
3230 +
3231 +LICENSE="LGPL-2.1"
3232 +SLOT="${PV}"
3233 +IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype udev +udisks v4l +X +xcomposite xinerama +xml"
3234 +REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
3235 + X? ( truetype )
3236 + elibc_glibc? ( threads )
3237 + osmesa? ( opengl )
3238 + test? ( abi_x86_32 )" # osmesa-opengl #286560 # X-truetype #551124
3239 +
3240 +# FIXME: the test suite is unsuitable for us; many tests require net access
3241 +# or fail due to Xvfb's opengl limitations.
3242 +RESTRICT="test"
3243 +
3244 +COMMON_DEPEND="
3245 + X? (
3246 + x11-libs/libXcursor[${MULTILIB_USEDEP}]
3247 + x11-libs/libXext[${MULTILIB_USEDEP}]
3248 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
3249 + x11-libs/libXi[${MULTILIB_USEDEP}]
3250 + x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
3251 + )
3252 + alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
3253 + capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
3254 + cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
3255 + d3d9? (
3256 + media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
3257 + x11-libs/libX11[${MULTILIB_USEDEP}]
3258 + x11-libs/libXext[${MULTILIB_USEDEP}]
3259 + x11-libs/libxcb[${MULTILIB_USEDEP}]
3260 + )
3261 + fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
3262 + gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
3263 + gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
3264 + gstreamer? (
3265 + media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
3266 + media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
3267 + )
3268 + jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
3269 + lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
3270 + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
3271 + mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
3272 + ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
3273 + netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
3274 + nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
3275 + odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
3276 + openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
3277 + opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
3278 + opengl? (
3279 + virtual/glu[${MULTILIB_USEDEP}]
3280 + virtual/opengl[${MULTILIB_USEDEP}]
3281 + )
3282 + osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
3283 + pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
3284 + png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
3285 + pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
3286 + scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
3287 + ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
3288 + truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
3289 + udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
3290 + udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
3291 + v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
3292 + xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
3293 + xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
3294 + xml? (
3295 + dev-libs/libxml2[${MULTILIB_USEDEP}]
3296 + dev-libs/libxslt[${MULTILIB_USEDEP}]
3297 + )
3298 + abi_x86_32? (
3299 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
3300 + !<app-emulation/emul-linux-x86-baselibs-20140508-r14
3301 + !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
3302 + !<app-emulation/emul-linux-x86-db-20140508-r3
3303 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
3304 + !<app-emulation/emul-linux-x86-medialibs-20140508-r6
3305 + !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
3306 + !<app-emulation/emul-linux-x86-opengl-20140508-r1
3307 + !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
3308 + !<app-emulation/emul-linux-x86-sdl-20140508-r1
3309 + !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
3310 + !<app-emulation/emul-linux-x86-soundlibs-20140508
3311 + !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
3312 + !<app-emulation/emul-linux-x86-xlibs-20140508
3313 + )"
3314 +
3315 +RDEPEND="${COMMON_DEPEND}
3316 + app-emulation/wine-desktop-common
3317 + >app-eselect/eselect-wine-0.3
3318 + !app-emulation/wine:0
3319 + dos? ( >=games-emulation/dosbox-0.74_p20160629 )
3320 + gecko? ( app-emulation/wine-gecko:2.47[abi_x86_32?,abi_x86_64?] )
3321 + mono? ( app-emulation/wine-mono:4.7.0 )
3322 + perl? (
3323 + dev-lang/perl
3324 + dev-perl/XML-Simple
3325 + )
3326 + pulseaudio? (
3327 + realtime? ( sys-auth/rtkit )
3328 + )
3329 + samba? ( >=net-fs/samba-3.0.25[winbind] )
3330 + selinux? ( sec-policy/selinux-wine )
3331 + udisks? ( sys-fs/udisks:2 )"
3332 +
3333 +# tools/make_requests requires perl
3334 +DEPEND="${COMMON_DEPEND}
3335 + sys-devel/flex
3336 + >=sys-kernel/linux-headers-2.6
3337 + virtual/pkgconfig
3338 + virtual/yacc
3339 + X? (
3340 + x11-proto/inputproto
3341 + x11-proto/xextproto
3342 + x11-proto/xf86vidmodeproto
3343 + )
3344 + prelink? ( sys-devel/prelink )
3345 + xinerama? ( x11-proto/xineramaproto )"
3346 +
3347 +# These use a non-standard "Wine" category, which is provided by
3348 +# /etc/xdg/applications-merged/wine.menu
3349 +QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
3350 +usr/share/applications/wine-notepad.desktop
3351 +usr/share/applications/wine-uninstaller.desktop
3352 +usr/share/applications/wine-winecfg.desktop"
3353 +
3354 +wine_compiler_check() {
3355 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
3356 +
3357 + # GCC-specific bugs
3358 + if tc-is-gcc; then
3359 + # bug #549768
3360 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
3361 + ebegin "Checking for gcc-5 ms_abi compiler bug"
3362 + $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
3363 + # Run in subshell to prevent "Aborted" message
3364 + ( "${T}"/pr66838 || false ) >/dev/null 2>&1
3365 + if ! eend $?; then
3366 + eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
3367 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
3368 + eerror "or use gcc-config to select a different compiler version."
3369 + eerror "See https://bugs.gentoo.org/549768"
3370 + eerror
3371 + return 1
3372 + fi
3373 + fi
3374 + # bug #574044
3375 + if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
3376 + ebegin "Checking for gcc-5-3 stack realignment compiler bug"
3377 + # Compile in subshell to prevent "Aborted" message
3378 + ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
3379 + if ! eend $?; then
3380 + eerror "Wine cannot be built with this version of gcc-5.3"
3381 + eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
3382 + eerror "or use gcc-config to select a different compiler version."
3383 + eerror "See https://bugs.gentoo.org/574044"
3384 + eerror
3385 + return 1
3386 + fi
3387 + fi
3388 + fi
3389 +
3390 + # Ensure compiler support
3391 + if use abi_x86_64; then
3392 + ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
3393 + # Compile in subshell to prevent "Aborted" message
3394 + ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
3395 + if ! eend $?; then
3396 + eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
3397 + eerror
3398 + eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
3399 + eerror
3400 + return 1
3401 + fi
3402 + fi
3403 +}
3404 +
3405 +wine_build_environment_check() {
3406 + [[ ${MERGE_TYPE} = "binary" ]] && return 0
3407 +
3408 + if use abi_x86_64; then
3409 + if tc-is-gcc && [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]; then
3410 + eerror "You need gcc-4.4+ to compile 64-bit wine"
3411 + die
3412 + elif tc-is-clang && [[ $(clang-major-version) -lt 3 || ( $(clang-major-version) -eq 3 && $(clang-minor-version) -lt 8 ) ]]; then
3413 + eerror "You need clang-3.8+ to compile 64-bit wine"
3414 + die
3415 + fi
3416 + fi
3417 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -le 3 ]]; then
3418 + ewarn "GCC-5.0-5.3 suffered from compiler bugs and are no longer supported by"
3419 + ewarn "Gentoo's Toolchain Team. If your ebuild fails the compiler checks in"
3420 + ewarn "the configure phase, either update your compiler or switch to <5.0 || >=5.4"
3421 + fi
3422 + if tc-is-gcc && [[ $(gcc-major-version) -eq 5 && $(gcc-minor-version) -eq 4 ]]; then
3423 + if has "-march=i686" ${CFLAGS} && ! has "-mtune=generic" ${CFLAGS}; then
3424 + ewarn "Compilation can hang with CFLAGS=\"-march=i686\". You can temporarily work"
3425 + ewarn "around this by adding \"-mtune=generic\" to your CFLAGS for wine."
3426 + ewarn "See package.env in man 5 portage for more information on how to do this."
3427 + ewarn "See https://bugs.gentoo.org/show_bug.cgi?id=613128 for more details"
3428 + fi
3429 + fi
3430 +
3431 + if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
3432 + eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
3433 + eerror "See https://bugs.gentoo.org/487864 for more details."
3434 + eerror
3435 + return 1
3436 + fi
3437 +}
3438 +
3439 +wine_env_vcs_vars() {
3440 + local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
3441 + local pn_live_val="${pn_live_var}"
3442 + eval pn_live_val='$'${pn_live_val}
3443 + if [[ ! -z ${pn_live_val} ]]; then
3444 + if use d3d9; then
3445 + eerror "Because of the multi-repo nature of ${MY_PN}, ${pn_live_var}"
3446 + eerror "cannot be used to set the commit. Instead, you may use the"
3447 + eerror "environmental variables WINE_COMMIT, and D3D9_COMMIT."
3448 + eerror
3449 + return 1
3450 + fi
3451 + fi
3452 + if [[ ! -z ${EGIT_COMMIT} ]]; then
3453 + eerror "Commits must now be specified using the environmental variables"
3454 + eerror "WINE_COMMIT, and D3D9_COMMIT"
3455 + eerror
3456 + return 1
3457 + fi
3458 +}
3459 +
3460 +pkg_pretend() {
3461 + wine_build_environment_check || die
3462 +
3463 + # Verify OSS support
3464 + if use oss && ! use kernel_FreeBSD; then
3465 + if ! has_version ">=media-sound/oss-4"; then
3466 + eerror "You cannot build wine with USE=oss without having support from a"
3467 + eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
3468 + eerror
3469 + die
3470 + fi
3471 + fi
3472 +}
3473 +
3474 +pkg_setup() {
3475 + wine_build_environment_check || die
3476 + wine_env_vcs_vars || die
3477 +
3478 + WINE_VARIANT="${PN#wine}-${PV}"
3479 + WINE_VARIANT="${WINE_VARIANT#-}"
3480 +
3481 + MY_PREFIX="${EPREFIX}/usr/lib/wine-${WINE_VARIANT}"
3482 + MY_DATAROOTDIR="${EPREFIX}/usr/share/wine-${WINE_VARIANT}"
3483 + MY_DATADIR="${MY_DATAROOTDIR}"
3484 + MY_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"
3485 + MY_INCLUDEDIR="${EPREFIX}/usr/include/wine-${WINE_VARIANT}"
3486 + MY_LIBEXECDIR="${EPREFIX}/usr/libexec/wine-${WINE_VARIANT}"
3487 + MY_LOCALSTATEDIR="${EPREFIX}/var/wine-${WINE_VARIANT}"
3488 + MY_MANDIR="${MY_DATADIR}/man"
3489 +}
3490 +
3491 +src_unpack() {
3492 + if [[ ${PV} == "9999" ]] ; then
3493 + EGIT_CHECKOUT_DIR="${S}" EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
3494 + if use d3d9; then
3495 + git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
3496 + git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
3497 + fi
3498 + fi
3499 +
3500 + default
3501 +
3502 + l10n_find_plocales_changes "${S}/po" "" ".po"
3503 +}
3504 +
3505 +src_prepare() {
3506 + local md5="$(md5sum server/protocol.def)"
3507 + local PATCHES=(
3508 + "${FILESDIR}"/${MY_PN}-1.5.26-winegcc.patch #260726
3509 + "${FILESDIR}"/${MY_PN}-1.9.5-multilib-portage.patch #395615
3510 + "${FILESDIR}"/${MY_PN}-1.7.12-osmesa-check.patch #429386
3511 + "${FILESDIR}"/${MY_PN}-1.6-memset-O3.patch #480508
3512 + "${FILESDIR}"/${MY_PN}-2.0-multislot-apploader.patch
3513 + )
3514 + if use d3d9; then
3515 + PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
3516 + PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
3517 + fi
3518 +
3519 + default
3520 + eautoreconf
3521 +
3522 + # Modification of the server protocol requires regenerating the server requests
3523 + if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
3524 + einfo "server/protocol.def was patched; running tools/make_requests"
3525 + tools/make_requests || die #432348
3526 + fi
3527 + sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
3528 + if ! use run-exes; then
3529 + sed -i '/^MimeType/d' loader/wine.desktop || die #117785
3530 + fi
3531 +
3532 + # Edit wine.desktop to work for specific variant
3533 + sed -e "/^Exec=/s/wine /wine-${WINE_VARIANT} /" -i loader/wine.desktop || die
3534 +
3535 + # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
3536 + cp "${WORKDIR}/${WINE_DESKTOP_COMMON_P}/icons/oic_winlogo.ico" dlls/user32/resources/ || die
3537 +
3538 + l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
3539 +}
3540 +
3541 +src_configure() {
3542 + wine_compiler_check || die
3543 +
3544 + export LDCONFIG=/bin/true
3545 + use custom-cflags || strip-flags
3546 +
3547 + multilib-minimal_src_configure
3548 +}
3549 +
3550 +multilib_src_configure() {
3551 + local myconf=(
3552 + --prefix="${MY_PREFIX}"
3553 + --datarootdir="${MY_DATAROOTDIR}"
3554 + --datadir="${MY_DATADIR}"
3555 + --docdir="${MY_DOCDIR}"
3556 + --includedir="${MY_INCLUDEDIR}"
3557 + --libdir="${EPREFIX}/usr/$(get_libdir)/wine-${WINE_VARIANT}"
3558 + --libexecdir="${MY_LIBEXECDIR}"
3559 + --localstatedir="${MY_LOCALSTATEDIR}"
3560 + --mandir="${MY_MANDIR}"
3561 + --sysconfdir=/etc/wine
3562 + $(use_with alsa)
3563 + $(use_with capi)
3564 + $(use_with lcms cms)
3565 + $(use_with cups)
3566 + $(use_with ncurses curses)
3567 + $(use_with udisks dbus)
3568 + $(use_with fontconfig)
3569 + $(use_with ssl gnutls)
3570 + $(use_enable gecko mshtml)
3571 + $(use_with gphoto2 gphoto)
3572 + $(use_with gsm)
3573 + $(use_with gstreamer)
3574 + --without-hal
3575 + $(use_with jpeg)
3576 + $(use_with ldap)
3577 + $(use_enable mono mscoree)
3578 + $(use_with mp3 mpg123)
3579 + $(use_with netapi)
3580 + $(use_with nls gettext)
3581 + $(use_with openal)
3582 + $(use_with opencl)
3583 + $(use_with opengl)
3584 + $(use_with osmesa)
3585 + $(use_with oss)
3586 + $(use_with pcap)
3587 + $(use_with png)
3588 + $(use_with pulseaudio pulse)
3589 + $(use_with threads pthread)
3590 + $(use_with scanner sane)
3591 + $(use_enable test tests)
3592 + $(use_with truetype freetype)
3593 + $(use_with udev)
3594 + $(use_with v4l)
3595 + $(use_with X x)
3596 + $(use_with xcomposite)
3597 + $(use_with xinerama)
3598 + $(use_with xml)
3599 + $(use_with xml xslt)
3600 + )
3601 +
3602 + use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
3603 +
3604 + local PKG_CONFIG AR RANLIB
3605 + # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
3606 + # set AR and RANLIB to make QA scripts happy; #483342
3607 + tc-export PKG_CONFIG AR RANLIB
3608 +
3609 + if use amd64; then
3610 + if [[ ${ABI} == amd64 ]]; then
3611 + myconf+=( --enable-win64 )
3612 + else
3613 + myconf+=( --disable-win64 )
3614 + fi
3615 +
3616 + # Note: using --with-wine64 results in problems with multilib.eclass
3617 + # CC/LD hackery. We're using separate tools instead.
3618 + fi
3619 +
3620 + ECONF_SOURCE=${S} \
3621 + econf "${myconf[@]}"
3622 + emake depend
3623 +}
3624 +
3625 +multilib_src_test() {
3626 + # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
3627 + if [[ ${ABI} == x86 ]]; then
3628 + if [[ $(id -u) == 0 ]]; then
3629 + ewarn "Skipping tests since they cannot be run under the root user."
3630 + ewarn "To run the test ${MY_PN} suite, add userpriv to FEATURES in make.conf"
3631 + return
3632 + fi
3633 +
3634 + WINEPREFIX="${T}/.wine-${ABI}" \
3635 + Xemake test
3636 + fi
3637 +}
3638 +
3639 +multilib_src_install_all() {
3640 + local DOCS=( ANNOUNCE AUTHORS README )
3641 + local l
3642 + add_locale_docs() {
3643 + local locale_doc="documentation/README.$1"
3644 + [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
3645 + }
3646 + l10n_for_each_locale_do add_locale_docs
3647 +
3648 + einstalldocs
3649 + prune_libtool_files --all
3650 +
3651 + if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
3652 + rm "${D%/}${MY_PREFIX}"/bin/{wine{dump,maker},function_grep.pl} \
3653 + "${D%/}${MY_MANDIR}"/man1/wine{dump,maker}.1 || die
3654 + fi
3655 +
3656 + # Remove wineconsole if neither backend is installed #551124
3657 + if ! use X && ! use ncurses; then
3658 + rm "${D%/}${MY_PREFIX}"/bin/wineconsole* || die
3659 + rm "${D%/}${MY_MANDIR}"/man1/wineconsole* || die
3660 + rm_wineconsole() {
3661 + rm "${D%/}${MY_PREFIX}/$(get_libdir)"/wine/{,fakedlls/}wineconsole.exe* || die
3662 + }
3663 + multilib_foreach_abi rm_wineconsole
3664 + fi
3665 +
3666 + use abi_x86_32 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine{,-preloader} #255055
3667 + use abi_x86_64 && pax-mark psmr "${D%/}${MY_PREFIX}"/bin/wine64{,-preloader}
3668 +
3669 + if use abi_x86_64 && ! use abi_x86_32; then
3670 + dosym "${MY_PREFIX}"/bin/wine{64,} # 404331
3671 + dosym "${MY_PREFIX}"/bin/wine{64,}-preloader
3672 + fi
3673 +
3674 + # Make wrappers for binaries for handling multiple variants
3675 + # Note: wrappers instead of symlinks because some are shell which use basename
3676 + for b in "${D%/}${MY_PREFIX}"/bin/*; do
3677 + make_wrapper ${b##*/}-${WINE_VARIANT} "${MY_PREFIX}"/bin/${b##*/}
3678 + done
3679 +
3680 + # respect LINGUAS when installing man pages, #469418
3681 + for l in de fr pl; do
3682 + use linguas_${l} || rm -r "${D%/}${MY_MANDIR}"/${l}*
3683 + done
3684 +
3685 + for m in "${D%/}${MY_MANDIR}"/*/*; do
3686 + new_man=${m##*/}
3687 + new_man=${new_man%%.1}
3688 + newman "${m}" ${new_man##*/}-${WINE_VARIANT}.1
3689 + done
3690 +}
3691 +
3692 +pkg_postinst() {
3693 + eselect wine register ${P}
3694 + if [[ ${PN} == "wine-vanilla" ]]; then
3695 + eselect wine register --vanilla ${P} || die
3696 + else
3697 + if use d3d9; then
3698 + eselect wine register --d3d9 ${P} || die
3699 + fi
3700 + fi
3701 +
3702 + eselect wine update --all --if-unset || die
3703 +
3704 + fdo-mime_desktop_database_update
3705 +
3706 + if ! use gecko; then
3707 + ewarn "Without Wine Gecko, wine prefixes will not have a default"
3708 + ewarn "implementation of iexplore. Many older windows applications"
3709 + ewarn "rely upon the existence of an iexplore implementation, so"
3710 + ewarn "you will likely need to install an external one, like via winetricks"
3711 + fi
3712 + if ! use mono; then
3713 + ewarn "Without Wine Mono, wine prefixes will not have a default"
3714 + ewarn "implementation of .NET. Many windows applications rely upon"
3715 + ewarn "the existence of a .NET implementation, so you will likely need"
3716 + ewarn "to install an external one, like via winetricks"
3717 + fi
3718 +}
3719 +
3720 +pkg_prerm() {
3721 + eselect wine deregister ${P}
3722 + if [[ ${PN} == "wine-vanilla" ]]; then
3723 + eselect wine deregister --vanilla ${P} || die
3724 + else
3725 + if use d3d9; then
3726 + eselect wine deregister --d3d9 ${P} || die
3727 + fi
3728 + fi
3729 +
3730 + eselect wine update --all --if-unset || die
3731 +}
3732 +
3733 +pkg_postrm() {
3734 + fdo-mime_desktop_database_update
3735 +}