education.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
  3. ;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
  4. ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
  5. ;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages education)
  24. #:use-module (ice-9 regex)
  25. #:use-module (gnu packages)
  26. #:use-module (gnu packages base)
  27. #:use-module (gnu packages bash)
  28. #:use-module (gnu packages compression)
  29. #:use-module (gnu packages freedesktop)
  30. #:use-module (gnu packages gettext)
  31. #:use-module (gnu packages glib)
  32. #:use-module (gnu packages gnome)
  33. #:use-module (gnu packages gtk)
  34. #:use-module (gnu packages javascript)
  35. #:use-module (gnu packages kde-frameworks) ; extra-cmake-modules
  36. #:use-module (gnu packages perl)
  37. #:use-module (gnu packages pkg-config)
  38. #:use-module (gnu packages python)
  39. #:use-module (gnu packages qt)
  40. #:use-module (gnu packages sdl)
  41. #:use-module (gnu packages sqlite)
  42. #:use-module (gnu packages texinfo)
  43. #:use-module (gnu packages xorg)
  44. #:use-module (gnu packages xml)
  45. #:use-module ((guix licenses) #:prefix license:)
  46. #:use-module (guix packages)
  47. #:use-module (guix download)
  48. #:use-module (guix git-download)
  49. #:use-module (guix svn-download)
  50. #:use-module (guix utils)
  51. #:use-module (guix build-system cmake)
  52. #:use-module (guix build-system gnu)
  53. #:use-module (guix build-system trivial)
  54. #:use-module (srfi srfi-1))
  55. (define-public gcompris
  56. (package
  57. (name "gcompris")
  58. (version "17.05")
  59. (source (origin
  60. (method url-fetch)
  61. (uri (string-append "http://gcompris.net/download/gtk/src/gcompris-"
  62. version ".tar.bz2"))
  63. (sha256
  64. (base32
  65. "18y483alb4r4vfmh80nnl0pah5gv0b8frcm6l1drb9njn5xlcpgc"))))
  66. (build-system gnu-build-system)
  67. (arguments
  68. `(#:configure-flags
  69. ;; Use SDL mixer because otherwise GCompris would need an old version
  70. ;; of Gstreamer.
  71. (list "--enable-sdlmixer"
  72. "LDFLAGS=-lgmodule-2.0")
  73. #:phases
  74. (modify-phases %standard-phases
  75. (add-after 'set-paths 'set-sdl-paths
  76. (lambda* (#:key inputs #:allow-other-keys)
  77. (setenv "CPATH"
  78. (string-append (assoc-ref inputs "sdl-mixer")
  79. "/include/SDL"))
  80. #t)))))
  81. (inputs
  82. `(("gtk+" ,gtk+-2)
  83. ("librsvg" ,librsvg)
  84. ("libxml2" ,libxml2)
  85. ("sdl-mixer" ,sdl-mixer)
  86. ("sqlite" ,sqlite)
  87. ("glib:bin" ,glib)
  88. ("python" ,python)))
  89. (native-inputs
  90. `(("intltool" ,intltool)
  91. ("texinfo" ,texinfo)
  92. ("texi2html" ,texi2html)
  93. ("glib:bin" ,glib "bin")
  94. ("pkg-config" ,pkg-config)))
  95. (home-page "http://gcompris.net")
  96. (synopsis "Educational software suite")
  97. (description "GCompris is an educational software suite comprising of
  98. numerous activities for children aged 2 to 10. Some of the activities are
  99. game orientated, but nonetheless still educational. Below you can find a list
  100. of categories with some of the activities available in that category.
  101. @enumerate
  102. @item computer discovery: keyboard, mouse, different mouse gestures, ...
  103. @item arithmetic: table memory, enumeration, double entry table, mirror image, ...
  104. @item science: the canal lock, the water cycle, the submarine, electric simulation ...
  105. @item geography: place the country on the map
  106. @item games: chess, memory, connect 4, oware, sudoku ...
  107. @item reading: reading practice
  108. @item other: learn to tell time, puzzle of famous paintings, vector drawing, cartoon making, ...
  109. @end enumerate
  110. ")
  111. (license license:gpl3+)))
  112. (define-public gcompris-qt
  113. (package
  114. (name "gcompris-qt")
  115. (version "0.95")
  116. (source
  117. (origin
  118. (method url-fetch)
  119. (uri (string-append
  120. "https://gcompris.net/download/qt/src/gcompris-qt-"
  121. version ".tar.xz"))
  122. (sha256
  123. (base32
  124. "1aaijjx2b7k1cyx59jhs64hlp1sppw1faa81qxl5lxc79vifrlrl"))))
  125. (build-system cmake-build-system)
  126. (arguments
  127. `(#:phases
  128. (modify-phases %standard-phases
  129. (add-before 'check 'start-xorg-server
  130. (lambda* (#:key inputs #:allow-other-keys)
  131. ;; The test suite requires a running X server.
  132. (system (string-append (assoc-ref inputs "xorg-server")
  133. "/bin/Xvfb :1 &"))
  134. (setenv "DISPLAY" ":1")
  135. #t))
  136. (add-after 'install 'wrap-executable
  137. (lambda* (#:key inputs outputs #:allow-other-keys)
  138. (let ((out (assoc-ref outputs "out")))
  139. (wrap-program (string-append out "/bin/gcompris-qt")
  140. `("QT_PLUGIN_PATH" ":" prefix
  141. ,(map (lambda (label)
  142. (string-append (assoc-ref inputs label)
  143. "/lib/qt5/plugins"))
  144. '("qtbase" "qtdeclarative" "qtmultimedia" "qtsvg")))
  145. `("QML2_IMPORT_PATH" ":" prefix
  146. ,(map (lambda (label)
  147. (string-append (assoc-ref inputs label)
  148. "/lib/qt5/qml"))
  149. '("qtdeclarative" "qtgraphicaleffects"
  150. "qtmultimedia" "qtquickcontrols"))))
  151. #t))))
  152. #:configure-flags (list "-DQML_BOX2D_MODULE=disabled"
  153. "-DBUILD_TESTING=TRUE")))
  154. (native-inputs
  155. `(("extra-cmake-modules" ,extra-cmake-modules)
  156. ("gettext" ,gettext-minimal)
  157. ("perl" ,perl)
  158. ("qttools" ,qttools)
  159. ("xorg-server" ,xorg-server)))
  160. (inputs
  161. `(("python-2" ,python-2)
  162. ("qtbase" ,qtbase)
  163. ("qtdeclarative" ,qtdeclarative)
  164. ("qtgraphicaleffects" ,qtgraphicaleffects)
  165. ("qtmultimedia" ,qtmultimedia)
  166. ("qtquickcontrols" ,qtquickcontrols)
  167. ("qtsensors" ,qtsensors)
  168. ("qtsvg" ,qtsvg)
  169. ("qtxmlpatterns" ,qtxmlpatterns)))
  170. (home-page "https://gcompris.net/index-en.html")
  171. (synopsis "Educational games for small children")
  172. (description
  173. "Gcompris offers a large collection of educational games for small
  174. children, designed to be a unified interface to integrate more educational
  175. games. Language-oriented games contain vocabulary, sounds, and voices for
  176. many different languages.
  177. Currently available boards include:
  178. @enumerate
  179. @item learning how to use a mouse and keyboard
  180. @item learning simple arithmetic
  181. @item learning how to read an analog clock
  182. @item recognize letters after hearing their names
  183. @item reading practice
  184. @item small games (memory games, jigsaw puzzles, ...)
  185. @end enumerate\n")
  186. (license license:gpl3+)))
  187. (define-public tipp10
  188. (package
  189. (name "tipp10")
  190. (version "2.1.0")
  191. (source (origin
  192. (method url-fetch)
  193. ;; guix download is not able to handle the download links on the
  194. ;; home-page, which use '<meta http-equiv="refresh" …>'
  195. (uri (string-append "mirror://debian/pool/main/"
  196. "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
  197. (sha256
  198. (base32
  199. "0d387b404j88gsv6kv0rb7wxr23v5g5vl6s5l7602x8pxf7slbbx"))
  200. (patches (search-patches "tipp10-fix-compiling.patch"
  201. "tipp10-remove-license-code.patch"))))
  202. (build-system cmake-build-system)
  203. (arguments
  204. `(#:tests? #f ; packages has no tests
  205. #:phases
  206. (modify-phases %standard-phases
  207. (add-after 'unpack 'disable-new-version-check
  208. (lambda _
  209. ;; Make new version check to default to false.
  210. ;; TODO: Remove the checkbox from the dialog and the check itself
  211. (substitute* '("widget/settingspages.cpp" "widget/mainwindow.cpp")
  212. (("settings.value(\"check_new_version\", true)")
  213. "settings.value(\"check_new_version\", false)"))
  214. #t))
  215. (replace 'configure
  216. (lambda* (#:key outputs #:allow-other-keys)
  217. (let ((out (assoc-ref outputs "out")))
  218. ;; Make program honor $PREFIX
  219. (substitute* "tipp10.pro"
  220. (("\\.path = /usr/") (string-append ".path = " out "/")))
  221. (substitute* "def/defines.h"
  222. (("\"/usr/") (string-append "\"" out "/")))
  223. ;; Recreate Makefile
  224. (invoke "qmake")))))))
  225. (inputs
  226. `(("qt4" ,qt-4)
  227. ("sqlite" ,sqlite)))
  228. (home-page "https://www.tipp10.com/")
  229. (synopsis "Touch typing tutor")
  230. (description "Tipp10 is a touch typing tutor. The ingenious thing about
  231. the software is its intelligence feature: characters that are mistyped are
  232. repeated more frequently. Beginners will find their way around right away so
  233. they can start practicing without a hitch.
  234. Useful support functions and an extensive progress tracker, topical lessons
  235. and the ability to create your own practice lessons make learning to type
  236. easy.")
  237. (license license:gpl2)))
  238. (define-public snap
  239. (package
  240. (name "snap")
  241. (version "4.2.2.9")
  242. (source
  243. (origin
  244. (method git-fetch)
  245. (uri (git-reference
  246. (url "https://github.com/jmoenig/Snap.git")
  247. (commit version)))
  248. (file-name (git-file-name name version))
  249. (sha256
  250. (base32
  251. "07qyhh4f8gr1fqyvxa2i6lkzaaa0vl12yzllgp81rdil8z8bi976"))))
  252. (build-system trivial-build-system)
  253. (arguments
  254. `(#:modules ((guix build utils))
  255. #:builder
  256. (begin
  257. (use-modules (guix build utils))
  258. (let* ((source (assoc-ref %build-inputs "source"))
  259. (out (assoc-ref %outputs "out"))
  260. (share (string-append out "/share/snap")))
  261. (copy-recursively source share)
  262. ;; Replace the sole minified file in the package.
  263. (with-directory-excursion (string-append share "/src")
  264. (delete-file "FileSaver.min.js")
  265. (symlink (string-append (assoc-ref %build-inputs "js-filesaver")
  266. "/share/javascript/FileSaver.min.js")
  267. "FileSaver.min.js"))
  268. ;; Create a "snap" executable.
  269. (let* ((bin (string-append out "/bin"))
  270. (script (string-append bin "/snap"))
  271. (snap (string-append share "/snap.html"))
  272. (bash (string-append (assoc-ref %build-inputs "bash")
  273. "/bin/sh"))
  274. (xdg-open (string-append (assoc-ref %build-inputs "xdg-utils")
  275. "/bin/xdg-open")))
  276. (mkdir-p bin)
  277. (call-with-output-file script
  278. (lambda (port)
  279. (format port "#!~a\n~a '~a'" bash xdg-open snap)))
  280. (chmod script #o555)))
  281. #t)))
  282. (inputs
  283. `(("bash" ,bash-minimal)
  284. ("js-filesaver" ,js-filesaver)
  285. ("xdg-utils" ,xdg-utils)))
  286. (home-page "https://snap.berkeley.edu")
  287. (synopsis "Visual, blocks based programming language")
  288. (description "Snap! (formerly BYOB) is a visual, drag-and-drop
  289. programming language. It is an extended reimplementation of Scratch (a
  290. project of the Lifelong Kindergarten Group at the MIT Media Lab) that
  291. allows you to Build Your Own Blocks. It also features first class
  292. lists, first class procedures, and continuations. These added
  293. capabilities make it suitable for a serious introduction to computer
  294. science for high school or college students.
  295. This package provides a @command{snap} executable calling @command{xdg-open}
  296. to open the application in a web browser, for offline usage.")
  297. (license license:agpl3+)))