blob: 17c3d14359ea476abf33935aaeb2b0448b03e155 (
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
54
55
56
57
|
# Maintainer: DeathKhan <DeathKhan@users.noreply.github.com>
pkgname=typst-studio-bin
pkgver=0.2.0
pkgrel=2
pkgdesc="Desktop Typst editor with Tinymist LSP and live HTML preview"
arch=('x86_64')
url="https://github.com/DeathKhan/typst-studio"
license=('GPL-3.0-or-later')
depends=('typst' 'gtk3')
optdepends=(
'tinymist: external language server if not using the bundled binary'
)
makedepends=('imagemagick' 'squashfs-tools')
provides=('typst-studio')
conflicts=('typst-studio')
options=('!debug')
source=(
"${pkgname}-${pkgver}.AppImage::${url}/releases/download/v${pkgver}/typst-studio-${pkgver}.AppImage"
"typst-studio.desktop"
"icon.png::${url}/raw/v${pkgver}/build/icon.png"
)
sha256sums=(
'92a93e11929b7ca7ed62add92cfd55d62591356efb500383d450a999c7db8a5e'
'f34ee73cc0aef77b2d210aee0ce3cfdd305c3ee05ae995aaaaa61a9e2ff6b6cf'
'f0f39b2bc53cc60c4a461364ccbd21b9773daf4d8134070c1bfbefad08a05b21'
)
prepare() {
chmod +x "${srcdir}/${pkgname}-${pkgver}.AppImage"
cd "${srcdir}"
rm -rf squashfs-root app.squashfs
# Extract without FUSE so end users never need libfuse at runtime.
local offset
offset="$("./${pkgname}-${pkgver}.AppImage" --appimage-offset)"
tail -c +$((offset + 1)) "${pkgname}-${pkgver}.AppImage" > app.squashfs
unsquashfs -force -no-xattrs -d squashfs-root app.squashfs
}
package() {
install -dm755 "${pkgdir}/opt/typst-studio"
cp -a "${srcdir}/squashfs-root/." "${pkgdir}/opt/typst-studio/"
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/typst-studio" <<'EOF'
#!/bin/sh
exec /opt/typst-studio/AppRun "$@"
EOF
install -Dm644 "${srcdir}/typst-studio.desktop" \
"${pkgdir}/usr/share/applications/typst-studio.desktop"
for size in 16 32 48 64 128 256 512; do
install -dm755 "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps"
magick "${srcdir}/icon.png" -resize "${size}x${size}" \
"${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/typst-studio.png"
done
}
|