Compiling the Zandronum server on a Raspberry Pi: Difference between revisions

From Zandronum Wiki
(Created page with "It is possible to compile <code>zandronum-server</code> on a Raspberry Pi. It is mostly the same as compiling on Linux, but we have to disable...")
 
(Update OSDN link to Heptapod)
Tag: Source edit
 
(8 intermediate revisions by 2 users not shown)
Line 12: Line 12:
* Access to a terminal on your Raspberry Pi.
* Access to a terminal on your Raspberry Pi.


This guide was written for the Raspberry Pi Model 2B, but should work on all models.
This guide was written for the Raspberry Pi Model 4B, but should work on all older models.


== Install Dependencies ==
== Install Dependencies ==


=== Raspbian ===
=== Raspberry PI OS (formerly known as: Raspbian) ===
   $ sudo apt-get install build-essential zlib1g-dev libsdl1.2-dev libjpeg-dev \
   $ sudo apt-get install build-essential zlib1g-dev libsdl1.2-dev libjpeg-dev \
     nasm tar libbz2-dev libgtk2.0-dev cmake mercurial libfluidsynth-dev libgl1-mesa-dev \
     nasm tar libbz2-dev libgtk2.0-dev cmake mercurial libfluidsynth-dev libgl1-mesa-dev \
Line 31: Line 31:


Clone the Zandronum repository:
Clone the Zandronum repository:
     $ hg clone https://bitbucket.org/Torr_Samaho/zandronum .
     $ hg clone https://foss.heptapod.net/zandronum/zandronum-stable zandronum
 
Get the latest stable release (for other versions replace <code>"max(tagged())"</code> with one of the tags found in [https://bitbucket.org/Torr_Samaho/zandronum the repository]):
    $ hg update -cr "max(tagged())"
 
Apply patch that fixes compilation under Raspberry Pi:
    $ wget -O raspi.patch "https://gist.githubusercontent.com/csnxs/0e4ce613a5d1736ead593500ca5a9df0/raw/330a41c796bdca88b5040bedf9e6a568ec567e7f/-" && \
      hg import --no-commit raspi.patch && \
      rm raspi.patch


Create and <code>cd</code> to the directory where build files will be outputted:
Create and <code>cd</code> to the directory where build files will be outputted:
    $ cd ./zandronum
     $ mkdir buildserver && cd buildserver
     $ mkdir buildserver && cd buildserver


Line 64: Line 57:
     ./zandronum-server
     ./zandronum-server
You'll probably want to add the <code>-iwad</code> parameter to get it to successfully launch, though.
You'll probably want to add the <code>-iwad</code> parameter to get it to successfully launch, though.
Note: you might need to replace the pk3 to the 3.0 before running this because accidentally messed up the pk3.


Once you've set it all up, enjoy playing on your Pi-powered server!
Once you've set it all up, enjoy playing on your Pi-powered server!


[[File:Pi server.png]]
[[File:Pi server new.png]]

Latest revision as of 22:35, 17 December 2023

It is possible to compile zandronum-server on a Raspberry Pi. It is mostly the same as compiling on Linux, but we have to disable some things first.

You can not combine the Zandronum client on a Raspberry Pi, as:

  1. The software renderer requires assembly files, and assembly files are only available for the ia32 and x86_64 CPU architectures, and not the Raspberry Pi's ARM architecture.
  2. The OpenGL renderer uses normal OpenGL, which is not supported by the Raspberry Pi. The Raspberry Pi only supports OpenGL ES.


Getting Started

You will need:

  • A Raspberry Pi.
  • Access to a terminal on your Raspberry Pi.

This guide was written for the Raspberry Pi Model 4B, but should work on all older models.

Install Dependencies

Raspberry PI OS (formerly known as: Raspbian)

  $ sudo apt-get install build-essential zlib1g-dev libsdl1.2-dev libjpeg-dev \
    nasm tar libbz2-dev libgtk2.0-dev cmake mercurial libfluidsynth-dev libgl1-mesa-dev \
    libssl-dev

Arch Linux ARM

  $ sudo pacman -S --needed gcc make zlib sdl libjpeg-turbo nasm tar bzip2 gtk2 cmake mercurial \
    fluidsynth mesa glu openssl

Prepare Environment

Create and cd to your working directory:

   $ mkdir $HOME/zandronum-build && cd $HOME/zandronum-build

Clone the Zandronum repository:

   $ hg clone https://foss.heptapod.net/zandronum/zandronum-stable zandronum

Create and cd to the directory where build files will be outputted:

   $ cd ./zandronum
   $ mkdir buildserver && cd buildserver

Generate Makefiles

Run cmake, this generates the Makefiles.

   $ make clean; \
     cmake -DCMAKE_BUILD_TYPE=Release -DSERVERONLY=ON -DNO_ASM=1 ..

The -DNO_ASM=1 argument is important as it doesn't compile the architecture-dependent assembly code.

Compile Zandronum

Now, run this command to build Zandronum.

   $ make -j$(nproc)

This compile Zandronum using all of your Raspberry Pi's CPUs.

Run Zandronum

Assuming all went well, you should now have a zandronum-server binary in your working directory. To launch it:

   ./zandronum-server

You'll probably want to add the -iwad parameter to get it to successfully launch, though. Note: you might need to replace the pk3 to the 3.0 before running this because accidentally messed up the pk3.

Once you've set it all up, enjoy playing on your Pi-powered server!