projects/guix·blob javascript-team · refs

108 lines · 4.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2026 Carlos Durán Domínguez <[email protected]>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages array-languages)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix build-system go)
22 #:use-module (guix gexp)
23 #:use-module (guix git-download)
24 #:use-module (guix packages)
25 #:use-module (guix utils)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages bash))
28
29;;;
30;;; Code:
31
32(define-public goal
33 (package
34 (name "goal")
35 (version "1.5.0")
36 (source
37 (origin
38 (method git-fetch)
39 (uri (git-reference
40 (url "https://codeberg.org/anaseto/goal")
41 (commit (string-append "v" version))))
42 (file-name (git-file-name name version))
43 (sha256
44 (base32 "1ckkjd2hf2v6f8x0ck9brp1ii4q8lcssvvwn7d6l1l5n9kcfjw7n"))))
45 (build-system go-build-system)
46 (inputs (list bash-minimal))
47 (outputs (list "out" "lib"))
48 (arguments
49 (list
50 #:unpack-path "codeberg.org/anaseto/goal"
51 #:import-path "codeberg.org/anaseto/goal/cmd/goal"
52 #:build-flags
53 #~(list "-tags" "full,nosse4") ;disable SSE4.2 optimizations
54 #:test-flags
55 #~(list "-skip" "TestSources/version.goal" ;git tests require a repo
56 "-tags" "full,nosse4")
57 #:phases
58 #~(modify-phases %standard-phases
59 ;; Goal requires a shell interpreter.
60 (add-after 'unpack 'fix-sh-path
61 (lambda* (#:key unpack-path #:allow-other-keys)
62 (substitute* (string-append "src/" unpack-path "/os/os.go")
63 (("/bin/sh")
64 #$(file-append bash-minimal "/bin/sh")))))
65 ;; Tests require the goal binary.
66 (add-before 'check 'add-goal-path
67 (lambda _
68 (setenv "PATH"
69 (string-append (getenv "PATH") ":" #$output "/bin"))))
70 ;; Goal is embeddable, but end users typically don't need the source
71 ;; code.
72 (replace 'install
73 (lambda* (#:key unpack-path #:allow-other-keys #:rest arguments)
74 (apply (assoc-ref %standard-phases 'install)
75 `(,@arguments #:import-path ,unpack-path))
76 (mkdir-p #$output:lib)
77 (rename-file (string-append #$output "/src")
78 (string-append #$output:lib "/src"))))
79 (add-after 'install 'install-goal-libs-and-documentation
80 (lambda* (#:key unpack-path inputs #:allow-other-keys #:rest
81 arguments)
82 (let ((outdir (string-append #$output "/share/goal/"
83 #$(version-major version) "/lib")))
84 (mkdir-p outdir)
85 (copy-recursively (string-append "src/" unpack-path "/lib")
86 outdir))
87 (install-file (string-append "src/" unpack-path "/docs/goal.1")
88 (string-append #$output "/share/man/man1")))))))
89 (native-search-paths
90 (list (search-path-specification
91 (variable "GOALLIB")
92 (separator #f)
93 (files `(,(string-append "share/goal/"
94 (version-major version) "/lib"))))))
95 (home-page "https://anaseto.codeberg.page/goal-docs/")
96 (synopsis "Embeddable scripting array language")
97 (description
98 "Goal is an embeddable array programming language with a bytecode
99interpreter, written in Go. The command line intepreter can execute scripts
100or run in interactive mode. Goal shines the most in common scripting tasks,
101like handling columnar data or text processing. It is also suitable for
102exploratory programming.")
103 (license license:isc)))
104
105;;;
106;;; Avoid adding new packages to the end of this file. To reduce the chances
107;;; of a merge conflict, place them above in alphabetic order.
108;;;