slang.scm 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  4. ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
  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. (define-module (gnu packages slang)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix utils)
  24. #:use-module (guix build-system gnu)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (gnu packages readline)
  27. #:use-module (gnu packages ncurses)
  28. #:use-module (gnu packages popt)
  29. #:use-module (gnu packages fribidi)
  30. #:use-module (gnu packages compression)
  31. #:use-module (gnu packages image)
  32. #:use-module (gnu packages pcre)
  33. #:use-module (gnu packages python))
  34. (define-public slang
  35. (package
  36. (name "slang")
  37. (version "2.3.0")
  38. (source (origin
  39. (method url-fetch)
  40. (uri (string-append
  41. "http://www.jedsoft.org/releases/slang/slang-"
  42. version
  43. ".tar.gz"))
  44. (sha256
  45. (base32
  46. "0aqd2cjabj6nhd4r3dc4vhqif2bf3dmqnrn2gj0xm4gqyfd177jy"))
  47. (modules '((guix build utils)))
  48. (snippet
  49. '(begin
  50. (substitute* "src/Makefile.in"
  51. (("/bin/ln") "ln"))
  52. (substitute* "configure"
  53. (("-ltermcap") ""))))))
  54. (build-system gnu-build-system)
  55. (arguments
  56. '(#:parallel-tests? #f
  57. #:parallel-build? #f)) ; there's at least one race
  58. (inputs
  59. `(("readline" ,readline)
  60. ("zlib" ,zlib)
  61. ("libpng" ,libpng)
  62. ("pcre" ,pcre)
  63. ("ncurses" ,ncurses)))
  64. (home-page "http://www.jedsoft.org/slang/")
  65. (synopsis "Library for interactive applications and extensibility")
  66. (description
  67. "S-Lang is a multi-platform programmer's library designed to allow a
  68. developer to create robust multi-platform software. It provides facilities
  69. required by interactive applications such as display/screen management,
  70. keyboard input, keymaps, and so on. The most exciting feature of the library
  71. is the slang interpreter that may be easily embedded into a program to make it
  72. extensible. While the emphasis has always been on the embedded nature of the
  73. interpreter, it may also be used in a stand-alone fashion through the use of
  74. slsh, which is part of the S-Lang distribution.")
  75. (license license:gpl2+)))
  76. (define-public newt
  77. (package
  78. (name "newt")
  79. (version "0.52.18")
  80. (source (origin
  81. (method url-fetch)
  82. (uri (string-append "https://pagure.io/releases/"
  83. name "/" name "-" version ".tar.gz"))
  84. (sha256
  85. (base32
  86. "07n9f2mqsjfj35wx5ldhvl9sqcjqpcl0g4fdd9mawmny9rihw6vp"))))
  87. (build-system gnu-build-system)
  88. (outputs '("out" "python"))
  89. (inputs
  90. `(("slang" ,slang)
  91. ("popt" ,popt)
  92. ("python" ,python)
  93. ("fribidi" ,fribidi)))
  94. (arguments
  95. `(#:tests? #f ; no test suite
  96. #:configure-flags
  97. ;; Set the correct RUNPATH in binaries.
  98. (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
  99. #:make-flags
  100. ;; configure does not allow us to override this variable from the
  101. ;; command-line. Fortunately, the Makefile does, so provide it here.
  102. (list (string-append "PYTHONVERS=python"
  103. ,(version-major+minor (package-version python))))
  104. #:phases
  105. (modify-phases %standard-phases
  106. (add-after
  107. 'unpack 'patch-/usr/bin/install
  108. (lambda _
  109. (substitute* "po/Makefile"
  110. (("/usr/bin/install") "install"))
  111. #t))
  112. (add-after
  113. 'install 'move-python
  114. (lambda* (#:key outputs #:allow-other-keys)
  115. (let ((out (assoc-ref outputs "out"))
  116. (py (assoc-ref outputs "python"))
  117. (ver ,(version-major+minor (package-version python))))
  118. (mkdir-p (string-append py "/lib"))
  119. (rename-file (string-append out "/lib/python" ver)
  120. (string-append py "/lib/python" ver))
  121. #t))))))
  122. (home-page "https://pagure.io/newt")
  123. (synopsis "Not Erik's Windowing Toolkit - text mode windowing with slang")
  124. (description
  125. "Newt is a windowing toolkit for text mode built from the slang library.
  126. It allows color text mode applications to easily use stackable windows, push
  127. buttons, check boxes, radio buttons, lists, entry fields, labels, and
  128. displayable text. Scrollbars are supported, and forms may be nested to
  129. provide extra functionality.")
  130. (license license:lgpl2.0)))