|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | | -install_pandoc() { |
4 | | - git clone https://aur.archlinux.org/pandoc.git |
5 | | - cd pandoc || { |
6 | | - echo "Failed to enter pandoc directory" |
7 | | - return 1 |
8 | | - } |
9 | | - makepkg -si --noconfirm |
10 | | - cd .. |
11 | | - rm -rf pandoc |
12 | | - echo "Pandoc installed" |
13 | | -} |
14 | | - |
15 | 3 | set -e |
16 | 4 |
|
17 | 5 | export ARCH="$(uname -m)" |
18 | 6 |
|
19 | 7 | ZIG_VERSION="0.13.0" |
20 | | -MINISIGN_URL="https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz" |
| 8 | +PANDOC_VERSION="3.6.3" |
| 9 | +MINISIGN_VERSION="0.11" |
| 10 | + |
| 11 | +PANDOC_BASE="https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}" |
| 12 | +MINISIGN_URL="https://github.com/jedisct1/minisign/releases/download/${MINISIGN_VERSION}/minisign-${MINISIGN_VERSION}-linux.tar.gz" |
| 13 | +APPIMAGE_URL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage" |
| 14 | +ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz" |
| 15 | + |
| 16 | +case "${ARCH}" in |
| 17 | +"x86_64") |
| 18 | + PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz" |
| 19 | + ;; |
| 20 | +"aarch64") |
| 21 | + PANDOC_URL="${PANDOC_BASE}/pandoc-${PANDOC_VERSION}-linux-arm64.tar.gz" |
| 22 | + ;; |
| 23 | +*) |
| 24 | + echo "Unsupported ARCH: '${ARCH}'" |
| 25 | + exit 1 |
| 26 | + ;; |
| 27 | +esac |
21 | 28 |
|
22 | 29 | # Update & install OS base dependencies |
23 | 30 | buildPkgs="base-devel freetype2 oniguruma wget fuse file zsync appstream" |
24 | 31 | ghosttyPkgs="gtk4 libadwaita" |
25 | 32 | pacman -Syu --noconfirm |
26 | 33 | # pacman -Syw --noconfirm ${buildPkgs} ${ghosttyPkgs} |
27 | 34 | pacman -Syq --needed --noconfirm ${buildPkgs} ${ghosttyPkgs} |
28 | | -install_pandoc |
29 | 35 |
|
30 | 36 | # Download & install other dependencies |
31 | 37 | # appimagetool: https://github.com/AppImage/appimagetool |
32 | 38 | if [ ! -f '/usr/local/bin/appimagetool' ]; then |
33 | | - wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage" -O /tmp/appimagetool.AppImage |
| 39 | + wget -q "${APPIMAGE_URL}" -O /tmp/appimagetool.AppImage |
34 | 40 | chmod +x /tmp/appimagetool.AppImage |
35 | 41 | mv /tmp/appimagetool.AppImage /usr/local/bin/appimagetool |
36 | 42 | fi |
|
44 | 50 |
|
45 | 51 | # zig: https://ziglang.org |
46 | 52 | if [ ! -d "/opt/zig-linux-${ARCH}-${ZIG_VERSION}" ]; then |
47 | | - wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz" -O /tmp/zig-linux.tar.xz |
| 53 | + wget -q "${ZIG_URL}" -O /tmp/zig-linux.tar.xz |
48 | 54 | tar -xf /tmp/zig-linux.tar.xz -C /opt |
49 | 55 | ln -s "/opt/zig-linux-${ARCH}-${ZIG_VERSION}/zig" /usr/local/bin/zig |
50 | 56 | fi |
51 | 57 |
|
| 58 | +# pandoc: https://github.com/jgm/pandoc |
| 59 | +if [ ! -f '/usr/local/bin/pandoc' ]; then |
| 60 | + wget -q "${PANDOC_URL}" -O /tmp/pandoc-linux.tar.gz |
| 61 | + tar -xzf pandoc-linux.tar.gz -C /tmp |
| 62 | + mv "/tmp/pandoc-${PANDOC_VERSION}/bin/*" /usr/local/bin |
| 63 | +fi |
| 64 | + |
52 | 65 | # Cleanup |
53 | 66 | rm -rf \ |
54 | 67 | /tmp/appimagetool.AppImage \ |
55 | | - /tmp/minisign-linux.tar.gz \ |
56 | | - /tmp/minisign-linux \ |
57 | | - /tmp/zig-linux.tar.xz |
| 68 | + /tmp/minisign-linux* \ |
| 69 | + /tmp/zig-linux.tar.xz \ |
| 70 | + /tmp/pandoc* |
0 commit comments