gnu: protobuf: Update to 3.11.3.
[jackhill/guix/guix.git] / gnu / packages / nim.scm
CommitLineData
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>
84aafbbb
JMSG
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")
c2837780 30 (version "0.17.2")
84aafbbb
JMSG
31 (source
32 (origin
33 (method url-fetch)
6eed2644 34 (uri (string-append "https://nim-lang.org/download/"
84aafbbb
JMSG
35 name "-" version ".tar.xz"))
36 (sha256
37 (base32
c2837780 38 "1gc2xk3ygmz9y4pm75pligssgw995a7gvnfpy445fjpw4d81pzxa"))))
84aafbbb
JMSG
39 (build-system gnu-build-system)
40 (arguments
41 `(#:tests? #f ; No tests.
42 #:phases
43 (modify-phases %standard-phases
c2837780 44 (delete 'configure) ; no configure script
84aafbbb
JMSG
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)))
6eed2644
EF
51 (add-after 'patch-source-shebangs 'patch-more-shebangs
52 (lambda _
79e074ea
JK
53 (let ((sh (which "sh")))
54 (substitute* '("tests/stdlib/tosprocterminate.nim"
55 "lib/pure/osproc.nim")
56 (("/bin/sh") sh))
57 (substitute* (find-files "c_code" "stdlib_osproc.c")
58 (("\"/bin/sh\", 7") (format "~s, ~s" sh (string-length sh)))))
6eed2644
EF
59 #t))
60 (replace 'build
61 (lambda _
ed5f55de
TGR
62 (invoke "sh" "build.sh")
63 #t))
84aafbbb
JMSG
64 (replace 'install
65 (lambda* (#:key outputs #:allow-other-keys)
66 (let ((out (assoc-ref outputs "out")))
ed5f55de
TGR
67 (invoke "./install.sh" out)
68 #t))))))
6eed2644 69 (home-page "https://nim-lang.org")
84aafbbb
JMSG
70 (synopsis "Statically-typed, imperative programming language")
71 (description "Nim (formerly known as Nimrod) is a statically-typed,
72imperative programming language that tries to give the programmer ultimate power
73without compromises on runtime efficiency. This means it focuses on compile-time
74mechanisms in all their various forms.")
75 (license license:expat)))