From d3fc85c88fbb07e38362fc302b61a538416ce76e Mon Sep 17 00:00:00 2001 From: fsLeg Date: Sat, 30 Aug 2025 12:44:51 +0300 Subject: [PATCH] hugo: use system libsass and libwebp --- hugo/hugo.SlackBuild | 24 ++++++++++++++++-------- hugo/hugo.info | 2 +- hugo/mkvendor.sh | 24 +++--------------------- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/hugo/hugo.SlackBuild b/hugo/hugo.SlackBuild index 7d34604..a2908a3 100644 --- a/hugo/hugo.SlackBuild +++ b/hugo/hugo.SlackBuild @@ -27,8 +27,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=hugo VERSION=${VERSION:-0.149.0} BUILD=${BUILD:-1} -TAG=${TAG:-_SBo} -PKGTYPE=${PKGTYPE:-tgz} +TAG=${TAG:-fsleg} +PKGTYPE=${PKGTYPE:-txz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -74,6 +74,10 @@ if [ "${EXTENDED:-yes}" = "yes" ] || [ "${DEPLOY:-yes}" = "yes" ]; then TAGS="-tags " if [ "${EXTENDED:-yes}" = "yes" ]; then TAGS+="extended," + CFLAGS_SYS="$(pkg-config --cflags libsass) -DUSE_LIBSASS_SRC \ + $(pkg-config --cflags libwebp) -DLIBWEBP_NO_SRC" + LDFLAGS_SYS="$(pkg-config --libs libsass) \ + $(pkg-config --libs libwebp)" fi if [ "${DEPLOY:-yes}" = "yes" ]; then TAGS+="withdeploy" @@ -81,9 +85,11 @@ if [ "${EXTENDED:-yes}" = "yes" ] || [ "${DEPLOY:-yes}" = "yes" ]; then fi CGO_ENABLED=1 \ -CGO_CPPFLAGS="${SLKCFLAGS}" \ -CGO_CFLAGS="${SLKCFLAGS}" \ -CGO_CXXFLAGS="${SLKCFLAGS}" \ +CGO_CFLAGS="$SLKCFLAGS \ + $CFLAGS_SYS" \ +CGO_CXXFLAGS="$CGO_CFLAGS" \ +CGO_CPPFLAGS="$CGO_CFLAGS" \ +CGO_LDFLAGS="$LDFLAGS_SYS" \ GOPATH=$(pwd)/gocache \ GOCACHE=$(pwd)/gocache \ go build -v \ @@ -103,7 +109,9 @@ mkdir -p $PKG/usr/bin \ $PKG/usr/share/bash-completion/completions \ $PKG/usr/share/fish/vendor_completions.d \ $PKG/usr/share/zsh/site-functions -./hugo gen man --dir $PKG/usr/man/man1 +# hugo can generate man pages as well as docs, however, man pages are harder to read +# due to bad formatting, otherwise they are identical to docs +#./hugo gen man --dir $PKG/usr/man/man1 ./hugo gen doc --dir $PKG/usr/doc/$PRGNAM-$VERSION ./hugo completion bash > $PKG/usr/share/bash-completion/completions/$PRGNAM ./hugo completion fish > $PKG/usr/share/fish/vendor_completions.d/$PRGNAM.fish @@ -113,8 +121,8 @@ install -Dm755 -t $PKG/usr/bin hugo find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +#find $PKG/usr/man -type f -exec gzip -9 {} \; +#for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done cp -a \ CONTRIBUTING.md LICENSE README.md SECURITY.md \ diff --git a/hugo/hugo.info b/hugo/hugo.info index 16e4fa9..77d9c64 100644 --- a/hugo/hugo.info +++ b/hugo/hugo.info @@ -4,7 +4,7 @@ HOMEPAGE="https://gohugo.io/" DOWNLOAD="https://github.com/gohugoio/hugo/archive/v0.149.0/hugo-0.149.0.tar.gz \ https://sbo.t-rg.ws/hugo-0.149.0-vendored-sources.tar.xz" MD5SUM="aaef840fe6d8057b7e7695c34ae11ba9 \ - a99b2b03c4dc02337f2102c420543ad1" + b8d29f25d4f295c29308e31c4ad93a41" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="google-go-lang" diff --git a/hugo/mkvendor.sh b/hugo/mkvendor.sh index f206e87..ff4b97a 100644 --- a/hugo/mkvendor.sh +++ b/hugo/mkvendor.sh @@ -14,30 +14,12 @@ cd "$TMP/$PRGNAM-$VERSION" go mod vendor -# libwebp-1.3.2 is the one in Slackware 15, newer ones don't compile -if [ -e "$CWD/libwebp-1.3.2.tar.gz" ]; then - cp "$CWD/libwebp-1.3.2.tar.gz" "$TMP/" -else - wget --directory-prefix="$TMP" --tries=0 --retry-on-http-error=503 "https://github.com/webmproject/libwebp/archive/v1.3.2/libwebp-v1.3.2.tar.gz" -fi -tar xf "$TMP/libwebp-1.3.2.tar.gz" -C .. -mv "$TMP/libwebp-1.3.2" vendor/github.com/bep/gowebp/libwebp_src - -# libsass is deprecated, 3.6.6 is the last release -if [ -e "$CWD/libsass-3.6.6.tar.gz" ]; then - cp "$CWD/libsass-3.6.6.tar.gz" "$TMP/" -else - wget --directory-prefix="$TMP" --tries=0 --retry-on-http-error=503 "https://github.com/sass/libsass/archive/3.6.6/libsass-3.6.6.tar.gz" -fi -tar xf "$TMP/libsass-3.6.6.tar.gz" -C .. -mv "$TMP/libsass-3.6.6" vendor/github.com/bep/golibsass/libsass_src - -if [ -f "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar" ]; then - rm "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar" +if [ -f "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar.xz" ]; then + rm -v "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar.xz" fi tar cfJ "$OUTPUT/$PRGNAM-$VERSION-vendored-sources.tar.xz" vendor/ go clean -cache -modcache cd "$CWD" -rm -rf "$TMP" +rm -rv "$TMP" -- 2.46.4