-
-
Notifications
You must be signed in to change notification settings - Fork 262
total rewrite of Doom3 script #1869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3a2f3eb
total rewrite of Doom3 script
theofficialgman 792d1c6
remove deprecated package
theofficialgman 6ea8a34
remove some unnecessary dependencies
theofficialgman 48bd019
fix while loop
theofficialgman 4025261
remove more depends
theofficialgman c514997
specify icon location with directory instead of dirname
theofficialgman ae1542d
remove packages only if necessary
theofficialgman a5feb31
move choice to top
theofficialgman 1c9ad0b
better punctuation
theofficialgman df3343f
tune compiled code for specific cpu
theofficialgman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| #!/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 | ||
| 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 \ | ||
| libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxss-dev \ | ||
| freeglut3-dev libvorbisfile3 libcurl4 cmake build-essential \ | ||
| libsdl2-ttf-dev libsdl2-dev libsdl2-mixer-dev || error "Failed to install dependencies" | ||
|
|
||
| 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 .. -DONATIVE=ON || 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=${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!" | ||
| } | ||
|
|
||
| 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=${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!" | ||
| } | ||
|
|
||
| $choice | ||
|
|
||
| rm -rf /tmp/dhewm3 | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
theofficialgman marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.