I've cleaned up your installation
A lot of the steps you included, copied from the wiki include a lot of a=, h=, d= etc statements. This is great for having it installed on various configurations and systems. But since we all have basically the same configurations and even usernames (cpi), we can possibly clean it up and make it more elegant, putting in the exact input required.
It’s basically like doing algebra, re how to work out where each defined variable goes. It will clean up the installation A LOT. Hell. We could even write an automated script to install it all.
Eg.
Reviewing step 5.
a=’’ && [ “(uname -m)" = x86_64 ] && a=64 c="(lscpu -p | grep -v ‘#’ | sort -u -t , -k 2,4 | wc -l)” ; [ “c" -eq 0 ] && c=1 rm -f output_sdl/liboutput_sdl.so f='-UFMOD_LIBRARY -UFMOD_INCLUDE_DIR' && [ -d fmodapi44464linux ] && f="-DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex{a}-4.44.64.so
-DFMOD_INCLUDE_DIR=fmodapi44464linux/api/inc”
cmake … -DCMAKE_BUILD_TYPE=Release $f &&
make -j$c
The first line includes definitions. If we know what we want to type, we can just remove them.
The second line we can just ignore, since we’re probably not going to need to install anything to do with fmod.
In the third line, the $f is referring to f="-DFMOD_LIBRARY=fmodapi44464linux/api/lib/libfmodex{a}-4.44.64.so
Again, we’re not working with fmod, so we can remove it. cmake … -DCMAKE_BUILD_TYPE=Release
In the fourth line, the -j$c is referring to c="(lscpu -p | grep -v ‘#’ | sort -u -t , -k 2,4 | wc -l)” ; [ “c" -eq 0 ] && c=1
, ie an identifier for how many cores we have.
Just change the $c to 4, because we know that we have 4 cores. make-j4
So after all of that, we can simplify the entirety of step 5 to:
cmake .. -DCMAKE_BUILD_TYPE=Release && make-j4
(note: I have also fixed up a typo, where you have used three dots (…) instead of two (…)
Of course, we still need to edit the oalsound.cpp
before doing make, but that’s easily achievable with this:
sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp
This is basically step 3, done a bit more eloquently.
Putting it all together, I would say that we can probably skip the entirety of step 4. This simplifies the entire process down to:
sudo apt-get -y install g++ make cmake libsdl2-dev git zlib1g-dev libbz2-dev libjpeg-dev libfluidsynth-dev libgme-dev libopenal-dev libmpg123-dev libsndfile1-dev libwildmidi-dev libgtk-3-dev timidity nasm tar chrpath patchelf
git clone git://github.com/rheit/zdoom.git
sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp
mkdir -pv zdoom/build
cd zdoom/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
(I added the -y argument, so you don’t need to push y to confirm installing each package. I also added patchelf to the install list, since we’ll need it for a step later re: installing)
Here’s the step to install the files we just made with cmake. I guess this is kinda optional, but isn’t? Not doing it is the equivalent of installing a game on your computer in your desktop folder. I prefer to install things in a more conventional installation path.
sudo mkdir -pv /usr/games/zdoom
patchelf --set-rpath '$ORIGIN' zdoom
sudo cp -v zdoom zdoom.pk3 \
/usr/games/zdoom/
printf %s "\
#!/bin/sh
exec /usr/games/zdoom/zdoom \"\$@\"
" > zdoom.sh
chmod 755 zdoom.sh
sudo mv -v zdoom.sh /usr/bin/zdoom
Then finally, we can delete all of the files we just used to make the files. Consider this like doing your dishes after making dinner. You don’t have to do it, but someone’s going to get antsy if you don’t.
sudo rm -r /home/cpi/zdoom/
Test if it works with export DISPLAY=:0 zdoom -width 320 -height 240
As for running it on the gameshell, make an action.config file wherever you want, containing this. (assuming you’ve got a whole bunch of WAD files saved to the /home/cpi/games/ChocoDM directory)
ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad, WAD, pk3, PK3
LAUNCHER=zdoom -width 320 -height 240 -iwad
TITLE=Zdoom
EXCLUDE=
SO_URL=
All of that should be able to be added to a single script in order to streamline the process. I’m a bit lazy when it comes to making verbose visual output, so just make sure you kinda know what you’re doing if you do decide to do this. Otherwise there will be a hell of a lot of troubleshooting!
Here is a much simpler and cleaner way to install zdoom.
SSH into your gameshell, and run this.
wget -O /home/cpi/zdoom.sh https://www.dropbox.com/s/j2fu7twdrw7ec72/zdoom.sh?dl=1
chmod +x /home/cpi/zdoom.sh
./zdoom.sh
In case the dropbox links ever go down, and the script breaks, I have provided the essential files below:
Here are the contents of the script
#!/bin/sh
# WRITEN BY JAVELINFACE FOR THE GAMESHELL FEB 5 2020
echo "----------INSTALL PACKAGES----------"
sudo apt-get -y install g++ make cmake libsdl2-dev git zlib1g-dev libbz2-dev libjpeg-dev libfluidsynth-dev libgme-dev libopenal-dev libmpg123-dev libsndfile1-dev libwildmidi-dev libgtk-3-dev timidity nasm tar chrpath patchelf
echo "----------CLONE ZDOOM FILES----------"
git clone git://github.com/rheit/zdoom.git
echo "----------FIX ERRONEOUS FILES----------"
sed -i "42 a #include <functional>" /home/cpi/zdoom/src/sound/oalsound.cpp
echo "----------MAKE ZDOOM----------"
mkdir -pv zdoom/build
cd zdoom/build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j4
echo "----------INSTALL ZDOOM----------"
sudo mkdir -pv /usr/games/zdoom
patchelf --set-rpath '$ORIGIN' zdoom
sudo cp -v zdoom zdoom.pk3 \
/usr/games/zdoom/
printf %s "\
#!/bin/sh
exec /usr/games/zdoom/zdoom \"\$@\"
" > zdoom.sh
chmod 755 zdoom.sh
sudo mv -v zdoom.sh /usr/bin/zdoom
echo "----------ADD LAUNCHER MENU ITEMS----------"
mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad,WAD,pk3,PK3
LAUNCHER=zdoom -width 320 -height 240 -iwad
TITLE=Zdoom
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom/action.config
mkdir -pv /home/cpi/apps/Menu/20_Retro\ Games/06_brutal
printf %s "ROM=/home/cpi/games/ChocoDM
ROM_SO=
EXT=wad,WAD,pk3,PK3
LAUNCHER=zdoom -width 320 -height 240 -file /home/cpi/games/ChocoDM/brutalv20p.pk3 -iwad
TITLE=Brutal Doom
EXCLUDE=
SO_URL=" > /home/cpi/apps/Menu/20_Retro\ Games/06_brutal/action.config
echo "----------GIVE IT AN ICON----------"
wget -O /home/cpi/apps/Menu/20_Retro\ Games/05_zdoom/zdoom.png https://www.dropbox.com/s/z4eezhuzhbdxi8t/zdoom.png?dl=1
wget -O /home/cpi/apps/Menu/20_Retro\ Games/06_zdoom/brutal.png https://www.dropbox.com/s/hc6ye5w9yqjazjd/brutal.png?dl=1
echo "----------MODIFY INI FILE----------"
mkdir -pv /home/cpi/.config/zdoom
wget -O /home/cpi/.config/zdoom/zdoom.ini https://www.dropbox.com/s/9reeu639xn403l7/zdoom.ini?dl=1
echo "----------DOWNLOAD BRUTAL DOOM----------"
wget -O /home/cpi/games/ChocoDM/brutalv20b.pk3 https://www.dropbox.com/s/hc0sz5j2vun2t8d/brutalv20b.pk3?dl=1
echo "----------CLEANUP----------"
sudo rm -r /home/cpi/zdoom/
rm /home/cpi/zdoom.sh
Here are the contents of zdoom.ini