diff mbox series

[bug#70875,v2] gnu: Add quirrel

Message ID 129aa222dbae82ff4e2fc85f32a56b6405a63b12.1715422522.git.atai@atai.org
State New
Headers show
Series [bug#70875,v2] gnu: Add quirrel | expand

Commit Message

Andy Tai May 11, 2024, 10:16 a.m. UTC
* gnu/packages/squirrel.scm (quirrel): New variable

Change-Id: I3b25604f7c5cc4f046a6421810e3928d5c5ba276
---
 gnu/packages/squirrel.scm | 64 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)


base-commit: 703ae431f4ad28658e34675310b4fdf58685ccdd

Comments

Maxim Cournoyer June 24, 2024, 3:43 a.m. UTC | #1
Hi,

Andy Tai <atai@atai.org> writes:

> * gnu/packages/squirrel.scm (quirrel): New variable
>
> Change-Id: I3b25604f7c5cc4f046a6421810e3928d5c5ba276
> ---
>  gnu/packages/squirrel.scm | 64 ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 63 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/squirrel.scm b/gnu/packages/squirrel.scm
> index 1b9489882f..638f06ab8f 100644
> --- a/gnu/packages/squirrel.scm
> +++ b/gnu/packages/squirrel.scm
> @@ -1,5 +1,5 @@
>  ;;; GNU Guix --- Functional package management for GNU
> -;;; Copyright © 2019 Li-cheng (Andy) Tai <atai@atai.org>
> +;;; Copyright © 2019, 2023 Li-Cheng (Andy) Tai <atai@atai.org>
>  ;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -22,6 +22,7 @@ (define-module (gnu packages squirrel)
>    #:use-module (gnu packages sphinx)
>    #:use-module (guix build-system cmake)
>    #:use-module (guix download)
> +  #:use-module (guix git-download)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix build utils)
>    #:use-module (guix packages)
> @@ -81,3 +82,64 @@ (define-public squirrel
>  size, memory bandwidth, and real-time requirements of applications like video
>  games.")
>      (license license:expat)))
> +
> +
> +
> +(define-public quirrel
> +  (package
> +    (name "quirrel")
> +    (version "4.6.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/GaijinEntertainment/quirrel.git")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "18xvhssnh5lddi4ava7wzzvsiin8rh3vrbhcblv7l00qv0brh6gg"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     '(#:configure-flags '("-DDISABLE_STATIC=ON")
> +       #:tests? #f ;no tests
> +       #:phases (modify-phases %standard-phases
> +                  ;; TODO: build and install doc files like squirrel above
> +                  (add-after 'install 'install-headers
> +                    (lambda* (#:key outputs #:allow-other-keys)
> +                      (let* ((out (assoc-ref outputs "out"))
> +                             (include-dir (string-append out "/include")))

New packages should use gexps for phases, and gexp variables such as
#$output to refer to the "out" output.

> +                        (mkdir-p include-dir)
> +                        (for-each (lambda (header-file)
> +                                    (copy-recursively header-file
> +                                                      (string-append
> +                                                       include-dir "/"
> +                                                       (basename header-file))))
> +                                  (find-files "../include"))) #t)))))
> +    (native-inputs `(("cmake" ,cmake-minimal)
> +                     ("python-sphinx" ,python-sphinx)))

Do not add labels anymore, which are deprecated.

> +    (home-page "https://github.com/GaijinEntertainment/quirrel")
> +    (synopsis "Script language that is based on Squirrel language and is
> +inspired by Python, Javascript and especially Lua")
> +    (description
> +     "Quirrel is a script language that is based on Squirrel language and is
> +inspired by Python, Javascript and especially Lua, with
> +@itemize
> +@item Lexical scoping
> +@item Higher order functions, closures and lambda
> +@item Classes and inheritance
> +@item Tail recursion
> +@item Delegation
> +@item String interpolation
> +@item Exception handling
> +@item Cooperative threads (coroutines)
> +@item Generators
> +@item Performance - Quirrel is fast and small (comparable with Lua and sometimes even faster)
> +@item Both compiler and virtual machine fit together in about 13k lines of C++ code and add only around 100kb-150kb the executable size.

Please wrap long lines at 80 chars.

> +@item Automatic memory management (CPU bursts free - reference counting and GC)
> +@item Optional 16bits characters strings
> +@item Dynamic typing type system is close to Javascript but stricter and simpler (there is integer type and no 'undefined')
> +@item Powerful embedding api
> +@item Modules
> +@item Hot-reload (if you implement it in your code)
> +@end itemize")
> +    (license license:expat)))

Otherwise it looks good to me.  Could you please send a v2?
diff mbox series

Patch

diff --git a/gnu/packages/squirrel.scm b/gnu/packages/squirrel.scm
index 1b9489882f..638f06ab8f 100644
--- a/gnu/packages/squirrel.scm
+++ b/gnu/packages/squirrel.scm
@@ -1,5 +1,5 @@ 
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Li-cheng (Andy) Tai <atai@atai.org>
+;;; Copyright © 2019, 2023 Li-Cheng (Andy) Tai <atai@atai.org>
 ;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +22,7 @@  (define-module (gnu packages squirrel)
   #:use-module (gnu packages sphinx)
   #:use-module (guix build-system cmake)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build utils)
   #:use-module (guix packages)
@@ -81,3 +82,64 @@  (define-public squirrel
 size, memory bandwidth, and real-time requirements of applications like video
 games.")
     (license license:expat)))
+
+
+
+(define-public quirrel
+  (package
+    (name "quirrel")
+    (version "4.6.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/GaijinEntertainment/quirrel.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "18xvhssnh5lddi4ava7wzzvsiin8rh3vrbhcblv7l00qv0brh6gg"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags '("-DDISABLE_STATIC=ON")
+       #:tests? #f ;no tests
+       #:phases (modify-phases %standard-phases
+                  ;; TODO: build and install doc files like squirrel above
+                  (add-after 'install 'install-headers
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (include-dir (string-append out "/include")))
+                        (mkdir-p include-dir)
+                        (for-each (lambda (header-file)
+                                    (copy-recursively header-file
+                                                      (string-append
+                                                       include-dir "/"
+                                                       (basename header-file))))
+                                  (find-files "../include"))) #t)))))
+    (native-inputs `(("cmake" ,cmake-minimal)
+                     ("python-sphinx" ,python-sphinx)))
+    (home-page "https://github.com/GaijinEntertainment/quirrel")
+    (synopsis "Script language that is based on Squirrel language and is
+inspired by Python, Javascript and especially Lua")
+    (description
+     "Quirrel is a script language that is based on Squirrel language and is
+inspired by Python, Javascript and especially Lua, with
+@itemize
+@item Lexical scoping
+@item Higher order functions, closures and lambda
+@item Classes and inheritance
+@item Tail recursion
+@item Delegation
+@item String interpolation
+@item Exception handling
+@item Cooperative threads (coroutines)
+@item Generators
+@item Performance - Quirrel is fast and small (comparable with Lua and sometimes even faster)
+@item Both compiler and virtual machine fit together in about 13k lines of C++ code and add only around 100kb-150kb the executable size.
+@item Automatic memory management (CPU bursts free - reference counting and GC)
+@item Optional 16bits characters strings
+@item Dynamic typing type system is close to Javascript but stricter and simpler (there is integer type and no 'undefined')
+@item Powerful embedding api
+@item Modules
+@item Hot-reload (if you implement it in your code)
+@end itemize")
+    (license license:expat)))