[HOWTO] Build and run tomenet windows client on manjaro linux

Discussion about topics that don't fit elsewhere.
Post Reply
User avatar
jezek
Posts: 35
Joined: Tue Mar 10, 2020 3:07 pm

[HOWTO] Build and run tomenet windows client on manjaro linux

Post by jezek »

Hello, I've struggled for a few days to crosscompile tomenet client for windows on mnjaro linux. So I wrote down the instructions, maybe it will help somebody.

Edit: Tomenet needs SDL2 and SDL2_mixer now. I've updated the instructions. See viewtopic.php?p=7458#p7458.

Warning: Following instructions are valid only for tomenet version using SDL v1 (before 11.jul.2022 +- a day)

Build and run tomenet windows client on manjaro linux
=====================================================
  1. Run tomenet under wine.
    1. Install wine, wine-mono, lib32-libpulse packages, e.g. using pacman.

      Code: Select all

      sudo pacman -Syu wine wine-mono lib32-libpulse
    2. Download tomenet windows installer (e.g. to ~/Downloads) from https://tomenet.eu/downloads.php using browser (or some other method).
    3. Install tomenet using wine.

      Code: Select all

      wine ~/Downloads/TomeNET-480-complete-install.exe
    4. You should be able to run tomenet using wine, e.g. using command.

      Code: Select all

      env WINEPREFIX="/home/jezek/.wine" wine C:\\\\users\\\\Public\\\\Desktop\\\\TomeNET.lnk
  2. Crossbuild tomenet using mingw-w64
    1. Install dependencies needed for crossbuilding tomenet.
      1. Install packages essential for compiling and crosscompiling using pacman.

        Code: Select all

        sudo pacman -Syu base-devel mingw-w64-gcc
        It will ask you what package from base-devel to install, feel free to select all.
      2. Install libraries from AUR using pamac.

        Code: Select all

        sudo pamac build mingw-w64-libgnurx mingw-w64-sdl mingw-w64-libmikmod mingw-w64-libvorbis mingw-w64-smpeg mingw-w64-flac
        This will take some time.
        For explanation, the package mingw-w64-libgnurx is for using regexp, mingw-w64-sdl is for SDL and all other are dependencies for building mingw-w64-sdl_mixer.
      3. Clone and build mingw-w64-sdl_mixer.

        Code: Select all

        cd /tmp
        git clone https://github.com/atomlong/mingw-w64-sdl_mixer.git
        cd ./mingw-w64-sdl_mixer
        makepkg -si
        The mingw-w64-sdl_mixer package was not found in AUR database, we have to install it manually. Fortunately there was an existing github repository. The required dependencies were installed in 2.a.2.
    2. Clone tomenet, build tomenet client executable and run it.
      1. Clone tomenet from https://github.com/TomenetGame/tomenet into our directory of choise (in this case ~/projects).

        Code: Select all

        mkdir -p ~/projects
        cd ~/projects
        git clone https://github.com/TomenetGame/tomenet.git
      2. Build tomenet.exe

        Code: Select all

        cd ~/projects/tomenet/src
        make -f makefile.mingw tomenet.exe
      3. Copy built tomenet.exe to wine and run

        Code: Select all

        cp tomenet.exe ~/.wine/drive_c/Program\ Files\ \(x86\)/TomeNET/TomeNET.exe
        env WINEPREFIX="/home/jezek/.wine" wine C:\\\\users\\\\Public\\\\Desktop\\\\TomeNET.lnk
Last edited by jezek on Wed Jul 13, 2022 5:39 pm, edited 1 time in total.
User avatar
tokariew
Posts: 367
Joined: Thu May 13, 2010 8:20 pm
Location: Poland

Re: [HOWTO] Build and run tomenet windows client on manjaro linux

Post by tokariew »

Why… not build the native version… from github? and run linux… version on manjaro?
img {
max-width: 100%;
}
https://tokariew.xyz
User avatar
jezek
Posts: 35
Joined: Tue Mar 10, 2020 3:07 pm

Re: [HOWTO] Build and run tomenet windows client on manjaro linux

Post by jezek »

I know, how to build and run native linux version. This I need for development, I have no Windows. ;)
mikaelh
Developer
Posts: 210
Joined: Sun Dec 13, 2009 3:18 pm

Re: [HOWTO] Build and run tomenet windows client on manjaro linux

Post by mikaelh »

Congratulations, you figured out how me and C. Blue do most of the development work for the Windows client. :D

Btw, you should install SDL2 now. Looks like C. Blue decided to migrate to SDL2 just two days after you posted your instructions.

I have some old instructions on how to manually cross-compile SDL and SDL_mixer over here: https://muuttuja.org/tomenet/howto-install-sdl.txt. The gist is that you need to run configure with these parameters:

Code: Select all

./configure --prefix=/usr/i686-w64-mingw32 --host=i686-w64-mingw32
User avatar
jezek
Posts: 35
Joined: Tue Mar 10, 2020 3:07 pm

Re: [HOWTO] Build and run tomenet windows client on manjaro linux

Post by jezek »

Yes, I've figured out about the SDL2 yesterday when I tried to rebase. :) So I updated the procedure.

Build and run tomenet windows client on manjaro linux (SDL2 version)
=====================================================
  1. Run tomenet under wine.
    1. Install wine, wine-mono, lib32-libpulse packages, e.g. using pacman.

      Code: Select all

      sudo pacman -Syu wine wine-mono lib32-libpulse
    2. Download tomenet windows installer (e.g. to ~/Downloads) from https://tomenet.eu/downloads.php using browser (or some other method).
    3. Install tomenet using wine.

      Code: Select all

      wine ~/Downloads/TomeNET-480-complete-install.exe
    4. You should be able to run tomenet using wine, e.g. using command.

      Code: Select all

      env WINEPREFIX="/home/jezek/.wine" wine C:\\\\users\\\\Public\\\\Desktop\\\\TomeNET.lnk
  2. Crossbuild tomenet using mingw-w64
    1. Install dependencies needed for crossbuilding tomenet.
      1. Install packages essential for compiling and crosscompiling using pacman.

        Code: Select all

        sudo pacman -Syu base-devel mingw-w64-gcc
        It will ask you what package from base-devel to install, feel free to select all.
      2. Install libraries from AUR using pamac.

        Code: Select all

        sudo pamac build mingw-w64-libgnurx mingw-w64-sdl2
        This will take some time.
        For explanation, the package mingw-w64-libgnurx is for using regexp, mingw-w64-sdl2 is for SDL2 library.
      3. Download and unpack mingw-w64-sdl2_mixer.

        Code: Select all

        wget -q -O- https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.0/SDL2_mixer-devel-2.6.0-mingw.tar.gz | tar xzv -C /tmp SDL2_mixer-2.6.0/i686-w64-mingw32
        sudo cp -r /tmp/SDL2_mixer-2.6.0/i686-w64-mingw32/* /usr/i686-w64-mingw32
        The mingw-w64-sdl2_mixer package we need is at least version 2.6, which is in the time of writing not in AUR. Luckily on github, there is precompiled archive for our mingw, so let's just use it and decompress the files directly without compiling. (Maybe we could done this with the SDL2 package too.)
      4. Copy some required .dll files into tomenet under wine.

        Code: Select all

        cp /usr/i686-w64-mingw32/bin/SDL2.dll /usr/i686-w64-mingw32/bin/SDL2_mixer.dll /usr/i686-w64-mingw32/bin/libgcc_s_dw2-1.dll /usr/i686-w64-mingw32/bin/libwinpthread-1.dll ~/.wine/drive_c/Program\ Files\ \(x86\)/TomeNET/
        Without this, the new compiled tomenet.exe in next steps won't run.
    2. Clone tomenet, build tomenet client executable and run it.
      1. Clone tomenet from https://github.com/TomenetGame/tomenet into our directory of choise (in this case ~/projects).

        Code: Select all

        mkdir -p ~/projects && cd ~/projects
        git clone https://github.com/TomenetGame/tomenet.git
      2. Build tomenet.exe

        Code: Select all

        cd ~/projects/tomenet/src
        make -f makefile.mingw tomenet.exe
      3. Copy built tomenet.exe to wine and run

        Code: Select all

        cp tomenet.exe ~/.wine/drive_c/Program\ Files\ \(x86\)/TomeNET/TomeNET.exe
        env WINEPREFIX="/home/jezek/.wine" wine C:\\\\users\\\\Public\\\\Desktop\\\\TomeNET.lnk
Post Reply