slang.scm 5.8 KB

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