| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 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 | |
| 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") |
| 54 | #:test-flags
|
| 55 | #~(list "-skip" "TestSources/version.goal" |
| 56 | "-tags" "full,nosse4")
|
| 57 | #:phases
|
| 58 | #~(modify-phases %standard-phases
|
| 59 | |
| 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 | |
| 66 | (add-before 'check 'add-goal-path
|
| 67 | (lambda _
|
| 68 | (setenv "PATH"
|
| 69 | (string-append (getenv "PATH") ":" #$output "/bin"))))
|
| 70 | |
| 71 | |
| 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
|
| 99 | interpreter, written in Go. The command line intepreter can execute scripts
|
| 100 | or run in interactive mode. Goal shines the most in common scripting tasks,
|
| 101 | like handling columnar data or text processing. It is also suitable for
|
| 102 | exploratory programming.")
|
| 103 | (license license:isc)))
|
| 104 |
|
| 105 | |
| 106 | |
| 107 | |
| 108 | |