sandrinr / docker-xcsoar-buildenv

A Docker based build environment for XCSoar
MIT License
2 stars 0 forks source link

docker-xcsoar-buildenv

A Docker based build environment for XCSoar.

Description

If you are using macOS or Windows and want to do some quick changes to XCSoar without investing into the the build toolchain on your machine this Docker based dev setup for XCSoar might be for you.

The Linux based development toolchain for XCSoar is well supported and generally working well. By using a Docker based setup in macOS or Windows we can benefit from this situation.

Usage

Note: the Docker image is currently only tested on macOS because I have no need for a Windows environment at the moment. If somebody tests this on Windows and finds issues please drop an issue or PR.

Requirements

Installation instructions on macOS using Homebrew

  1. Install Docker for Mac
  2. Install the remaining dependencies using Homebrew
    brew install socat
    brew cask install xquartz

Please ensure to restart your Mac after you have installed XQuartz, it is needed for its environment to work correctly.

Usage on macOS

  1. To forward X11 network traffic out of Docker to the X servers UNIX socket run socat on the host machine in a separate terminal (it will block):

    socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
  2. Now you can work inside the directory of the XCSoar source, e.g. compiling it:

    docker run -it --rm -w /src -v $PWD:/src:delegated sandrinr/xcsoar-buildenv make OPENGL=n ENABLE_SDL=y

    The -w /src -v $PWD:/src:delegated is important for the image to work and have access to your XCSoar source.

  3. Once you have a compiled project you can run XCSoar. If you have an X11 server installed and the socat command from above running, then XCSoar should show up on your host machine.

    docker run -it --rm -w /src -v $PWD:/src:delegated sandrinr/xcsoar-buildenv output/UNIX/bin/xcsoar

Possible Future Work

Should this image show traction we could extend it in many ways. Possible ideas:

Notes and Caveats

Contributing

Contributions are always welcome in the form of issues or PRs.