Skip to content

Instantly share code, notes, and snippets.

@abelsromero
Created July 16, 2017 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abelsromero/2aa91b5220304d4469aee560fc9694d9 to your computer and use it in GitHub Desktop.
Save abelsromero/2aa91b5220304d4469aee560fc9694d9 to your computer and use it in GitHub Desktop.
openTESArena-msys2-build.md

This document describes how to setup a MYS2 environment to build OpenTESArena (https://github.com/afritz1/OpenTESArena). Note that this guide is exclusive for a 64 bits build.

MSYS2 installation

  1. Download and install last version from http://www.msys2.org/

  2. (OPTIONAL) Change language in .bashrc and restart shell

    export LANG=en_US.UTF-8
    
  3. Update packages

    $ pacman -Syu
    $ pacman -Su
    

Note

Sometimes after the first step the system fails telling that the process could not be exited. Just close the shell and reopen it.

  1. Install mingw 64bits toolchain

    $ pacman -S mingw-w64-x86_64-toolchain --noconfirm
    
  2. Install cmake

    $ pacman -S mingw-w64-x86_64-cmake --noconfirm
    

Important

Do not install the package named cmake, use the one above.

  1. (OPTIONAL) Add make alias to .bashrc to avoid typing mingw32-make every time

    alias make="mingw32-make"
    

Other requirements

  1. (OPTIONAL) Install Git, or ignore it and just add yor current Git to the path.

    $ pacman -S git --noconfirm
    

Building OpenTESArena (64x)

  1. Install OpenAL (current version 1.18.0)

    $ pacman -S mingw-w64-x86_64-openal --noconfirm
    
  2. Install SDL2 (current version 2.0.5)

    $ pacman -S mingw-w64-x86_64-SDL2 --noconfirm
    
  3. Install WildMIDI (current version 0.4.1)

    WildMidi is not available though package manager. First, you must install the unzip package and then do a manual installation.

    $ pacman -S unzip --noconfirm
    $ wget https://github.com/Mindwerks/wildmidi/releases/download/wildmidi-0.4.1/wildmidi-0.4.1-win64.zip
    $ cp wildmidi-0.4.1-win64/mingw/*.h /mingw64/include/
    $ cp wildmidi-0.4.1-win64/mingw/*.a /mingw64/lib/
    
  4. Clone OpenTESArena and move the directory

    $ git clone https://github.com/afritz1/OpenTESArena.git
    $ cd OpenTESArena
    
  5. Create build directory and move into it

    $ mkdir build
    $ cd build
    
  6. Now, there are 2 ways to

  7. Create make files with cmake

    $ cmake \
     -D CMAKE_MAKE_PROGRAM="mingw32-make" \
     -D CMAKE_BUILD_TYPE=Release \
     -G "Unix Makefiles" ..
    

Note

Both "Unix Makefiles" and "MingGW Makefiles" work. However, Unix option does not require to remove sh from the shell path.

  1. Use make alias to build

    $ make
    
  2. Deploy

    1. Copy the generate .exe to a directory.

    2. Follow instruction it https://github.com/afritz1/OpenTESArena#windows regarding setup of ARENA dir, options.txt and MIDI accordingly.

    3. Copy the required libraries to the deploy (found inside the msys64 directory and WildMidi zip):

      • libgcc_s_seh-1.dll

      • libopenal-1.dll

      • libstdc++-6.dll

      • libWildMidi.dll

      • libwinpthread-1.dll

      • SDL2.dll

Found issues

  1. .profile is not executed. So shell configurations must be set in .bashrc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment