summaryrefslogtreecommitdiff
path: root/ci/ciimage/arch/install.sh
blob: ccbbab0a222696ecc2ed730a5d3419e314f04524 (plain)
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
#!/bin/bash

set -e

# Inspired by https://github.com/greyltc/docker-archlinux-aur/blob/master/add-aur.sh

pkgs=(
  python python-setuptools python-wheel python-pip python-pytest-xdist python-gobject python-jsonschema
  ninja make git sudo fakeroot autoconf automake patch
  libelf gcc gcc-fortran gcc-objc vala rust bison flex cython go dlang-dmd
  mono boost qt5-base gtkmm3 gtest gmock protobuf wxgtk2 gobject-introspection
  itstool gtk3 java-environment=8 gtk-doc llvm clang sdl2 graphviz
  doxygen vulkan-validation-layers openssh mercurial gtk-sharp-2 qt5-tools
  libwmf valgrind cmake netcdf-fortran openmpi nasm gnustep-base gettext
  python-jsonschema python-lxml
  # cuda
)

aur_pkgs=(scalapack)
pip_pkgs=(hotdoc gcovr)
cleanup_pkgs=(go)

AUR_USER=docker
PACMAN_OPTS='--needed --noprogressbar --noconfirm'

# Patch config files
sed -i 's/#Color/Color/g'                            /etc/pacman.conf
sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf
sed -i "s,PKGEXT='.pkg.tar.zst',PKGEXT='.pkg.tar',g" /etc/makepkg.conf

# Install packages
pacman -Syu $PACMAN_OPTS "${pkgs[@]}"
python -m pip install "${pip_pkgs[@]}"

# Setup the user
useradd -m $AUR_USER
echo "${AUR_USER}:" | chpasswd -e
echo "$AUR_USER      ALL = NOPASSWD: ALL" >> /etc/sudoers

# Install yay
su $AUR_USER -c 'cd; git clone https://aur.archlinux.org/yay.git'
su $AUR_USER -c 'cd; cd yay; makepkg'
pushd /home/$AUR_USER/yay/
pacman -U *.pkg.tar --noprogressbar --noconfirm
popd
rm -rf /home/$AUR_USER/yay

# Install yay deps
su $AUR_USER -c "yay -S $PACMAN_OPTS ${aur_pkgs[*]}"

# cleanup
pacman -Rs --noconfirm "${cleanup_pkgs[@]}"
su $AUR_USER -c "yes | yay -Scc"