projects/guix·blob java-team · refs

144 lines · 5.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019, 2024 Li-cheng (Andy) Tai <[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 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 git-download)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix build utils)
28 #:use-module (guix gexp)
29 #:use-module (guix packages)
30 #:use-module (guix utils))
31
32(define-public squirrel
33 (package
34 (name "squirrel")
35 (version "3.2")
36 (source (origin
37 (method git-fetch)
38 (uri (git-reference
39 (url "https://github.com/albertodemichelis/squirrel.git")
40 (commit (string-append "v" version))))
41 (file-name (string-append name "-" version ".tar.gz"))
42 (sha256
43 (base32
44 "028v90k5bbcb8qwysgv6r0ycy6g920ns32i2sdq0i8hqib90ac5z"))))
45 (build-system cmake-build-system)
46 (arguments
47 '(#:configure-flags '("-DDISABLE_STATIC=ON")
48 #:tests? #f ; no tests
49 #:phases
50 (modify-phases %standard-phases
51 (add-after 'install 'install-documentation
52 (lambda* (#:key outputs #:allow-other-keys)
53 (let* ((source (assoc-ref %build-inputs "source"))
54 (out (assoc-ref outputs "out"))
55 (doc-dir (string-append out "/share/doc/squirrel")))
56 (for-each
57 (lambda (file)
58 (install-file (string-append source "/" file) doc-dir))
59 '("COPYRIGHT" "HISTORY" "README"
60 ;"doc/sqstdlib3.pdf" "doc/squirrel3.pdf" ;; pdf not build out of git; TODO
61
62 )))
63 #t)))))
64 (native-inputs
65 `(("cmake" ,cmake-minimal)
66 ("python-sphinx" ,python-sphinx)))
67 (home-page "https://squirrel-lang.org/")
68 (synopsis "High level imperative, object-oriented programming language")
69 (description
70 "Squirrel is a high level imperative, object-oriented programming
71language, designed to be a light-weight scripting language that fits in the
72size, memory bandwidth, and real-time requirements of applications like video
73games.")
74 (license license:expat)))
75
76(define-public squirrel-for-supertux
77 (let ((commit "abab32a2077397c3739c70fc8b5b22a18bc2b5de")
78 (revision "0"))
79 (package
80 (inherit squirrel)
81 (name "squirrel-for-supertux")
82 (version (git-version "2025-12-21" revision commit))
83 (source (origin
84 (method git-fetch)
85 (uri (git-reference
86 (url "https://github.com/SuperTux/squirrel.git")
87 (commit commit)))
88 (file-name (string-append name "-" version ".tar.gz"))
89 (sha256
90 (base32
91 "0dsg9iz0hsypa8020vl35fqzzichrrq09f1ns2fnmi3x1ggw0c0f")))))))
92
93(define-public simplesquirrel-for-supertux
94 (let ((commit "37c2410b5f31d3aea3431d83b9b4398883224f23")
95 (revision "0"))
96 (package
97 (name "simplesquirrel-for-supertux")
98 (version (git-version "2026-01-06" revision commit))
99 (source (origin
100 (method git-fetch)
101 (uri (git-reference
102 (url "https://github.com/SuperTux/simplesquirrel.git")
103 (commit commit)))
104 (file-name (git-file-name name version))
105 (sha256
106 (base32 "0d41vmjzdx1l4xfzn4sywy6bhspv89ih589s77b5gbllylgrakxp"))))
107 (build-system cmake-build-system)
108 (arguments
109 (list
110 ;; No tests by default. Tests that can be enabled with
111 ;; -DSSQ_BUILD_TESTS configure options do not seem to be
112 ;; in working order.
113 #:tests? #f
114 #:configure-flags
115 #~(list
116 ;; "-DSSQ_BUILD_TESTS=ON"
117 "-DSSQ_USE_SQ_SUBMODULE=OFF"
118 (string-append "-DSQUIRREL_INCLUDE_DIR="
119 #$(this-package-input "squirrel-for-supertux")
120 "/include")
121 (string-append "-DSQUIRREL_LIBRARIES="
122 #$(this-package-input "squirrel-for-supertux")
123 "/include/lib/libsquirrel.so")
124 (string-append "-DSQSTDLIB_LIBRARIES="
125 #$(this-package-input "squirrel-for-supertux")
126 "/include/lib/libsqstdlib.so"))
127 #:phases
128 #~(modify-phases %standard-phases
129 (add-after 'unpack 'do-not-install-static-lib
130 (lambda _
131 (substitute* "CMakeLists.txt"
132 (("INSTALL\\(TARGETS \\$\\{PROJECT_NAME\\}_static .*$")
133 "")))))))
134 (inputs (list squirrel-for-supertux))
135 (home-page "https://matusnovak.github.io/simplesquirrel")
136 (synopsis "C++ API bindings for Squirrel language")
137 (description "Simplesquirrel is a C++ 11 library providing
138bindings for Squirrel language. It allows binding C++ function
139and calling it from Squirrel, looking up for Squirrel function
140(or class) and calling it (or creating instance of it) on C++ side,
141passing any C++ pointer as either instance or userpointer,
142creating enumerations, tables, and arrays.")
143 (license license:expat))))
144