You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
3.1 KiB

  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. ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
  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. (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. (define-public nim
  27. (package
  28. (name "nim")
  29. (version "1.0.6")
  30. (source
  31. (origin
  32. (method url-fetch)
  33. (uri (string-append "https://nim-lang.org/download/"
  34. name "-" version ".tar.xz"))
  35. (sha256
  36. (base32
  37. "1cv6bxc7w21455c0pv0r2h64ljyzw266jsk1fsgiiyk2rx8mfkhk"))))
  38. (build-system gnu-build-system)
  39. (arguments
  40. `(#:tests? #f ; No tests.
  41. #:phases
  42. (modify-phases %standard-phases
  43. (delete 'configure) ; no configure script
  44. (add-after 'unpack 'patch-installer
  45. (lambda* (#:key outputs #:allow-other-keys)
  46. (let ((out (assoc-ref outputs "out")))
  47. (substitute* "install.sh"
  48. (("1/nim") "1"))
  49. #t)))
  50. (add-after 'patch-source-shebangs 'patch-more-shebangs
  51. (lambda _
  52. (let ((sh (which "sh")))
  53. (substitute* '("tests/stdlib/tosprocterminate.nim"
  54. "lib/pure/osproc.nim")
  55. (("/bin/sh") sh))
  56. (substitute* (find-files "c_code" "stdlib_osproc.c")
  57. (("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-length sh)))))
  58. #t))
  59. (replace 'build
  60. (lambda _
  61. (invoke "sh" "build.sh")
  62. #t))
  63. (replace 'install
  64. (lambda* (#:key outputs #:allow-other-keys)
  65. (let ((out (assoc-ref outputs "out")))
  66. (invoke "./install.sh" out)
  67. #t))))))
  68. (home-page "https://nim-lang.org")
  69. (synopsis "Statically-typed, imperative programming language")
  70. (description "Nim (formerly known as Nimrod) is a statically-typed,
  71. imperative programming language that tries to give the programmer ultimate power
  72. without compromises on runtime efficiency. This means it focuses on compile-time
  73. mechanisms in all their various forms.")
  74. (license license:expat)))