gnu: automatic-component-toolkit: Swap to go-build-system.

* gnu/packages/code.scm (automatic-component-toolkit):
[build-system]: Swap to go-build-system to make the package more
maintainable and build predictable.
[arguments] <#:phases>: Swap to default 'build and 'install phases,
revert 'configure phase. Add 'pretend-cmd-act phase to satisfy
go-build-system.
[native-inputs]: Remove go.

Change-Id: Iba7bd4c87bdbbb91381f81a77c7811cb9f1f4943
This commit is contained in:
Sharlatan Hellseher 2024-04-07 10:13:52 +01:00
parent 08de161274
commit 12f02c9bb8
No known key found for this signature in database
GPG Key ID: 76D727BFF62CD2B5

@ -19,6 +19,7 @@
;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de> ;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2023 Fries <fries1234@protonmail.com> ;;; Copyright © 2023 Fries <fries1234@protonmail.com>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -61,7 +62,6 @@
#:use-module (gnu packages emacs) #:use-module (gnu packages emacs)
#:use-module (gnu packages flex) #:use-module (gnu packages flex)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
#:use-module (gnu packages golang) ; for automatic-component-toolkit
#:use-module (gnu packages golang-build) #:use-module (gnu packages golang-build)
#:use-module (gnu packages golang-crypto) #:use-module (gnu packages golang-crypto)
#:use-module (gnu packages golang-web) #:use-module (gnu packages golang-web)
@ -101,23 +101,24 @@
(sha256 (sha256
(base32 (base32
"1r0sbw82cf9dbcj3vgnbd4sc1lklzvijic2z5wgkvs21azcm0yzh")))) "1r0sbw82cf9dbcj3vgnbd4sc1lklzvijic2z5wgkvs21azcm0yzh"))))
(build-system gnu-build-system) (build-system go-build-system)
(arguments (arguments
(list #:tests? #false ;no tests (list
#:phases #:tests? #f ;no tests
#~(modify-phases %standard-phases #:install-source? #f
(delete 'configure) #:import-path "github.com/Autodesk/AutomaticComponentToolkit/cmd/act"
(replace 'build #:unpack-path "github.com/Autodesk/AutomaticComponentToolkit/"
(lambda _ #:phases
(setenv "HOME" "/tmp") #~(modify-phases %standard-phases
(invoke "bash" "Build/build.sh"))) ;; Golang produces the final binary based on the current directory
(replace 'install ;; name if -o options is not provided, utilize this assumption to
(lambda _ ;; completely relay on go-build-system.
(let ((bin (string-append #$output "/bin"))) (add-before 'build 'pretend-cmd-act
(mkdir-p bin) (lambda* (#:key unpack-path #:allow-other-keys)
(copy-file "act.linux" (let ((act (string-append "src/" unpack-path "/cmd/act"))
(string-append #$output "/bin/act")))))))) (source (string-append "src/" unpack-path "/Source")))
(native-inputs (list go)) (mkdir-p act)
(copy-recursively source act)))))))
(synopsis "Automatically generate software components") (synopsis "Automatically generate software components")
(description (description
"The Automatic Component Toolkit (@dfn{ACT}) is a code generator that "The Automatic Component Toolkit (@dfn{ACT}) is a code generator that