Skip to content

Commit

Permalink
Added Snap update automation for new releases of Ghostscript
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
tillkamppeter committed Dec 24, 2023
1 parent 9637b47 commit 5effebf
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 5effebf

Please sign in to comment.