Let's play Duke Nukem 3D on Linux

October 6, 2020    Blog Post

I recently bought a new budget laptop and decided to install Duke Nukem 3D as I like this game :)

The port which I use to play on other computer is EDuke32 so i decided to use the same on a new laptop.

Since I use Docker containers a lot, I decided to use it to compile EDuke32 from source. Some time ago the Debian / Ubuntu repository was working, but it is no longer active, so there is no other way to download the executables.

Install Docker service

I will use one of my virtual machines with Docker already running to build EDuke32 executables. If you don’t have Docker installed, follow the Docker install steps for the Linux distribution you are using.

Build script

I will use a Bash script to install the required packages and run the build commands as per the installation instructions from EDuke32 website.

I’m using Linux Mint 20 on my new laptop, so I’m following the instructions for Debian/Ubuntu Linux in my build script.

The script is very simple, but it does what it should. For EDuke32 I created a directory ~ Games / educe32, but you can put your script and game files elsewhere.

Open your favorite text editor such as vim and copy / paste the following script into it:

#!/bin/bash

apt update

DEBIAN_FRONTEND=noninteractive apt-get -yq install build-essential nasm libgl1-mesa-dev libglu1-mesa-dev libsdl1.2-dev libsdl-mixer1.2-dev libsdl2-dev libsdl2-mixer-dev flac libflac-dev libvorbis-dev libvpx-dev libgtk2.0-dev freepats git

cd /

git clone https://voidpoint.io/terminx/eduke32.git eduke32build

cd /eduke32build
make

cp eduke32 /eduke32/
cp mapster32 /eduke32/
chown -R  $UUID:$GGID /eduke32/

echo "Build done !!!"

Save it in the eduke32 directory as buildeduke32.sh. Add executable permissions by running chmod 755 buildeduke32.sh.

Compilation

Linux Mint 20 is based on Ubuntu 20 Focal, so I select the ʻubuntu: focal` docker images to run my build on:

$ cd Games
$ docker run -it --rm -v $PWD/eduke32:/eduke32 -e UUID=$(id -u) -e GGID=$(id -g) ubuntu:focal /eduke32/buildeduke32.sh

You should choose a Docker image identical (if possible) to the system that is running on the target system.

If all went well, you should see on the screen:

Building: make  -s
-rwxr-xr-x 1 root root 2711840 Oct  6 13:36 eduke32
-rwxr-xr-x 1 root root 1945792 Oct  6 13:37 mapster32
Build done !!!

Finishing

For your EDuke32 to be fully functional (playable), you need to copy the DUKE3D.GRP and DUKE.RTS files from the original copy of Duke Nukem 3D to the eduke32 directory.

Starting EDuke32

To start using Duke Nukem 3D, go to the eduke32 directory and run ./eduke32.