From 30e0462c412de6ee4f6b6dc4f2b4a6994d4864ef Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Thu, 16 Jun 2022 23:33:22 -0400 Subject: [PATCH] sublime-text3: unrestrict, merge template with sublime-text3-bin --- srcpkgs/sublime-text3-bin | 1 + srcpkgs/sublime-text3-bin/template | 55 ---------------------------- srcpkgs/sublime-text3/INSTALL.msg | 4 --- srcpkgs/sublime-text3/template | 57 +++++++++++++++++++++++++++--- srcpkgs/sublime-text3/update | 2 ++ 5 files changed, 55 insertions(+), 64 deletions(-) create mode 120000 srcpkgs/sublime-text3-bin delete mode 100644 srcpkgs/sublime-text3-bin/template delete mode 100644 srcpkgs/sublime-text3/INSTALL.msg create mode 100644 srcpkgs/sublime-text3/update diff --git a/srcpkgs/sublime-text3-bin b/srcpkgs/sublime-text3-bin new file mode 120000 index 00000000000..009ce821bd4 --- /dev/null +++ b/srcpkgs/sublime-text3-bin @@ -0,0 +1 @@ +sublime-text3 \ No newline at end of file diff --git a/srcpkgs/sublime-text3-bin/template b/srcpkgs/sublime-text3-bin/template deleted file mode 100644 index 73d67ea9c63..00000000000 --- a/srcpkgs/sublime-text3-bin/template +++ /dev/null @@ -1,55 +0,0 @@ -# Template file for 'sublime-text3-bin' -pkgname=sublime-text3-bin -version=3211 -revision=1 -archs="i686 x86_64" -wrksrc="sublime_text_3" -hostmakedepends="w3m" -depends="libpng gtk+ hicolor-icon-theme desktop-file-utils" -short_desc="Sophisticated text editor for code, markup and prose" -maintainer="Andrea Brancaleoni " -license="custom:EULA" -homepage="http://www.sublimetext.com/3dev" -_license_checksum=33929b71625d13dacf2a0a5853171b9c04058f71e2955ee660b8d0f8dda45ed1 -repository="nonfree" -restricted=yes -nopie=yes -replaces="sublime-text3>0" - -if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then - distfiles="https://download.sublimetext.com/sublime_text_3_build_${version}_x64.tar.bz2" - checksum=0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee -else - distfiles="https://download.sublimetext.com/sublime_text_3_build_${version}_x32.tar.bz2" - checksum=480609962bbbd12128b5332c7831372b8851c13e160512730d1b0a6a835a3071 -fi - -post_extract() { - $XBPS_FETCH_CMD https://www.sublimehq.com/eula - sed -n ' - /is licensed.*not sold/p - /
    /,${ /<\/ol>/{x;p;d}; H } - $a
- ' 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/subl3 - vsed -e 's:Exec=/opt/sublime_text/:Exec=/usr/lib/sublime_text/:' \ - -i ${DESTDIR}/usr/share/applications/sublime_text.desktop - vlicense EULA -} diff --git a/srcpkgs/sublime-text3/INSTALL.msg b/srcpkgs/sublime-text3/INSTALL.msg deleted file mode 100644 index cf4c4e70a7a..00000000000 --- a/srcpkgs/sublime-text3/INSTALL.msg +++ /dev/null @@ -1,4 +0,0 @@ -sublime-text3 is replaced with the restricted sublime-text3-bin -package, due to its license that restricts redistribution. -In order to install it you have to build it with xbps-src, please see: -https://docs.voidlinux.org/xbps/repositories/restricted.html diff --git a/srcpkgs/sublime-text3/template b/srcpkgs/sublime-text3/template index c077963863d..44eb22ee257 100644 --- a/srcpkgs/sublime-text3/template +++ b/srcpkgs/sublime-text3/template @@ -1,15 +1,62 @@ # Template file for 'sublime-text3' pkgname=sublime-text3 version=3211 -revision=3 +revision=4 archs="i686 x86_64" -build_style=meta -short_desc="Empty meta-package for sublime-text3" +wrksrc="sublime_text_3" +hostmakedepends="w3m" +depends="libpng gtk+ hicolor-icon-theme desktop-file-utils" +short_desc="Sophisticated text editor for code, markup and prose" maintainer="Andrea Brancaleoni " -license="custom:EULA" #no vlicense check +license="custom:EULA" homepage="http://www.sublimetext.com/3dev" repository="nonfree" +nopie=yes + +case "$XBPS_TARGET_MACHINE" in + x86_64) + distfiles="https://download.sublimetext.com/sublime_text_3_build_${version}_x64.tar.bz2" + checksum=0b3c8ca5e6df376c3c24a4b9ac2e3b391333f73b229bc6e87d0b4a5f636d74ee + ;; + i686) + distfiles="https://download.sublimetext.com/sublime_text_3_build_${version}_x32.tar.bz2" + checksum=480609962bbbd12128b5332c7831372b8851c13e160512730d1b0a6a835a3071 + ;; +esac +_license_checksum=287d037b0ecedb68ae1e3138411d54b87172156effecd1987a5f85834aa26a24 + +post_extract() { + $XBPS_FETCH_CMD https://www.sublimehq.com/eula + sed -n ' + /is licensed.*not sold/p + /
    /,${ /<\/ol>/{x;p;d}; H } + $a
+ ' EULA + + filesum="$(xbps-digest EULA)" + if [ "$filesum" != "$_license_checksum" ]; then + msg_error "SHA256 mismatch for EULA:\n$filesum\n" + fi +} + do_install() { - vdoc "${XBPS_SRCPKGDIR}/${pkgname}/INSTALL.msg" README.voidlinux + 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/subl3 + vsed -e 's:Exec=/opt/sublime_text/:Exec=/usr/lib/sublime_text/:' \ + -i ${DESTDIR}/usr/share/applications/sublime_text.desktop + vlicense EULA +} + +sublime-text3-bin_package() { + build_style=meta + short_desc+=" (transitional dummy package)" + depends="sublime-text3>=${version}_${revision}" } diff --git a/srcpkgs/sublime-text3/update b/srcpkgs/sublime-text3/update new file mode 100644 index 00000000000..db2af5b98e4 --- /dev/null +++ b/srcpkgs/sublime-text3/update @@ -0,0 +1,2 @@ +site="https://www.sublimetext.com/3" +pattern='sublime_text_3_build_\K[-.\d]+(?=_x64\.tar)'