Skip to content

Commit

Permalink
refactor: don't install all packages on all systems
Browse files Browse the repository at this point in the history
  • Loading branch information
adonis0147 committed Oct 30, 2024
1 parent 4afdeb4 commit 7a233af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
8 changes: 0 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ build_packages_task:
# Don't install llvm
sed -i '/function install_packages/,/^}/ s/llvm//' devel/scripts/install.sh
if [[ "$(uname -m)" != 'x86_64' ]]; then
# Don't install neovim
sed -i '/function install_packages/,/^}/ s/neovim//' devel/scripts/install.sh
fi
# Don't install zsh
sed -i '/function install_packages/,/^}/ s/zsh//' devel/scripts/install.sh
script: |
if [[ "$(uname -m)" == 'x86_64' ]]; then
cmd="sed -i -e 's|mirrorlist=|#mirrorlist=|' -e 's|#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=https://vault.centos.org/7.9.2009|' /etc/yum.repos.d/CentOS-Base.repo"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ jobs:
# Don't install llvm
sed -i '/function install_packages/,/^}/ s/llvm//' devel/scripts/install.sh
# Don't install zsh
sed -i '/function install_packages/,/^}/ s/zsh//' devel/scripts/install.sh
cd devel/scripts
packages=(
Expand Down
18 changes: 14 additions & 4 deletions devel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,12 @@ function install_packages() {

pushd "${DOWNLOADS_PATH}/packages" >/dev/null
if [[ "${#packages[@]}" -eq 0 ]]; then
packages=(
tzdb
if sed -n 's/^NAME=\(.*\)/\1/p' /etc/os-release 2>/dev/null | grep 'Alpine Linux' &>/dev/null; then
packages=()
else
packages=(tzdb)
fi
packages+=(
m4
zlib
libdb
Expand Down Expand Up @@ -810,15 +814,21 @@ function install_packages() {
mpfr
zstd
gdb
neovim
xxhash
ccache
libedit
libxml2
swig
llvm
zsh
)

if [[ "$(uname -m)" == 'x86_64' ]]; then
packages+=(neovim)
fi

if tty &>/dev/null; then
packages+=(zsh)
fi
fi

for package in "${packages[@]}"; do
Expand Down

0 comments on commit 7a233af

Please sign in to comment.