Building the Windows binaries on Linux
Alright, hey everyone ! I'm currently trying to build SM64RT (the Windows binaries, usable with Wine) on Linux. (see #15)
Context:
My postulate is simple: if a tool such as Msys2 can build sm64rt, with the required libs, and if Msys2 is based on archlinux, then any other archlinux install should be capable to build the same software with the same settings but without Msys2. We just need the right libs and tools to do so. The produced Windows binaries can then be exploited using wine.
What is the purpose ?
-
Of this PR ? To track potential issues i can be facing, keep a long of the solutions in order to help other people who want to do the same. If everything goes well, perhaps everything can be merged into the main code.
-
Of all of this ? To avoid having
sm64pcBuilder2(the source code is private) andMsys2- both windows only tools.
What i'll be using:
- Artix install (i'm used to the runit init system, but you can do the same with a base archlinux).
- Msys2 mirrors added (see "config files")
Config files:
Added this at the end of /etc/pacman.conf:
/etc/pacman.conf
[mingw32]
Include = /etc/pacman.d/mirrorlist.custom
[mingw64]
Include = /etc/pacman.d/mirrorlist.custom
[ucrt64]
Include = /etc/pacman.d/mirrorlist.custom
[clang64]
Include = /etc/pacman.d/mirrorlist.custom
[clang32]
Include = /etc/pacman.d/mirrorlist.custom
Added the file /etc/pacman.d/mirrorlist.custom:
/etc/pacman.d/mirrorlist.custom
# See https://www.msys2.org/dev/mirrors
## Primary
Server = https://mirror.msys2.org/mingw/$repo/
Server = https://repo.msys2.org/mingw/$repo/
## Tier 1
Server = https://mirror.umd.edu/msys2/mingw/$repo/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/$repo/
Server = https://download.nus.edu.sg/mirror/msys2/mingw/$repo/
Server = https://ftp.acc.umu.se/mirror/msys2.org/mingw/$repo/
Server = https://ftp.nluug.nl/pub/os/windows/msys2/builds/mingw/$repo/
Server = https://ftp.osuosl.org/pub/msys2/mingw/$repo/
Server = https://mirror.internet.asn.au/pub/msys2/mingw/$repo/
Server = https://mirror.selfnet.de/msys2/mingw/$repo/
Server = https://mirrors.dotsrc.org/msys2/mingw/$repo/
Server = https://mirrors.bfsu.edu.cn/msys2/mingw/$repo/
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/$repo/
Server = https://mirrors.ustc.edu.cn/msys2/mingw/$repo/
Server = https://mirror.nju.edu.cn/msys2/mingw/$repo/
Server = https://repo.extreme-ix.org/msys2/mingw/$repo/
Server = https://mirrors.hit.edu.cn/msys2/mingw/$repo/
Server = https://mirror.clarkson.edu/msys2/mingw/$repo/
Server = https://quantum-mirror.hu/mirrors/pub/msys2/mingw/$repo/
Server = https://mirror2.sandyriver.net/pub/software/msys2/mingw/$repo/
Server = https://mirror.archlinux.tw/MSYS2/mingw/$repo/
## Tier 2
Server = https://mirror.ufro.cl/msys2/mingw/$repo/
Server = https://fastmirror.pp.ua/msys2/mingw/$repo/
Server = https://ftp.cc.uoc.gr/mirrors/msys2/mingw/$repo/
Server = https://mirror.jmu.edu/pub/msys2/mingw/$repo/
Server = https://mirrors.piconets.webwerks.in/msys2-mirror/mingw/$repo/
Server = https://www2.futureware.at/~nickoe/msys2-mirror/mingw/$repo/
Server = https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/$repo/
Server = https://mirrors.bit.edu.cn/msys2/mingw/$repo/
Server = https://repo.casualgamer.ca/mingw/$repo/
Server = https://mirrors.aliyun.com/msys2/mingw/$repo/
Server = https://mirror.iscas.ac.cn/msys2/mingw/$repo/
Server = https://mirrors.tencent.com/msys2/mingw/$repo/
That's it for the introduction !
A few things are needed nonetheless:
- linking windows.h to Windows.h (just in case the uppercase "W" breaks the process) -
ln -s /mingw64/include/windows.h /mingw64/include/Windows.h - The 1st commit to this pr: add a new path to the include line (Mingw64 libs aren't located natively like for Msys2).