Commit | Line | Data |
---|---|---|
84aafbbb JMSG |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org> | |
6eed2644 | 3 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
c2837780 | 4 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
536cc4aa | 5 | ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org> |
84aafbbb JMSG |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages nim) | |
23 | #:use-module (guix build-system gnu) | |
24 | #:use-module (guix download) | |
25 | #:use-module ((guix licenses) #:prefix license:) | |
26 | #:use-module (guix packages)) | |
27 | ||
28 | (define-public nim | |
29 | (package | |
30 | (name "nim") | |
6fbefd03 | 31 | (version "1.4.2") |
84aafbbb JMSG |
32 | (source |
33 | (origin | |
34 | (method url-fetch) | |
6eed2644 | 35 | (uri (string-append "https://nim-lang.org/download/" |
84aafbbb JMSG |
36 | name "-" version ".tar.xz")) |
37 | (sha256 | |
38 | (base32 | |
6fbefd03 | 39 | "0q8i56343b69f1bh48a8vxkqman9i2kscyj0lf017n3xfy1pb903")))) |
84aafbbb JMSG |
40 | (build-system gnu-build-system) |
41 | (arguments | |
42 | `(#:tests? #f ; No tests. | |
43 | #:phases | |
44 | (modify-phases %standard-phases | |
c2837780 | 45 | (delete 'configure) ; no configure script |
84aafbbb JMSG |
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))) | |
6eed2644 EF |
52 | (add-after 'patch-source-shebangs 'patch-more-shebangs |
53 | (lambda _ | |
79e074ea JK |
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") | |
52bdd304 | 59 | (("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-length sh))))) |
6eed2644 EF |
60 | #t)) |
61 | (replace 'build | |
62 | (lambda _ | |
ed5f55de TGR |
63 | (invoke "sh" "build.sh") |
64 | #t)) | |
84aafbbb JMSG |
65 | (replace 'install |
66 | (lambda* (#:key outputs #:allow-other-keys) | |
67 | (let ((out (assoc-ref outputs "out"))) | |
ed5f55de TGR |
68 | (invoke "./install.sh" out) |
69 | #t)))))) | |
6eed2644 | 70 | (home-page "https://nim-lang.org") |
84aafbbb JMSG |
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))) |