2016-09-13 05:52:54 -04:00
name : hugo
2024-03-09 11:47:53 -05:00
base : core22
2020-09-12 01:56:29 -04:00
confinement : strict
2022-08-30 01:14:22 -04:00
adopt-info : hugo
2023-07-04 12:52:25 -04:00
title : Hugo
icon : snap/local/logo.png
summary : Fast and Flexible Static Site Generator
description : |
Hugo is a static site generator written in Go, optimized for speed and
designed for flexibility. With its advanced templating system and fast asset
pipelines, Hugo renders a complete site in seconds, often less.
Due to its flexible framework, multilingual support, and powerful taxonomy
system, Hugo is widely used to create :
* Corporate, government, nonprofit, education, news, event, and project sites
* Documentation sites
* Image portfolios
* Landing pages
* Business, professional, and personal blogs
* Resumes and CVs
Use Hugo's embedded web server during development to instantly see changes to
content, structure, behavior, and presentation. Then deploy the site to your
host, or push changes to your Git provider for automated builds and
deployment.
issues : https://github.com/gohugoio/hugo/issues
license : "Apache-2.0"
source-code : https://github.com/gohugoio/hugo.git
website : https://gohugo.io/
2016-09-13 05:52:54 -04:00
2021-10-11 17:39:02 -04:00
package-repositories :
- type : apt
components : [ main]
suites : [ focal]
key-id : 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
url : https://deb.nodesource.com/node_16.x
2022-04-01 04:52:39 -04:00
plugs :
2022-06-24 02:59:37 -04:00
etc-gitconfig :
2022-04-01 04:52:39 -04:00
interface : system-files
read :
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
- /etc/gitconfig
2022-06-24 02:59:37 -04:00
gitconfig :
2022-04-01 04:52:39 -04:00
interface : personal-files
read :
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
- $HOME/.gitconfig
2023-07-08 11:36:42 -04:00
- $HOME/.config/git
- $HOME/.gitconfig.local
dot-aws :
interface : personal-files
read :
- $HOME/.aws
dot-azure :
interface : personal-files
read :
- $HOME/.azure
dot-config-gcloud :
interface : personal-files
read :
- $HOME/.config/gcloud
2023-07-27 01:15:21 -04:00
dot-cache-hugo :
interface : personal-files
write :
2023-07-27 15:43:52 -04:00
- $HOME/.cache/hugo_cache
2023-07-27 01:15:21 -04:00
ssh-keys :
interface : ssh-keys
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
environment :
HOME : $SNAP_REAL_HOME
GIT_EXEC_PATH : $SNAP/usr/lib/git-core
GOCACHE : $SNAP_USER_DATA/.cache/go-build
npm_config_cache : $SNAP_USER_DATA/.npm
npm_config_init_module : $SNAP_USER_DATA/.npm-init.js
npm_config_userconfig : $SNAP_USER_DATA/.npmrc
pandoc_datadir : $SNAP/usr/share/pandoc
PYTHONHOME : /usr:$SNAP/usr
2024-03-09 11:47:53 -05:00
RUBYLIB : $SNAP/usr/lib/ruby/vendor_ruby/3.0.0:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/ruby/vendor_ruby/3.0.0:$SNAP/usr/lib/ruby/vendor_ruby:$SNAP/usr/lib/ruby/3.0.0:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/ruby/3.0.0
2023-07-01 20:55:23 -04:00
# HUGO_SECURITY_EXEC_OSENV
#
# Default value:
2024-03-09 11:47:53 -05:00
# (?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE)$
2023-07-01 20:55:23 -04:00
# Bundled applications require additional access:
# git: GIT_EXEC_PATH and LD_LIBRARY_PATH
# npx: npm_config_{cache,init_module,userconfig}
# pandoc: pandoc_datadir
# rst2html: PYTHONHOME and SNAP
# asciidoctor: RUBYLIB
2024-03-09 11:47:53 -05:00
HUGO_SECURITY_EXEC_OSENV : (?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|GIT_EXEC_PATH|LD_LIBRARY_PATH|npm_config_(cache|init_module|userconfig)|pandoc_datadir|PYTHONHOME|SNAP|RUBYLIB)$
2016-09-13 05:52:54 -04:00
apps :
hugo :
command : bin/hugo
2018-04-05 09:15:51 -04:00
completer : hugo-completion
2021-04-22 11:57:40 -04:00
plugs :
- home
- network-bind
- removable-media
2022-06-27 11:27:30 -04:00
- etc-gitconfig
- gitconfig
2023-07-08 11:36:42 -04:00
- dot-aws
- dot-azure
- dot-config-gcloud
2023-07-27 01:15:21 -04:00
- dot-cache-hugo
- ssh-keys
2016-09-13 05:52:54 -04:00
parts :
2018-09-25 09:05:55 -04:00
git :
plugin : nil
stage-packages :
- git
prime :
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
- usr/bin/git
- usr/lib
go :
plugin : nil
stage-snaps :
2024-03-09 11:47:53 -05:00
- go/1.22/stable
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
prime :
- bin/go
- pkg/tool
- -pkg/tool/*
2018-09-25 09:05:55 -04:00
2016-09-13 05:52:54 -04:00
hugo :
2018-09-30 01:29:57 -04:00
plugin : nil
2016-09-13 05:52:54 -04:00
source : .
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
after :
- git
- go
2022-08-30 01:14:22 -04:00
override-pull : |
2024-03-09 11:47:53 -05:00
craftctl default
craftctl set version=$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')
2022-08-30 05:52:16 -04:00
if grep -q 'Suffix:\s*""' common/hugo/version_current.go; then
2024-03-09 11:47:53 -05:00
craftctl set grade=stable
2022-08-30 05:52:16 -04:00
else
2024-03-09 11:47:53 -05:00
craftctl set grade=devel
2022-08-30 05:52:16 -04:00
fi
2018-07-09 04:41:10 -04:00
override-build : |
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
echo "\nStarting override-build:"
2018-09-25 09:05:55 -04:00
set -ex
2018-09-30 01:29:57 -04:00
export GOPATH=$(realpath ../go)
2018-09-30 16:22:01 -04:00
export PATH=$GOPATH/bin:$PATH
2018-09-25 09:05:55 -04:00
2023-06-21 18:39:02 -04:00
HUGO_BUILD_TAGS="extended"
2018-10-11 10:56:53 -04:00
echo " * Building hugo (HUGO_BUILD_TAGS=\"$HUGO_BUILD_TAGS\")..."
2022-08-30 05:52:16 -04:00
go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=snap:$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')" -tags "$HUGO_BUILD_TAGS"
2018-04-05 09:14:51 -04:00
./hugo version
2018-07-09 04:41:10 -04:00
ldd hugo || :
2018-09-25 09:05:55 -04:00
2018-07-09 04:41:10 -04:00
echo " * Building shell completion..."
2022-01-30 18:33:15 -05:00
./hugo completion bash > hugo-completion
2018-09-25 09:05:55 -04:00
2024-03-09 11:47:53 -05:00
echo " * Installing to ${CRAFT_PART_INSTALL}..."
install -d $CRAFT_PART_INSTALL/bin
cp -av hugo $CRAFT_PART_INSTALL/bin/
mv -v hugo-completion $CRAFT_PART_INSTALL/
2018-09-25 09:05:55 -04:00
2018-07-09 04:41:10 -04:00
echo " * Stripping binary..."
2024-03-09 11:47:53 -05:00
ls -l $CRAFT_PART_INSTALL/bin/hugo
strip --remove-section=.comment --remove-section=.note $CRAFT_PART_INSTALL/bin/hugo
ls -l $CRAFT_PART_INSTALL/bin/hugo
2018-08-24 11:35:07 -04:00
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
asciidoctor :
plugin : nil
stage-packages :
- asciidoctor
override-build : |
set -ex
2024-03-09 11:47:53 -05:00
craftctl default
sed -i '1s|#!/usr/bin/ruby|#!/usr/bin/env ruby|' $CRAFT_PART_INSTALL/usr/bin/asciidoctor
# don't try and flock() gemspecs since this is blocked by AppArmor - see
# https://github.com/rubygems/rubygems/pull/5278 in particular
# https://github.com/rubygems/rubygems/pull/5278/commits/27b682c81226838b1254ac5843a3f5b1cb20f076
sed -i 's|!solaris_platform|win_platform|' $CRAFT_PART_INSTALL/usr/lib/ruby/vendor_ruby/rubygems.rb
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
2023-08-23 15:58:19 -04:00
dart-sass :
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
plugin : nil
build-packages :
- curl
override-build : |
set -ex
2024-03-09 11:47:53 -05:00
craftctl default
case "$CRAFT_TARGET_ARCH" in
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
amd64) arch=x64 ;;
arm64) arch=arm64 ;;
2023-02-03 07:09:42 -05:00
armhf) arch=arm ;;
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
i386) arch=ia32 ;;
*) arch="" ;;
esac
if [[ -n $arch ]]; then
2023-06-21 18:39:02 -04:00
url=$(curl -s https://api.github.com/repos/sass/dart-sass/releases/latest | awk -F\" "/browser_download_url.*-linux-${arch}.tar.gz/{print \$(NF-1)}")
curl -LO --retry-connrefused --retry 10 "${url}"
tar xf dart-sass-*-linux-${arch}.tar.gz
2024-03-09 11:47:53 -05:00
install -d $CRAFT_PART_INSTALL/bin
cp -av dart-sass/* $CRAFT_PART_INSTALL/bin/
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
fi
2021-04-26 12:17:44 -04:00
node :
plugin : nil
2021-04-27 11:00:04 -04:00
stage-packages :
- nodejs
2021-04-26 12:17:44 -04:00
2021-04-22 11:57:40 -04:00
pandoc :
plugin : nil
stage-packages :
- pandoc
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
rst2html :
plugin : nil
stage-packages :
- python3-docutils
override-build : |
set -ex
2024-03-09 11:47:53 -05:00
craftctl default
sed -i "s|'/usr/share/docutils/'|os.path.expandvars('\$SNAP/usr/share/docutils/')|" $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages/docutils/__init__.py
2021-04-22 11:57:40 -04:00
organize :
snap: Make external dependencies actually work
Git:
- Set GIT_EXEC_PATH and include usr/lib/git-core so that git can find the
git-remote-https helper (needed by e.g. "go mod download").
Go:
- Put Go in its own snap part, and use stage-snaps instead of build-snaps
so that it is included in the final snap.
- Set GOCACHE to a writable directory. (In a previous commit,
HOME is set to $SNAP_REAL_HOME which is unwritable.)
Hugo:
- Patch config/security/securityConfig.go "[security.exec] osEnv" whitelist
(during snap build) so that external dependencies can use the required
environment variables to run properly from within the snap.
Asciidoctor:
- Replace shebang line in asciidoctor so it can find the ruby executable.
- Set RUBYLIB so that Ruby can find its libraries.
Caveat/TODO: The Ruby version is hardcoded in our custom RUBYLIB.
Embedded Dart Sass:
- Download from GitHub and install it, for amd64 and arm64 only.
Node.js:
- Remove my incomplete include list so that npx is actually installed.
- Set npm_config_{cache,init_module,userconfig} to writable locations.
Pandoc:
- Set pandoc_datadir so that Pandoc can find its data files.
rst2html:
- Install python3-docutils package for rst2html, rst2html5, etc.
- Set PYTHONHOME so that Python can find its libraries.
Note that asciidoctor, pandoc and rst2html are not in Hugo’s default
"[security.exec] allow" whitelist, and the snap package does not change
that default, so they still needed to be whitelisted manually in
config.toml if necessary by the end user.
Special thanks to Joe Mooring (@jmooring) for meticulously diagnosing
the issue and providing a comprehensive test repository at
https://github.com/jmooring/hugo-snap-test without which I would not
have been able to understand and resolve the issue.
Fixes #9078
2022-08-13 13:29:01 -04:00
usr/share/docutils/scripts/python3 : usr/bin