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