/
build-all.sh
executable file
·177 lines (165 loc) · 3.77 KB
/
build-all.sh
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
set -u
# set -x
# this script should be run by ci to build all the pkgs
# this is the list of which custom pkgs to build, but the pkg still needs to be
# added to complex or simple below
custom_pkgs=(
bfs
cogapp
delta
fd
jc
litellm
netcat
)
simple=(
bash
bat
bfs
datasette
delta
deno
direnv
docker-compose
emacs
exa
fd
ffmpeg
fzf
gawk
gem
gh
git
go
jc
jq
jupyter
litellm
mosh
ncdu
nginx
# packages below don't work for various reasons
parallel
perl
pgcli
pipenv
pipx
poetry
pv
python
rclone
rsync
ruby
s3cmd
socat
tldr
tree
vim
wget
xonsh
yarn
youtube-dl
yq
yt-dlp
zsh
# packages below don't work for various reasons
# # tmux # builds, but doesn't start (message about term not supporting clear)
# # tmate # builds, but binaries have issues (terminfo + dydl stuff on mac)
# # curl # builds, but gives ssl errors. probably a dep issue
# # pstree # no conda package
# # mplayer # no conda package
# # shfmt # no conda package
# # howdoi # no conda package
)
# format is: complex[<cmd-to-run>]=<package-name>
declare -A complex
complex[ag]=the_silver_searcher
complex[cargo]=rust
complex[chronic]=moreutils
complex[cog]=cogapp
complex[convert]=imagemagick
complex[ctags]=universal-ctags
complex[ffprobe]=ffmpeg
complex[gtimeout]=gnu-coreutils # bin should be called timeout, but no support for that yet
complex[http]=httpie
complex[java]=openjdk
complex[mogrify]=imagemagick
complex["mosh-client"]=mosh
complex["mosh-server"]=mosh
complex[nc]=netcat
complex[node]=nodejs
complex[npm]=nodejs
complex[npx]=nodejs
complex[nvim]=neovim
complex[pee]=moreutils
complex[pg_dump]=postgresql
complex[pg_restore]=postgresql
complex[postgres]=postgresql
complex[psql]=postgresql
complex[python]=python3
complex["redis-cli"]=redis
complex[rg]=ripgrep
complex[rustc]=rust
complex[sponge]=moreutils
complex[sqlite3]=sqlite
complex[sshd]=openssh
complex[ssh]=openssh
complex[ts]=moreutils
complex[vidir]=moreutils
complex[vipe]=moreutils
check_status() {
local i="$1"
if [[ "$?" == "0" ]]; then
echo "OK!"
else
echo "ERROR!"
sed <"$i.log" 's/^/>> /' || true # using a `|| true` so we don't exit the script if one pkg fails
fi
}
build-custom-packages() {
for p in "${custom_pkgs[@]}"; do
cd "$SCRIPT_DIR/custom-recipes/$p"
echo ">>> Building custom conda package for '$p'"
conda build . && echo "OK!" || echo "Error!" || true
echo ">>> Completed custom conda package for '$p' "
done
cd "$SCRIPT_DIR"
true
}
build-simple-packages() {
echo "Building simple 1bins"
for i in "${simple[@]}"; do
if [[ -e "$SCRIPT_DIR/out/$i" ]]; then
echo "Skipping $i"
else
printf "Building $i... "
./build.sh "$i" &>"$i".log || true
check_status "$i"
fi
done
echo "Finished building simple 1bins!"
}
build-complex-packages() {
echo "Building complex 1bins (where pkg name and executable name differ)"
for cmd_name in "${!complex[@]}"; do
if ! [[ -e "$SCRIPT_DIR/out/$cmd_name" ]]; then
PACKAGE_NAME="${complex[$cmd_name]}"
printf "Building $cmd_name (package: $PACKAGE_NAME)... "
export CMD_TO_RUN="$cmd_name"
./build.sh "$PACKAGE_NAME" &>"$cmd_name".log || true
check_status "$cmd_name"
else
echo "Skipping $cmd_name"
fi
done
echo "Finished building complex 1bins!"
}
main() {
build-custom-packages
build-simple-packages
build-complex-packages
}
set -x
main