Skip to content

Commit 1b8a1ce

Browse files
committed
add installing packages from Arch Linux + add pdf-xchange
1 parent 331360f commit 1b8a1ce

3 files changed

Lines changed: 99 additions & 1 deletion

File tree

build_files/50-arch.sh

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/usr/bin/bash
2+
3+
set -ouex pipefail
4+
5+
source /ctx/build_files/build-helpers.sh
6+
7+
pdnf install pacman \
8+
gendesk icoutils
9+
10+
#DBPath = /var/lib/pacman/
11+
#CacheDir = /var/cache/pacman/pkg/
12+
#LogFile = /var/log/pacman.log
13+
#GPGDir = /etc/pacman.d/gnupg/
14+
#HookDir = /etc/pacman.d/hooks/
15+
16+
sed -i -E 's!^#?RootDir\s*=.*$!RootDir = /tmp/pacmanroot/!g' /etc/pacman.conf
17+
sed -i -E 's!^#?CacheDir\s*=.*$!CacheDir = /tmp/pacmanroot/var/cache/pacman/pkg/!g' /etc/pacman.conf
18+
sed -i -E 's!^#?LogFile\s*=.*$!LogFile = /tmp/pacmanroot/var/log/pacman.log!g' /etc/pacman.conf
19+
sed -i -E 's!^#?GPGDir\s*=.*$!GPGDir = /tmp/pacmanroot/etc/pacman.d/gnupg/!g' /etc/pacman.conf
20+
sed -i -E 's!^#?HookDir\s*=.*$!HookDir = /tmp/pacmanroot/etc/pacman.d/hooks/!g' /etc/pacman.conf
21+
22+
sed -i '1s|^|Server = https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/$repo/os/$arch\n|' /etc/pacman.d/mirrorlist
23+
sed -i '1s|^|Server = https://ftp.psnc.pl/linux/archlinux/$repo/os/$arch\n|' /etc/pacman.d/mirrorlist
24+
echo 'Server = https://archive.archlinux.org/.all' >> /etc/pacman.d/mirrorlist
25+
26+
mkdir -p /tmp/pacmanroot
27+
mkdir -p /tmp/pacmanroot/var/{cache,lib}/pacman /tmp/pacmanroot/{etc/pacman.d,log}
28+
#cp -f /etc/pacman.conf /tmp/pacmanroot/etc/pacman.conf
29+
rsync -ar /etc/pacman.d/ /tmp/pacmanroot/pacman.d/
30+
#ln -s /proc /tmp/pacmanroot/proc
31+
#ln -s /dev /tmp/pacmanroot/dev
32+
#ln -s /sys /tmp/pacmanroot/sys
33+
34+
if [ -d /usr/share/pacman/keyrings ]; then
35+
rsync -ar {/,/tmp/pacmanroot/}usr/share/pacman/keyrings
36+
rm -rf /usr/share/pacman/keyrings
37+
fi
38+
mkdir -p /usr/share/pacman
39+
ln -s /tmp/pacmanroot/usr/share/pacman/keyrings /usr/share/pacman/keyrings
40+
pacman-key --init
41+
pacman-key --populate
42+
43+
pacman -Sydd --noconfirm archlinux-keyring
44+
45+
# BioArchLinux
46+
pacman-key --recv-keys B1F96021DB62254D
47+
pacman-key --finger B1F96021DB62254D
48+
pacman-key --lsign-key B1F96021DB62254D
49+
tee -a /etc/pacman.conf <<'EOF'
50+
[bioarchlinux]
51+
Server = https://repo.bioarchlinux.org/$arch
52+
EOF
53+
54+
# Chaotic AUR
55+
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
56+
pacman-key --lsign-key 3056513887B78AEB
57+
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
58+
pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
59+
tee -a /etc/pacman.conf <<'EOF'
60+
[chaotic-aur]
61+
Server = https://cdn-mirror.chaotic.cx/$repo/$arch
62+
Include = /tmp/pacmanroot/etc/pacman.d/chaotic-mirrorlist
63+
EOF
64+
65+
# Arch4Edu
66+
pacman-key --recv-keys 7931B6D628C8D3BA
67+
pacman-key --finger 7931B6D628C8D3BA
68+
pacman-key --lsign-key 7931B6D628C8D3BA
69+
curl --retry 3 -sSLo /tmp/pacmanroot/etc/pacman.d/mirrorlist.arch4edu https://raw.githubusercontent.com/arch4edu/mirrorlist/refs/heads/master/mirrorlist.arch4edu
70+
tee -a /etc/pacman.conf <<'EOF'
71+
[arch4edu]
72+
Include = /tmp/pacmanroot/etc/pacman.d/mirrorlist.arch4edu
73+
EOF
74+
75+
pacman-key --populate
76+
pacman -Sydd --noconfirm bioarchlinux-keyring chaotic-keyring arch4edu-keyring
77+
pacman -Syudd --noconfirm chaotic-mirrorlist mirrorlist.arch4edu
78+
pacman-key --populate
79+
80+
# pdf-xchange (Chaotic AUR)
81+
pacman -Swdd --noconfirm pdf-xchange
82+
tar --overwrite -xavf /tmp/pacmanroot/var/cache/pacman/pkg/pdf-xchange-*.pkg.tar.zst --directory=/ usr
83+
84+
# Cleanup
85+
pacman -Scc --noconfirm
86+
pdnf remove pacman
87+
rm -rf /etc/pacman.{conf,d} /usr/share/pacman
88+
rm -rf /var/{cache,lib}/pacman /var/log/pacman.log /root/.cache/paru
89+
rm -rf /tmp/pacmanroot

build_files/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ run_parallel \
6565
/ctx/build_files/50-scrutiny.sh \
6666
/ctx/build_files/50-beszel.sh \
6767
/ctx/build_files/50-rstudio.sh \
68-
/ctx/build_files/50-openrefine.sh
68+
/ctx/build_files/50-openrefine.sh \
69+
/ctx/build_files/50-arch.sh
6970

7071
#### Enabling a System Unit File
7172

build_files/tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ test -f /opt/KopiaUI/resources/server/kopia
9090
test -L /usr/bin/kopia
9191
/usr/bin/kopia --version | grep -qF "from: kopia/kopia"
9292

93+
# Make sure there's no artifacts from Arch's packages being improperly unpacked
94+
if [[ -e /.BUILDINFO || -e /.MTREE || -e /.PKGINFO ]]; then exit 1; fi
95+
96+
# pdf-xchange
97+
test -e /usr/bin/pdf-xchange
98+
test -d /usr/lib/pdf-xchange
99+
test -f /usr/share/applications/pdf-xchange.desktop
100+
93101
# Check for KDE Plasma version mismatch
94102
# Fedora Repos have gotten the newer one, trying to upgrade
95103
# everything except a few packages, breaking SDDM and shell

0 commit comments

Comments
 (0)