rosenthal: Add hugo.

* rosenthal/packages/web.scm (hugo): New variable.
* rosenthal/packages/binaries.scm (hugo-bin): Deprecated by it.
This commit is contained in:
Hilton Chain 2025-04-03 00:55:13 +08:00
parent d87c76525a
commit fc947d3e1f
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
2 changed files with 74 additions and 41 deletions

View File

@ -83,6 +83,9 @@ network and application layer, supporting various proxy and anti-censorship
protocols out-of-the-box.")
(license license:gpl3)))
(define-public hugo-bin
(deprecated-package "hugo-bin" hugo))
(define-public mihomo-bin
(package
(name "mihomo-bin")
@ -186,47 +189,6 @@ different needs.")
(release-monitoring-url
. "https://pkg.cloudflareclient.com/dists/bookworm/main/binary-amd64/Packages")))))
(define-public hugo-bin
(package
(name "hugo-bin")
(version "0.145.0")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/gohugoio/hugo" "/releases/download/v"
version "/hugo_extended_" version "_linux-amd64.tar.gz"))
(sha256
(base32
"1r2alw2a3acs99dx89p886p3qbwpds6kpgz510jjiym8dna6hx3w"))))
(build-system copy-build-system)
(arguments
(list #:install-plan #~'(("hugo" "bin/"))
#:phases
#~(modify-phases %standard-phases
(delete 'strip)
(add-after 'install 'patch-elf
(lambda _
(let ((hugo (string-append #$output "/bin/hugo")))
(invoke "patchelf" "--set-interpreter"
(string-append #$(this-package-input "glibc")
#$(glibc-dynamic-linker))
hugo)
(invoke "patchelf" "--set-rpath"
(string-append (ungexp (this-package-input "gcc")
"lib")
"/lib")
hugo)))))))
(supported-systems '("x86_64-linux"))
(native-inputs (list patchelf-0.16))
(inputs (list `(,gcc "lib") glibc))
(home-page "https://gohugo.io/")
(synopsis "Static site generator")
(description
"Hugo is a static site generator written in Go, optimized for speed and
designed for flexibility.")
(license license:asl2.0)
(properties '((upstream-name . "hugo")))))
(define-public komga-bin
(package
(name "komga-bin")

View File

@ -8,8 +8,10 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (rosenthal utils download)
#:use-module (guix build-system go)
#:use-module (gnu packages golang)
#:use-module (gnu packages image)
#:use-module (gnu packages web))
(define-public buku-run-dev
@ -29,6 +31,75 @@
(base32
"079ygn39px71bypa54jn4z55iq24lxxcy7jv3ijy08iinqbfvldc")))))))
(define-public hugo
(package
(name "hugo")
(version "0.145.0")
(source
(origin
(method go-vendored-fetch)
(uri (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/gohugoio/hugo")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"19kfij8c1ljfn8xr3mfm5c89fhp62bl0c7rx0i8726jn6dbpl9g5"))))
(sha256
(base32
"10fmva8p4hcbs2kyjggbanrmix1mf1fym549c5zdv80khpppzfnb"))))
(build-system go-build-system)
(arguments
(list
#:go go-1.23
#:install-source? #f
#:import-path "."
#:build-flags
''("-tags" "extended withdeploy"
"-ldflags=-X github.com/gohugoio/hugo/common/hugo.vendorInfo=Nonguix")
#:test-flags ''("-skip=^TestCommands/mod|^TestCommands/server")
#:test-subdirs ''(".")
#:modules
'(((guix build gnu-build-system) #:prefix gnu:)
(guix build go-build-system)
(guix build utils))
#:phases
#~(modify-phases %standard-phases
(replace 'unpack
(lambda args
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
(unsetenv "GO111MODULE")))
(replace 'install-license-files
(assoc-ref gnu:%standard-phases 'install-license-files))
(add-after 'unpack 'fix-paths
(lambda* (#:key inputs #:allow-other-keys)
(setenv "C_INCLUDE_PATH"
(string-append
(getenv "C_INCLUDE_PATH") ":"
(dirname
(dirname
(dirname
(search-input-file inputs "src/dec/alphai_dec.h"))))))
(with-directory-excursion "vendor/github.com/bep/gowebp"
(substitute* (find-files "internal/libwebp")
(("../../libwebp_src/(.*)\"" _ file)
(string-append (search-input-file inputs file) "\""))))
(with-directory-excursion "vendor/github.com/bep/golibsass"
(substitute* (find-files "internal/libsass")
(("../../libsass_src/(.*)\"" _ file)
(string-append (search-input-file inputs file) "\"")))))))))
(inputs
(list (package-source libsass)
(package-source libwebp)))
(home-page "https://gohugo.io/")
(synopsis "Static site generator")
(description
"Hugo is a static site generator written in Go, optimized for speed and
designed for flexibility.")
(license license:asl2.0)))
;; TODO: Package Forgejo without vendored dependencies.
(define-public forgejo
(package