gnu: qtwebengine: Rename to qtwebengine-5.
[jackhill/guix/guix.git] / gnu / packages / nim.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
3 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
6 ;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
7 ;;;
8 ;;; This file is part of GNU Guix.
9 ;;;
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
14 ;;;
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23 (define-module (gnu packages nim)
24 #:use-module (guix build-system gnu)
25 #:use-module (guix download)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages))
28
29 (define-public nim
30 (package
31 (name "nim")
32 (version "1.6.6")
33 (source
34 (origin
35 (method url-fetch)
36 (uri (string-append "https://nim-lang.org/download/"
37 name "-" version ".tar.xz"))
38 (sha256
39 (base32 "0lm4450ig8k4l3rzxv6kcqji5l1lzicsw76ckwxm0q9qdz713cb7"))))
40 (build-system gnu-build-system)
41 (arguments
42 `(#:tests? #f ; No tests.
43 #:phases
44 (modify-phases %standard-phases
45 (delete 'configure) ; no configure script
46 (add-after 'unpack 'patch-installer
47 (lambda* (#:key outputs #:allow-other-keys)
48 (let ((out (assoc-ref outputs "out")))
49 (substitute* "install.sh"
50 (("1/nim") "1"))
51 #t)))
52 (add-after 'patch-source-shebangs 'patch-more-shebangs
53 (lambda _
54 (let ((sh (which "sh")))
55 (substitute* '("tests/stdlib/tosprocterminate.nim"
56 "lib/pure/osproc.nim")
57 (("/bin/sh") sh))
58 (substitute* (find-files "c_code" "stdlib_osproc.c")
59 (("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-length sh)))))
60 #t))
61 (replace 'build
62 (lambda _
63 (invoke "sh" "build.sh")
64 #t))
65 (replace 'install
66 (lambda* (#:key outputs #:allow-other-keys)
67 (let ((out (assoc-ref outputs "out")))
68 (invoke "./install.sh" out)
69 #t))))))
70 (home-page "https://nim-lang.org")
71 (synopsis "Statically-typed, imperative programming language")
72 (description "Nim (formerly known as Nimrod) is a statically-typed,
73 imperative programming language that tries to give the programmer ultimate power
74 without compromises on runtime efficiency. This means it focuses on compile-time
75 mechanisms in all their various forms.")
76 (license license:expat)))