Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
winetricks
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
winetricks
Commits
d05bdfbd
Commit
d05bdfbd
authored
Feb 22, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add patches with rewrite new style wow64 support (github #2191)
parent
08a8a9e3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
214 additions
and
0 deletions
+214
-0
0001-Remove-unuseful-binary-arch-detection.patch
patches/0001-Remove-unuseful-binary-arch-detection.patch
+99
-0
0002-add-w_expand_env32-and-w_expand_env64-and-using-them.patch
...dd-w_expand_env32-and-w_expand_env64-and-using-them.patch
+108
-0
0003-Rename-w_try_regsvr-to-w_try_regsvr32.patch
patches/0003-Rename-w_try_regsvr-to-w_try_regsvr32.patch
+0
-0
winetricks.spec
winetricks.spec
+7
-0
No files found.
patches/0001-Remove-unuseful-binary-arch-detection.patch
0 → 100644
View file @
d05bdfbd
From a5fbd3bb1e8d45f1fb68ffe52c4e455aa093aa6c Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Tue, 20 Feb 2024 00:02:13 +0300
Subject: [PATCH 1/3] Remove unuseful binary arch detection
To: wine-devel <wine-devel@winehq.org>
---
src/winetricks | 53 +++++++++-----------------------------------------
1 file changed, 9 insertions(+), 44 deletions(-)
diff --git a/src/winetricks b/src/winetricks
index 4bdc9da..86a2570 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -1064,34 +1064,6 @@ w_expand_env()
winetricks_early_wine_arch cmd.exe /c echo "%$1%"
}
-# Determine what architecture a binary file is built for
-winetricks_get_file_arch()
-{
- _W_file="$1"
- # macOS uses Mach-O binaries, not ELF
- if [ "$(uname -s)" = "Darwin" ]; then
- _W_lipo_output="$(lipo -archs "${_W_file}")"
- case "${_W_lipo_output}" in
- "arm64") _W_file_arch="arm64" ;;
- "i386") _W_file_arch="i386" ;;
- "x86_64") _W_file_arch="x86_64" ;;
- *) w_die "Unknown file arch: ${_W_lipo_output}" ;;
- esac
- else
- # Assume ELF binaries for everything else
- _W_ob_output="$(od -An -t x1 -j 0x12 -N 1 "${_W_file}" | tr -d "[:space:]")"
- case "${_W_ob_output}" in
- "3e") _W_file_arch="x86_64" ;;
- "03"|"06") _W_file_arch="i386" ;;
- "b7") _W_file_arch="aarch64" ;;
- "28") _W_file_arch="aarch32" ;;
- *) w_die "Unknown file arch: ${_W_ob_output}";;
- esac
- fi
-
- echo "${_W_file_arch}"
-}
-
# Get the latest tagged release from github.com API
w_get_github_latest_release()
{
@@ -5060,20 +5032,6 @@ winetricks_set_wineprefix()
# Using the variable W_SYSTEM32_DLLS instead of SYSTEM32 because some stuff does go under system32 for both arch's
# e.g., spool/drivers/color
if test -d "${W_DRIVE_C}/windows/syswow64"; then
- # Check the bitness of wineserver + wine binary, used later to determine if we're on a WOW setup (no wine64)
- # https://github.com/Winetricks/winetricks/issues/2030
- WINESERVER_BIN="$(which "${WINESERVER}")"
- _W_wineserver_binary_arch="$(winetricks_get_file_arch "${WINESERVER_BIN}")"
- WINE_BIN="$(which "${WINE}")"
- _W_wine_binary_arch="$(winetricks_get_file_arch "${WINE_BIN}")"
-
- # determine wow64 type (new/old)
- # FIXME: check what upstream is calling them
- if [ "${_W_wineserver_binary_arch}" = "${_W_wine_binary_arch}" ]; then
- _W_wow64_style="new"
- else
- _W_wow64_style="classic"
- fi
# Probably need fancier handling/checking, but for a basic start:
# Note 'wine' may be named 'wine-stable'/'wine-staging'/etc.):
@@ -5082,8 +5040,6 @@ winetricks_set_wineprefix()
# WINE_MULTI = generic wine, new name
if [ -n "${WINE64}" ]; then
true
- elif [ "${_W_wow64_style}" = "new" ]; then
- WINE64="${WINE}"
elif [ "${WINE%??}64" = "${WINE}" ]; then
WINE64="${WINE}"
elif command -v "${WINE}64" >/dev/null 2>&1; then
@@ -5093,7 +5049,16 @@ winetricks_set_wineprefix()
WINE64="$(dirname "${WINE}")/"
[ "${WINE64}" = "./" ] && WINE64=""
WINE64="${WINE64}$(basename "${WINE}" | sed 's/^wine/wine64/')"
+ test -x "${WINE64}" || WINE64="${WINE}"
+ fi
+
+ # if we can't detect wine64 command, it is the new wow64 mode
+ if echo "${WINE64}" | grep -q "wine64" ; then
+ _W_wow64_style="classic"
+ else
+ _W_wow64_style="new"
fi
+
WINE_ARCH="${WINE64}"
WINE_MULTI="${WINE}"
W_ARCH=win64
--
2.42.1
patches/0002-add-w_expand_env32-and-w_expand_env64-and-using-them.patch
0 → 100644
View file @
d05bdfbd
From 815a01132de8fbb2b66f68a29e0aa2f024b0541c Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Tue, 20 Feb 2024 12:12:31 +0300
Subject: [PATCH 2/3] add w_expand_env32 and w_expand_env64 and using them to
get correct paths
To: wine-devel <wine-devel@winehq.org>
---
src/winetricks | 38 ++++++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/src/winetricks b/src/winetricks
index 86a2570..7db190d 100755
--- a/src/winetricks
+++ b/src/winetricks
@@ -1064,6 +1064,16 @@ w_expand_env()
winetricks_early_wine_arch cmd.exe /c echo "%$1%"
}
+w_expand_env32()
+{
+ winetricks_early_wine "${W_SYSTEM32_DLLS_WIN}\\cmd.exe" /c echo "%$1%"
+}
+
+w_expand_env64()
+{
+ WINE=${WINE64} winetricks_early_wine "${W_SYSTEM64_DLLS_WIN64}\\cmd.exe" /c echo "%$1%"
+}
+
# Get the latest tagged release from github.com API
w_get_github_latest_release()
{
@@ -5063,9 +5073,6 @@ winetricks_set_wineprefix()
WINE_MULTI="${WINE}"
W_ARCH=win64
- W_PROGRAMS_WIN="$(w_expand_env ProgramFiles)"
- W_PROGRAMS_UNIX="$(w_pathconv -u "${W_PROGRAMS_WIN}")"
-
# Common variable for 32-bit dlls on win32/win64:
W_SYSTEM32_DLLS="${W_WINDIR_UNIX}/syswow64"
W_SYSTEM32_DLLS_WIN="C:\\windows\\syswow64"
@@ -5074,18 +5081,21 @@ winetricks_set_wineprefix()
W_SYSTEM64_DLLS_WIN32="C:\\windows\\sysnative" # path to access 64-bit dlls from 32-bit apps
W_SYSTEM64_DLLS_WIN64="C:\\windows\\system32" # path to access 64-bit dlls from 64-bit apps
+ W_PROGRAMS_WIN="$(w_expand_env64 ProgramFiles)"
+ W_PROGRAMS_UNIX="$(w_pathconv -u "${W_PROGRAMS_WIN}")"
+
# There's also ProgramW6432, which =%ProgramFiles%(but only available when running under a 64 bit OS)
# See https://ss64.com/nt/syntax-variables.html
- W_PROGRAMW6432_WIN="$(w_expand_env ProgramW6432)"
+ W_PROGRAMW6432_WIN="$(w_expand_env64 ProgramW6432)"
W_PROGRAMW6432_UNIX="$(w_pathconv -u "${W_PROGRAMW6432_WIN}")"
# 64-bit Windows has a second directory for program files
- W_PROGRAMS_X86_WIN="${W_PROGRAMS_WIN} (x86)"
- W_PROGRAMS_X86_UNIX="${W_PROGRAMS_UNIX} (x86)"
+ W_PROGRAMS_X86_WIN="$(w_expand_env32 ProgramFiles)"
+ W_PROGRAMS_X86_UNIX="$(w_pathconv -u "${W_PROGRAMS_X86_WIN}")"
- W_COMMONFILES_X86_WIN="$(w_expand_env CommonProgramFiles\(x86\))"
+ W_COMMONFILES_X86_WIN="$(w_expand_env64 CommonProgramFiles\(x86\))"
W_COMMONFILES_X86="$(w_pathconv -u "${W_COMMONFILES_X86_WIN}")"
- W_COMMONFILES_WIN="$(w_expand_env CommonProgramW6432)"
+ W_COMMONFILES_WIN="$(w_expand_env64 CommonProgramW6432)"
W_COMMONFILES="$(w_pathconv -u "${W_COMMONFILES_WIN}")"
# 64-bit prefixes still have plenty of issues/a lot of verbs only install 32-bit libraries
@@ -5130,9 +5140,6 @@ winetricks_set_wineprefix()
WINE_MULTI="${WINE}"
W_ARCH=win32
- W_PROGRAMS_WIN="$(w_expand_env ProgramFiles)"
- W_PROGRAMS_UNIX="$(w_pathconv -u "${W_PROGRAMS_WIN}")"
-
# Common variable for 32-bit dlls on win32/win64:
W_SYSTEM32_DLLS="${W_WINDIR_UNIX}/system32"
W_SYSTEM32_DLLS_WIN="C:\\windows\\system32"
@@ -5143,19 +5150,22 @@ winetricks_set_wineprefix()
W_SYSTEM64_DLLS_WIN32="C:\\does-not-exist-on-win32" # path to access 64-bit dlls from 32-bit apps
W_SYSTEM64_DLLS_WIN64="C:\\does-not-exist-on-win32" # path to access 64-bit dlls from 64-bit apps
+ W_PROGRAMS_WIN="$(w_expand_env32 ProgramFiles)"
+ W_PROGRAMS_UNIX="$(w_pathconv -u "${W_PROGRAMS_WIN}")"
+
W_PROGRAMS_X86_WIN="${W_PROGRAMS_WIN}"
W_PROGRAMS_X86_UNIX="${W_PROGRAMS_UNIX}"
- W_COMMONFILES_X86_WIN="$(w_expand_env CommonProgramFiles)"
+ W_COMMONFILES_X86_WIN="$(w_expand_env32 CommonProgramFiles)"
W_COMMONFILES_X86="$(w_pathconv -u "${W_COMMONFILES_X86_WIN}")"
- W_COMMONFILES_WIN="$(w_expand_env CommonProgramFiles)"
+ W_COMMONFILES_WIN="$(w_expand_env32 CommonProgramFiles)"
W_COMMONFILES="$(w_pathconv -u "${W_COMMONFILES_WIN}")"
fi
## Arch independent variables:
# Note: using AppData since it's arch independent
- W_APPDATA_WIN="$(w_expand_env AppData)"
+ W_APPDATA_WIN="$(w_expand_env32 AppData)"
W_APPDATA_UNIX="$(w_pathconv -u "${W_APPDATA_WIN}")"
case "${W_APPDATA_WIN}" in
--
2.42.1
patches/0003-Rename-w_try_regsvr-to-w_try_regsvr32.patch
0 → 100644
View file @
d05bdfbd
This diff is collapsed.
Click to expand it.
winetricks.spec
View file @
d05bdfbd
...
@@ -16,6 +16,10 @@ Source: %name-%version.tar
...
@@ -16,6 +16,10 @@ Source: %name-%version.tar
Patch2: 0001-winetricks-try-use-xvt-as-terminal.patch
Patch2: 0001-winetricks-try-use-xvt-as-terminal.patch
Patch10: 0001-Remove-unuseful-binary-arch-detection.patch
Patch11: 0002-add-w_expand_env32-and-w_expand_env64-and-using-them.patch
Patch12: 0003-Rename-w_try_regsvr-to-w_try_regsvr32.patch
BuildArch: noarch
BuildArch: noarch
ExclusiveArch: %ix86 x86_64 %arm aarch64
ExclusiveArch: %ix86 x86_64 %arm aarch64
...
@@ -47,6 +51,9 @@ or tweak various Wine settings individually.
...
@@ -47,6 +51,9 @@ or tweak various Wine settings individually.
%prep
%prep
%setup
%setup
%patch2 -p1
%patch2 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
# fix req. Disable autoreq at all?
# fix req. Disable autoreq at all?
%__subst 's|fusermount|a= fusermount|' src/winetricks
%__subst 's|fusermount|a= fusermount|' src/winetricks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment