From 5effebff2cf38804b27bf16cc07788913b1bcb1b Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Sat, 23 Dec 2023 21:49:05 -0300 Subject: [PATCH] Added Snap update automation for new releases of Ghostscript - Discovered that Ghostscript's GIT repo https://git.ghostscript.com/ghostpdl.gitis mirrored to GitHub, as https://github.com/ArtifexSoftware/ghostpdl.git So use this one to have a repo which works with the scripting of ubuntu/desktop-snaps out-of-the-box. - Activated "source-depth: 1" line toactually do update automation. - Added override-pull: scriptlet to Ghostscript part to remove extra tools built as part of GhostPDL, we only need Ghostscript but Artifex providesGIT repositories only for the full GhostPDL, not Ghostscript-only. So we remove the directories gpdl/, pcl/, and xps/ from the source before we build it. This saves us from several ~20MB executables which we do not need. - Intendedly downgrade Ghostscript's upstream version to 10.02.0, for testing Snap update automation. --- snapcraft.yaml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index ceca8aa..da92fb7 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -363,15 +363,13 @@ parts: - -usr/lib/libqpdf.a ghostscript: - # Does not build from GIT, so we use the release tarball here for now - source: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs10021/ghostscript-10.02.1.tar.gz + # use GitHub mirror of GhostPDL here, as original GIT, self-hosted by + # Artifex is not supported by ubuntu/desktop-snaps #source: https://git.ghostscript.com/ghostpdl.git - #source-type: git - #source-tag: ghostpdl-10.02.1 - # Ghostscript is hosting their GIT repository by themselves and not on - # GitHub/GitLab, so the ubuntu/desktop-snaps update automation does not - # work here. - #source-depth: 1 + source: https://github.com/ArtifexSoftware/ghostpdl.git + source-type: git + source-tag: ghostpdl-10.02.0 + source-depth: 1 # ext:updatesnap # version-format: # format: "ghostpdl-%M.%m.%R" @@ -391,6 +389,18 @@ parts: - --with-cups-serverbin=/snap/cups/current/lib/cups - --with-cups-serverroot=/var/snap/cups/common/etc/cups - --with-cups-datadir=/snap/cups/current/share/cups + override-pull: | + set -eux + # Do the actual pull task + craftctl default + # The repo is actually ghostpdl and not only Ghostscript, so a wider + # variety of print data renderers/interpreters/converters. One of + # them, gpdl, does not build with our ./configure settings but we + # actually do not need it. So delete its source directory to skip + # it. + # We also delete the source directories pcl and xps to not build + # further storage-space-consuming tools. + rm -rf gpdl pcl xps build-environment: # To find the libraries built in this Snap - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"