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