User Tools

Site Tools


user:draugthewhopper:windowsbuild

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
user:draugthewhopper:windowsbuild [2020/08/18 17:15]
draugthewhopper
user:draugthewhopper:windowsbuild [2021/01/02 18:30]
draugthewhopper
Line 1: Line 1:
-Links to various Windows build instructions:​+====== Windows client builds ====== 
 + 
 +Throughout 2019 and 2020, I've been able to build the GTK2 client on Windows, with relatively good success, except that everything explodes when I take it out of the build environment. 
 + 
 + 
 +====== ​Links ====== 
 + 
 +to various Windows build instructions:​
  
 [[wiki:​data:​pages:​crossfire_release_guide?​s[]=windows&​s[]=build|Release Guide -> Windows]] (2014 or older) [[wiki:​data:​pages:​crossfire_release_guide?​s[]=windows&​s[]=build|Release Guide -> Windows]] (2014 or older)
Line 7: Line 14:
 [[server:​server_compiling?​s[]=visual&​s[]=studio#​requirements1|Server compiling with Visual Studio 6]] (contains passing references to gtk client builds) [[server:​server_compiling?​s[]=visual&​s[]=studio#​requirements1|Server compiling with Visual Studio 6]] (contains passing references to gtk client builds)
  
-[[http://​xob.kapsi.fi/​~makegho/​trash/​crossfire-win32.txt|MinGW and CMake instructions from ~2018]] External on xob.kapsi.fi/​~makegho+[[http://​xob.kapsi.fi/​~makegho/​trash/​crossfire-win32.txt|MinGW and CMake instructions from ~2018]] ​(External on xob.kapsi.fi/​~makegho)
  
-My notes, ​loosely based on the makegho 2018 instructions:​+====== ​My Notes ====== 
 + 
 +loosely based on the makegho 2018 instructions:​
  
 These instructions assume a fresh, clean 32-bit windows 10 machine. These instructions assume a fresh, clean 32-bit windows 10 machine.
  
 Install compiler tools: Install compiler tools:
-Go to http://​www.msys2.org/​ + 
-Download and run latest i686 installer (msys2-i686-20190524.exe) +Go to http://​www.msys2.org/​ 
-Start an msys2 32-bit shell (“MSYS2 MinGW 32-bit” in the start menu) and type:+ 
 +Download and run latest i686 installer (msys2-i686-20190524.exe) 
 + 
 +Start an msys2 32-bit shell (“MSYS2 MinGW 32-bit” in the start menu) and type: 
  pacman -S mingw-w64-i686-gcc ​  pacman -S mingw-w64-i686-gcc ​
  pacman -S mingw-w64-i686-make  pacman -S mingw-w64-i686-make
Line 23: Line 36:
  pacman -S mingw-w64-i686-SDL_image  pacman -S mingw-w64-i686-SDL_image
  pacman -S mingw-w64-i686-SDL_mixer  pacman -S mingw-w64-i686-SDL_mixer
- Alternatively,​ do a oneliner: 
- pacman -S mingw-w64-i686-gcc pacman -S mingw-w64-i686-make pacman -S mingw-w64-i686-pkg-config pacman -S mingw-w64-i686-vala pacman -S mingw-w64-i686-SDL_image pacman -S mingw-w64-i686-SDL_mixer 
  
-- Add c:​\msys32\mingw32\bin to path+Alternatively,​ do a oneliner: 
 + 
 + pacman ​-S mingw-w64-i686-gcc mingw-w64-i686-make mingw-w64-i686-pkg-config mingw-w64-i686-vala mingw-w64-i686-SDL_image mingw-w64-i686-SDL_mixer 
 + 
 +Add c:​\msys32\mingw32\bin to path
   
 Install PERL: Install PERL:
-http://​strawberryperl.com/​releases.html + 
-Download portable 32 bit edition +http://​strawberryperl.com/​releases.html 
-Extract to C:\perl + 
-Add C:​\perl\perl\bin to path. +Download portable 32 bit edition 
- Note that this can cause some issues, especially if CMake tries to use perl-supplied components instead of those from MSYS/MinGW+ 
 +Extract to C:\perl 
 + 
 +Add C:​\perl\perl\bin to path. 
 + 
 +Note that this can cause some issues, especially if CMake tries to use perl-supplied components instead of those from MSYS/MinGW. But, perl is still needed "for def-keys and msgtypes generation"​
  
 Download and extract CrossFire source to e.g. c:​\cfsource.rxxxxx. Download and extract CrossFire source to e.g. c:​\cfsource.rxxxxx.
-https://​sourceforge.net/​projects/​crossfire/​files/​crossfire-client/​+ 
 +https://​sourceforge.net/​projects/​crossfire/​files/​crossfire-client/​
  
 Install latest CMake 32-bit: Install latest CMake 32-bit:
-https://​cmake.org/​download/​+ 
 +https://​cmake.org/​download/​
  
 Run CMake gui: Run CMake gui:
-- Set source code directory, e.g. c:/​cfsource.rxxxxx 
-- Set binary directory, e.g. c:/cfbuild 
-- Click '​Configure'​ and choose 'MinGW Makefiles'​ 
-- Change CMAKE_INSTALL_PREFIX to something reasonable 
- - (C:\Program Files (x86)\... is probably read only). 
- - (Nothing seems to be put in this folder anyway?) 
-- If CMake finds wrong include directories,​ e.g. from Visual Studio, change them manually to '​C:​\msys32\mingw32\include'​ 
-- If CMake fails near a pkgconfig or gtk/gio item, check to make sure that it hasn’t defaulted the PKG_CONFIG_EXECUTABLE to a perl directory. If so, revert it to the msys32 one, probably C:​\msys32\mingw32\bin\pkg-config.exe 
-- Click “Configure” again, hope no errors occur. 
-- Once it finally doesn’t have warnings or errors, Click '​generate'​. 
  
-- If configuring goes wrong, delete directory c:​\cfbuild\CMakeFiles and try again.+Set source code directory, e.g. c:/​cfsource.rxxxxx 
 + 
 +Set binary directory, e.g. c:/​cfbuild 
 + 
 +Click '​Configure'​ and choose 'MinGW Makefiles'​ 
 + 
 +Change CMAKE_INSTALL_PREFIX to something reasonable 
 + 
 +(C:\Program Files (x86)\... is probably read only). 
 + 
 +(Nothing seems to be put in this folder anyway?) 
 + 
 +If CMake finds wrong include directories,​ e.g. from Visual Studio, change them manually to '​C:​\msys32\mingw32\include'​ 
 + 
 +If CMake fails near a pkgconfig or gtk/gio item, check to make sure that it hasn’t defaulted the PKG_CONFIG_EXECUTABLE to a perl directory. If so, revert it to the msys32 one, probably C:​\msys32\mingw32\bin\pkg-config.exe 
 + 
 +Click “Configure” again, hope no errors occur. 
 + 
 +Once it finally doesn’t have warnings or errors, Click '​generate'​. 
 + 
 +If configuring goes wrong, delete directory c:​\cfbuild\CMakeFiles and try again.
  
 Compile: Compile:
-Open msys32 32-bit shell (“MSYS2 MinGW 32-bit” in the Start Menu) + 
-Go to c:​\cfbuild +Open msys32 32-bit shell (“MSYS2 MinGW 32-bit” in the Start Menu) 
-- Run 'mingw32-make.exe'+ 
 +Go to c:​\cfbuild 
 + 
 +run mingw32-make.exe
  
 Create release package: Create release package:
-Run '​mingw32-make install',​ though it doesn'​t seem to do much. + 
-Make directory '​release',​ somewhere in your system +Run '​mingw32-make install',​ though it doesn'​t seem to do much. 
-Copy \cfbuild\bin\crossfire-client-gtk2.exe to release\+ 
 +Make directory '​release',​ somewhere in your system 
 + 
 +Copy \cfbuild\bin\crossfire-client-gtk2.exe to release\ 
 Create dir release\bin,​ and copy \cfbuild\bin\cfsndserv.exe to it Create dir release\bin,​ and copy \cfbuild\bin\cfsndserv.exe to it
-Copy directory '​share'​ to release\+ 
 +Copy directory '​share'​ to release\
  
 At this point, the client should run more or less fine, at least in your dev environment. Now we need to prep it so it can be run on other systems (but this is the broken part). At this point, the client should run more or less fine, at least in your dev environment. Now we need to prep it so it can be run on other systems (but this is the broken part).
  
-In release, create a folder called “lib”, and copy “gdk-pixbuf-2.0” and “gtk-2.0” from “C:​\msys32\mingw32\lib”. +<del>In release, create a folder called “lib”, and copy “gdk-pixbuf-2.0” and “gtk-2.0” from “C:​\msys32\mingw32\lib”. 
- This fixes some xpm warnings, and makes a few GUI icons render correctly, apparently a very few gui elements are xpm? + 
-Fetch “msys32\mingw32\share\themes” and place it in “release\share\”. This fixes an issue that breaks the GTK theme.+This fixes some xpm warnings, and makes a few GUI icons render correctly, apparently a very few gui elements are xpm? 
 + 
 +Fetch “msys32\mingw32\share\themes” and place it in “release\share\”. This fixes an issue that breaks the GTK theme.</​del>​ 
 + 
 +Find sounds from somewhere, and put them in share\ 
 + 
 +Find the DLLs, and put them in release\ 
 + 
 +Most of the DLLs can be found in c:​\msys32\bin. Currently includes: 
 + 
 + libatk-1.0-0.dll 
 + libbrotlicommon.dll 
 + libbrotlidec.dll 
 + libbz2-1.dll 
 + libcairo-2.dll 
 + libcrypto-1_1.dll 
 + libcurl-4.dll 
 + libdatrie-1.dll 
 + libexpat-1.dll 
 + libffi-6.dll 
 + libfontconfig-1.dll 
 + libfreetype-6.dll 
 + libfribidi-0.dll 
 + libgcc_s_dw2-1.dll 
 + libgdk-win32-2.0-0.dll 
 + libgdk_pixbuf-2.0-0.dll Adding this causes a deluge of warnings about XPM not being supported. To fix, in release, create a folder called “lib”, and copy “gdk-pixbuf-2.0” and “gtk-2.0” from “C:​\msys32\mingw32\lib”. <​del>​This fixes some xpm warnings, and makes a few GUI icons render correctly, apparently a very few gui elements are xpm?</​del>​ 
 + libgio-2.0-0.dll 
 + libglib-2.0-0.dll <​del>​Adding this causes the sound server to fail to spawn, message "Could not spawn sound server: Failed to execute helper program (Invalid argument)"​ Skip for now, and it will work in the dev enrions.</​del>​ The sound server will fail to spawn if you do not get the glib helper program. This is a Windows-specific thing. 
 + libgmodule-2.0-0.dll 
 + libgobject-2.0-0.dll 
 + libgraphite2.dll 
 + libgtk-win32-2.0-0.dll Adding this breaks the GTK theme. Fetch “msys32\mingw32\share\themes” and place it in “release\share\”. This only works if you have also copied the above items into "​lib"​ 
 + libharfbuzz-0.dll 
 + libiconv-2.dll 
 + libidn2-0.dll 
 + libintl-8.dll 
 + libnghttp2-14.dll 
 + libpango-1.0-0.dll 
 + libpangocairo-1.0-0.dll 
 + libpangoft2-1.0-0.dll 
 + libpangowin32-1.0-0.dll 
 + libpcre-1.dll 
 + libpixman-1-0.dll 
 + libpng16-16.dll 
 + libpsl-5.dll 
 + libssl-1_1.dll 
 + libstdc++-6.dll 
 + libthai-0.dll 
 + libunistring-2.dll 
 + libwinpthread-1.dll 
 + SDL.dll 
 + zlib1.dll 
 + 
 +These DLLs go in release\bin\,​ since they are used by the sound server: 
 + 
 + libmad-0.dll 
 + libSDL_mixer-1-2-0.dll 
 + libogg-0.dll 
 + libvorbis-0.dll 
 + libvorbisfile-3.dll 
 + 
 +It works to put them in release\, but the sound server checks for them in .\, so it helps if they'​re in the same folder as cfsndserv.exe 
 + 
 +At this point, the client runs in your dev environs, no warnings, sound works, etc<​del>,​ as long as you did not copy libglib.</​del>​ 
 + 
 +Get the glib helper program from C:​\msys32\mingw32\bin\gspawn-win32-helper-console.exe,​ and copy it to release\ 
 + 
 +Pull the release\ folder to another machine, and run. 
 + 
 +<​del>​It now complains that libglib is missing. Copy it as well. Sound is now broken. when you launch, there'​s now warnings and the themes are broken again.</​del>​ 
 + 
 +Weep because everything'​s on fire. 
 + 
 +<​del>​ 
 + 
 +Find the rest of the DLLs from the 1.72.0 release.
  
-Find the DLLs, and put them in release\ +Find any missing ​DLLs from official runtime distributions.
- - Most of the DLLs can be found in c:​\msys32\binCurrently includes:+
  
-libatk-1.0-0.dll +If DLLs are still missing, shed some tears.
-libbrotlicommon.dll +
-libbrotlidec.dll +
-libbz2-1.dll +
-libcairo-2.dll +
-libcrypto-1_1.dll +
-libcurl-4.dll +
-libdatrie-1.dll +
-libexpat-1.dll +
-libffi-6.dll +
-libfontconfig-1.dll +
-libfreetype-6.dll +
-libfribidi-0.dll +
-libgcc_s_dw2-1.dll +
-libgdk-win32-2.0-0.dll +
-libgdk_pixbuf-2.0-0.dll +
-libgio-2.0-0.dll +
-libglib-2.0-0.dll +
-libgmodule-2.0-0.dll +
-libgobject-2.0-0.dll +
-libgraphite2.dll +
-libgtk-win32-2.0-0.dll +
-libharfbuzz-0.dll +
-libiconv-2.dll +
-libidn2-0.dll +
-libintl-8.dll +
-libnghttp2-14.dll +
-libpango-1.0-0.dll +
-libpangocairo-1.0-0.dll +
-libpangoft2-1.0-0.dll +
-libpangowin32-1.0-0.dll +
-libpcre-1.dll +
-libpixman-1-0.dll +
-libpng16-16.dll +
-libpsl-5.dll +
-libssl-1_1.dll +
-libstdc++-6.dll +
-libthai-0.dll +
-libunistring-2.dll +
-libwinpthread-1.dll +
-SDL.dll +
-zlib1.dll+
  
-- Pull the release\ folder ​to another machince, and run +I had to rename libpng16_16.dll to libpng14_14.dll. I have no idea what could have required libpng14, and libpng14 has serious vulnerabilities too. (Renaming DLLs is not safe either.)
-- Weep because everything'​s on fire.+
  
-<​del>​ - Find the rest of the DLLs from the 1.72.0 release. +</​del>​
- - Find any missing DLLs from official runtime distributions. +
- - If DLLs are still missing, shed some tears. +
- - I had to rename libpng16_16.dll to libpng14_14.dll. I have no idea what could have required libpng14, and libpng14 has serious vulnerabilities too. (Renaming DLLs is not safe either.)</​del>​+
  
user/draugthewhopper/windowsbuild.txt · Last modified: 2021/08/31 14:14 by draugthewhopper