WIP: bees service
[jackhill/guix/guix.git] / gnu / packages / squirrel.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Li-cheng (Andy) Tai <atai@atai.org>
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 squirrel)
20 #:use-module (gnu packages)
21 #:use-module (gnu packages cmake)
22 #:use-module (gnu packages sphinx)
23 #:use-module (guix build-system cmake)
24 #:use-module (guix download)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix build utils)
27 #:use-module (guix packages)
28 #:use-module (guix utils))
29
30 (define-public squirrel
31 (package
32 (name "squirrel")
33 (version "3.1")
34 (source (origin
35 (method url-fetch)
36 (uri (string-append "mirror://sourceforge/squirrel/squirrel3/"
37 "squirrel " version " stable/squirrel_"
38 (string-join (string-split version #\.) "_")
39 "_stable.tar.gz"))
40 (file-name (string-append name "-" version ".tar.gz"))
41 (sha256
42 (base32
43 "1jyh1523zrrnh9swanfrda0s14mvwc9431dh07g0nx74hbxsfia8"))))
44 (build-system cmake-build-system)
45 (arguments
46 '(#:configure-flags '("-DDISABLE_STATIC=ON")
47 #:tests? #f ; no tests
48 #:phases
49 (modify-phases %standard-phases
50 (add-after 'install 'install-documentation
51 (lambda* (#:key outputs #:allow-other-keys)
52 (let* ((out (assoc-ref outputs "out"))
53 (doc-dir (string-append out "/share/doc/squirrel")))
54 (for-each
55 (lambda (file)
56 (install-file (string-append "../squirrel3/" file) doc-dir))
57 '("COPYRIGHT" "HISTORY" "README"
58 "doc/sqstdlib3.pdf" "doc/squirrel3.pdf")))
59 #t))
60 (add-after 'install 'install-headers
61 (lambda* (#:key outputs #:allow-other-keys)
62 (let* ((out (assoc-ref outputs "out"))
63 (include-dir (string-append out "/include/squirrel")))
64 (mkdir-p include-dir)
65 (for-each
66 (lambda (header-file)
67 (copy-recursively header-file
68 (string-append include-dir
69 "/"
70 (basename header-file))))
71 (find-files "../squirrel3/include")))
72 #t)))))
73 (native-inputs
74 `(("cmake" ,cmake-minimal)
75 ("python-sphinx" ,python-sphinx)))
76 (home-page "https://squirrel-lang.org/")
77 (synopsis "High level imperative, object-oriented programming language")
78 (description
79 "Squirrel is a high level imperative, object-oriented programming
80 language, designed to be a light-weight scripting language that fits in the
81 size, memory bandwidth, and real-time requirements of applications like video
82 games.")
83 (license license:expat)))