]> git.t-rg.ws Git - slackbuilds.git/commitdiff
hugo: use system libsass and libwebp
authorfsLeg <fsleg@t-rg.ws>
Sat, 30 Aug 2025 09:44:51 +0000 (12:44 +0300)
committerfsLeg <fsleg@t-rg.ws>
Sat, 30 Aug 2025 09:44:51 +0000 (12:44 +0300)
hugo/hugo.SlackBuild
hugo/hugo.info
hugo/mkvendor.sh

index 7d34604bf9f93b70ea7bdd342dd5e008e9052271..a2908a322f86f478d2eaef1c414c116755a1794d 100644 (file)
@@ -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 \
index 16e4fa983069389595aa4fe91f8daa1f3c0e414a..77d9c64f049eba053e416226d684c27a75564105 100644 (file)
@@ -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"
index f206e87377c2aef6490bd28b72c176d6206dfbdb..ff4b97a202b6365f19525fe1d03c85cc446dc119 100644 (file)
@@ -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"