Last active
March 29, 2022 19:08
-
-
Save peat-psuwit/0f307e501e46b46898b034aa80c1cf41 to your computer and use it in GitHub Desktop.
Automatically setup a GitPod working environment
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
#!/bin/sh | |
if [ -e debian/ubports.source_location ] && ! [ -e .pc/ ]; then | |
# Fetch & extract source | |
sudo apt install --no-install-recommends -y devscripts quilt | |
( | |
{ read -r url; read -r file; } < debian/ubports.source_location | |
wget -O "../${file}" "$url" | |
) | |
origtargz --unpack | |
QUILT_PATCHES=debian/patches quilt push -a | |
cat >>.git/info/exclude <<EOF | |
/* | |
!/debian/ | |
EOF | |
fi | |
cat >~/.quiltrc <<'EOF' | |
QUILT_PATCHES=debian/patches | |
QUILT_NO_DIFF_INDEX=1 | |
QUILT_NO_DIFF_TIMESTAMPS=1 | |
QUILT_REFRESH_ARGS="-p ab" | |
QUILT_DIFF_ARGS="--color=auto" # If you want some color when using `quilt diff`. | |
QUILT_PATCH_OPTS="--reject-format=unified" | |
QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33" | |
EOF | |
# Various packages depend on system-installed Python modules. | |
type pyenv && pyenv local system | |
# Setup UBports repo | |
echo 'deb http://repo2.ubports.com focal main' | sudo dd status=none of=/etc/apt/sources.list.d/ubports.list | |
wget -O- https://repo.ubports.com/keyring.gpg | sudo dd status=none of=/etc/apt/trusted.gpg.d/ubports.gpg | |
# Install dependencies | |
sudo apt update | |
sudo apt -y build-dep . | |
echo "Now you can browse the code. Container-wide upgrade continues in terminal." | code --no-wait - &>/dev/null & | |
sudo apt -y upgrade |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment