1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

gnu: Add goal.

* gnu/packages/array-languages.scm (goal): New variable.

Change-Id: I4e56852bbe25c66748325d6a225742b633be2e68
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Carlos Durán Domínguez
2026-02-10 21:20:47 +01:00
committed by Liliana Marie Prikler
parent b5505aef5f
commit 276afa66c3

View File

@@ -29,6 +29,79 @@
;;;
;;; Code:
(define-public goal
(package
(name "goal")
(version "1.5.0")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://codeberg.org/anaseto/goal")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "1ckkjd2hf2v6f8x0ck9brp1ii4q8lcssvvwn7d6l1l5n9kcfjw7n"))))
(build-system go-build-system)
(inputs (list bash-minimal))
(outputs (list "out" "lib"))
(arguments
(list
#:unpack-path "codeberg.org/anaseto/goal"
#:import-path "codeberg.org/anaseto/goal/cmd/goal"
#:build-flags
#~(list "-tags" "full,nosse4") ;disable SSE4.2 optimizations
#:test-flags
#~(list "-skip" "TestSources/version.goal" ;git tests require a repo
"-tags" "full,nosse4")
#:phases
#~(modify-phases %standard-phases
;; Goal requires a shell interpreter.
(add-after 'unpack 'fix-sh-path
(lambda* (#:key unpack-path #:allow-other-keys)
(substitute* (string-append "src/" unpack-path "/os/os.go")
(("/bin/sh")
#$(file-append bash-minimal "/bin/sh")))))
;; Tests require the goal binary.
(add-before 'check 'add-goal-path
(lambda _
(setenv "PATH"
(string-append (getenv "PATH") ":" #$output "/bin"))))
;; Goal is embeddable, but end users typically don't need the source
;; code.
(replace 'install
(lambda* (#:key unpack-path #:allow-other-keys #:rest arguments)
(apply (assoc-ref %standard-phases 'install)
`(,@arguments #:import-path ,unpack-path))
(mkdir-p #$output:lib)
(rename-file (string-append #$output "/src")
(string-append #$output:lib "/src"))))
(add-after 'install 'install-goal-libs-and-documentation
(lambda* (#:key unpack-path inputs #:allow-other-keys #:rest
arguments)
(let ((outdir (string-append #$output "/share/goal/"
#$(version-major version) "/lib")))
(mkdir-p outdir)
(copy-recursively (string-append "src/" unpack-path "/lib")
outdir))
(install-file (string-append "src/" unpack-path "/docs/goal.1")
(string-append #$output "/share/man/man1")))))))
(native-search-paths
(list (search-path-specification
(variable "GOALLIB")
(separator #f)
(files `(,(string-append "share/goal/"
(version-major version) "/lib"))))))
(home-page "https://anaseto.codeberg.page/goal-docs/")
(synopsis "Embeddable scripting array language")
(description
"Goal is an embeddable array programming language with a bytecode
interpreter, written in Go. The command line intepreter can execute scripts
or run in interactive mode. Goal shines the most in common scripting tasks,
like handling columnar data or text processing. It is also suitable for
exploratory programming.")
(license license:isc)))
;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above in alphabetic order.