gnu: Add external-program.
[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 _
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 _
ed5f55de
TGR
60 (invoke "sh" "build.sh")
61 #t))
84aafbbb
JMSG
62 (replace 'install
63 (lambda* (#:key outputs #:allow-other-keys)
64 (let ((out (assoc-ref outputs "out")))
ed5f55de
TGR
65 (invoke "./install.sh" out)
66 #t))))))
6eed2644 67 (home-page "https://nim-lang.org")
84aafbbb
JMSG
68 (synopsis "Statically-typed, imperative programming language")
69 (description "Nim (formerly known as Nimrod) is a statically-typed,
70imperative programming language that tries to give the programmer ultimate power
71without compromises on runtime efficiency. This means it focuses on compile-time
72mechanisms in all their various forms.")
73 (license license:expat)))