diff --git a/system/wine/30-win32-aliases.conf b/system/wine/30-win32-aliases.conf
new file mode 100644
index 0000000000..99ae1f7b83
--- /dev/null
+++ b/system/wine/30-win32-aliases.conf
@@ -0,0 +1,20 @@
+
+
+
+
+ MS Shell Dlg
+ Microsoft Sans Serif
+ sans-serif
+
+
+ MS Shell Dlg 2
+ Tahoma
+ sans-serif
+
+
+
+ MS Sans Serif
+ Microsoft Sans Serif
+ sans-serif
+
+
diff --git a/system/wine/README b/system/wine/README
index df81467072..d0cb2a2c44 100644
--- a/system/wine/README
+++ b/system/wine/README
@@ -20,51 +20,11 @@ you may disable OpenGL support by using:
OPENGL=no ./wine.SlackBuild
-The above options can be combined.
-
-This SlackBuild will try to autodetect whether to build for 32 or 64
-bits or both. WINE64 and WINE32 can be used to enable/disable each
-ARCH:
-
- WINE64=no ./wine.SlackBuild
- WINE32=no ./wine.SlackBuild
-
-The executable for 64 bit wine is named wine64.
-
-=======================================================================
-
-MULTILIB
-
-To build the 32 bit wine on x86_64 you will need to have multilib
-packages installed.
-
-AlienBOB's multilib readme and repo:
-
-https://docs.slackware.com/slackware:multilib
-http://www.slackware.com/~alien/multilib/
-
-A script that rsyncs with alienBOB's repo and installs the multilib
-packages which can be found here:
-
-https://slackware.uk/~dive/scripts/alien-multilib-rsync.sh
-
-Be sure to read the short instructions at the top. If you use slackpkg
-then you will also want to blacklist his packages in
-/etc/slackpkg/blacklist:
-
-[0-9]+alien
-[0-9]+compat32
-
=======================================================================
NOTES
-With 64 bit support you would use the wine64 binary. If you have a
-combined 32 and 64 bit package you need to set the environmental
-variable WINEPREFIX to point to the 64 bit wine directory when running
-wine64, which should be different to the 32 bit directory (~/.wine by
-default).
-
-Example:
-
-WINEPREFIX=~/.wine64 wine64 notepad
+64bit systems now default to the new WOW64 mode which builds both 64bit
+and 32bit PE dlls. This has removed the multilib dependency that was
+pereviously required and will allow execution of both 64bit and 32bit
+binaries. No multilib required.
diff --git a/system/wine/doinst.sh b/system/wine/doinst.sh
index 392c12adb9..726ffe403b 100644
--- a/system/wine/doinst.sh
+++ b/system/wine/doinst.sh
@@ -2,3 +2,8 @@ if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications
fi
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/system/wine/0001-winhlp32-Workaround-a-bug-in-Flex.patch b/system/wine/flex.patch
similarity index 90%
rename from system/wine/0001-winhlp32-Workaround-a-bug-in-Flex.patch
rename to system/wine/flex.patch
index d674ead817..52fc3ff53a 100644
--- a/system/wine/0001-winhlp32-Workaround-a-bug-in-Flex.patch
+++ b/system/wine/flex.patch
@@ -19,8 +19,8 @@ index 8f6945ca988..da2dd22e447 100644
+%option noinput nounput never-interactive 8bit noyywrap
%x quote
%{
- #include "config.h"
-@@ -367,7 +367,3 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void)
+ #include
+@@ -366,7 +366,3 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void)
{
return lex_data ? lex_data->window : Globals.active_win;
}
@@ -29,5 +29,3 @@ index 8f6945ca988..da2dd22e447 100644
-int yywrap(void) { return 1; }
-#endif
--
-2.11.0
-
diff --git a/system/wine/wine-binfmt.conf b/system/wine/wine-binfmt.conf
new file mode 100644
index 0000000000..4d43073365
--- /dev/null
+++ b/system/wine/wine-binfmt.conf
@@ -0,0 +1,2 @@
+# Start WINE on Windows executables
+:DOSWin:M::MZ::/usr/bin/wine:
diff --git a/system/wine/wine-browsedrive.desktop b/system/wine/wine-browsedrive.desktop
new file mode 100644
index 0000000000..4454f7abd7
--- /dev/null
+++ b/system/wine/wine-browsedrive.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Browse C: Drive
+Comment=Browse your virtual C: drive
+Exec=wine winebrowser c:
+Terminal=false
+Type=Application
+Icon=folder-wine
+Categories=System;X-Wine;
diff --git a/system/wine/wine-uninstaller.desktop b/system/wine/wine-uninstaller.desktop
new file mode 100644
index 0000000000..0a26ce2c4a
--- /dev/null
+++ b/system/wine/wine-uninstaller.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Uninstall Wine Software
+Comment=Uninstall Windows applications for Wine
+Exec=wine uninstaller
+Terminal=false
+Type=Application
+Icon=wine-uninstaller
+Categories=System;X-Wine;
diff --git a/system/wine/wine.SlackBuild b/system/wine/wine.SlackBuild
index 12a0939ec6..8f2a826fc0 100644
--- a/system/wine/wine.SlackBuild
+++ b/system/wine/wine.SlackBuild
@@ -28,7 +28,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=wine
VERSION=${VERSION:-9.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -56,19 +56,6 @@ else
do_opengl="without"
fi
-WINE32=${WINE32@L}
-WINE64=${WINE64@L}
-WINETMP="$( mktemp -d $TMP/wine-test-XXXXXX )"
-echo "int main(void) {; return(0); }" > "$WINETMP/test.c"
-gcc -m32 "$WINETMP/test.c" -o /dev/null >/dev/null 2>&1 && WINE32=${WINE32:-yes}
-gcc -m64 "$WINETMP/test.c" -o /dev/null >/dev/null 2>&1 && WINE64=${WINE64:-yes}
-rm -rf "$WINETMP"
-
-if [ "$WINE32$WINE64" = "nono" ]; then
- echo "Both 64 and 32 bit builds disabled. Nothing to do."
- exit 1
-fi
-
BUILD_ARCH="$ARCH-slackware-linux"
SLKCFLAGS="-O2"
@@ -82,10 +69,12 @@ case "$ARCH" in
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911
# https://bugs.gentoo.org/613128
SLKCFLAGS="-Os -march=$ARCH -mtune=i686"
+ WINE32="yes"
;;
x86_64)
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+ WINE64="yes"
;;
esac
@@ -105,7 +94,11 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Fix for flex
-patch -p1 --verbose < $CWD/0001-winhlp32-Workaround-a-bug-in-Flex.patch
+patch -p1 --verbose < $CWD/flex.patch
+# WriteCopy Fix
+patch -p1 < $CWD/writecopy.patch
+# Fix path of opencl headers.
+sed 's|OpenCL/opencl.h|CL/opencl.h|g' -i configure*
if [ "$WINE64" = "yes" ]; then
wine64="--with-wine64=../wine64"
@@ -122,6 +115,7 @@ if [ "$WINE64" = "yes" ]; then
--sysconfdir=/etc \
--mandir=/usr/man \
--enable-win64 \
+ --enable-archs="i386,x86_64" \
--with-x \
--with-gnutls \
--${do_opengl}-opengl \
@@ -169,8 +163,31 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+# Add font configuration:
+install -d $PKG/etc/fonts/conf.{avail,d}
+install -m644 $CWD/30-win32-aliases.conf $PKG/etc/fonts/conf.avail
+ln -sf /etc/fonts/conf.avail/30-win32-aliases.conf $PKG/etc/fonts/conf.d/30-win32-aliases.conf
+install -Dm 644 $CWD/wine-binfmt.conf $PKG/usr/lib$LIBDIRSUFFIX/binfmt.d/wine.conf
+
+# Create Wine menu structure:
+mkdir -p $PKG/etc/xdg/menus/applications-merged
+cp $CWD/wine.menu $PKG/etc/xdg/menus/applications-merged
+
+# Add a desktop menu for winecfg, wine-uninstaller and wine-browsedrive:
+mkdir -p $PKG/usr/share/{applications,icons/hicolor/scalable/apps,pixmaps}
+
+convert $CWD/wine.svg -scale 64 $PKG/usr/share/pixmaps/wine.png
+cp $CWD/wine.svg $PKG/usr/share/icons/hicolor/scalable/apps/
+
+convert $CWD/winecfg.png -scale 64 $PKG/usr/share/pixmaps/winecfg.png
+convert $CWD/winecfg.png -scale 64 $PKG/usr/share/pixmaps/folder-wine.png
+convert $CWD/winecfg.png -scale 64 $PKG/usr/share/pixmaps/wine-uninstaller.png
+
+cp programs/winecfg/winecfg.svg $PKG/usr/share/icons/hicolor/scalable/apps/
+cp $CWD/*.desktop $PKG/usr/share/applications/
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ANNOUNCE.md AUTHORS COPYING.LIB LICENSE* README.md VERSION \
+cp -a ANNOUNCE.md AUTHORS COPYING.* LICENSE* README.md VERSION \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
diff --git a/system/wine/wine.menu b/system/wine/wine.menu
new file mode 100644
index 0000000000..cf32bd67b0
--- /dev/null
+++ b/system/wine/wine.menu
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/system/wine/wine.svg b/system/wine/wine.svg
new file mode 100644
index 0000000000..15fa028df2
--- /dev/null
+++ b/system/wine/wine.svg
@@ -0,0 +1,127 @@
+
+
+
diff --git a/system/wine/winecfg.desktop b/system/wine/winecfg.desktop
new file mode 100644
index 0000000000..16999d8ba1
--- /dev/null
+++ b/system/wine/winecfg.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Exec=winecfg
+Icon=winecfg
+Terminal=false
+Name=Wine Configuration
+Comment=Configure Wine
+Type=Application
+Categories=Settings;
diff --git a/system/wine/winecfg.png b/system/wine/winecfg.png
new file mode 100644
index 0000000000..48812f040a
Binary files /dev/null and b/system/wine/winecfg.png differ
diff --git a/system/wine/writecopy.patch b/system/wine/writecopy.patch
new file mode 100644
index 0000000000..d067dccd92
--- /dev/null
+++ b/system/wine/writecopy.patch
@@ -0,0 +1,18 @@
+@@ -, +, @@
+---
+ dlls/kernelbase/memory.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+--- a/dlls/kernelbase/memory.c
++++ a/dlls/kernelbase/memory.c
+@@ -481,7 +481,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualLock( void *addr, SIZE_T size )
+ */
+ BOOL WINAPI DECLSPEC_HOTPATCH VirtualProtect( void *addr, SIZE_T size, DWORD new_prot, DWORD *old_prot )
+ {
+- return VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
++ BOOL ret = VirtualProtectEx( GetCurrentProcess(), addr, size, new_prot, old_prot );
++ if (*old_prot == PAGE_WRITECOPY) *old_prot = PAGE_READWRITE;
++ return ret;
+ }
+
+
+--