parent
e5f4bc5eec
commit
ff4f5cda9b
@ -0,0 +1,629 @@
|
||||
From 9e081cd4a04e3326d4927aa082695f15432590e2 Mon Sep 17 00:00:00 2001
|
||||
From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
|
||||
Date: Thu, 14 Aug 2014 11:49:20 +0200
|
||||
Subject: [PATCH] TESTING -- override pthreads to fix gstreamer v4
|
||||
|
||||
I believe the code is ready and will work properly now in all cases.
|
||||
but please test before cherry picking this patch, and report
|
||||
success or failure to me please.
|
||||
|
||||
Changes since v1:
|
||||
- Call pthread_yield to make sure that we link against libpthread.
|
||||
This fixes the build on saucy.
|
||||
Changes since v2:
|
||||
- Set thread_data->detached before creating the thread to prevent
|
||||
a race condition.
|
||||
Changes since v3:
|
||||
- Set thread_data->detached CORRECTLY. Fix a small race between
|
||||
thread creation and pthread_detach.
|
||||
---
|
||||
dlls/ntdll/ntdll_misc.h | 3 +
|
||||
dlls/ntdll/thread.c | 307 +++++++++++++++++++++++++++++++++++++--
|
||||
dlls/winegstreamer/glibthread.c | 13 ++
|
||||
libs/wine/loader.c | 7 +
|
||||
libs/wine/wine.map | 6 +
|
||||
loader/Makefile.in | 2 +-
|
||||
loader/main.c | 41 +++++
|
||||
7 files changed, 362 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 4370084..1af819b 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "winnt.h"
|
||||
#include "winternl.h"
|
||||
#include "wine/server.h"
|
||||
+#include "wine/list.h"
|
||||
|
||||
#define MAX_NT_PATH_LENGTH 277
|
||||
|
||||
@@ -235,6 +236,8 @@ struct ntdll_thread_data
|
||||
WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */
|
||||
void *exit_frame; /* 204 exit frame pointer */
|
||||
#endif
|
||||
+ struct list entry;
|
||||
+ BOOL detached;
|
||||
};
|
||||
|
||||
static inline struct ntdll_thread_data *ntdll_get_thread_data(void)
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index c8461b0..8d5470e 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -33,6 +33,7 @@
|
||||
#ifdef HAVE_SYS_SYSCALL_H
|
||||
#include <sys/syscall.h>
|
||||
#endif
|
||||
+#include <errno.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
#include "ntstatus.h"
|
||||
@@ -58,6 +59,7 @@ struct startup_info
|
||||
TEB *teb;
|
||||
PRTL_THREAD_START_ROUTINE entry_point;
|
||||
void *entry_arg;
|
||||
+ BOOL native_thread;
|
||||
};
|
||||
|
||||
static PEB *peb;
|
||||
@@ -202,6 +204,78 @@ static ULONG get_dyld_image_info_addr(void)
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef __linux__
|
||||
+extern typeof(pthread_create) *__glob_pthread_create, *call_pthread_create;
|
||||
+extern typeof(pthread_join) *__glob_pthread_join, *call_pthread_join;
|
||||
+extern typeof(pthread_detach) *__glob_pthread_detach, *call_pthread_detach;
|
||||
+
|
||||
+static typeof(pthread_create) __hook_pthread_create;
|
||||
+static typeof(pthread_join) __hook_pthread_join;
|
||||
+static typeof(pthread_detach) __hook_pthread_detach;
|
||||
+
|
||||
+static pthread_mutex_t thread_lock;
|
||||
+
|
||||
+static void thread_wrap_init(void)
|
||||
+{
|
||||
+ pthread_mutexattr_t attr;
|
||||
+ pthread_mutexattr_init(&attr);
|
||||
+ pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST);
|
||||
+ pthread_mutex_init(&thread_lock, &attr);
|
||||
+ pthread_mutexattr_destroy(&attr);
|
||||
+
|
||||
+ call_pthread_create = __hook_pthread_create;
|
||||
+ call_pthread_join = __hook_pthread_join;
|
||||
+ call_pthread_detach = __hook_pthread_detach;
|
||||
+}
|
||||
+
|
||||
+static TEB *dead_teb;
|
||||
+static struct list active_list = LIST_INIT(active_list);
|
||||
+
|
||||
+static void take_thread_lock(void)
|
||||
+{
|
||||
+ int ret = pthread_mutex_lock(&thread_lock);
|
||||
+ if (ret == EOWNERDEAD)
|
||||
+ pthread_mutex_consistent(&thread_lock);
|
||||
+}
|
||||
+
|
||||
+static void detach_thread_unlock(TEB *own_teb)
|
||||
+{
|
||||
+ struct ntdll_thread_data *thread_data;
|
||||
+ TEB *teb = dead_teb;
|
||||
+
|
||||
+ dead_teb = own_teb;
|
||||
+
|
||||
+ pthread_mutex_unlock(&thread_lock);
|
||||
+ if (!teb)
|
||||
+ return;
|
||||
+
|
||||
+ thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
|
||||
+ __glob_pthread_join(thread_data->pthread_id, NULL);
|
||||
+ signal_free_thread(teb);
|
||||
+}
|
||||
+
|
||||
+static void reap_thread(TEB *teb)
|
||||
+{
|
||||
+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
|
||||
+ take_thread_lock();
|
||||
+ if (thread_data->detached)
|
||||
+ detach_thread_unlock(teb);
|
||||
+ else {
|
||||
+ /*
|
||||
+ * Do not unlock, wait until the thread is thoroughly dead.
|
||||
+ * This prevents a race condition where detach is called
|
||||
+ * after the thread has not finished dying yet.
|
||||
+ */
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+#define __glob_pthread_create pthread_create
|
||||
+#define __glob_pthread_join pthread_join
|
||||
+#define __glob_pthread_detach pthread_detach
|
||||
+#define thread_wrap_init()
|
||||
+#endif
|
||||
+
|
||||
/***********************************************************************
|
||||
* thread_init
|
||||
*
|
||||
@@ -220,6 +294,7 @@ HANDLE thread_init(void)
|
||||
struct ntdll_thread_data *thread_data;
|
||||
static struct debug_info debug_info; /* debug info for initial thread */
|
||||
|
||||
+ thread_wrap_init();
|
||||
virtual_init();
|
||||
|
||||
/* reserve space for shared user data */
|
||||
@@ -349,14 +424,12 @@ void terminate_thread( int status )
|
||||
pthread_exit( UIntToPtr(status) );
|
||||
}
|
||||
|
||||
-
|
||||
-/***********************************************************************
|
||||
- * exit_thread
|
||||
- */
|
||||
-void exit_thread( int status )
|
||||
+static void exit_thread_common( int status )
|
||||
{
|
||||
+#ifndef __linux__
|
||||
static void *prev_teb;
|
||||
TEB *teb;
|
||||
+#endif
|
||||
|
||||
if (status) /* send the exit code to the server (0 is already the default) */
|
||||
{
|
||||
@@ -380,24 +453,177 @@ void exit_thread( int status )
|
||||
|
||||
pthread_sigmask( SIG_BLOCK, &server_block_set, NULL );
|
||||
|
||||
+#ifndef __linux__
|
||||
if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() )))
|
||||
{
|
||||
struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
|
||||
|
||||
if (thread_data->pthread_id)
|
||||
{
|
||||
- pthread_join( thread_data->pthread_id, NULL );
|
||||
+ __glob_pthread_join( thread_data->pthread_id, NULL );
|
||||
signal_free_thread( teb );
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+ reap_thread(NtCurrentTeb());
|
||||
+#endif
|
||||
|
||||
close( ntdll_get_thread_data()->wait_fd[0] );
|
||||
close( ntdll_get_thread_data()->wait_fd[1] );
|
||||
close( ntdll_get_thread_data()->reply_fd );
|
||||
close( ntdll_get_thread_data()->request_fd );
|
||||
+}
|
||||
+
|
||||
+void exit_thread( int status )
|
||||
+{
|
||||
+ exit_thread_common(status);
|
||||
pthread_exit( UIntToPtr(status) );
|
||||
}
|
||||
|
||||
+#ifdef __linux__
|
||||
+
|
||||
+struct unix_arg {
|
||||
+ void *(*start)(void *);
|
||||
+ void *arg;
|
||||
+};
|
||||
+
|
||||
+/* dummy used for comparison */
|
||||
+static DWORD native_unix_start;
|
||||
+
|
||||
+static void call_native_cleanup(void *arg)
|
||||
+{
|
||||
+ exit_thread_common(0);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+__hook_pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
||||
+ void *(*start_routine) (void *), void *parm)
|
||||
+{
|
||||
+ NTSTATUS ret;
|
||||
+ pthread_t tid;
|
||||
+ size_t stack = 8 * 1024 * 1024;
|
||||
+ struct unix_arg arg;
|
||||
+ arg.start = start_routine;
|
||||
+ arg.arg = parm;
|
||||
+
|
||||
+ if (!thread)
|
||||
+ thread = &tid;
|
||||
+
|
||||
+ TRACE("Overriding thread creation!\n");
|
||||
+ if (attr) {
|
||||
+ static int once;
|
||||
+ if (!once++)
|
||||
+ FIXME("most thread attributes ignored!\n");
|
||||
+ else
|
||||
+ WARN("most thread attributes ignored!\n");
|
||||
+
|
||||
+ pthread_attr_getstacksize(attr, &stack);
|
||||
+ }
|
||||
+
|
||||
+ ret = RtlCreateUserThread( NtCurrentProcess(), NULL, FALSE, NULL, stack, 0, (void*)&native_unix_start, &arg, NULL, (void*)thread );
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ FIXME("ret: %08x\n", ret);
|
||||
+ switch (ret) {
|
||||
+ case STATUS_SUCCESS:
|
||||
+ TRACE("created thread %lx for %p/%p\n", *thread, start_routine, parm);
|
||||
+ return 0;
|
||||
+ case STATUS_NO_MEMORY:
|
||||
+ return ENOMEM;
|
||||
+ case STATUS_TOO_MANY_OPENED_FILES:
|
||||
+ return EMFILE;
|
||||
+ default:
|
||||
+ ERR("Unhandled ntstatus %08x\n", ret);
|
||||
+ return ENOMEM;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int __hook_pthread_detach(pthread_t thread)
|
||||
+{
|
||||
+ struct ntdll_thread_data *thread_data;
|
||||
+ TEB *teb = NULL;
|
||||
+
|
||||
+ if (pthread_equal(thread, pthread_self())) {
|
||||
+ TRACE("Detached self: %lx\n", pthread_self());
|
||||
+ ntdll_get_thread_data()->detached = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ take_thread_lock();
|
||||
+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) {
|
||||
+ if (pthread_equal(thread_data->pthread_id, thread)) {
|
||||
+ teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1);
|
||||
+
|
||||
+ list_remove(&thread_data->entry);
|
||||
+ if (!pthread_tryjoin_np(thread, NULL)) {
|
||||
+ detach_thread_unlock(NULL);
|
||||
+ TRACE("Thread %lx was dead, cleaning up\n", thread);
|
||||
+ signal_free_thread(teb);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ thread_data->detached = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ detach_thread_unlock(NULL);
|
||||
+ if (!teb)
|
||||
+ TRACE("Could not find thread %lx to detach\n", thread);
|
||||
+ else
|
||||
+ TRACE("Changed thread %lx to detached\n", thread);
|
||||
+ return teb ? 0 : ESRCH;
|
||||
+}
|
||||
+
|
||||
+static int __hook_pthread_join(pthread_t thread, void **retval)
|
||||
+{
|
||||
+ struct ntdll_thread_data *thread_data, *t2;
|
||||
+ int ret = ESRCH;
|
||||
+
|
||||
+ if (pthread_equal(thread, pthread_self()))
|
||||
+ return EDEADLK;
|
||||
+
|
||||
+ take_thread_lock();
|
||||
+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) {
|
||||
+ TEB *teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1);
|
||||
+
|
||||
+ if (pthread_equal(thread, thread_data->pthread_id)) {
|
||||
+
|
||||
+ ret = pthread_tryjoin_np(thread, retval);
|
||||
+ if (!ret) {
|
||||
+ TRACE("Thread %lx was dead fastpath, cleaning up\n", thread);
|
||||
+ goto free;
|
||||
+ }
|
||||
+ detach_thread_unlock(NULL);
|
||||
+
|
||||
+ ret = __glob_pthread_join(thread, retval);
|
||||
+ if (ret) {
|
||||
+ TRACE("Thread %lx join failed with %i, ignoring\n", thread, ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ take_thread_lock();
|
||||
+ /* Check if someone else freed the thread yet */
|
||||
+ LIST_FOR_EACH_ENTRY(t2, &active_list, typeof(*thread_data), entry)
|
||||
+ if (t2 == thread_data) {
|
||||
+ TRACE("Cleaning up after successful join\n");
|
||||
+ goto free;
|
||||
+ }
|
||||
+ TRACE("No clean up after successful join, multiple pthread_join's?\n");
|
||||
+ break;
|
||||
+
|
||||
+free:
|
||||
+ list_remove(&thread_data->entry);
|
||||
+ detach_thread_unlock(NULL);
|
||||
+ signal_free_thread(teb);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ detach_thread_unlock(NULL);
|
||||
+ if (ret)
|
||||
+ TRACE("failed with %i\n", ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
|
||||
/***********************************************************************
|
||||
* start_thread
|
||||
@@ -426,9 +652,19 @@ static void start_thread( struct startup_info *info )
|
||||
if (TRACE_ON(relay))
|
||||
DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg );
|
||||
|
||||
- call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg );
|
||||
-}
|
||||
+#ifdef __linux__
|
||||
+ if (info->native_thread) {
|
||||
+ void *(*start)(void*) = (void*)func;
|
||||
|
||||
+ FIXME("Started native thread %08x\n", GetCurrentThreadId());
|
||||
+ pthread_cleanup_push(call_native_cleanup, NULL);
|
||||
+ pthread_exit(start(arg));
|
||||
+ pthread_cleanup_pop(1);
|
||||
+ return;
|
||||
+ }
|
||||
+#endif
|
||||
+ call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg );
|
||||
+}
|
||||
|
||||
/***********************************************************************
|
||||
* RtlCreateUserThread (NTDLL.@)
|
||||
@@ -440,14 +676,13 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
|
||||
HANDLE *handle_ptr, CLIENT_ID *id )
|
||||
{
|
||||
sigset_t sigset;
|
||||
- pthread_t pthread_id;
|
||||
pthread_attr_t attr;
|
||||
struct ntdll_thread_data *thread_data;
|
||||
struct startup_info *info = NULL;
|
||||
HANDLE handle = 0, actctx = 0;
|
||||
TEB *teb = NULL;
|
||||
DWORD tid = 0;
|
||||
- int request_pipe[2];
|
||||
+ int request_pipe[2], ret;
|
||||
NTSTATUS status;
|
||||
|
||||
if (process != NtCurrentProcess())
|
||||
@@ -472,10 +707,14 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
|
||||
if (handle_ptr) *handle_ptr = wine_server_ptr_handle( result.create_thread.handle );
|
||||
else NtClose( wine_server_ptr_handle( result.create_thread.handle ));
|
||||
}
|
||||
+ TRACE("CreateThread for other process returns %08x\n", result.create_thread.status);
|
||||
return result.create_thread.status;
|
||||
}
|
||||
|
||||
- if (server_pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES;
|
||||
+ if (server_pipe( request_pipe ) == -1) {
|
||||
+ TRACE("CreateThread cannot create request pipe: %m\n");
|
||||
+ return STATUS_TOO_MANY_OPENED_FILES;
|
||||
+ }
|
||||
wine_server_send_fd( request_pipe[0] );
|
||||
|
||||
SERVER_START_REQ( new_thread )
|
||||
@@ -496,12 +735,16 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
|
||||
if (status)
|
||||
{
|
||||
close( request_pipe[1] );
|
||||
+ TRACE("CreateThread server request failed with %08x\n", status);
|
||||
return status;
|
||||
}
|
||||
|
||||
pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset );
|
||||
|
||||
- if ((status = signal_alloc_thread( &teb ))) goto error;
|
||||
+ if ((status = signal_alloc_thread( &teb ))) {
|
||||
+ TRACE("CreateThread signal thread allocation failed with %08x\n", status);
|
||||
+ goto error;
|
||||
+ }
|
||||
|
||||
teb->Peb = NtCurrentTeb()->Peb;
|
||||
teb->ClientId.UniqueProcess = ULongToHandle(GetCurrentProcessId());
|
||||
@@ -524,32 +767,64 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
|
||||
|
||||
info = (struct startup_info *)(teb + 1);
|
||||
info->teb = teb;
|
||||
- info->entry_point = start;
|
||||
- info->entry_arg = param;
|
||||
+#ifdef __linux__
|
||||
+ info->native_thread = (void*)start == (void*)&native_unix_start;
|
||||
+ if (info->native_thread) {
|
||||
+ struct unix_arg *arg = param;
|
||||
+ info->entry_point = (void*)arg->start;
|
||||
+ info->entry_arg = arg->arg;
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
+ info->entry_point = start;
|
||||
+ info->entry_arg = param;
|
||||
+ }
|
||||
|
||||
thread_data = (struct ntdll_thread_data *)teb->SpareBytes1;
|
||||
+#ifdef __linux__
|
||||
+ thread_data->detached = !info->native_thread;
|
||||
+#endif
|
||||
thread_data->request_fd = request_pipe[1];
|
||||
thread_data->reply_fd = -1;
|
||||
thread_data->wait_fd[0] = -1;
|
||||
thread_data->wait_fd[1] = -1;
|
||||
+ thread_data->entry.next = NULL;
|
||||
|
||||
- if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) goto error;
|
||||
+ if ((status = virtual_alloc_thread_stack( teb, stack_reserve ?: (8 << 20), stack_commit ?: (1 << 20) ))) {
|
||||
+ TRACE("Allocating virtual stack for %p (%li/%li) failed with %08x\n", start, stack_reserve, stack_commit, status);
|
||||
+ goto error;
|
||||
+ }
|
||||
|
||||
pthread_attr_init( &attr );
|
||||
pthread_attr_setstack( &attr, teb->DeallocationStack,
|
||||
(char *)teb->Tib.StackBase - (char *)teb->DeallocationStack );
|
||||
pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */
|
||||
interlocked_xchg_add( &nb_threads, 1 );
|
||||
- if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info ))
|
||||
+
|
||||
+ take_thread_lock();
|
||||
+ ret = __glob_pthread_create( &thread_data->pthread_id, &attr, (void * (*)(void *))start_thread, info );
|
||||
+ if (ret)
|
||||
{
|
||||
+ TRACE("pthread create failed with %i/%m\n", ret);
|
||||
interlocked_xchg_add( &nb_threads, -1 );
|
||||
pthread_attr_destroy( &attr );
|
||||
status = STATUS_NO_MEMORY;
|
||||
goto error;
|
||||
}
|
||||
+ if (!thread_data->detached)
|
||||
+ list_add_tail(&active_list, &thread_data->entry);
|
||||
+ detach_thread_unlock(NULL);
|
||||
+
|
||||
pthread_attr_destroy( &attr );
|
||||
pthread_sigmask( SIG_SETMASK, &sigset, NULL );
|
||||
|
||||
+ TRACE("Created thread succesfully, win handle: %04x, pthread: %lx\n", tid, thread_data->pthread_id);
|
||||
+
|
||||
+#ifdef __linux__
|
||||
+ if ((void*)start == (void*)&native_unix_start && id)
|
||||
+ *(pthread_t*)id = thread_data->pthread_id;
|
||||
+ else
|
||||
+#endif
|
||||
if (id) id->UniqueThread = ULongToHandle(tid);
|
||||
if (handle_ptr) *handle_ptr = handle;
|
||||
else NtClose( handle );
|
||||
diff --git a/dlls/winegstreamer/glibthread.c b/dlls/winegstreamer/glibthread.c
|
||||
index 0d829a0..46e22f4 100644
|
||||
--- a/dlls/winegstreamer/glibthread.c
|
||||
+++ b/dlls/winegstreamer/glibthread.c
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
+#if 0
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
@@ -388,3 +389,15 @@ void g_thread_impl_init (void)
|
||||
g_thread_self_tls = TlsAlloc ();
|
||||
g_thread_init(&g_thread_functions_for_glib_use_default);
|
||||
}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+void g_thread_impl_init (void)
|
||||
+{
|
||||
+ static gboolean beenhere = FALSE;
|
||||
+
|
||||
+ if (!beenhere++)
|
||||
+ g_thread_init(NULL);
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
diff --git a/libs/wine/loader.c b/libs/wine/loader.c
|
||||
index 7261522..a8c31b9 100644
|
||||
--- a/libs/wine/loader.c
|
||||
+++ b/libs/wine/loader.c
|
||||
@@ -73,6 +73,13 @@ char **__wine_main_argv = NULL;
|
||||
WCHAR **__wine_main_wargv = NULL;
|
||||
char **__wine_main_environ = NULL;
|
||||
|
||||
+#ifdef __linux__
|
||||
+#include <pthread.h>
|
||||
+typeof(pthread_create) *call_pthread_create, *__glob_pthread_create;
|
||||
+typeof(pthread_join) *call_pthread_join, *__glob_pthread_join;
|
||||
+typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach;
|
||||
+#endif
|
||||
+
|
||||
struct dll_path_context
|
||||
{
|
||||
unsigned int index; /* current index in the dll path list */
|
||||
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
|
||||
index 2159fac..fb3b951 100644
|
||||
--- a/libs/wine/wine.map
|
||||
+++ b/libs/wine/wine.map
|
||||
@@ -117,6 +117,12 @@ WINE_1.0
|
||||
wine_utf8_mbstowcs;
|
||||
wine_utf8_wcstombs;
|
||||
wine_wctype_table;
|
||||
+ __glob_pthread_create;
|
||||
+ call_pthread_create;
|
||||
+ __glob_pthread_join;
|
||||
+ call_pthread_join;
|
||||
+ __glob_pthread_detach;
|
||||
+ call_pthread_detach;
|
||||
|
||||
local: *;
|
||||
};
|
||||
diff --git a/loader/Makefile.in b/loader/Makefile.in
|
||||
index 95e4798..a18dd02 100644
|
||||
--- a/loader/Makefile.in
|
||||
+++ b/loader/Makefile.in
|
||||
@@ -1,4 +1,4 @@
|
||||
-EXTRALIBS = $(PTHREAD_LIBS)
|
||||
+EXTRALIBS = $(PTHREAD_LIBS) $(DL_LIBS)
|
||||
|
||||
C_SRCS = \
|
||||
main.c \
|
||||
diff --git a/loader/main.c b/loader/main.c
|
||||
index ac67290..76609e1 100644
|
||||
--- a/loader/main.c
|
||||
+++ b/loader/main.c
|
||||
@@ -202,6 +202,45 @@ static int pre_exec(void)
|
||||
|
||||
#endif
|
||||
|
||||
+#ifdef __linux__
|
||||
+
|
||||
+extern typeof(pthread_create) *call_pthread_create, *__glob_pthread_create;
|
||||
+extern typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach;
|
||||
+extern typeof(pthread_join) *call_pthread_join, *__glob_pthread_join;
|
||||
+
|
||||
+int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
||||
+ void *(*start_routine) (void *), void *arg)
|
||||
+{
|
||||
+ return call_pthread_create(thread, attr, start_routine, arg);
|
||||
+}
|
||||
+
|
||||
+int pthread_detach(pthread_t thread)
|
||||
+{
|
||||
+ return call_pthread_detach(thread);
|
||||
+}
|
||||
+
|
||||
+int pthread_join(pthread_t thread, void **retval)
|
||||
+{
|
||||
+ return call_pthread_join(thread, retval);
|
||||
+}
|
||||
+
|
||||
+static void init_thread_hook(void) {
|
||||
+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.2.5");
|
||||
+ if (!__glob_pthread_create)
|
||||
+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.1");
|
||||
+
|
||||
+ call_pthread_detach = __glob_pthread_detach = dlsym(RTLD_NEXT, "pthread_detach");
|
||||
+ call_pthread_join = __glob_pthread_join = dlsym(RTLD_NEXT, "pthread_join");
|
||||
+
|
||||
+ /* Call a function from libpthread to ensure being linked against it */
|
||||
+ pthread_yield();
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+#define init_thread_hook()
|
||||
+
|
||||
+#endif
|
||||
|
||||
/**********************************************************************
|
||||
* main
|
||||
@@ -211,6 +250,8 @@ int main( int argc, char *argv[] )
|
||||
char error[1024];
|
||||
int i;
|
||||
|
||||
+ init_thread_hook();
|
||||
+
|
||||
if (!getenv( "WINELOADERNOEXEC" )) /* first time around */
|
||||
{
|
||||
static char noexec[] = "WINELOADERNOEXEC=1";
|
||||
--
|
||||
1.7.6.6.GIT
|
||||
|
@ -0,0 +1,498 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.7.22.ebuild,v 1.1 2014/10/05 13:17:36 ryao Exp $
|
||||
|
||||
EAPI="5"
|
||||
|
||||
AUTOTOOLS_AUTORECONF=1
|
||||
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"
|
||||
PLOCALE_BACKUP="en"
|
||||
|
||||
inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
|
||||
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
|
||||
inherit git-2
|
||||
SRC_URI=""
|
||||
#KEYWORDS=""
|
||||
else
|
||||
MY_P="${PN}-${PV/_/-}"
|
||||
SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
|
||||
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
fi
|
||||
|
||||
GV="2.24"
|
||||
MV="4.5.2"
|
||||
PULSE_PATCHES="winepulse-patches-1.7.21"
|
||||
COMPHOLIOV="${PV}"
|
||||
COMPHOLIO_PATCHES="wine-compholio-${COMPHOLIOV}"
|
||||
WINE_GENTOO="wine-gentoo-2013.06.24"
|
||||
DESCRIPTION="Free implementation of Windows(tm) on Unix"
|
||||
HOMEPAGE="http://www.winehq.org/"
|
||||
SRC_URI="${SRC_URI}
|
||||
gecko? (
|
||||
abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
|
||||
abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
|
||||
)
|
||||
mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
|
||||
pipelight? ( https://github.com/compholio/wine-compholio-daily/archive/v${COMPHOLIOV}.tar.gz -> ${COMPHOLIO_PATCHES}.tar.gz )
|
||||
pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
|
||||
http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X xcomposite xinerama +xml"
|
||||
REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
|
||||
test? ( abi_x86_32 )
|
||||
elibc_glibc? ( threads )
|
||||
gstreamer? ( pulseaudio )
|
||||
mono? ( abi_x86_32 )
|
||||
osmesa? ( opengl )" #286560
|
||||
# winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
|
||||
|
||||
# FIXME: the test suite is unsuitable for us; many tests require net access
|
||||
# or fail due to Xvfb's opengl limitations.
|
||||
RESTRICT="test"
|
||||
|
||||
NATIVE_DEPEND="
|
||||
truetype? ( >=media-libs/freetype-2.0.0 )
|
||||
capi? ( net-dialup/capi4k-utils )
|
||||
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
||||
udisks? ( sys-apps/dbus )
|
||||
fontconfig? ( media-libs/fontconfig:= )
|
||||
gphoto2? ( media-libs/libgphoto2:= )
|
||||
openal? ( media-libs/openal:= )
|
||||
gstreamer? ( media-libs/gstreamer:0.10 media-libs/gst-plugins-base:0.10 )
|
||||
X? (
|
||||
x11-libs/libXcursor
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXi
|
||||
x11-libs/libXxf86vm
|
||||
)
|
||||
xinerama? ( x11-libs/libXinerama )
|
||||
alsa? ( media-libs/alsa-lib )
|
||||
cups? ( net-print/cups:= )
|
||||
opencl? ( virtual/opencl )
|
||||
opengl? (
|
||||
virtual/glu
|
||||
virtual/opengl
|
||||
)
|
||||
gsm? ( media-sound/gsm:= )
|
||||
jpeg? ( virtual/jpeg:0= )
|
||||
ldap? ( net-nds/openldap:= )
|
||||
lcms? ( media-libs/lcms:2= )
|
||||
mp3? ( >=media-sound/mpg123-1.5.0 )
|
||||
netapi? ( net-fs/samba[netapi(+)] )
|
||||
nls? ( sys-devel/gettext )
|
||||
odbc? ( dev-db/unixODBC:= )
|
||||
osmesa? ( media-libs/mesa[osmesa] )
|
||||
pipelight? ( sys-apps/attr )
|
||||
pulseaudio? ( media-sound/pulseaudio )
|
||||
xml? ( dev-libs/libxml2 dev-libs/libxslt )
|
||||
scanner? ( media-gfx/sane-backends:= )
|
||||
ssl? ( net-libs/gnutls:= )
|
||||
png? ( media-libs/libpng:0= )
|
||||
v4l? ( media-libs/libv4l )
|
||||
xcomposite? ( x11-libs/libXcomposite )"
|
||||
|
||||
COMMON_DEPEND="
|
||||
!amd64? ( ${NATIVE_DEPEND} )
|
||||
amd64? (
|
||||
abi_x86_64? ( ${NATIVE_DEPEND} )
|
||||
abi_x86_32? (
|
||||
truetype? ( || (
|
||||
>=app-emulation/emul-linux-x86-xlibs-2.1[development,-abi_x86_32(-)]
|
||||
>=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
|
||||
) )
|
||||
ncurses? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-libs/ncurses-5.9-r3[abi_x86_32(-)]
|
||||
) )
|
||||
udisks? ( || (
|
||||
>=app-emulation/emul-linux-x86-baselibs-20130224[development,-abi_x86_32(-)]
|
||||
>=sys-apps/dbus-1.6.18-r1[abi_x86_32(-)]
|
||||
) )
|
||||
fontconfig? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/fontconfig-2.10.92[abi_x86_32(-)]
|
||||
) )
|
||||
gphoto2? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libgphoto2-2.5.3.1[abi_x86_32(-)]
|
||||
) )
|
||||
openal? ( || (
|
||||
app-emulation/emul-linux-x86-sdl[development,-abi_x86_32(-)]
|
||||
>=media-libs/openal-1.15.1[abi_x86_32(-)]
|
||||
) )
|
||||
gstreamer? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=media-libs/gstreamer-0.10.36-r2:0.10[abi_x86_32(-)]
|
||||
>=media-libs/gst-plugins-base-0.10.36:0.10[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
X? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=x11-libs/libXcursor-1.1.14[abi_x86_32(-)]
|
||||
>=x11-libs/libXext-1.3.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXrandr-1.4.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXi-1.7.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXxf86vm-1.1.3[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
xinerama? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=x11-libs/libXinerama-1.1.3[abi_x86_32(-)]
|
||||
) )
|
||||
alsa? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[alsa,development,-abi_x86_32(-)]
|
||||
>=media-libs/alsa-lib-1.0.27.2[abi_x86_32(-)]
|
||||
) )
|
||||
cups? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs
|
||||
>=net-print/cups-1.7.1-r1[abi_x86_32(-)]
|
||||
) )
|
||||
opencl? ( >=virtual/opencl-0-r3[abi_x86_32(-)] )
|
||||
opengl? ( || (
|
||||
app-emulation/emul-linux-x86-opengl[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=virtual/glu-9.0-r1[abi_x86_32(-)]
|
||||
>=virtual/opengl-7.0-r1[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
gsm? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/gsm-1.0.13-r1[abi_x86_32(-)]
|
||||
) )
|
||||
jpeg? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=virtual/jpeg-0-r2:0[abi_x86_32(-)]
|
||||
) )
|
||||
ldap? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=net-nds/openldap-2.4.38-r1:=[abi_x86_32(-)]
|
||||
) )
|
||||
lcms? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/lcms-2.5:2[abi_x86_32(-)]
|
||||
) )
|
||||
mp3? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/mpg123-1.15.4[abi_x86_32(-)]
|
||||
) )
|
||||
netapi? ( >=net-fs/samba-3.6.23-r1[netapi(+),abi_x86_32(-)] )
|
||||
nls? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-devel/gettext-0.18.3.2[abi_x86_32(-)]
|
||||
) )
|
||||
odbc? ( || (
|
||||
app-emulation/emul-linux-x86-db[development,-abi_x86_32(-)]
|
||||
>=dev-db/unixODBC-2.3.2:=[abi_x86_32(-)]
|
||||
) )
|
||||
osmesa? ( || (
|
||||
>=app-emulation/emul-linux-x86-opengl-20121028[development,-abi_x86_32(-)]
|
||||
>=media-libs/mesa-9.1.6[osmesa,abi_x86_32(-)]
|
||||
) )
|
||||
pipelight? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-apps/attr-2.4.47-r1[abi_x86_32(-)]
|
||||
) )
|
||||
pulseaudio? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/pulseaudio-5.0[abi_x86_32(-)]
|
||||
) )
|
||||
xml? ( || (
|
||||
>=app-emulation/emul-linux-x86-baselibs-20131008[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=dev-libs/libxml2-2.9.1-r4[abi_x86_32(-)]
|
||||
>=dev-libs/libxslt-1.1.28-r1[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
scanner? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-gfx/sane-backends-1.0.23:=[abi_x86_32(-)]
|
||||
) )
|
||||
ssl? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=net-libs/gnutls-2.12.23-r6:=[abi_x86_32(-)]
|
||||
) )
|
||||
png? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libpng-1.6.10:0[abi_x86_32(-)]
|
||||
) )
|
||||
v4l? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libv4l-0.9.5[abi_x86_32(-)]
|
||||
) )
|
||||
xcomposite? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=x11-libs/libXcomposite-0.4.4-r1[abi_x86_32(-)]
|
||||
) )
|
||||
)
|
||||
)"
|
||||
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
dos? ( games-emulation/dosbox )
|
||||
perl? ( dev-lang/perl dev-perl/XML-Simple )
|
||||
samba? ( >=net-fs/samba-3.0.25 )
|
||||
selinux? ( sec-policy/selinux-wine )
|
||||
udisks? ( sys-fs/udisks:2 )
|
||||
pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
|
||||
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
amd64? ( abi_x86_32? ( !abi_x86_64? ( ${NATIVE_DEPEND} ) ) )
|
||||
X? (
|
||||
x11-proto/inputproto
|
||||
x11-proto/xextproto
|
||||
x11-proto/xf86vidmodeproto
|
||||
)
|
||||
xinerama? ( x11-proto/xineramaproto )
|
||||
prelink? ( sys-devel/prelink )
|
||||
>=sys-kernel/linux-headers-2.6
|
||||
virtual/pkgconfig
|
||||
virtual/yacc
|
||||
sys-devel/flex"
|
||||
|
||||
# These use a non-standard "Wine" category, which is provided by
|
||||
# /etc/xdg/applications-merged/wine.menu
|
||||
QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
|
||||
usr/share/applications/wine-notepad.desktop
|
||||
usr/share/applications/wine-uninstaller.desktop
|
||||
usr/share/applications/wine-winecfg.desktop"
|
||||
|
||||
wine_build_environment_check() {
|
||||
[[ ${MERGE_TYPE} = "binary" ]] && return 0
|
||||
|
||||
if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
|
||||
eerror "You need gcc-4.4+ to build 64-bit wine"
|
||||
eerror
|
||||
return 1
|
||||
fi
|
||||
|
||||
if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
|
||||
eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
|
||||
eerror "See https://bugs.gentoo.org/487864 for more details."
|
||||
eerror
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
wine_build_environment_check || die
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
wine_build_environment_check || die
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
git-2_src_unpack
|
||||
else
|
||||
unpack ${MY_P}.tar.bz2
|
||||
fi
|
||||
|
||||
use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
|
||||
if use pipelight; then
|
||||
unpack "${COMPHOLIO_PATCHES}.tar.gz"
|
||||
# we use a separate pulseaudio patchset
|
||||
rm -r "${COMPHOLIO_PATCHES}/patches/06-winepulse" || die
|
||||
# ... and need special tools for binary patches
|
||||
mv "${COMPHOLIO_PATCHES}/patches/10-Missing_Fonts" "${T}" || die
|
||||
fi
|
||||
unpack "${WINE_GENTOO}.tar.bz2"
|
||||
|
||||
l10n_find_plocales_changes "${S}/po" "" ".po"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
local md5="$(md5sum server/protocol.def)"
|
||||
local f
|
||||
local PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
|
||||
"${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
|
||||
"${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
|
||||
"${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
|
||||
)
|
||||
use pulseaudio && PATCHES+=(
|
||||
"../${PULSE_PATCHES}"/*.patch #421365
|
||||
)
|
||||
if use gstreamer; then
|
||||
# See http://bugs.winehq.org/show_bug.cgi?id=30557
|
||||
ewarn "Applying experimental patch to fix GStreamer support. Note that"
|
||||
ewarn "this patch has been reported to cause crashes in certain games."
|
||||
|
||||
PATCHES+=( "../${PULSE_PATCHES}"/gstreamer/*.patch )
|
||||
fi
|
||||
if use pipelight; then
|
||||
ewarn "Applying the unofficial Compholio patchset for Pipelight support,"
|
||||
ewarn "which is unsupported by Wine developers. Please don't report bugs"
|
||||
ewarn "to Wine bugzilla unless you can reproduce them with USE=-pipelight"
|
||||
|
||||
PATCHES+=(
|
||||
"../${COMPHOLIO_PATCHES}/patches"/*/*.patch #507950
|
||||
"../${COMPHOLIO_PATCHES}/patches/patch-list.patch"
|
||||
)
|
||||
# epatch doesn't support binary patches
|
||||
ebegin "Applying Compholio font patches"
|
||||
for f in "${T}/10-Missing_Fonts"/*.patch; do
|
||||
"../${COMPHOLIO_PATCHES}/debian/tools/gitapply.sh" < "${f}" || die "Failed to apply Compholio font patches"
|
||||
done
|
||||
eend
|
||||
fi
|
||||
autotools-utils_src_prepare
|
||||
|
||||
if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
|
||||
einfo "server/protocol.def was patched; running tools/make_requests"
|
||||
tools/make_requests || die #432348
|
||||
fi
|
||||
sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
|
||||
if ! use run-exes; then
|
||||
sed -i '/^MimeType/d' tools/wine.desktop || die #117785
|
||||
fi
|
||||
|
||||
# hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
|
||||
cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
|
||||
|
||||
l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
export LDCONFIG=/bin/true
|
||||
use custom-cflags || strip-flags
|
||||
|
||||
multilib-minimal_src_configure
|
||||
}
|
||||
|
||||
multilib_src_configure() {
|
||||
local myconf=(
|
||||
--sysconfdir=/etc/wine
|
||||
$(use_with alsa)
|
||||
$(use_with capi)
|
||||
$(use_with lcms cms)
|
||||
$(use_with cups)
|
||||
$(use_with ncurses curses)
|
||||
$(use_with udisks dbus)
|
||||
$(use_with fontconfig)
|
||||
$(use_with ssl gnutls)
|
||||
$(use_with gphoto2 gphoto)
|
||||
$(use_with gsm)
|
||||
$(use_with gstreamer)
|
||||
--without-hal
|
||||
$(use_with jpeg)
|
||||
$(use_with ldap)
|
||||
$(use_with mp3 mpg123)
|
||||
$(use_with netapi)
|
||||
$(use_with nls gettext)
|
||||
$(use_with openal)
|
||||
$(use_with opencl)
|
||||
$(use_with opengl)
|
||||
$(use_with osmesa)
|
||||
$(use_with oss)
|
||||
$(use_with png)
|
||||
$(use_with threads pthread)
|
||||
$(use_with scanner sane)
|
||||
$(use_enable test tests)
|
||||
$(use_with truetype freetype)
|
||||
$(use_with v4l)
|
||||
$(use_with X x)
|
||||
$(use_with xcomposite)
|
||||
$(use_with xinerama)
|
||||
$(use_with xml)
|
||||
$(use_with xml xslt)
|
||||
)
|
||||
|
||||
use pulseaudio && myconf+=( --with-pulse )
|
||||
use pipelight && myconf+=( --with-xattr )
|
||||
|
||||
local PKG_CONFIG AR RANLIB
|
||||
# Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
|
||||
# set AR and RANLIB to make QA scripts happy; #483342
|
||||
tc-export PKG_CONFIG AR RANLIB
|
||||
|
||||
if use amd64; then
|
||||
if [[ ${ABI} == amd64 ]]; then
|
||||
myconf+=( --enable-win64 )
|
||||
else
|
||||
myconf+=( --disable-win64 )
|
||||
fi
|
||||
|
||||
# Note: using --with-wine64 results in problems with multilib.eclass
|
||||
# CC/LD hackery. We're using separate tools instead.
|
||||
fi
|
||||
|
||||
ECONF_SOURCE=${S} \
|
||||
econf "${myconf[@]}"
|
||||
emake depend
|
||||
}
|
||||
|
||||
multilib_src_test() {
|
||||
# FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
|
||||
if [[ ${ABI} == x86 ]]; then
|
||||
if [[ $(id -u) == 0 ]]; then
|
||||
ewarn "Skipping tests since they cannot be run under the root user."
|
||||
ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
|
||||
return
|
||||
fi
|
||||
|
||||
WINEPREFIX="${T}/.wine-${ABI}" \
|
||||
Xemake test
|
||||
fi
|
||||
}
|
||||
|
||||
multilib_src_install_all() {
|
||||
local DOCS=( ANNOUNCE AUTHORS README )
|
||||
local l
|
||||
add_locale_docs() {
|
||||
local locale_doc="documentation/README.$1"
|
||||
[[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
|
||||
}
|
||||
l10n_for_each_locale_do add_locale_docs
|
||||
|
||||
einstalldocs
|
||||
prune_libtool_files --all
|
||||
|
||||
emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
|
||||
if use gecko ; then
|
||||
insinto /usr/share/wine/gecko
|
||||
use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
|
||||
use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
|
||||
fi
|
||||
if use mono ; then
|
||||
insinto /usr/share/wine/mono
|
||||
doins "${DISTDIR}"/wine-mono-${MV}.msi
|
||||
fi
|
||||
if ! use perl ; then
|
||||
rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
|
||||
fi
|
||||
|
||||
use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
|
||||
use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
|
||||
|
||||
if use abi_x86_64 && ! use abi_x86_32; then
|
||||
dosym /usr/bin/wine{64,} # 404331
|
||||
dosym /usr/bin/wine{64,}-preloader
|
||||
fi
|
||||
|
||||
# respect LINGUAS when installing man pages, #469418
|
||||
for l in de fr pl; do
|
||||
use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
|
||||
done
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
gnome2_icon_savelist
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
gnome2_icon_cache_update
|
||||
fdo-mime_desktop_database_update
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
gnome2_icon_cache_update
|
||||
fdo-mime_desktop_database_update
|
||||
}
|
@ -0,0 +1,497 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.7.28.ebuild,v 1.1 2014/10/05 13:17:36 ryao Exp $
|
||||
|
||||
EAPI="5"
|
||||
|
||||
AUTOTOOLS_AUTORECONF=1
|
||||
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"
|
||||
PLOCALE_BACKUP="en"
|
||||
|
||||
inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx
|
||||
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
|
||||
inherit git-2
|
||||
SRC_URI=""
|
||||
#KEYWORDS=""
|
||||
else
|
||||
MY_P="${PN}-${PV/_/-}"
|
||||
SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
|
||||
KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
fi
|
||||
|
||||
GV="2.24"
|
||||
MV="4.5.2"
|
||||
COMPHOLIO_P="wine-compholio-${PV}"
|
||||
WINE_GENTOO="wine-gentoo-2013.06.24"
|
||||
DESCRIPTION="Free implementation of Windows(tm) on Unix"
|
||||
HOMEPAGE="http://www.winehq.org/"
|
||||
SRC_URI="${SRC_URI}
|
||||
gecko? (
|
||||
abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
|
||||
abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
|
||||
)
|
||||
mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
|
||||
pipelight? ( https://github.com/compholio/wine-compholio-daily/archive/v${PV}.tar.gz -> ${COMPHOLIO_P}.tar.gz )
|
||||
pulseaudio? ( https://github.com/compholio/wine-compholio-daily/archive/v${PV}.tar.gz -> ${COMPHOLIO_P}.tar.gz )
|
||||
http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pipelight +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X xcomposite xinerama +xml"
|
||||
REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
|
||||
test? ( abi_x86_32 )
|
||||
elibc_glibc? ( threads )
|
||||
mono? ( abi_x86_32 )
|
||||
osmesa? ( opengl )" #286560
|
||||
# winepulse patches needed for gstreamer due to http://bugs.winehq.org/show_bug.cgi?id=30557
|
||||
|
||||
# FIXME: the test suite is unsuitable for us; many tests require net access
|
||||
# or fail due to Xvfb's opengl limitations.
|
||||
RESTRICT="test"
|
||||
|
||||
NATIVE_DEPEND="
|
||||
truetype? ( >=media-libs/freetype-2.0.0 )
|
||||
capi? ( net-dialup/capi4k-utils )
|
||||
ncurses? ( >=sys-libs/ncurses-5.2:= )
|
||||
udisks? ( sys-apps/dbus )
|
||||
fontconfig? ( media-libs/fontconfig:= )
|
||||
gphoto2? ( media-libs/libgphoto2:= )
|
||||
openal? ( media-libs/openal:= )
|
||||
gstreamer? ( media-libs/gstreamer:0.10 media-libs/gst-plugins-base:0.10 )
|
||||
X? (
|
||||
x11-libs/libXcursor
|
||||
x11-libs/libXext
|
||||
x11-libs/libXrandr
|
||||
x11-libs/libXi
|
||||
x11-libs/libXxf86vm
|
||||
)
|
||||
xinerama? ( x11-libs/libXinerama )
|
||||
alsa? ( media-libs/alsa-lib )
|
||||
cups? ( net-print/cups:= )
|
||||
opencl? ( virtual/opencl )
|
||||
opengl? (
|
||||
virtual/glu
|
||||
virtual/opengl
|
||||
)
|
||||
gsm? ( media-sound/gsm:= )
|
||||
jpeg? ( virtual/jpeg:0= )
|
||||
ldap? ( net-nds/openldap:= )
|
||||
lcms? ( media-libs/lcms:2= )
|
||||
mp3? ( >=media-sound/mpg123-1.5.0 )
|
||||
netapi? ( net-fs/samba[netapi(+)] )
|
||||
nls? ( sys-devel/gettext )
|
||||
odbc? ( dev-db/unixODBC:= )
|
||||
osmesa? ( media-libs/mesa[osmesa] )
|
||||
pipelight? ( sys-apps/attr )
|
||||
pulseaudio? ( media-sound/pulseaudio )
|
||||
xml? ( dev-libs/libxml2 dev-libs/libxslt )
|
||||
scanner? ( media-gfx/sane-backends:= )
|
||||
ssl? ( net-libs/gnutls:= )
|
||||
png? ( media-libs/libpng:0= )
|
||||
v4l? ( media-libs/libv4l )
|
||||
xcomposite? ( x11-libs/libXcomposite )"
|
||||
|
||||
COMMON_DEPEND="
|
||||
!amd64? ( ${NATIVE_DEPEND} )
|
||||
amd64? (
|
||||
abi_x86_64? ( ${NATIVE_DEPEND} )
|
||||
abi_x86_32? (
|
||||
truetype? ( || (
|
||||
>=app-emulation/emul-linux-x86-xlibs-2.1[development,-abi_x86_32(-)]
|
||||
>=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
|
||||
) )
|
||||
ncurses? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-libs/ncurses-5.9-r3[abi_x86_32(-)]
|
||||
) )
|
||||
udisks? ( || (
|
||||
>=app-emulation/emul-linux-x86-baselibs-20130224[development,-abi_x86_32(-)]
|
||||
>=sys-apps/dbus-1.6.18-r1[abi_x86_32(-)]
|
||||
) )
|
||||
fontconfig? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/fontconfig-2.10.92[abi_x86_32(-)]
|
||||
) )
|
||||
gphoto2? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libgphoto2-2.5.3.1[abi_x86_32(-)]
|
||||
) )
|
||||
openal? ( || (
|
||||
app-emulation/emul-linux-x86-sdl[development,-abi_x86_32(-)]
|
||||
>=media-libs/openal-1.15.1[abi_x86_32(-)]
|
||||
) )
|
||||
gstreamer? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=media-libs/gstreamer-0.10.36-r2:0.10[abi_x86_32(-)]
|
||||
>=media-libs/gst-plugins-base-0.10.36:0.10[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
X? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=x11-libs/libXcursor-1.1.14[abi_x86_32(-)]
|
||||
>=x11-libs/libXext-1.3.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXrandr-1.4.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXi-1.7.2[abi_x86_32(-)]
|
||||
>=x11-libs/libXxf86vm-1.1.3[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
xinerama? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=x11-libs/libXinerama-1.1.3[abi_x86_32(-)]
|
||||
) )
|
||||
alsa? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[alsa,development,-abi_x86_32(-)]
|
||||
>=media-libs/alsa-lib-1.0.27.2[abi_x86_32(-)]
|
||||
) )
|
||||
cups? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs
|
||||
>=net-print/cups-1.7.1-r1[abi_x86_32(-)]
|
||||
) )
|
||||
opencl? ( >=virtual/opencl-0-r3[abi_x86_32(-)] )
|
||||
opengl? ( || (
|
||||
app-emulation/emul-linux-x86-opengl[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=virtual/glu-9.0-r1[abi_x86_32(-)]
|
||||
>=virtual/opengl-7.0-r1[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
gsm? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/gsm-1.0.13-r1[abi_x86_32(-)]
|
||||
) )
|
||||
jpeg? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=virtual/jpeg-0-r2:0[abi_x86_32(-)]
|
||||
) )
|
||||
ldap? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=net-nds/openldap-2.4.38-r1:=[abi_x86_32(-)]
|
||||
) )
|
||||
lcms? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/lcms-2.5:2[abi_x86_32(-)]
|
||||
) )
|
||||
mp3? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/mpg123-1.15.4[abi_x86_32(-)]
|
||||
) )
|
||||
netapi? ( >=net-fs/samba-3.6.23-r1[netapi(+),abi_x86_32(-)] )
|
||||
nls? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-devel/gettext-0.18.3.2[abi_x86_32(-)]
|
||||
) )
|
||||
odbc? ( || (
|
||||
app-emulation/emul-linux-x86-db[development,-abi_x86_32(-)]
|
||||
>=dev-db/unixODBC-2.3.2:=[abi_x86_32(-)]
|
||||
) )
|
||||
osmesa? ( || (
|
||||
>=app-emulation/emul-linux-x86-opengl-20121028[development,-abi_x86_32(-)]
|
||||
>=media-libs/mesa-9.1.6[osmesa,abi_x86_32(-)]
|
||||
) )
|
||||
pipelight? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=sys-apps/attr-2.4.47-r1[abi_x86_32(-)]
|
||||
) )
|
||||
pulseaudio? ( || (
|
||||
app-emulation/emul-linux-x86-soundlibs[development,-abi_x86_32(-)]
|
||||
>=media-sound/pulseaudio-5.0[abi_x86_32(-)]
|
||||
) )
|
||||
xml? ( || (
|
||||
>=app-emulation/emul-linux-x86-baselibs-20131008[development,-abi_x86_32(-)]
|
||||
(
|
||||
>=dev-libs/libxml2-2.9.1-r4[abi_x86_32(-)]
|
||||
>=dev-libs/libxslt-1.1.28-r1[abi_x86_32(-)]
|
||||
)
|
||||
) )
|
||||
scanner? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-gfx/sane-backends-1.0.23:=[abi_x86_32(-)]
|
||||
) )
|
||||
ssl? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=net-libs/gnutls-2.12.23-r6:=[abi_x86_32(-)]
|
||||
) )
|
||||
png? ( || (
|
||||
app-emulation/emul-linux-x86-baselibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libpng-1.6.10:0[abi_x86_32(-)]
|
||||
) )
|
||||
v4l? ( || (
|
||||
app-emulation/emul-linux-x86-medialibs[development,-abi_x86_32(-)]
|
||||
>=media-libs/libv4l-0.9.5[abi_x86_32(-)]
|
||||
) )
|
||||
xcomposite? ( || (
|
||||
app-emulation/emul-linux-x86-xlibs[development,-abi_x86_32(-)]
|
||||
>=x11-libs/libXcomposite-0.4.4-r1[abi_x86_32(-)]
|
||||
) )
|
||||
)
|
||||
)"
|
||||
|
||||
RDEPEND="${COMMON_DEPEND}
|
||||
dos? ( games-emulation/dosbox )
|
||||
perl? ( dev-lang/perl dev-perl/XML-Simple )
|
||||
samba? ( >=net-fs/samba-3.0.25 )
|
||||
selinux? ( sec-policy/selinux-wine )
|
||||
udisks? ( sys-fs/udisks:2 )
|
||||
pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
|
||||
|
||||
DEPEND="${COMMON_DEPEND}
|
||||
amd64? ( abi_x86_32? ( !abi_x86_64? ( ${NATIVE_DEPEND} ) ) )
|
||||
X? (
|
||||
x11-proto/inputproto
|
||||
x11-proto/xextproto
|
||||
x11-proto/xf86vidmodeproto
|
||||
)
|
||||
xinerama? ( x11-proto/xineramaproto )
|
||||
prelink? ( sys-devel/prelink )
|
||||
>=sys-kernel/linux-headers-2.6
|
||||
virtual/pkgconfig
|
||||
virtual/yacc
|
||||
sys-devel/flex"
|
||||
|
||||
# These use a non-standard "Wine" category, which is provided by
|
||||
# /etc/xdg/applications-merged/wine.menu
|
||||
QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
|
||||
usr/share/applications/wine-notepad.desktop
|
||||
usr/share/applications/wine-uninstaller.desktop
|
||||
usr/share/applications/wine-winecfg.desktop"
|
||||
|
||||
wine_build_environment_check() {
|
||||
[[ ${MERGE_TYPE} = "binary" ]] && return 0
|
||||
|
||||
if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
|
||||
eerror "You need gcc-4.4+ to build 64-bit wine"
|
||||
eerror
|
||||
return 1
|
||||
fi
|
||||
|
||||
if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
|
||||
eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
|
||||
eerror "See https://bugs.gentoo.org/487864 for more details."
|
||||
eerror
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_pretend() {
|
||||
wine_build_environment_check || die
|
||||
}
|
||||
|
||||
pkg_setup() {
|
||||
wine_build_environment_check || die
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
git-2_src_unpack
|
||||
else
|
||||
unpack ${MY_P}.tar.bz2
|
||||
fi
|
||||
|
||||
use pipelight || use pulseaudio && unpack "${COMPHOLIO_P}.tar.gz"
|
||||
|
||||
unpack "${WINE_GENTOO}.tar.bz2"
|
||||
|
||||
l10n_find_plocales_changes "${S}/po" "" ".po"
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
local md5="$(md5sum server/protocol.def)"
|
||||
local f
|
||||
local PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
|
||||
"${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
|
||||
"${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
|
||||
"${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
|
||||
)
|
||||
local COMPHOLIO_MAKE_ARGS="-W fonts-Missing_Fonts.ok"
|
||||
|
||||
use pulseaudio || COMPHOLIO_MAKE_ARGS="${COMPHOLIO_MAKE_ARGS} -W winepulse-PulseAudio_Support.ok"
|
||||
if use gstreamer; then
|
||||
# See http://bugs.winehq.org/show_bug.cgi?id=30557
|
||||
ewarn "Applying experimental patch to fix GStreamer support. Note that"
|
||||
ewarn "this patch has been reported to cause crashes in certain games."
|
||||
|
||||
PATCHES+=( "${FILESDIR}/${PN}-1.7.28-gstreamer-v4.patch" )
|
||||
fi
|
||||
if use pipelight; then
|
||||
ewarn "Applying the unofficial Compholio patchset for Pipelight support,"
|
||||
ewarn "which is unsupported by Wine developers. Please don't report bugs"
|
||||
ewarn "to Wine bugzilla unless you can reproduce them with USE=-pipelight"
|
||||
|
||||
# epatch doesn't support binary patches and we ship our own pulse patches
|
||||
emake -C "${WORKDIR}/${COMPHOLIO_P}/patches" \
|
||||
$(echo ${COMPHOLIO_MAKE_ARGS}) \
|
||||
series
|
||||
|
||||
PATCHES+=( $(sed -e "s:^:${WORKDIR}/${COMPHOLIO_P}/patches/:" \
|
||||
"${WORKDIR}/${COMPHOLIO_P}/patches/series") )
|
||||
|
||||
# epatch doesn't support binary patches
|
||||
ebegin "Applying Compholio font patches"
|
||||
for f in "${WORKDIR}/${COMPHOLIO_P}/patches/fonts-Missing_Fonts"/*.patch; do
|
||||
"../${COMPHOLIO_P}/debian/tools/gitapply.sh" < "${f}" \
|
||||
|| die "Failed to apply ${f}"
|
||||
done
|
||||
eend
|
||||
elif use pulseaudio; then
|
||||
PATCHES+=( "../${COMPHOLIO_P}/patches/winepulse-PulseAudio_Support"/*.patch )
|
||||
fi
|
||||
autotools-utils_src_prepare
|
||||
|
||||
if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
|
||||
einfo "server/protocol.def was patched; running tools/make_requests"
|
||||
tools/make_requests || die #432348
|
||||
fi
|
||||
sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
|
||||
if ! use run-exes; then
|
||||
sed -i '/^MimeType/d' tools/wine.desktop || die #117785
|
||||
fi
|
||||
|
||||
# hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
|
||||
cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
|
||||
|
||||
l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
export LDCONFIG=/bin/true
|
||||
use custom-cflags || strip-flags
|
||||
|
||||
multilib-minimal_src_configure
|
||||
}
|
||||
|
||||
multilib_src_configure() {
|
||||
local myconf=(
|
||||
--sysconfdir=/etc/wine
|
||||
$(use_with alsa)
|
||||
$(use_with capi)
|
||||
$(use_with lcms cms)
|
||||
$(use_with cups)
|
||||
$(use_with ncurses curses)
|
||||
$(use_with udisks dbus)
|
||||
$(use_with fontconfig)
|
||||
$(use_with ssl gnutls)
|
||||
$(use_with gphoto2 gphoto)
|
||||
$(use_with gsm)
|
||||
$(use_with gstreamer)
|
||||
--without-hal
|
||||
$(use_with jpeg)
|
||||
$(use_with ldap)
|
||||
$(use_with mp3 mpg123)
|
||||
$(use_with netapi)
|
||||
$(use_with nls gettext)
|
||||
$(use_with openal)
|
||||
$(use_with opencl)
|
||||
$(use_with opengl)
|
||||
$(use_with osmesa)
|
||||
$(use_with oss)
|
||||
--without-pcap
|
||||
$(use_with png)
|
||||
$(use_with threads pthread)
|
||||
$(use_with scanner sane)
|
||||
$(use_enable test tests)
|
||||
$(use_with truetype freetype)
|
||||
$(use_with v4l)
|
||||
$(use_with X x)
|
||||
$(use_with xcomposite)
|
||||
$(use_with xinerama)
|
||||
$(use_with xml)
|
||||
$(use_with xml xslt)
|
||||
)
|
||||
|
||||
use pulseaudio && myconf+=( --with-pulse )
|
||||
use pipelight && myconf+=( --with-xattr )
|
||||
|
||||
local PKG_CONFIG AR RANLIB
|
||||
# Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
|
||||
# set AR and RANLIB to make QA scripts happy; #483342
|
||||
tc-export PKG_CONFIG AR RANLIB
|
||||
|
||||
if use amd64; then
|
||||
if [[ ${ABI} == amd64 ]]; then
|
||||
myconf+=( --enable-win64 )
|
||||
else
|
||||
myconf+=( --disable-win64 )
|
||||
fi
|
||||
|
||||
# Note: using --with-wine64 results in problems with multilib.eclass
|
||||
# CC/LD hackery. We're using separate tools instead.
|
||||
fi
|
||||
|
||||
ECONF_SOURCE=${S} \
|
||||
econf "${myconf[@]}"
|
||||
emake depend
|
||||
}
|
||||
|
||||
multilib_src_test() {
|
||||
# FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
|
||||
if [[ ${ABI} == x86 ]]; then
|
||||
if [[ $(id -u) == 0 ]]; then
|
||||
ewarn "Skipping tests since they cannot be run under the root user."
|
||||
ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
|
||||
return
|
||||
fi
|
||||
|
||||
WINEPREFIX="${T}/.wine-${ABI}" \
|
||||
Xemake test
|
||||
fi
|
||||
}
|
||||
|
||||
multilib_src_install_all() {
|
||||
local DOCS=( ANNOUNCE AUTHORS README )
|
||||
local l
|
||||
add_locale_docs() {
|
||||
local locale_doc="documentation/README.$1"
|
||||
[[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
|
||||
}
|
||||
l10n_for_each_locale_do add_locale_docs
|
||||
|
||||
einstalldocs
|
||||
prune_libtool_files --all
|
||||
|
||||
emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
|
||||
if use gecko ; then
|
||||
insinto /usr/share/wine/gecko
|
||||
use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
|
||||
use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
|
||||
fi
|
||||
if use mono ; then
|
||||
insinto /usr/share/wine/mono
|
||||
doins "${DISTDIR}"/wine-mono-${MV}.msi
|
||||
fi
|
||||
if ! use perl ; then
|
||||
rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
|
||||
fi
|
||||
|
||||
use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
|
||||
use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
|
||||
|
||||
if use abi_x86_64 && ! use abi_x86_32; then
|
||||
dosym /usr/bin/wine{64,} # 404331
|
||||
dosym /usr/bin/wine{64,}-preloader
|
||||
fi
|
||||
|
||||
# respect LINGUAS when installing man pages, #469418
|
||||
for l in de fr pl; do
|
||||
use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
|
||||
done
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
gnome2_icon_savelist
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
gnome2_icon_cache_update
|
||||
fdo-mime_desktop_database_update
|
||||
}
|
||||
|
||||
pkg_postrm() {
|
||||
gnome2_icon_cache_update
|
||||
fdo-mime_desktop_database_update
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Class-Load-XS/Class-Load-XS-0.40.0.ebuild,v 1.5 2012/12/25 18:27:17 blueness Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
MODULE_AUTHOR=DROLSKY
|
||||
MODULE_VERSION=0.04
|
||||
inherit perl-module
|
||||
|
||||
DESCRIPTION="XS implementation of parts of Class::Load"
|
||||
|
||||
LICENSE="Artistic-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 ppc x86 ~x64-macos"
|
||||
IUSE="test"
|
||||
|
||||
RDEPEND="
|
||||
>=dev-perl/Class-Load-0.150.0
|
||||
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
>=virtual/perl-Module-Build-0.360.100
|
||||
test? (
|
||||
>=virtual/perl-Test-Simple-0.880.0
|
||||
>=dev-perl/Module-Implementation-0.40.0
|
||||
dev-perl/Test-Fatal
|
||||
)
|
||||
"
|
||||
|
||||
SRC_TEST=do
|
@ -1,16 +1,16 @@
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
DIST Class-Load-XS-0.04.tar.gz 55168 SHA256 d4731aee4d5484cd1eef9b2aa46d0370be3f4c9aeb8fd14fc11bbd48201e05e3 SHA512 7c368964bcb1c145eb784a6bf52b461d5072dcd671b5a2f49b8678883c7c56a88ebaf8288bccba875867fd0de21440a86ac943aafd3c490b1de220c2a2b585b1 WHIRLPOOL c0b6fc259f14457f39843e2957efefd77db25b80bba6625871a7f894f17dd8d1658b1f637ad7f8bdd481e1fc6dee52eee2f16f412ead8374def628e3c04650a1
|
||||
DIST Class-Load-XS-0.06.tar.gz 56141 SHA256 338232719c6646e4d411954feb30b3db5bb5b024a277fc644e5270676d1a87b6 SHA512 07effa62cef0c27f25c5918e7dbc9aec3aa2ad88dfd06963cef2908c562532ea3048feb97717f0a120ca40250f3629f31a2d9d2263036e6de61158bebb6afe36 WHIRLPOOL 1ad8f87e7335bb9072a65e9a73f25105fef0915be3d1d8e90fefaf0c16c494bb215310ddabf32a7346c12e2c8924ee81e10fab0a5b57bd3542fbf6c273ebc25e
|
||||
EBUILD Class-Load-XS-0.40.0.ebuild 672 SHA256 fa0865c11db4151737e845ee8d13b149755dc1010f8282c243461a816bdf9b73 SHA512 a1abbf2c2816445c4cb00387725c05cc838d1b8528217812d38552921356cfc635e117f86522169124254c12c8f91bc042495d2ac2ef0a3c364b1ed2d37b171c WHIRLPOOL 1f74f5f30d9bc899493313b560d40ca9f5b7a99b12b93b802e642aeccebb4c7e5d6a03eee7f08ed83532a5762c2152065b7ae888bea05e0a378a2f7e877f581a
|
||||
EBUILD Class-Load-XS-0.60.0-r1.ebuild 700 SHA256 7711dc9b255223f84f350ca57c746379aa15b7be242fda5a14b5a028df664e7b SHA512 9d68b6cc757c355924128eeb33c16c88f584acbf0c6ff6c103815137bc31e46a1f9b1860a8a8aff2353b0dea9db74dc463bc30c77da5d12771e5da25b0b4f53c WHIRLPOOL f8a00cb01d5a93d16005569e93ee62f6798f787c5a6c9173f1c1d0ec6c9429fbb2135c77993604b8fe2aab9d11e6e60c2aabb596cc3f17af5ebf758430962fc4
|
||||
MISC ChangeLog 2181 SHA256 f83b4b87d6fe87f93eec08a8a3672091a6f23456b9065c797935be2b2af10e63 SHA512 053ca52b0a057766d03118567e6d034974c98f86c26d793fa8865311820aaa8239eb182dfa055255f810ffe6cc5a52b6b746cc7423e97d6e6e5f5d2a00ecaddf WHIRLPOOL f046a67a3200c0627a68b2df3cc6432dfba1ffddaa86499279540acbee89224235dc87804cd3a07af41052920f0f43b2f0e33a983443f6092e0f3fef8c6d4cb3
|
||||
MISC ChangeLog 2278 SHA256 56c499ee34d587444ef6908d033deaa6c93bfbe56eec1757a15a13f88916e235 SHA512 9082323bd898357b92d0e0c97108d7d35e975f675dd06ff512f9f29c2bbc1d3e36a13ef0bc77e0d04775afd8c58bd982ef16c7117d3901fbeed9f14c726cd470 WHIRLPOOL 1e267a618d2fe667265049e31b96bc199b8ecaa1b01326b9cf221ae0d053c44153e55fe7f39f002702e97be4447e79489434bfb1eb32a3aebff86ad64f564435
|
||||
MISC metadata.xml 301 SHA256 fe8a6160ad62874aea089d0ccdae940e999aa1423f1f86d2c060802e883a45fa SHA512 c78ac4f3a1c4ac1075ef939cad065e436be5b719acdbaaa479244d1760646c81a8f4dbe8dd4e6ebdb16d01185e1213b79eaa6ef928edf5d8883eefdb28f01fce WHIRLPOOL 5a9ada52577db80e90aaff8bd09c7b13446e266bf3565da0c0372398ad4689dfe269a669e916ca96167df43e8ae8d5f06defd3c56c8e90a19b06932af11f3c8e
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v2
|
||||
|
||||
iF4EAREIAAYFAlP1/2MACgkQ2ugaI38ACPBenwEAqYvwtIWyNfHp0WehU7xTyS4l
|
||||
7N428OtegJ7RPHFjH2wA/RLPVdwAEi/XbhhqJc2+wP0n9oxYQZ9dh95sal6E9ofK
|
||||
=nMNV
|
||||
iJwEAQEIAAYFAlQxa3sACgkQG9wOWsQutdZSFgP8CEAQEZLHYHhiZ/EiFTfxdj3M
|
||||
gTYXP8kZgeVK9gGJg1B6TmsIPnSSey7655rApgt0wNmauXOTOqPsbrVFLf5V0D99
|
||||
ArFj7w134H9BQ3WX+dUjtc9A7ssHYZp1OKVNZbmpFAAo0dGlXaN5OXJ8winZWo98
|
||||
2N9NF/LilZp2++6g2HQ=
|
||||
=cwZk
|
||||
-----END PGP SIGNATURE-----
|
||||
|
@ -1,26 +0,0 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/dev-perl/Config-Any/Config-Any-0.230.0.ebuild,v 1.4 2013/09/08 10:28:16 pinkbyte Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
MODULE_AUTHOR=BRICAS
|
||||
MODULE_VERSION=0.23
|
||||
inherit perl-module
|
||||
|
||||
DESCRIPTION="Support several config file formats"
|
||||
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~arm ~ppc ~x86 ~ppc-aix"
|
||||
IUSE="test"
|
||||
|
||||
RDEPEND=">=virtual/perl-Module-Pluggable-3.9
|
||||
!<dev-perl/config-general-2.47"
|
||||
DEPEND="${RDEPEND}
|
||||
test? (
|
||||
dev-perl/Test-Pod
|
||||
dev-perl/Test-Pod-Coverage
|
||||
)
|
||||
"
|
||||
|
||||
SRC_TEST=do
|
@ -1,16 +1,16 @@
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA256
|
||||
|
||||
DIST Config-Any-0.23.tar.gz 33172 SHA256 ff49d8d92e598feaacdd17635ab564b4625b4441d7c677d2a827f381db16669e SHA512 f9ba62f66063d42b4d19648f8c3f7b92619d24bc1eb106e790909cc89cb183a62d3582f154401e1d8ef2e6eb4905964878230d1e087a668d37f71bc36171d64e WHIRLPOOL cfa410a4c748183281a52d91ab82cf2d70506a43c0ffd57277de33421efad1b8b04eb6454b02bbf22b44458894c38c67bbaafa6761fee3ed65a025d87f518d40
|
||||
DIST Config-Any-0.24.tar.gz 35024 SHA256 710f8fc8f9414205cb58399bfbb4d9aaf7883f8ce046cee22913f6818795c61a SHA512 7eee9ea2794d87aada9a46668ac9c947b34c7107f53a3da9de21a3ebebc63b8718e3f8cea1009697909047d376de0e8fcd137d6d3dd66cb719bf7e48a50cd093 WHIRLPOOL 09a88c044427cd3bc919b944fac41f115440d240d616e7f6a194e66810ec7130dbcc55aa87664eaf4322cf1272b3348cf71ea8a287ff4723c5ea1eccf3888ab4
|
||||
EBUILD Config-Any-0.230.0.ebuild 588 SHA256 bf67a38a2e3089628f470d6dc8b982ef926d86f05be0195dd738a02b36f186a0 SHA512 c1df7a600bc96d208a814d50c113d9b89b5e3a4268620840c573f9000dbc6fe230ebc969c7d9c81a4dcb98dc0565e18c400c08f9c18a4b15bcd7e96b0a308117 WHIRLPOOL 6b55225d7fc2d03d94c29837ff186a0df4c0c80166d55072b3234856720cce7c2cab9db74b906c495798f989649c6573074f70e640479f50c507ae4796cb1772
|
||||
EBUILD Config-Any-0.240.0-r1.ebuild 586 SHA256 82d6f3da8349c784b957bcd92c7c2b6c47852c79a5320930c3245b67f54b0aee SHA512 580b939fcc3c60a9815a71adf6ef9902cfe7257378884a9fdf8e468990d8bf21ca2f386cdf1c53ece26d15c686f9394273f930e2e2a6634bb684a33b3c1dc5f4 WHIRLPOOL f774ae2be15a9c97326d55437a4ab1c54fd2945780a79469812c8b6c0487c8bf428fde05c3faab27bb85038c59643909d41d686e4eb4c26412a8587fc79c7716
|
||||
MISC ChangeLog 2528 SHA256 0b72753848ccdb07ba8b3aa5a512af14ac5158acb83a947f346cfeb252f09c81 SHA512 5c85979356a892701306d8eaa4a803648ddab93b7b313154c260328bc15e768a3d44b339380600f95343c7fba3cb83fc4775ddbd7928698d68f9eda0193208a1 WHIRLPOOL 48a6cf907d8f23c57480aac3bf2171fc6a2faa589efa1f41932aa26cf7f4c6e74c8b2201f4a20050dd9eccb5110e8b591daf466c6648b773d872bbfe1452b626
|
||||
MISC ChangeLog 2623 SHA256 129022954ba2c0bf6cba96352f93e1c19f38a414e7e36483188c81b7d6047570 SHA512 358af8d44239a86a6f149b4094a063e4beb2139b46e380e8dea254fa65bf8282c0de4aaf2e8f1c5ec6ab598fbed2b69c40b4f81441e1dbb5fe124ef379c0f504 WHIRLPOOL 14f01dd72f85dc8747e35527a7fc515ca7524d49209775c373c2e57e69451d8136812e4cd6ef5d554cdc2b81fc59b38cde481e71c3c37d4547b9126b976b129c
|
||||
MISC metadata.xml 743 SHA256 abe9bf786b7b03e294d0b155140289b0d89ab03cee031f950af77d5259773460 SHA512 e82cc4a01e8a6b7626c974c48a38c5ae2354c7d27c3bc870d7adca8301af3443c468834848e2d53e73f143d6733bcc3ec22dbf7dd31514056dab149849932d64 WHIRLPOOL 031672d4b2f91ea6da9147f58785ce672d921e9b2c0fd83050bc8b6f332f5fa2498c44dbf06fc847c0a8a3963c30e3d326bcaacd70839b37f60b4482e70230bf
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v2
|
||||
|
||||
iF4EAREIAAYFAlP8xTMACgkQ2ugaI38ACPAtDAEAmp8LgscnlO3Jq7T62Yvplwq2
|
||||
86Gt2gP4HBYVEndnyVYA/0AtnmjMN+6WKpsB/GM9LiR7FpouX37Dg2jYg+1IT+Vk
|
||||
=x/51
|
||||
iJwEAQEIAAYFAlQxaxAACgkQG9wOWsQutdYkIgP9G2ux0eD/NgqTy/09O/xsUscg
|
||||
+h84W/JEQi9k5K0fvjjxlOgRWKxWJLYdadKFrcx1uNvyiBMiFz7UU1mlOY7Mqrra
|
||||
DeKW3U9s/4XyOLMcSsFRX6JckDb0VwmVrPHVU1dLIWTt9kNxWfouopxu0c65rS0P
|
||||
tCqiOanLCuEwBav44lI=
|
||||
=Dt5c
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue