├── README.md
├── build32.sh
└── build64.sh
/README.md:
--------------------------------------------------------------------------------
1 | # WineD3D For Windows Build Scripts
2 | This repository contains the scripts I use to build [WineD3D For Windows](https://wined3d.fdossena.com).
3 |
4 | ## Download
5 | You can get prebuilt DLL files from [my website](https://wined3d.fdossena.com)
6 |
7 | __If you're trying to fix an old game, you _must use_ the 32 bit version, even on 64 bit systems.__
8 |
9 | ## Compatibility
10 | These scripts were tested on Arch Linux and Debian. Older versions of this project supported Debian exclusively.
11 |
12 | ## How to build
13 | ### Prerequisites
14 | To build WineD3D, you'll need to download some libraries first, most of them are probably already installed in your system. It is __strongly recommended__ to use a dedicated VM for building.
15 |
16 | __Arch, Manjaro, etc.__ (Recommended)
17 | ```bash
18 | sudo pacman -Sy alsa-lib attr autoconf bison desktop-file-utils faudio ffmpeg flex fontconfig fontforge freetype2 gcc-libs gettext giflib git glu gnutls gsm gst-plugins-base-libs gtk3 lcms2 lib32-alsa-lib lib32-attr lib32-faudio lib32-fontconfig lib32-freetype2 lib32-gcc-libs lib32-gettext lib32-giflib lib32-glu lib32-gnutls lib32-gst-plugins-base-libs lib32-gtk3 lib32-lcms2 lib32-libcups lib32-libgl lib32-libldap lib32-libpcap lib32-libpng lib32-libpulse lib32-libsm lib32-libva lib32-libxcomposite lib32-libxcomposite lib32-libxcursor lib32-libxdamage lib32-libxi lib32-libxinerama lib32-libxml2 lib32-libxmu lib32-libxrandr lib32-libxslt lib32-libxxf86vm lib32-mesa lib32-mpg123 lib32-openal lib32-opencl-icd-loader lib32-sdl2 lib32-v4l-utils lib32-vkd3d lib32-vulkan-icd-loader libcups libgl libgphoto2 libldap libpcap libpng libpulse libsm libva libxcomposite libxcomposite libxcursor libxdamage libxi libxinerama libxml2 libxmu libxrandr libxslt libxxf86vm mesa mingw-w64-gcc mpg123 openal opencl-headers opencl-icd-loader perl samba sane sdl2 sharutils v4l-utils vkd3d vulkan-headers vulkan-icd-loader
19 | ```
20 |
21 | __Debian, Ubuntu, etc.__
22 | Note: you need to use a 32 bit version of Debian to build the 32 bit DLLs and a 64 bit version for the 64 bit ones.
23 |
24 | ```bash
25 | sudo apt build-dep wine
26 | sudo apt install mingw-w64 git
27 | ```
28 |
29 | ### Building
30 | __Latest version of WineD3D__
31 | ```bash
32 | sh build32.sh
33 | ```
34 | The build process will take some time, at the end, you'll find 2 directories called wined3d and wined3d-staging, which will contain the build DLLs. The staging variant is built using [wine-staging](http://github.com/wine-compholio/wine-staging), which may improve compatibility.
35 |
36 | __Specific version of WineD3D__
37 | If you want to build a specific version of WineD3D, all you have to do is download the tarball of the version you want to build, extract it, and run
38 | ```bash
39 | sh build32.sh path_to_source_code/
40 | ```
41 | The build process will take some time, at the end, you'll find 2 directories called wined3d and wined3d-staging, which will contain the build DLLs. The staging variant is built using [wine-staging](http://github.com/wine-compholio/wine-staging), which may improve compatibility.
42 |
43 | Note that this build may fail on very old versions of Wine.
44 |
45 | ### 64 bit build
46 | The 64 bit version of WineD3D is only useful to run 64 bit apps on 64 bit Windows, it is __not for old games__.
47 |
48 | To build 64 bit DLLs, simply replace `build32.sh` in the previous commands with `build64.sh`
49 |
50 | ## Special thanks
51 | Thanks to Syvat G for improving the patched version to enhance compatibility!
52 |
53 | ## License
54 | Copyright (C) 2014-2022 Federico Dossena
55 |
56 | This program is free software: you can redistribute it and/or modify
57 | it under the terms of the GNU General Public License as published by
58 | the Free Software Foundation, either version 3 of the License, or
59 | (at your option) any later version.
60 |
61 | This program is distributed in the hope that it will be useful,
62 | but WITHOUT ANY WARRANTY; without even the implied warranty of
63 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64 | GNU General Public License for more details.
65 |
66 | You should have received a copy of the GNU General Public License
67 | along with this program. If not, see .
68 |
--------------------------------------------------------------------------------
/build32.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo Checking system...
3 | touch test_wined3d
4 | if [ $? -ne 0 ]
5 | then
6 | echo Cannot write in this directory
7 | exit 14
8 | fi
9 | rm -f test_wined3d
10 | parallelism=$(grep -c ^processor /proc/cpuinfo)
11 | echo Cleaning up...
12 | unset CC
13 | rm -rf wine-tools wine-win32 wine-git wine-staging
14 | mkdir wine-tools wine-win32
15 | if [ -z ${1} ]
16 | then
17 | echo Downloading wine...
18 | git clone git://source.winehq.org/git/wine.git ./wine-git
19 | if [ $? -ne 0 ]
20 | then
21 | echo Download failed with error $?
22 | exit 2
23 | fi
24 | p="wine-git/"
25 | else
26 | echo Building from $1
27 | p=$1
28 | fi
29 | p2=$(realpath --relative-to=. $p)"-copy/"
30 | mkdir $p2
31 | rm -rf $p2"/"*
32 | cp -rf $p"/"* $p2
33 | echo Building...
34 | unset CC
35 | cd wine-tools
36 | ../$p/configure --without-x
37 | if [ $? -ne 0 ]
38 | then
39 | echo Tools configure failed with error $?
40 | exit 3
41 | fi
42 | make -j$parallelism
43 | if [ $? -ne 0 ]
44 | then
45 | echo Tools make failed with error $?
46 | exit 4
47 | fi
48 | cd ../wine-win32
49 | ../$p/configure --without-x --disable-kernel32 --disable-tests --without-freetype --host=i686-w64-mingw32 CFLAGS="-O3 -DWINE_NOWINSOCK -DUSE_WIN32_OPENGL -DUSE_WIN32_VULKAN" --with-wine-tools=../wine-tools/ LDFLAGS=" -static-libgcc"
50 | if [ $? -ne 0 ]
51 | then
52 | echo Wine configure failed with error $?
53 | exit 5
54 | fi
55 | make -j$parallelism
56 | if [ $? -ne 0 ]
57 | then
58 | echo Wine make failed with error $?
59 | exit 6
60 | fi
61 | mkdir ../wined3d
62 | cp dlls/wined3d/wined3d.dll dlls/ddraw/ddraw.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d11/d3d11.dll dlls/dxgi/dxgi.dll dlls/d3d10_1/d3d10_1.dll ../wined3d
63 | cd ..
64 | rm -rf wine-tools/* wine-win32/*
65 | echo Downloading wine-staging...
66 | git clone https://github.com/wine-staging/wine-staging.git ./wine-staging
67 | if [ $? -ne 0 ]
68 | then
69 | echo Download failed with error $?
70 | exit 7
71 | fi
72 | echo Attempting to apply wine-staging...
73 | cd wine-staging
74 | rm -rf patches/*CSMT*
75 | sed 's/exit 1//g' patches/patchinstall.sh > patches/patchinstall1.sh
76 | chmod 775 patches/patchinstall1.sh
77 | ./patches/patchinstall1.sh DESTDIR="../$p2/" --all
78 | echo Attempting Typeless Texture Hack...
79 | cd ..
80 | uudecode ${0}
81 | cd $p2
82 | patch -p0 < ../textureHack.patch
83 | echo Building...
84 | cd ../wine-tools
85 | ../$p2/configure --without-x
86 | if [ $? -ne 0 ]
87 | then
88 | echo Tools configure failed with error $?
89 | exit 8
90 | fi
91 | make -j$parallelism
92 | if [ $? -ne 0 ]
93 | then
94 | echo Tools make failed with error $?
95 | exit 9
96 | fi
97 | cd ../wine-win32
98 | ../$p2/configure --without-x --disable-kernel32 --disable-tests --without-freetype --host=i686-w64-mingw32 CFLAGS="-O3 -DWINE_NOWINSOCK -DUSE_WIN32_OPENGL -DUSE_WIN32_VULKAN" --with-wine-tools=../wine-tools/ LDFLAGS=" -static-libgcc"
99 | if [ $? -ne 0 ]
100 | then
101 | echo Wine configure failed with error $?
102 | exit 10
103 | fi
104 | make -j$parallelism
105 | if [ $? -ne 0 ]
106 | then
107 | echo Wine make failed with error $?
108 | exit 11
109 | fi
110 | mkdir ../wined3d-staging
111 | cp dlls/wined3d/wined3d.dll dlls/ddraw/ddraw.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d11/d3d11.dll dlls/dxgi/dxgi.dll dlls/d3d10_1/d3d10_1.dll ../wined3d-staging
112 | cd ..
113 | echo Cleaning up...
114 | rm -rf wine-tools wine-win32 wine-staging wine-git $p2
115 | rm textureHack.patch
116 | echo All done with no errors!
117 | echo The wined3d dlls are in the wined3d and wined3d-staging directories
118 | exit 0
119 |
120 | #typeless texture hack from https://github.com/wine-mirror/wine/commit/77539c7716ca88599d7e0532e9e29328a85576f1
121 | #edited to remove git stuff and unnecessary changes
122 | begin 755 textureHack.patch
123 | M+2TM(&1L;',O=VEN960S9"]D979I8V4N8PHK*RL@9&QLPH*"@``
134 | `
135 | end
136 |
137 |
--------------------------------------------------------------------------------
/build64.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | echo Checking system...
3 | touch test_wined3d
4 | if [ $? -ne 0 ]
5 | then
6 | echo Cannot write in this directory
7 | exit 14
8 | fi
9 | rm -f test_wined3d
10 | parallelism=$(grep -c ^processor /proc/cpuinfo)
11 | echo Cleaning up...
12 | unset CC
13 | rm -rf wine-tools wine-win64 wine-git wine-staging
14 | mkdir wine-tools wine-win64
15 | if [ -z ${1} ]
16 | then
17 | echo Downloading wine...
18 | git clone git://source.winehq.org/git/wine.git ./wine-git
19 | if [ $? -ne 0 ]
20 | then
21 | echo Download failed with error $?
22 | exit 2
23 | fi
24 | p="wine-git/"
25 | else
26 | echo Building from $1
27 | p=$1
28 | fi
29 | p2=$(realpath --relative-to=. $p)"-copy/"
30 | mkdir $p2
31 | rm -rf $p2"/"*
32 | cp -rf $p"/"* $p2
33 | echo Building...
34 | unset CC
35 | cd wine-tools
36 | ../$p/configure --without-x --enable-win64
37 | if [ $? -ne 0 ]
38 | then
39 | echo Tools configure failed with error $?
40 | exit 3
41 | fi
42 | make -j$parallelism
43 | if [ $? -ne 0 ]
44 | then
45 | echo Tools make failed with error $?
46 | exit 4
47 | fi
48 | cd ../wine-win64
49 | ../$p/configure --without-x --enable-win64 --disable-kernel32 --disable-tests --without-freetype --host=x86_64-w64-mingw32 CFLAGS="-O3 -DWINE_NOWINSOCK -DUSE_WIN32_OPENGL -DUSE_WIN32_VULKAN" --with-wine-tools=../wine-tools/ LDFLAGS=" -static-libgcc"
50 | if [ $? -ne 0 ]
51 | then
52 | echo Wine configure failed with error $?
53 | exit 5
54 | fi
55 | make -j$parallelism
56 | if [ $? -ne 0 ]
57 | then
58 | echo Wine make failed with error $?
59 | exit 6
60 | fi
61 | mkdir ../wined3d
62 | cp dlls/wined3d/wined3d.dll dlls/ddraw/ddraw.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d11/d3d11.dll dlls/dxgi/dxgi.dll dlls/d3d10_1/d3d10_1.dll ../wined3d
63 | cd ..
64 | echo Downloading wine-staging...
65 | git clone https://github.com/wine-staging/wine-staging.git ./wine-staging
66 | if [ $? -ne 0 ]
67 | then
68 | echo Download failed with error $?
69 | exit 7
70 | fi
71 | echo Attempting to apply wine-staging...
72 | cd wine-staging
73 | rm -rf patches/*CSMT*
74 | sed 's/exit 1//g' patches/patchinstall.sh > patches/patchinstall1.sh
75 | chmod 775 patches/patchinstall1.sh
76 | ./patches/patchinstall1.sh DESTDIR="../$p2/" --all
77 | echo Attempting Typeless Texture Hack...
78 | cd ..
79 | uudecode ${0}
80 | cd $p2
81 | patch -p0 < ../textureHack.patch
82 | echo Building...
83 | cd ../wine-tools
84 | ../$p2/configure --without-x --enable-win64
85 | if [ $? -ne 0 ]
86 | then
87 | echo Tools configure failed with error $?
88 | exit 8
89 | fi
90 | make -j$parallelism
91 | if [ $? -ne 0 ]
92 | then
93 | echo Tools make failed with error $?
94 | exit 9
95 | fi
96 | cd ../wine-win64
97 | ../$p2/configure --without-x --enable-win64 --disable-kernel32 --disable-tests --without-freetype --host=x86_64-w64-mingw32 CFLAGS="-O3 -DWINE_NOWINSOCK -DUSE_WIN32_OPENGL -DUSE_WIN32_VULKAN" --with-wine-tools=../wine-tools/ LDFLAGS=" -static-libgcc"
98 | if [ $? -ne 0 ]
99 | then
100 | echo Wine configure failed with error $?
101 | exit 10
102 | fi
103 | make -j$parallelism
104 | if [ $? -ne 0 ]
105 | then
106 | echo Wine make failed with error $?
107 | exit 11
108 | fi
109 | mkdir ../wined3d-staging
110 | cp dlls/wined3d/wined3d.dll dlls/ddraw/ddraw.dll dlls/d3d8/d3d8.dll dlls/d3d9/d3d9.dll dlls/d3d10/d3d10.dll dlls/d3d10core/d3d10core.dll dlls/d3d11/d3d11.dll dlls/dxgi/dxgi.dll dlls/d3d10_1/d3d10_1.dll ../wined3d-staging
111 | cd ..
112 | echo Cleaning up...
113 | rm -rf wine-tools wine-win64 wine-staging wine-git $p2 textureHack.patch
114 | echo All done with no errors!
115 | echo The wined3d dlls are in the wined3d and wined3d-staging directories
116 | exit 0
117 |
118 | #typeless texture hack from https://github.com/wine-mirror/wine/commit/77539c7716ca88599d7e0532e9e29328a85576f1
119 | #edited to remove git stuff and unnecessary changes
120 | begin 755 textureHack.patch
121 | M+2TM(&1L;',O=VEN960S9"]D979I8V4N8PHK*RL@9&QLPH*"@``
132 | `
133 | end
134 |
--------------------------------------------------------------------------------