-
Notifications
You must be signed in to change notification settings - Fork 2
/
trifinger_base_dev.def
109 lines (89 loc) · 2.32 KB
/
trifinger_base_dev.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Base image with development tools
Bootstrap: localimage
From: ./trifinger_base_pylon.sif
%post -c /bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive
export XDG_CACHE_HOME=/_cache
apt-get update
function cached_wget() {
dest="${XDG_CACHE_HOME}/$1"
url="$2"
if [ ! -e "${dest}" ]; then
wget "${url}" -O "${dest}"
fi
}
# Install neovim
nvim_pkg=nvim-linux64.tar.gz
cached_wget ${nvim_pkg} https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
tar -xzf "${XDG_CACHE_HOME}/${nvim_pkg}" -C /usr/local --strip-components=1
apt-get install -y \
clang-tidy \
clangd-12 \
fzf \
gdb \
ipython3 \
python3-ipdb \
python3-psutil \
python3-venv \
silversearcher-ag \
tmux \
valgrind
# symlink clangd-12 to clangd
ln -s $(which clangd-12) /usr/bin/clangd
python3 -m pip install -U \
black \
flake8 \
flake8-bugbear \
line-profiler \
mypy \
pylsp-mypy \
python-lsp-black \
python-lsp-ruff \
python-lsp-server \
ruff
# mypy stub packages
python3 -m pip install -U \
types-colorama \
types-docutils \
types-Pygments \
types-PyYAML \
types-setuptools \
types-tabulate \
types-toml \
types-tqdm
# install go (needed for lazygit)
go_version=1.22.3
go_pkg=go${go_version}.linux-amd64.tar.gz
cached_wget ${go_pkg} https://go.dev/dl/${go_pkg}
tar -C /usr/local -xzf "${XDG_CACHE_HOME}/${go_pkg}"
GOBIN=/usr/local/bin/ /usr/local/go/bin/go install github.com/jesseduffield/lazygit@latest
echo '
# search for install dir to source local workspace
start_dir="$PWD"
prev=.
while [[ "$PWD" != "$prev" ]]; do
_setupfile="$PWD/install/local_setup.bash"
if [ -e "${_setupfile}" ]; then
echo "Sourcing ${_setupfile}"
. "${_setupfile}"
break
fi
prev="$PWD"
cd ..
done
cd "$start_dir"
' >> /setup.bash
# create a runscript that uses bash
cat > /runscript.bash << \EOM
#!/bin/bash
set -e
# setup environment
source /setup.bash
exec "$@"
EOM
%environment
export EDITOR=nvim
export VISUAL=nvim
%runscript
exec bash /runscript.bash "$@"