-
Notifications
You must be signed in to change notification settings - Fork 5
Simplified Build Instructions for Linux #3
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
Open
realThirdpartycookie
wants to merge
2
commits into
StereoKit:main
Choose a base branch
from
realThirdpartycookie:main
base: main
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.
Open
Changes from all commits
Commits
Show all changes
2 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 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,3 +1,6 @@ | ||
| # Ignore all shell scripts in the root directory | ||
| /*.sh | ||
|
|
||
| .vs/ | ||
| .vscode/ | ||
| .idea/ | ||
|
|
||
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
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
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,53 @@ | ||
| #!/bin/bash | ||
| # install_android-deps.sh: Install all dependencies for Android build on Linux | ||
|
|
||
| set -e | ||
|
|
||
| # Prevent running the whole script with sudo/root. | ||
| # We still use sudo for apt installs below, but the SDK should be under the user home, not /root. | ||
| if [ "$(id -u)" -eq 0 ]; then | ||
| if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then | ||
| echo "This script should not be run with sudo. Re-running as $SUDO_USER..." | ||
| exec sudo -u "$SUDO_USER" -H bash "$0" "$@" | ||
| else | ||
| echo "Please run this script without sudo (it will use sudo only where needed)." >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| sudo apt update | ||
| sudo apt install -y cmake libx11-dev libxfixes-dev libegl-dev libgbm-dev libfontconfig-dev unzip curl zip ninja-build openjdk-8-jdk adb google-android-cmdline-tools-13.0-installer | ||
|
|
||
| export ANDROID_HOME="$HOME/Android/Sdk" | ||
| export ANDROID_SDK_ROOT="$ANDROID_HOME" | ||
| export PATH="$ANDROID_HOME/platform-tools:$PATH" | ||
|
|
||
| export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/25.2.9519653" | ||
| export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" | ||
| export PATH="$JAVA_HOME/bin:$PATH" | ||
|
|
||
|
|
||
| sdkmanager --sdk_root=$ANDROID_HOME \ | ||
| "platform-tools" \ | ||
| "platforms;android-32" \ | ||
| "build-tools;32.0.0" \ | ||
| "ndk;25.2.9519653" | ||
|
|
||
|
|
||
| echo | ||
| read -p "Add Android environment variables to your ~/.bashrc for future sessions? If not, you will need to set them manually. [y/N] " add_envs | ||
| if [[ "$add_envs" =~ ^[Yy]$ ]]; then | ||
| { | ||
| echo '' | ||
| echo '# Android SDK/NDK environment variables (added by install_android_deps.sh)' | ||
| echo 'export ANDROID_HOME="$HOME/Android/Sdk"' | ||
| echo 'export ANDROID_SDK_ROOT="$ANDROID_HOME"' | ||
| echo 'export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/25.2.9519653"' | ||
| echo 'export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"' | ||
| echo 'export PATH="$ANDROID_HOME/platform-tools:$JAVA_HOME/bin:$PATH"' | ||
| } >> "$HOME/.bashrc" | ||
| echo "Variables added to ~/.bashrc. Please restart your terminal or run: source ~/.bashrc" | ||
| else | ||
| echo "Skipped adding environment variables to ~/.bashrc." | ||
| fi | ||
|
|
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.
This probably shouldn't be in the template by default. You've actually still got install_android_deps.sh in the root of this commit, likely because of this line!
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.
This is going to effectively prevent new sh files to be added to the main directory, but not the current one - that has been deleted now.
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.
Yeah, looks like you got install_android_deps.sh now.
Keeping .sh files out of the root directory is only to keep the template tidy for developers! IMO, templates should always have pretty clear and universally relevant roots. Devs can put whatever files they want in the root once they start developing, so I don't want to block inclusion of .sh files here.