nim.scm 2.8 KB

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