57 lines
1.8 KiB
Bash
57 lines
1.8 KiB
Bash
# Template file for 'sublime-text4'
|
|
pkgname=sublime-text4
|
|
version=4121
|
|
revision=1
|
|
archs="x86_64 aarch64"
|
|
wrksrc="sublime_text"
|
|
hostmakedepends="w3m"
|
|
depends="libpng gtk+3 hicolor-icon-theme desktop-file-utils"
|
|
short_desc="Sophisticated text editor for code, markup and prose"
|
|
maintainer="DirectorX <void.directorx@protonmail.com>"
|
|
license="custom:EULA"
|
|
homepage="https://www.sublimetext.com/"
|
|
conflicts="sublime-text3"
|
|
repository="nonfree"
|
|
restricted=yes
|
|
nopie=yes
|
|
_license_checksum=33929b71625d13dacf2a0a5853171b9c04058f71e2955ee660b8d0f8dda45ed1
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
x86_64)
|
|
distfiles="https://download.sublimetext.com/sublime_text_build_${version}_x64.tar.xz"
|
|
checksum=084fcf79457c320d59da1f0e58c85a7a63956bde41d64db01ec86df2554fc5e6
|
|
;;
|
|
aarch64)
|
|
distfiles="https://download.sublimetext.com/sublime_text_build_${version}_arm64.tar.xz"
|
|
checksum=7af7845b402aea98a6d259d0e817c849168182881ea1f80b98e5729525688f08
|
|
;;
|
|
esac
|
|
|
|
post_extract() {
|
|
$XBPS_FETCH_CMD https://www.sublimehq.com/eula
|
|
sed -n '
|
|
/is licensed.*not sold/p
|
|
/<ol>/,${ /<\/ol>/{x;p;d}; H }
|
|
$a </ol>
|
|
' <eula | w3m -dump -I utf-8 -T text/html >EULA
|
|
|
|
filesum="$(xbps-digest EULA)"
|
|
if [ "$filesum" != "$_license_checksum" ]; then
|
|
msg_error "SHA256 mismatch for EULA:\n$filesum\n"
|
|
fi
|
|
}
|
|
|
|
do_install() {
|
|
vmkdir "usr/bin"
|
|
vmkdir "usr/lib/sublime_text"
|
|
cp --preserve=mode -r ./* "${DESTDIR}/usr/lib/sublime_text"
|
|
vinstall "sublime_text.desktop" 644 "usr/share/applications/"
|
|
for size in 128 16 256 32 48; do
|
|
vinstall "Icon/${size}x${size}/sublime-text.png" 644 \
|
|
"usr/share/icons/hicolor/${size}x${size}/apps/"
|
|
done
|
|
ln -s /usr/lib/sublime_text/sublime_text ${DESTDIR}/usr/bin/subl4
|
|
vsed -e 's:Exec=/opt/sublime_text/:Exec=/usr/lib/sublime_text/:' \
|
|
-i ${DESTDIR}/usr/share/applications/sublime_text.desktop
|
|
vlicense EULA
|
|
}
|