From 3a2f3eb8670120db868aaf519bbd855a1a27b7c1 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 01:35:19 -0400 Subject: [PATCH 01/10] total rewrite of Doom3 script upstream @techcoder20 was not fixing their app and the repo there is separate from pi-apps move the install to pi-apps, fix multiple broken things, and enable 64bit (since it should have always worked) --- apps/Doom 3/install | 78 ++++++++++++++++++++++++++++++++++++++++++ apps/Doom 3/install-32 | 21 ------------ apps/Doom 3/uninstall | 10 +----- 3 files changed, 79 insertions(+), 30 deletions(-) create mode 100755 apps/Doom 3/install delete mode 100755 apps/Doom 3/install-32 diff --git a/apps/Doom 3/install b/apps/Doom 3/install new file mode 100755 index 0000000000..8d24e4fefd --- /dev/null +++ b/apps/Doom 3/install @@ -0,0 +1,78 @@ +#!/bin/bash + +# fix broken install due to @techcoder20 +sudo apt purge -y sdl2-image sdl2-mixer sdl2-ttf || true + +#Installing dependencies +install_packages libfontconfig-dev qt5-default automake mercurial libtool libfreeimage-dev \ +libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ +libaudio-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev libesd0-dev \ +freeglut3-dev libmodplug-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake aria2 \ +libsdl2-ttf-dev libsdl2-dev libsdl2-mixer-dev || error "Failed to install dependencies" + +# install qt5-default if its availabe in apt (necessary on debian/ubuntu versions prior to bullseye/hirsute) +package_available qt5-default +if [[ $? == "0" ]]; then + install_packages qt5-default || error "Failed to install dependencies" +else + # attempt to fix common error where users libqt5core5a package did not install properly + # this should not be necessary, but /usr/lib/*-linux-gnu*/qt-default/qtchooser/default.conf is missing on multiple users installs and is part of this package + sudo apt install --reinstall libqt5core5a -y +fi + + +cd /tmp +git clone https://github.com/dhewm/dhewm3 || error "Failed to clone dhewm3 from github" #Cloning dhewm3 repository +cd dhewm3/neo || exit +mkdir build || error "Failed to create build folder" +cd build || exit +cmake .. || error "Failed to build dhewm3" +make -j$(nproc) || error "Failed to build dhewm3" + + +Download_Demo () { + cd ~ + rm -f Doom3DemoGameFiles.zip + wget https://github.com/techcoder20/RPIDoom3Installer/releases/download/v1.0.0/Doom3DemoGameFiles.zip || error "Failed to download game files" + unzip Doom3DemoGameFiles.zip || error "Failed to extract game files" + rm -f Doom3DemoGameFiles.zip + cd /tmp/dhewm3/neo/build || error "Could not move to dhewm3 directory" + cp base.so d3xp.so dhewm3 libidlib.a ~/Doom3Demo || error "Failed to copy necessary files to Doom3Demo Folder" + echo "[Desktop Entry] +Version=1.0 +Type=Application +Name=Doom3Demo +Path=$HOME/Doom3Demo +Icon=$(dirname $0)/icon-64.png +Exec=$HOME/Doom3Demo/dhewm3 +Categories=Game; +Terminal=false" | tee $HOME/.local/share/applications/Doom3Demo.desktop >/dev/null || error "Failed to create menu button!" +} + +User_Supplied () { + mkdir -p ~/Doom3GameFiles || error "Failed to create Doom3GameFiles Folder" + warning "YOU MUST place the game files in ~/Doom3GameFiles for the game to work" + sleep 5 + cd /tmp/dhewm3/neo/build || error "Could not move to dhewm3 directory" + cp base.so d3xp.so dhewm3 libidlib.a ~/Doom3GameFiles || error "Failed to copy necessary files to Doom3GameFile Folder" + echo "[Desktop Entry] +Version=1.0 +Type=Application +Name=Doom3 +Path=$HOME/Doom3GameFiles +Icon=$(dirname $0)/icon-64.png +Exec=$HOME/Doom3GameFiles/dhewm3 +Categories=Game; +Terminal=false" | tee $HOME/.local/share/applications/Doom3.desktop >/dev/null || error "Failed to create menu button!" +} + +while true; do + read -p "Do you have the game files [Y/n]?" yn + case $yn in + [Yy]* ) User_Supplied;; + [Nn]* ) Download_Demo;; + * ) echo "Please answer yes or no.";; + esac +done + +rm -rf /tmp/dhewm3 diff --git a/apps/Doom 3/install-32 b/apps/Doom 3/install-32 deleted file mode 100755 index 9013e3195f..0000000000 --- a/apps/Doom 3/install-32 +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -rm -rf ~/RPIDoom3Installer || sudo rm -rf ~/RPIDoom3Installer || error "Failed to first remove ~/RPIDoom3Installer folder!" - -# Get dependencies -install_packages libfontconfig-dev qtbase5-dev qtchooser automake mercurial libtool libfreeimage-dev \ -libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ -libaudio-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev libesd0-dev \ -freeglut3-dev libmodplug-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake aria2 lolcat figlet || error "Failed to install dependencies" - -# install qt5-default if its availabe in apt (necessary on debian/ubuntu versions prior to bullseye/hirsute) -package_available qt5-default -if [[ $? == "0" ]]; then - install_packages qt5-default || error "Failed to install dependencies" -fi -git_clone https://github.com/techcoder20/RPIDoom3Installer || error 'Failed to clone RPIDoom3Installer repository!' -cd ~/RPIDoom3Installer || error "Failed to change directory " - -echo "Making scripts executable..." -sudo chmod +x install.sh uninstall.sh || error "Failed To make install script and uninstall script executable" -echo "Running install script..." -setarch linux32 ./install.sh no-apt || error "Failed to run install script :(" diff --git a/apps/Doom 3/uninstall b/apps/Doom 3/uninstall index a61613ac1a..0a36379636 100755 --- a/apps/Doom 3/uninstall +++ b/apps/Doom 3/uninstall @@ -1,12 +1,4 @@ #!/bin/bash purge_packages || error "Dependencies failed to uninstall" -if [ -d ~/RPIDoom3Installer ];then - cd ~/RPIDoom3Installer || "Failed to Change directory" - echo "Running uninstall script..." - ./uninstall.sh || error "Failed to execute uninstall script :(" -else - echo "WARNING: Doing nothing as ~/RPIDoom3Installer folder does not exist!" -fi - -exit 0 +sudo rm -rf ~/RPIDoom3Installer ~/Doom3GameFiles ~/Doom3Demo ~/Desktop/Doom3Demo.desktop ~/.local/share/applications/Doom3Demo.desktop ~/.local/share/applications/Doom3.desktop From 792d1c63045baec20b4de9bd6c7948f221ef59aa Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 01:40:13 -0400 Subject: [PATCH 02/10] remove deprecated package doesn't actually exist in debian buster/bullseye (might be in raspbian from stretch) --- apps/Doom 3/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index 8d24e4fefd..d2bcd7886b 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -6,7 +6,7 @@ sudo apt purge -y sdl2-image sdl2-mixer sdl2-ttf || true #Installing dependencies install_packages libfontconfig-dev qt5-default automake mercurial libtool libfreeimage-dev \ libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ -libaudio-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev libesd0-dev \ +libaudio-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \ freeglut3-dev libmodplug-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake aria2 \ libsdl2-ttf-dev libsdl2-dev libsdl2-mixer-dev || error "Failed to install dependencies" From 6ea8a34c16f2811533346311c743087db93f99cf Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 01:51:34 -0400 Subject: [PATCH 03/10] remove some unnecessary dependencies --- apps/Doom 3/install | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index d2bcd7886b..428252d4df 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -4,23 +4,12 @@ sudo apt purge -y sdl2-image sdl2-mixer sdl2-ttf || true #Installing dependencies -install_packages libfontconfig-dev qt5-default automake mercurial libtool libfreeimage-dev \ +install_packages libfontconfig-dev automake libtool libfreeimage-dev \ libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ -libaudio-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \ -freeglut3-dev libmodplug-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake aria2 \ +libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \ +freeglut3-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake build-essential \ libsdl2-ttf-dev libsdl2-dev libsdl2-mixer-dev || error "Failed to install dependencies" -# install qt5-default if its availabe in apt (necessary on debian/ubuntu versions prior to bullseye/hirsute) -package_available qt5-default -if [[ $? == "0" ]]; then - install_packages qt5-default || error "Failed to install dependencies" -else - # attempt to fix common error where users libqt5core5a package did not install properly - # this should not be necessary, but /usr/lib/*-linux-gnu*/qt-default/qtchooser/default.conf is missing on multiple users installs and is part of this package - sudo apt install --reinstall libqt5core5a -y -fi - - cd /tmp git clone https://github.com/dhewm/dhewm3 || error "Failed to clone dhewm3 from github" #Cloning dhewm3 repository cd dhewm3/neo || exit From 48bd01923a04020ae730ef00e954204a1b6f4c17 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 01:52:54 -0400 Subject: [PATCH 04/10] fix while loop --- apps/Doom 3/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index 428252d4df..42fac49e45 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -58,8 +58,8 @@ Terminal=false" | tee $HOME/.local/share/applications/Doom3.desktop >/dev/null | while true; do read -p "Do you have the game files [Y/n]?" yn case $yn in - [Yy]* ) User_Supplied;; - [Nn]* ) Download_Demo;; + [Yy]* ) User_Supplied; exit;; + [Nn]* ) Download_Demo; exit;; * ) echo "Please answer yes or no.";; esac done From 40252614d41137c64cf5b0f2e21779fcbf96e6a7 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 01:58:02 -0400 Subject: [PATCH 05/10] remove more depends --- apps/Doom 3/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index 42fac49e45..e0cedc54c2 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -7,7 +7,7 @@ sudo apt purge -y sdl2-image sdl2-mixer sdl2-ttf || true install_packages libfontconfig-dev automake libtool libfreeimage-dev \ libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \ -freeglut3-dev libsmpeg-dev libjpeg-dev libogg-dev libvorbis-dev libvorbisfile3 libcurl4 cmake build-essential \ +freeglut3-dev libvorbisfile3 libcurl4 cmake build-essential \ libsdl2-ttf-dev libsdl2-dev libsdl2-mixer-dev || error "Failed to install dependencies" cd /tmp From c51499724a747d51b21041b6688c771f4ce4ad49 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 02:07:05 -0400 Subject: [PATCH 06/10] specify icon location with directory instead of dirname --- apps/Doom 3/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index e0cedc54c2..b413c9d540 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -32,7 +32,7 @@ Version=1.0 Type=Application Name=Doom3Demo Path=$HOME/Doom3Demo -Icon=$(dirname $0)/icon-64.png +Icon=${DIRECTORY}/apps/Doom 3/icon-64.png Exec=$HOME/Doom3Demo/dhewm3 Categories=Game; Terminal=false" | tee $HOME/.local/share/applications/Doom3Demo.desktop >/dev/null || error "Failed to create menu button!" @@ -49,7 +49,7 @@ Version=1.0 Type=Application Name=Doom3 Path=$HOME/Doom3GameFiles -Icon=$(dirname $0)/icon-64.png +Icon=${DIRECTORY}/apps/Doom 3/icon-64.png Exec=$HOME/Doom3GameFiles/dhewm3 Categories=Game; Terminal=false" | tee $HOME/.local/share/applications/Doom3.desktop >/dev/null || error "Failed to create menu button!" From ae1542d0cd1e0e9aa09eb9c61f05a74504e125c2 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 16:55:34 -0400 Subject: [PATCH 07/10] remove packages only if necessary --- apps/Doom 3/install | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index b413c9d540..0f7b9ac121 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -1,8 +1,21 @@ #!/bin/bash # fix broken install due to @techcoder20 -sudo apt purge -y sdl2-image sdl2-mixer sdl2-ttf || true - + +# Remove packages if necessary +pkgToRemoveListFull="sdl2-image sdl2-mixer sdl2-ttf" +pkgToRemoveList="" +for pkgToRemove in $(echo $pkgToRemoveListFull); do + $(dpkg --status $pkgToRemove &> /dev/null) + if [[ $? -eq 0 ]]; then + pkgToRemoveList="$pkgToRemoveList $pkgToRemove" + fi +done + +if [[ ! -z "$pkgToRemoveList" ]]; then + sudo apt-get --yes --purge remove $pkgToRemoveList || error "Could not remove packages" +fi + #Installing dependencies install_packages libfontconfig-dev automake libtool libfreeimage-dev \ libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libtiff5-dev libwebp-dev libasound2-dev \ From a5feb314458aafb74c4eee1ed7f19102f9f7a2a7 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 17:00:36 -0400 Subject: [PATCH 08/10] move choice to top --- apps/Doom 3/install | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index 0f7b9ac121..99a8c54381 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -1,5 +1,14 @@ #!/bin/bash +while true; do + read -p "Do you have the doom3 game files. The demo mode will be installed if you answer No. [Y/n]?" yn + case $yn in + [Yy]* ) choice=User_Supplied; break;; + [Nn]* ) choice=Download_Demo; break;; + * ) echo "Please answer yes or no.";; + esac +done + # fix broken install due to @techcoder20 # Remove packages if necessary @@ -68,13 +77,6 @@ Categories=Game; Terminal=false" | tee $HOME/.local/share/applications/Doom3.desktop >/dev/null || error "Failed to create menu button!" } -while true; do - read -p "Do you have the game files [Y/n]?" yn - case $yn in - [Yy]* ) User_Supplied; exit;; - [Nn]* ) Download_Demo; exit;; - * ) echo "Please answer yes or no.";; - esac -done +$choice rm -rf /tmp/dhewm3 From 1c9ad0b5a7fceaa7988976cf66a7d266c95a5c10 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 17:01:34 -0400 Subject: [PATCH 09/10] better punctuation --- apps/Doom 3/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index 99a8c54381..a83190ccb5 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -1,7 +1,7 @@ #!/bin/bash while true; do - read -p "Do you have the doom3 game files. The demo mode will be installed if you answer No. [Y/n]?" yn + read -p "Do you have the doom3 game files? The demo mode will be installed if you answer No. [Y/n]" yn case $yn in [Yy]* ) choice=User_Supplied; break;; [Nn]* ) choice=Download_Demo; break;; From df3343f83c5340c003f9b2fb486211cc36926b10 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Tue, 24 May 2022 17:57:04 -0400 Subject: [PATCH 10/10] tune compiled code for specific cpu --- apps/Doom 3/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/Doom 3/install b/apps/Doom 3/install index a83190ccb5..1e77c37efe 100755 --- a/apps/Doom 3/install +++ b/apps/Doom 3/install @@ -37,7 +37,7 @@ git clone https://github.com/dhewm/dhewm3 || error "Failed to clone dhewm3 from cd dhewm3/neo || exit mkdir build || error "Failed to create build folder" cd build || exit -cmake .. || error "Failed to build dhewm3" +cmake .. -DONATIVE=ON || error "Failed to build dhewm3" make -j$(nproc) || error "Failed to build dhewm3"