
The binaries hnefatafl-ai, hnefatafl-client, hnefatafl-server,
hnefatafl-server-full and hnefatafl-text-protocol are made available from
the Arch, Cargo,
Debian, and Fedora
sources. The Windows and
Flathub sources only provide hnefatafl-client. The
NPM source only provides something akin to
hnefatafl-text-protocol.
On Linux you should run the Flathub client to avoid font issues.
Running the Applications
You can pass --help to any of the following commands to get all of the
runtime options.
You can run the engine with:
hnefatafl-text-protocol --display-game
or you can start a local server:
hnefatafl-server-full
and run a local client:
hnefatafl-client --host localhost
All platforms
You need to install Rust.
Linux Dependencies
ALSA development files are needed to build cpal on Linux (rodio dependency,
hnefatafl-client dependency). These are provided as part of the
alsa-lib package on Arch, libasound2-dev package on Debian and Ubuntu, and
alsa-lib-devel on Fedora.
The package uses the mold linker. This is provided via the mold
package on Arch, Debian, Ubuntu, and Fedora.
Cargo 
In your terminal run:
# On Windows pass `--features console` to see console output.
cargo install hnefatafl-copenhagen
Source 
In your terminal run:
git clone https://codeberg.org/dcampbell/hnefatafl.git
Linux
Arch 
In your terminal run:
sudo pacman --sync yay
yay --sync hnefatafl-copenhagen
Debian 
In your terminal run:
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/packages.hnefatafl.org.asc] https://hnefatafl.org/apt stable main' \
| sudo tee /etc/apt/sources.list.d/hnefatafl.list
or if using the newer /etc/apt/sources.list.d/debian.sources, add:
Types: deb
URIs: https://hnefatafl.org/apt
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/packages.hnefatafl.org.asc
Then, Download packages.hnefatafl.org.asc to /etc/apt/keyrings/ or:
wget https://hnefatafl.org/packages.hnefatafl.org.asc
sudo mv packages.hnefatafl.org.asc /etc/apt/keyrings/
Then:
sudo apt update && sudo apt install hnefatafl-copenhagen
Fedora COPR 
In your terminal run:
sudo dnf copr enable dcampbell24/hnefatafl-copenhagen
sudo dnf install hnefatafl-copenhagen
Flathub 
In your terminal run:
flatpak install flathub org.hnefatafl.hnefatafl_client
flatpak run org.hnefatafl.hnefatafl_client
or to see all your options run:
flatpak run org.hnefatafl.hnefatafl_client --help
or under KDE go to:
Application Launcher -> Games -> Hnefatafl Copenhagen
Windows
Chocolatey 
Install Chocolatey.
Then install hnefatafl-copenhagen.
Go to the Start menu and run Hnefatafl.
Android
F-Droid
- Go to Google. Scroll down to
Enhanced Safe Browsing for your account. If it is on, turn it off. - Go to F-Droid and download F-Droid.
- Open F-Droid, go to search, and install
Termux: Terminal emulator with packages. - Open Termux, then run the following:
# Only need to run this once per update.
pkg upgrade
termux-change-repo
pkg install rust git x11-repo
pkg install xfce termux-x11-nightly
git clone https://github.com/termux/termux-packages termux-packages-hnefatafl-copenhagen-dest
git clone -b hnefatafl-copenhagen https://github.com/robertkirkman/termux-packages termux-packages-hnefatafl-copenhagen-src
cp -r termux-packages-hnefatafl-copenhagen-src/x11-packages/hnefatafl-copenhagen/ termux-packages-hnefatafl-copenhagen-dest/x11-packages/
cd termux-packages-hnefatafl-copenhagen-dest
scripts/setup-termux.sh
./build-package.sh -I -f hnefatafl-copenhagen
cd output/
apt reinstall ./hnefatafl-copenhagen*.deb
# Repeat this every time you want to run the program.
export LIBGL_ALWAYS_SOFTWARE=1 DISPLAY=:0
termux-x11 -xstartup xfce4-session &
hnefatafl-client --ascii
Then go to Termux:X11 from the main menu. You may need to hold Termux:11 to
go to the Preferences -> Output, then increase the Display scale %.
NPM 
# With Apache and Firefox on Debian.
sudo npm install -g hnefatafl-copenhagen
sudo mkdir --parent /var/www/html/pkg
sudo cp /usr/lib/node_modules/hnefatafl-copenhagen/ -r pkg /var/www/html
Then load the javascript on a webpage:
cat << EOF > /var/www/html/index.html
<!DOCTYPE html>
<html>
<head>
<title>Copenhagen Hnefatafl</title>
</head>
<body>
<h1>Copenhagen Hnefatafl</h1>
<script type="module">
import init, { Game } from '../pkg/hnefatafl_copenhagen.js';
init().then(() => {
const game = new Game();
const output = game.read_line_js("show_board");
console.log(output);
});
</script>
</body>
</html>
EOF
See the message protocol for all of the commands available.
# With Apache running.
firefox localhost
Redox @
Edit your user config to include:
[packages]
hnefatafl-copenhagen = "source"
You should be at least using the packages supplied via
include = ["desktop-minimal.toml"]. Go to games and open Hnefatafl or run
/usr/games/hnefatafl-client. After logging in and exiting the application,
you’ll have to restart Redox, because the application is buggy.
There are also at least these bugs:
- There are no CJK fonts.
- On a button press two characters are read in instead of one.
- Backspace does not work.
- I think you have to restart Redox after entering the application, because TcpStream shutdown is not implemented.