diff options
author | moonshadow565 | 2022-04-25 03:48:27 +0200 |
---|---|---|
committer | moonshadow565 | 2022-04-25 03:48:27 +0200 |
commit | 5de510425d22afc6becf7769b249cf6a3c96cbd3 (patch) | |
tree | 181ef34486e029e8effe3bb8b25102c852689a6d | |
download | aur-5de510425d22afc6becf7769b249cf6a3c96cbd3.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 169 | ||||
-rw-r--r-- | 0002-LoL-6.17+-syscall-fix.patch | 27 | ||||
-rw-r--r-- | 0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch | 148 | ||||
-rw-r--r-- | 0004-LoL-broken-client-update-fix.patch | 153 | ||||
-rw-r--r-- | 0005-LoL-client-slow-start-fix.patch | 22 | ||||
-rw-r--r-- | PKGBUILD | 191 | ||||
-rwxr-xr-x | wine-lol-staging.install | 17 |
7 files changed, 727 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6cb09f61d3ef --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,169 @@ +pkgbase = wine-lol-staging + pkgdesc = A compatibility layer for running Windows programs (staging branch) with LoL patches(abi.vsyscall32=0 version) + pkgver = 7.7 + pkgrel = 1 + url = https://www.wine-staging.com/ + install = wine-lol-staging.install + arch = x86_64 + license = LGPL + makedepends = git + makedepends = autoconf + makedepends = bison + makedepends = perl + makedepends = fontforge + makedepends = flex + makedepends = mingw-w64-gcc + makedepends = giflib + makedepends = lib32-giflib + makedepends = libpng + makedepends = lib32-libpng + makedepends = gnutls + makedepends = lib32-gnutls + makedepends = libxinerama + makedepends = lib32-libxinerama + makedepends = libxcomposite + makedepends = lib32-libxcomposite + makedepends = libxmu + makedepends = lib32-libxmu + makedepends = libxxf86vm + makedepends = lib32-libxxf86vm + makedepends = libldap + makedepends = lib32-libldap + makedepends = mpg123 + makedepends = lib32-mpg123 + makedepends = openal + makedepends = lib32-openal + makedepends = v4l-utils + makedepends = lib32-v4l-utils + makedepends = alsa-lib + makedepends = lib32-alsa-lib + makedepends = libxcomposite + makedepends = lib32-libxcomposite + makedepends = mesa + makedepends = lib32-mesa + makedepends = libgl + makedepends = lib32-libgl + makedepends = opencl-icd-loader + makedepends = lib32-opencl-icd-loader + makedepends = libxslt + makedepends = lib32-libxslt + makedepends = libpulse + makedepends = lib32-libpulse + makedepends = libva + makedepends = lib32-libva + makedepends = gtk3 + makedepends = lib32-gtk3 + makedepends = gst-plugins-base-libs + makedepends = lib32-gst-plugins-base-libs + makedepends = vulkan-icd-loader + makedepends = lib32-vulkan-icd-loader + makedepends = sdl2 + makedepends = lib32-sdl2 + makedepends = vkd3d + makedepends = lib32-vkd3d + makedepends = libcups + makedepends = lib32-libcups + makedepends = sane + makedepends = libgphoto2 + makedepends = gsm + makedepends = ffmpeg + makedepends = samba + makedepends = opencl-headers + makedepends = vulkan-headers + depends = attr + depends = lib32-attr + depends = fontconfig + depends = lib32-fontconfig + depends = lcms2 + depends = lib32-lcms2 + depends = libxml2 + depends = lib32-libxml2 + depends = libxcursor + depends = lib32-libxcursor + depends = libxrandr + depends = lib32-libxrandr + depends = libxdamage + depends = lib32-libxdamage + depends = libxi + depends = lib32-libxi + depends = gettext + depends = lib32-gettext + depends = freetype2 + depends = lib32-freetype2 + depends = glu + depends = lib32-glu + depends = libsm + depends = lib32-libsm + depends = gcc-libs + depends = lib32-gcc-libs + depends = libpcap + depends = lib32-libpcap + depends = faudio + depends = lib32-faudio + depends = desktop-file-utils + optdepends = giflib + optdepends = lib32-giflib + optdepends = libpng + optdepends = lib32-libpng + optdepends = libldap + optdepends = lib32-libldap + optdepends = gnutls + optdepends = lib32-gnutls + optdepends = mpg123 + optdepends = lib32-mpg123 + optdepends = openal + optdepends = lib32-openal + optdepends = v4l-utils + optdepends = lib32-v4l-utils + optdepends = libpulse + optdepends = lib32-libpulse + optdepends = alsa-plugins + optdepends = lib32-alsa-plugins + optdepends = alsa-lib + optdepends = lib32-alsa-lib + optdepends = libjpeg-turbo + optdepends = lib32-libjpeg-turbo + optdepends = libxcomposite + optdepends = lib32-libxcomposite + optdepends = libxinerama + optdepends = lib32-libxinerama + optdepends = opencl-icd-loader + optdepends = lib32-opencl-icd-loader + optdepends = libxslt + optdepends = lib32-libxslt + optdepends = libva + optdepends = lib32-libva + optdepends = gtk3 + optdepends = lib32-gtk3 + optdepends = gst-plugins-base-libs + optdepends = lib32-gst-plugins-base-libs + optdepends = vulkan-icd-loader + optdepends = lib32-vulkan-icd-loader + optdepends = sdl2 + optdepends = lib32-sdl2 + optdepends = vkd3d + optdepends = lib32-vkd3d + optdepends = sane + optdepends = libgphoto2 + optdepends = gsm + optdepends = ffmpeg + optdepends = cups + optdepends = samba + optdepends = dosbox + options = staticlibs + options = !lto + options = !strip + source = git+https://github.com/wine-staging/wine-staging.git#tag=v7.7 + source = git+https://github.com/wine-mirror/wine.git#tag=wine-7.7 + source = 0002-LoL-6.17+-syscall-fix.patch + source = 0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch + source = 0004-LoL-broken-client-update-fix.patch + source = 0005-LoL-client-slow-start-fix.patch + sha256sums = SKIP + sha256sums = SKIP + sha256sums = c127907db75cd8575da27198c8f46aa19dd2a219324e7491761f206f3ce91601 + sha256sums = c2cb9265567dfe8c9f148e237910792cad7666d9d3cbf68d8717076030cddc92 + sha256sums = 0c5b97c64fd4983119db8675f0686e26143898de1566c4da46d5df74cb98cfb2 + sha256sums = ad03a922191069774757f9f8b12c6eb9b87bbcf16da7b290adb9176fbcaa4ba8 + +pkgname = wine-lol-staging diff --git a/0002-LoL-6.17+-syscall-fix.patch b/0002-LoL-6.17+-syscall-fix.patch new file mode 100644 index 000000000000..7bf74f30ee42 --- /dev/null +++ b/0002-LoL-6.17+-syscall-fix.patch @@ -0,0 +1,27 @@ +diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c +index c876d51..654c84d 100644 +--- a/tools/winebuild/import.c ++++ b/tools/winebuild/import.c +@@ -1401,19 +1401,9 @@ void output_syscalls( DLLSPEC *spec ) + switch (target.cpu) + { + case CPU_i386: +- if (UsePIC) +- { +- output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); +- output( "1:\tmovl %s-1b(%%eax),%%edx\n", asm_name("__wine_syscall_dispatcher") ); +- output( "\tmovl $%u,%%eax\n", id ); +- needs_get_pc_thunk = 1; +- } +- else +- { +- output( "\tmovl $%u,%%eax\n", id ); +- output( "\tmovl $%s,%%edx\n", asm_name("__wine_syscall") ); +- } +- output( "\tcall *%%edx\n" ); ++ output( "\t.byte 0xb8\n" ); /* mov eax, SYSCALL */ ++ output( "\t.long %d\n", id ); ++ output( "\t.byte 0x64,0xff,0x15,0xc0,0x00,0x00,0x00\n" ); /* call dword ptr fs:[0C0h] */ + output( "\tret $%u\n", odp->type == TYPE_STDCALL ? get_args_size( odp ) : 0 ); + break; + case CPU_x86_64: diff --git a/0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch b/0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch new file mode 100644 index 000000000000..55917702ac29 --- /dev/null +++ b/0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch @@ -0,0 +1,148 @@ +diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c +index e2a6148..574e74e 100644 +--- a/dlls/ntdll/unix/signal_i386.c ++++ b/dlls/ntdll/unix/signal_i386.c +@@ -386,6 +386,8 @@ static inline int set_thread_area( struct modify_ldt_s *ptr ) + + static ULONG first_ldt_entry = 32; + ++static int wine_cs; ++ + enum i386_trap_code + { + #if defined(__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +@@ -502,6 +504,11 @@ static inline WORD get_cs(void) { WORD res; __asm__( "movw %%cs,%0" : "=r" (res) + static inline WORD get_ds(void) { WORD res; __asm__( "movw %%ds,%0" : "=r" (res) ); return res; } + static inline WORD get_fs(void) { WORD res; __asm__( "movw %%fs,%0" : "=r" (res) ); return res; } + static inline WORD get_gs(void) { WORD res; __asm__( "movw %%gs,%0" : "=r" (res) ); return res; } ++static CDECL void __attribute((naked)) set_cs( DWORD val ) { ++ asm ( "movl 4(%esp),%eax\n\t" ++ "xchg 0(%esp),%eax\n\t" ++ "push %eax\n\t" ++ "lret"); } + static inline void set_fs( WORD val ) { __asm__( "mov %0,%%fs" :: "r" (val)); } + static inline void set_gs( WORD val ) { __asm__( "mov %0,%%gs" :: "r" (val)); } + +@@ -679,7 +686,8 @@ static inline void *init_handler( const ucontext_t *sigcontext ) + } + #endif + +- if (!ldt_is_system(CS_sig(sigcontext)) || !ldt_is_system(SS_sig(sigcontext))) /* 16-bit mode */ ++ if ((CS_sig(sigcontext) != wine_cs && !ldt_is_system(CS_sig(sigcontext))) || ++ !ldt_is_system(SS_sig(sigcontext))) /* 16-bit mode */ + { + /* + * Win16 or DOS protected mode. Note that during switch +@@ -1170,7 +1178,7 @@ static inline DWORD is_privileged_instr( CONTEXT *context ) + BYTE instr[16]; + unsigned int i, len, prefix_count = 0; + +- if (!ldt_is_system( context->SegCs )) return 0; ++ if (context->SegCs != wine_cs && !ldt_is_system( context->SegCs )) return 0; + len = virtual_uninterrupted_read_memory( (BYTE *)context->Eip, instr, sizeof(instr) ); + + for (i = 0; i < len; i++) switch (instr[i]) +@@ -1237,7 +1245,7 @@ static inline BOOL check_invalid_gs( ucontext_t *sigcontext, CONTEXT *context ) + WORD system_gs = x86_thread_data()->gs; + + if (context->SegGs == system_gs) return FALSE; +- if (!ldt_is_system( context->SegCs )) return FALSE; ++ if (context->SegCs != wine_cs && !ldt_is_system( context->SegCs )) return FALSE; + /* only handle faults in system libraries */ + if (virtual_is_valid_code_address( instr, 1 )) return FALSE; + +@@ -1478,7 +1486,7 @@ C_ASSERT( (offsetof(struct stack_layout, xstate) == sizeof(struct stack_layout)) + EIP_sig(sigcontext) = (DWORD)pKiUserExceptionDispatcher; + /* clear single-step, direction, and align check flag */ + EFL_sig(sigcontext) &= ~(0x100|0x400|0x40000); +- CS_sig(sigcontext) = get_cs(); ++ CS_sig(sigcontext) = wine_cs; + DS_sig(sigcontext) = get_ds(); + ES_sig(sigcontext) = get_ds(); + FS_sig(sigcontext) = get_fs(); +@@ -2143,6 +2151,36 @@ static void ldt_set_entry( WORD sel, LDT_ENTRY entry ) + LDT_FLAGS_ALLOCATED); + } + ++static WORD internal_ldt_alloc_entry(void) ++{ ++ for (int idx = first_ldt_entry; idx < LDT_SIZE; idx++) ++ { ++ if (__wine_ldt_copy.flags[idx] & LDT_FLAGS_ALLOCATED) continue; ++ ++ /* mark selector as allocated */ ++ __wine_ldt_copy.flags[idx] |= LDT_FLAGS_ALLOCATED; ++ return (idx << 3) | 7; ++ } ++ return 0; ++} ++ ++static inline void cs_init( int first_thread ) ++{ ++ LDT_ENTRY entry; ++ sigset_t sigset; ++ ++ /* no locking for first thread */ ++ if (!first_thread) server_enter_uninterrupted_section( &ldt_mutex, &sigset ); ++ if (!wine_cs) ++ wine_cs = internal_ldt_alloc_entry(); ++ ++ entry = ldt_make_entry( 0, (UINT_PTR)-1, LDT_FLAGS_CODE|LDT_FLAGS_32BIT ); ++ ldt_set_entry( wine_cs, entry ); ++ ++ if (!first_thread) server_leave_uninterrupted_section( &ldt_mutex, &sigset ); ++ set_cs( wine_cs ); ++} ++ + static void ldt_set_fs( WORD sel, TEB *teb ) + { + if (sel == gdt_fs_sel) +@@ -2260,38 +2298,35 @@ void signal_init_threading(void) + NTSTATUS signal_alloc_thread( TEB *teb ) + { + struct x86_thread_data *thread_data = (struct x86_thread_data *)&teb->GdiTebBatch; ++ static int first_thread = 1; + + if (!gdt_fs_sel) + { +- static int first_thread = 1; + sigset_t sigset; +- int idx; ++ WORD sel; + LDT_ENTRY entry = ldt_make_entry( teb, page_size - 1, LDT_FLAGS_DATA | LDT_FLAGS_32BIT ); + + if (first_thread) /* no locking for first thread */ + { + /* leave some space if libc is using the LDT for %gs */ + if (!is_gdt_sel( get_gs() )) first_ldt_entry = 512; +- idx = first_ldt_entry; +- ldt_set_entry( (idx << 3) | 7, entry ); +- first_thread = 0; ++ sel = (first_ldt_entry << 3) | 7; ++ ldt_set_entry( sel, entry ); + } + else + { + server_enter_uninterrupted_section( &ldt_mutex, &sigset ); +- for (idx = first_ldt_entry; idx < LDT_SIZE; idx++) +- { +- if (__wine_ldt_copy.flags[idx]) continue; +- ldt_set_entry( (idx << 3) | 7, entry ); +- break; +- } ++ sel = internal_ldt_alloc_entry(); ++ if (sel) ldt_set_entry( sel, entry ); + server_leave_uninterrupted_section( &ldt_mutex, &sigset ); +- if (idx == LDT_SIZE) return STATUS_TOO_MANY_THREADS; ++ if (!sel) return STATUS_TOO_MANY_THREADS; + } +- thread_data->fs = (idx << 3) | 7; ++ thread_data->fs = sel; + } + else thread_data->fs = gdt_fs_sel; + ++ cs_init( first_thread ); ++ first_thread = 0; + teb->WOW32Reserved = __wine_syscall_dispatcher; + return STATUS_SUCCESS; + } diff --git a/0004-LoL-broken-client-update-fix.patch b/0004-LoL-broken-client-update-fix.patch new file mode 100644 index 000000000000..d33e044b51ea --- /dev/null +++ b/0004-LoL-broken-client-update-fix.patch @@ -0,0 +1,153 @@ +diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c +index 94b300c..9f44ddc 100644 +--- a/dlls/ntdll/unix/virtual.c ++++ b/dlls/ntdll/unix/virtual.c +@@ -111,6 +111,8 @@ struct file_view + unsigned int protect; /* protection for all pages at allocation time and SEC_* flags */ + }; + ++#define SYMBOLIC_LINK_QUERY 0x0001 ++ + /* per-page protection flags */ + #define VPROT_READ 0x01 + #define VPROT_WRITE 0x02 +@@ -4310,34 +4312,96 @@ static NTSTATUS get_working_set_ex( HANDLE process, LPCVOID addr, + return STATUS_SUCCESS; + } + ++static NTSTATUS read_nt_symlink( UNICODE_STRING *name, WCHAR *target, DWORD size ) ++{ ++ NTSTATUS status; ++ OBJECT_ATTRIBUTES attr; ++ HANDLE handle; ++ ++ attr.Length = sizeof(attr); ++ attr.RootDirectory = 0; ++ attr.Attributes = OBJ_CASE_INSENSITIVE; ++ attr.ObjectName = name; ++ attr.SecurityDescriptor = NULL; ++ attr.SecurityQualityOfService = NULL; ++ ++ if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) ++ { ++ UNICODE_STRING targetW; ++ targetW.Buffer = target; ++ targetW.MaximumLength = (size - 1) * sizeof(WCHAR); ++ status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); ++ if (!status) target[targetW.Length / sizeof(WCHAR)] = 0; ++ NtClose( handle ); ++ } ++ return status; ++} ++ ++static NTSTATUS follow_device_symlink( WCHAR *buffer, SIZE_T max_path_len, WCHAR *name, SIZE_T *current_path_len ) ++{ ++ WCHAR *p = buffer; ++ NTSTATUS status = STATUS_SUCCESS; ++ SIZE_T devname_len = 6; // e.g. \??\C: ++ UNICODE_STRING devname; ++ DWORD target_len; ++ ++ if (*current_path_len >= devname_len * sizeof(WCHAR) && name[devname_len - 1] == ':') { ++ devname.Buffer = name; ++ devname.Length = devname_len * sizeof(WCHAR); ++ if (!(status = read_nt_symlink( &devname, p, (max_path_len - *current_path_len) / sizeof(WCHAR) + devname_len + 1 ))) ++ { ++ target_len = lstrlenW(p); ++ *current_path_len -= devname_len * sizeof(WCHAR); // skip the device name ++ p += target_len; ++ ++ memcpy( p, name + devname_len, *current_path_len ); ++ *current_path_len += target_len * sizeof(WCHAR); ++ } ++ } ++ else memcpy( p, name, *current_path_len ); ++ ++ return status; ++} ++ + static NTSTATUS get_memory_section_name( HANDLE process, LPCVOID addr, + MEMORY_SECTION_NAME *info, SIZE_T len, SIZE_T *ret_len ) + { ++ SIZE_T current_path_len, max_path_len; ++ WCHAR *name; + NTSTATUS status; + + if (!info) return STATUS_ACCESS_VIOLATION; ++ max_path_len = len - sizeof(*info) - sizeof(WCHAR); // dont count null char ++ if (!(name = malloc( max_path_len ))) return STATUS_NO_MEMORY; + + SERVER_START_REQ( get_mapping_filename ) + { + req->process = wine_server_obj_handle( process ); + req->addr = wine_server_client_ptr( addr ); + if (len > sizeof(*info) + sizeof(WCHAR)) +- wine_server_set_reply( req, info + 1, len - sizeof(*info) - sizeof(WCHAR) ); ++ wine_server_set_reply( req, name, max_path_len ); + status = wine_server_call( req ); + if (!status || status == STATUS_BUFFER_OVERFLOW) + { +- if (ret_len) *ret_len = sizeof(*info) + reply->len + sizeof(WCHAR); +- if (len < sizeof(*info)) status = STATUS_INFO_LENGTH_MISMATCH; ++ current_path_len = reply->len; ++ if (len < sizeof(*info)) ++ { ++ status = STATUS_INFO_LENGTH_MISMATCH; ++ } ++ else if (!status) status = follow_device_symlink( (WCHAR *)(info + 1), max_path_len, name, ¤t_path_len); ++ ++ if (ret_len) *ret_len = sizeof(*info) + current_path_len + sizeof(WCHAR); + if (!status) + { + info->SectionFileName.Buffer = (WCHAR *)(info + 1); +- info->SectionFileName.Length = reply->len; +- info->SectionFileName.MaximumLength = reply->len + sizeof(WCHAR); +- info->SectionFileName.Buffer[reply->len / sizeof(WCHAR)] = 0; ++ info->SectionFileName.Length = current_path_len; ++ info->SectionFileName.MaximumLength = current_path_len + sizeof(WCHAR); ++ info->SectionFileName.Buffer[current_path_len / sizeof(WCHAR)] = 0; + } + } + } + SERVER_END_REQ; ++ free(name); + return status; + } + +diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c +index 185a406..b4eabf9 100644 +--- a/dlls/psapi/tests/psapi_main.c ++++ b/dlls/psapi/tests/psapi_main.c +@@ -471,7 +471,6 @@ static void test_GetMappedFileName(void) + ret = GetMappedFileNameA(GetCurrentProcess(), base, map_name, sizeof(map_name)); + ok(ret, "GetMappedFileName error %ld\n", GetLastError()); + ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); +- todo_wine + ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); + + SetLastError(0xdeadbeef); +@@ -482,7 +481,6 @@ static void test_GetMappedFileName(void) + { + ok(memcmp(map_nameW, nt_map_name, lstrlenW(map_nameW)) == 0, "map name does not start with a device name: %s\n", map_name); + WideCharToMultiByte(CP_ACP, 0, map_nameW, -1, map_name, MAX_PATH, NULL, NULL); +- todo_wine + ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); + } + +@@ -490,7 +488,6 @@ static void test_GetMappedFileName(void) + ret = GetMappedFileNameA(GetCurrentProcess(), base + 0x2000, map_name, sizeof(map_name)); + ok(ret, "GetMappedFileName error %ld\n", GetLastError()); + ok(ret > strlen(device_name), "map_name should be longer than device_name\n"); +- todo_wine + ok(memcmp(map_name, device_name, strlen(device_name)) == 0, "map name does not start with a device name: %s\n", map_name); + + SetLastError(0xdeadbeef); +@@ -566,7 +563,7 @@ static void test_GetProcessImageFileName(void) + { + /* Windows returns 2*strlen-1 */ + ok(ret >= strlen(szImgPath), "szImgPath=\"%s\" ret=%ld\n", szImgPath, ret); +- todo_wine ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); ++ ok(!strcmp(szImgPath, szMapPath), "szImgPath=\"%s\" szMapPath=\"%s\"\n", szImgPath, szMapPath); + } + + SetLastError(0xdeadbeef); diff --git a/0005-LoL-client-slow-start-fix.patch b/0005-LoL-client-slow-start-fix.patch new file mode 100644 index 000000000000..9758837ea3fa --- /dev/null +++ b/0005-LoL-client-slow-start-fix.patch @@ -0,0 +1,22 @@ +diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c +index 3d0c2deca35..b0c03d992d4 100644 +--- a/dlls/ws2_32/socket.c ++++ b/dlls/ws2_32/socket.c +@@ -2516,6 +2516,17 @@ int WINAPI select( int count, fd_set *read_ptr, fd_set *write_ptr, + + TRACE( "read %p, write %p, except %p, timeout %p\n", read_ptr, write_ptr, except_ptr, timeout ); + ++ static int is_RCS = -1; ++ if (is_RCS < 0) { ++ is_RCS = GetModuleHandleA(NULL) == GetModuleHandleA("RiotClientServices.exe"); ++ } ++ const struct timeval zero_tv = { 0, 1000 }; ++ if (is_RCS && read_ptr && write_ptr && except_ptr && timeout && timeout->tv_sec == 1 && timeout->tv_usec == 0) { ++ if (read_ptr->fd_count == 8 && write_ptr->fd_count == 0 && except_ptr->fd_count == 1) { ++ timeout = &zero_tv; ++ } ++ } ++ + if (!(sync_event = get_sync_event())) return -1; + + if (read_ptr) poll_count += read_ptr->fd_count; diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a7262d8c02d4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,191 @@ +# Maintainer: moonshadow565 <moonshadow565@hotmail.com> + +pkgname=wine-lol-staging +pkgver=7.7 +pkgrel=1 +pkgdesc='A compatibility layer for running Windows programs (staging branch) with LoL patches(abi.vsyscall32=0 version)' +arch=('x86_64') +url='https://www.wine-staging.com/' +license=('LGPL') +install=wine-lol-staging.install + +options=('staticlibs' '!lto' '!strip') + +source=("git+https://github.com/wine-staging/wine-staging.git#tag=v${pkgver}" + "git+https://github.com/wine-mirror/wine.git#tag=wine-${pkgver}" + "0002-LoL-6.17+-syscall-fix.patch" + "0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch" + "0004-LoL-broken-client-update-fix.patch" + "0005-LoL-client-slow-start-fix.patch" + ) + +sha256sums=('SKIP' + 'SKIP' + 'c127907db75cd8575da27198c8f46aa19dd2a219324e7491761f206f3ce91601' + 'c2cb9265567dfe8c9f148e237910792cad7666d9d3cbf68d8717076030cddc92' + '0c5b97c64fd4983119db8675f0686e26143898de1566c4da46d5df74cb98cfb2' + 'ad03a922191069774757f9f8b12c6eb9b87bbcf16da7b290adb9176fbcaa4ba8' + ) + +depends=( + 'attr' 'lib32-attr' + 'fontconfig' 'lib32-fontconfig' + 'lcms2' 'lib32-lcms2' + 'libxml2' 'lib32-libxml2' + 'libxcursor' 'lib32-libxcursor' + 'libxrandr' 'lib32-libxrandr' + 'libxdamage' 'lib32-libxdamage' + 'libxi' 'lib32-libxi' + 'gettext' 'lib32-gettext' + 'freetype2' 'lib32-freetype2' + 'glu' 'lib32-glu' + 'libsm' 'lib32-libsm' + 'gcc-libs' 'lib32-gcc-libs' + 'libpcap' 'lib32-libpcap' + 'faudio' 'lib32-faudio' + 'desktop-file-utils' +) + +makedepends=('git' 'autoconf' 'bison' 'perl' 'fontforge' 'flex' 'mingw-w64-gcc' + 'giflib' 'lib32-giflib' + 'libpng' 'lib32-libpng' + 'gnutls' 'lib32-gnutls' + 'libxinerama' 'lib32-libxinerama' + 'libxcomposite' 'lib32-libxcomposite' + 'libxmu' 'lib32-libxmu' + 'libxxf86vm' 'lib32-libxxf86vm' + 'libldap' 'lib32-libldap' + 'mpg123' 'lib32-mpg123' + 'openal' 'lib32-openal' + 'v4l-utils' 'lib32-v4l-utils' + 'alsa-lib' 'lib32-alsa-lib' + 'libxcomposite' 'lib32-libxcomposite' + 'mesa' 'lib32-mesa' + 'libgl' 'lib32-libgl' + 'opencl-icd-loader' 'lib32-opencl-icd-loader' + 'libxslt' 'lib32-libxslt' + 'libpulse' 'lib32-libpulse' + 'libva' 'lib32-libva' + 'gtk3' 'lib32-gtk3' + 'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs' + 'vulkan-icd-loader' 'lib32-vulkan-icd-loader' + 'sdl2' 'lib32-sdl2' + 'vkd3d' 'lib32-vkd3d' + 'libcups' 'lib32-libcups' + 'sane' + 'libgphoto2' + 'gsm' + 'ffmpeg' + 'samba' + 'opencl-headers' + 'vulkan-headers' +) + +optdepends=( + 'giflib' 'lib32-giflib' + 'libpng' 'lib32-libpng' + 'libldap' 'lib32-libldap' + 'gnutls' 'lib32-gnutls' + 'mpg123' 'lib32-mpg123' + 'openal' 'lib32-openal' + 'v4l-utils' 'lib32-v4l-utils' + 'libpulse' 'lib32-libpulse' + 'alsa-plugins' 'lib32-alsa-plugins' + 'alsa-lib' 'lib32-alsa-lib' + 'libjpeg-turbo' 'lib32-libjpeg-turbo' + 'libxcomposite' 'lib32-libxcomposite' + 'libxinerama' 'lib32-libxinerama' + 'opencl-icd-loader' 'lib32-opencl-icd-loader' + 'libxslt' 'lib32-libxslt' + 'libva' 'lib32-libva' + 'gtk3' 'lib32-gtk3' + 'gst-plugins-base-libs' 'lib32-gst-plugins-base-libs' + 'vulkan-icd-loader' 'lib32-vulkan-icd-loader' + 'sdl2' 'lib32-sdl2' + 'vkd3d' 'lib32-vkd3d' + 'sane' + 'libgphoto2' + 'gsm' + 'ffmpeg' + 'cups' + 'samba' + 'dosbox' +) + +prepare() { + rm -rf build-32 + mkdir -p build-32 + + # restore the wine tree to its git origin state, without wine-staging patches + printf '%s\n' ' -> Cleaning wine source code tree...' + git -C wine reset --hard HEAD # restore tracked files + git -C wine clean -xdf # delete untracked files + + # change back to the wine upstream commit that this version of wine-staging is based in + printf '%s\n' ' -> Changing wine HEAD to the wine-staging base commit...' + git -C wine config --local advice.detachedHead false + git -C wine checkout "$(wine-staging/patches/patchinstall.sh --upstream-commit)" + + # fix path of opencl headers + sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i wine/configure* + + # fix openldap 2.5+ detection + sed 's/-lldap_r/-lldap/' -i wine/configure + + # apply all wine-staging patches + printf '%s\n' ' -> Applying wine-staging patches...' + wine-staging/patches/patchinstall.sh DESTDIR="${srcdir}/wine" --all + + cd "${srcdir}/wine" + + # Reverts syscall thunks so leagues stub.dll can hook them properly(?) + printf 'Apply 0002-LoL-6.17+-syscall-fix\n' + patch -Np1 < "${srcdir}/0002-LoL-6.17+-syscall-fix.patch" + + # Fakes cs segment, needs "sudo sysctl -w abi.vsyscall32=0" + printf 'Apply 0003-LoL-abi.vsyscall32\n' + patch -Np1 < "${srcdir}/0003-LoL-abi.vsyscall32-alternative_patch_by_using_a_fake_cs_segment.patch" + + # Something with resolving long paths and symlinks, might not be needed if you keep your install in sane place ??? + printf 'Apply 0004-LoL-broken-client-update-fix\n' + patch -Np1 < "${srcdir}/0004-LoL-broken-client-update-fix.patch" + + # Hack for league to start in reasonable time + printf 'Apply 0005-LoL-client-slow-start-fix.patch\n' + patch -Np1 < "${srcdir}/0005-LoL-client-slow-start-fix.patch" +} + +build() { + # does not compile without remove these flags as of 4.10 + export CFLAGS="${CFLAGS/-fno-plt/} -m32" + export LDFLAGS="${LDFLAGS/,-z,now/}" + + # build wine-staging 32-bit + printf '%s\n' ' -> Building wine-staging-32...' + cd "${srcdir}/build-32" + export PKG_CONFIG_PATH='/usr/lib32/pkgconfig' + ../wine/configure \ + --prefix='/opt/wine-lol-staging' \ + --libdir='/opt/wine-lol-staging/lib32' \ + --with-x \ + --with-gstreamer \ + --with-xattr \ + --with-mingw \ + --disable-tests \ + --disable-winemenubuilder \ + --disable-win16 + make -j12 +} + +package() { + # package wine-staging 32-bit + printf '%s\n' ' -> Packaging wine-staging-32...' + cd build-32 + make prefix="${pkgdir}/opt/wine-lol-staging" \ + libdir="${pkgdir}/opt/wine-lol-staging/lib32" \ + dlldir="${pkgdir}/opt/wine-lol-staging/lib32/wine" \ + install + + find "$pkgdir"/opt/wine-lol-staging/lib32/wine -iname "*.a" -delete + find "$pkgdir"/opt/wine-lol-staging/lib32/wine -iname "*.def" -delete +} diff --git a/wine-lol-staging.install b/wine-lol-staging.install new file mode 100755 index 000000000000..8612960b4134 --- /dev/null +++ b/wine-lol-staging.install @@ -0,0 +1,17 @@ +post_install() +{ + echo "+-----------------------------------------------------------------------------------+" + echo "| IMPORTANT! [x] |" + echo "+-----------------------------------------------------------------------------------+" + echo "| |" + echo "| 1. run 'sudo sysctl -w abi.vsyscall32=0' on each reboot before starting a game |" + echo "| |" + echo "| 2. run '/opt/wine-lol-staging/bin/wine' instead of regular 'wine' or add to PATH |" + echo "| |" + echo "+-----------------------------------------------------------------------------------+" +} + +post_upgrade() +{ + post_install +} |