-
Notifications
You must be signed in to change notification settings - Fork 29
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
mGBA: add Ubuntu script #152
Open
NotToDisturb
wants to merge
3
commits into
cobalt2727:master
Choose a base branch
from
NotToDisturb:mgba
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+96
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
This file contains 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
This file contains 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,76 @@ | ||
#!/bin/bash | ||
|
||
clear -x | ||
echo "mGBA script successfully started!" | ||
echo "Credits: https://github.com/mgba-emu/mgba" | ||
sleep 3 | ||
|
||
echo "Running updates..." | ||
sleep 1 | ||
|
||
case "$__os_codename" in | ||
bionic) | ||
echo " -------UBUNTU 18.04 DETECTED-------" | ||
echo | ||
echo "theofficialgman has done his PPA Qt5 wizardry" | ||
echo "enjoy mGBA on Ubuntu Bionic, Focal, Hirsute, and beyond" | ||
|
||
if ! [[ "$dpkg_architecture" =~ ^("arm64"|"armhf")$ ]]; then | ||
warning "You are not running an ARMhf/ARM64 architecture, your system is not supported and this may not work" | ||
ubuntu_ppa_installer "beineri/opt-qt-5.15.2-bionic" | ||
else | ||
ubuntu_ppa_installer "theofficialgman/opt-qt-5.15.2-bionic-arm" | ||
fi | ||
ppa_installer | ||
ubuntu_ppa_installer "theofficialgman/melonds-depends" || error "PPA failed to install" | ||
ubuntu_ppa_installer "theofficialgman/cmake-bionic" || error "PPA failed to install" | ||
|
||
echo "Adding Ubuntu Toolchain Test PPA to install GCC 11..." | ||
ubuntu_ppa_installer "ubuntu-toolchain-r/test" || error "PPA failed to install" | ||
|
||
# sudo apt install cmake gcc-11 g++-11 qt5123d qt512base qt512canvas3d qt512declarative qt512gamepad qt512graphicaleffects qt512imageformats qt512multimedia qt512xmlpatterns -y || error "Could not install dependencies" | ||
sudo apt install -y cmake gcc-11 g++-11 qt515base qt515multimedia qt515gamepad || error "Could not install dependencies" | ||
;; | ||
*) | ||
package_available qt5-default | ||
if [[ $? == "0" ]]; then | ||
sudo apt install -y qt5-default qtbase5-private-dev qtmultimedia5-dev || error "Failed to install dependencies" | ||
else | ||
sudo apt install -y qtbase5-dev qtchooser qtbase5-private-dev qtmultimedia5-dev || error "Failed to install dependencies" | ||
fi | ||
sudo apt install -y cmake gcc g++ || error "Could not install dependencies" | ||
;; | ||
esac | ||
|
||
echo "Installing dependencies..." | ||
sleep 1 | ||
sudo apt install cmake git libsdl2-2.0-0 libsdl2-dev ffmpeg libelf-dev libepoxy-dev libzip-dev zipcmp zipmerge ziptool libedit-dev libjson-c-dev libsqlite3-dev liblua5.3-dev -y || error "Could not install dependencies" | ||
|
||
echo "Building mGBA..." | ||
sleep 1 | ||
cd ~ | ||
git clone https://github.com/mgba-emu/mgba.git | ||
cd mgba | ||
git pull || error "Could Not Pull Latest mGBA Source Code, verify your ~/mgba directory hasn't been modified. You can detete the ~/mGBA folder to attempt to fix this error." | ||
mkdir -p build | ||
cd build | ||
rm -rf CMakeCache.txt | ||
case "$__os_codename" in | ||
bionic) | ||
cmake .. -DCMAKE_CXX_FLAGS=-mcpu=native -DCMAKE_C_FLAGS=-mcpu=native -DCMAKE_PREFIX_PATH=/opt/qt515 -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 | ||
;; | ||
*) | ||
cmake .. -DCMAKE_CXX_FLAGS=-mcpu=native -DCMAKE_C_FLAGS=-mcpu=native | ||
;; | ||
esac | ||
make -j$(nproc) || error "Compilation failed" | ||
sudo make install || error "Make install failed" | ||
|
||
##echo "Removing build files..." | ||
##sleep 1 | ||
##cd ~ | ||
##sudo rm -rf mgba | ||
|
||
echo "Done!" | ||
echo "Sending you back to the main menu..." | ||
sleep 5 |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think you forgot to take out the redundant error function definition during your testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure what it does, most of the script is copied over from melonDS and this is present there (link)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my fault, then - it's a duplicate from functions.sh
Will remove from melonDS in a moment