mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
gnu: nebula: Use G-expressions.
* gnu/packages/networking.scm (nebula) [arguments]: Use G-expressions. <#:phases>: Set version during build time. Change-Id: I0cda81f952e3543ac2a01d5d917df4944ac82950
This commit is contained in:
parent
ace1785c5d
commit
ffc7650c11
1 changed files with 26 additions and 20 deletions
|
@ -4696,26 +4696,32 @@ (define-public nebula
|
|||
(delete-file-recursively "wintun")))))
|
||||
(build-system go-build-system)
|
||||
(arguments
|
||||
`(#:go ,go-1.20
|
||||
#:import-path "github.com/slackhq/nebula"
|
||||
#:install-source? #f
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'build
|
||||
(lambda _
|
||||
;; Build nebula and nebula-cert
|
||||
(let* ((dir "github.com/slackhq/nebula")
|
||||
(nebula-cmd (string-append dir "/cmd/nebula"))
|
||||
(cert-cmd (string-append dir "/cmd/nebula-cert")))
|
||||
(invoke "go" "build" nebula-cmd)
|
||||
(invoke "go" "build" cert-cmd))))
|
||||
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(bindir (string-append out "/bin")))
|
||||
(install-file "nebula" bindir)
|
||||
(install-file "nebula-cert" bindir)))))))
|
||||
(list
|
||||
#:go go-1.20
|
||||
#:import-path "github.com/slackhq/nebula"
|
||||
#:install-source? #f
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'build
|
||||
(lambda* (#:key import-path #:allow-other-keys)
|
||||
;; Suggested option to provide build time flags is not supported
|
||||
;; in Guix for go-build-system.
|
||||
;; -ldflags "-X main.Build=SOMEVERSION"
|
||||
(substitute* (string-append "src/" import-path "/cmd/nebula/main.go")
|
||||
(("Version: ")
|
||||
(string-append "Version: " #$version)))
|
||||
;; Build nebula and nebula-cert
|
||||
(let* ((dir "github.com/slackhq/nebula")
|
||||
(nebula-cmd (string-append dir "/cmd/nebula"))
|
||||
(cert-cmd (string-append dir "/cmd/nebula-cert")))
|
||||
(invoke "go" "build" nebula-cmd)
|
||||
(invoke "go" "build" cert-cmd))))
|
||||
(replace 'install
|
||||
(lambda _
|
||||
(let* ((out #$output)
|
||||
(bindir (string-append out "/bin")))
|
||||
(install-file "nebula" bindir)
|
||||
(install-file "nebula-cert" bindir)))))))
|
||||
(inputs
|
||||
(list go-dario-cat-mergo
|
||||
go-github-com-anmitsu-go-shlex
|
||||
|
|
Loading…
Reference in a new issue