Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / education.scm
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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2018, 2019 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
24 (define-module (gnu packages education)
25 #:use-module (ice-9 regex)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages bash)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages fonts)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages game-development)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages gtk)
38 #:use-module (gnu packages javascript)
39 #:use-module (gnu packages kde-frameworks) ; extra-cmake-modules
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages qt)
44 #:use-module (gnu packages sdl)
45 #:use-module (gnu packages sqlite)
46 #:use-module (gnu packages texinfo)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages xorg)
49 #:use-module (gnu packages xml)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix packages)
52 #:use-module (guix download)
53 #:use-module (guix git-download)
54 #:use-module (guix svn-download)
55 #:use-module (guix utils)
56 #:use-module (guix build-system cmake)
57 #:use-module (guix build-system gnu)
58 #:use-module (guix build-system python)
59 #:use-module (guix build-system trivial)
60 #:use-module (srfi srfi-1))
61
62 (define-public gcompris
63 (package
64 (name "gcompris")
65 (version "17.05")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "http://gcompris.net/download/gtk/src/gcompris-"
69 version ".tar.bz2"))
70 (sha256
71 (base32
72 "18y483alb4r4vfmh80nnl0pah5gv0b8frcm6l1drb9njn5xlcpgc"))))
73 (build-system gnu-build-system)
74 (arguments
75 `(#:configure-flags
76 ;; Use SDL mixer because otherwise GCompris would need an old version
77 ;; of Gstreamer.
78 (list "--enable-sdlmixer"
79 "LDFLAGS=-lgmodule-2.0")
80 #:phases
81 (modify-phases %standard-phases
82 (add-after 'set-paths 'set-sdl-paths
83 (lambda* (#:key inputs #:allow-other-keys)
84 (setenv "CPATH"
85 (string-append (assoc-ref inputs "sdl-mixer")
86 "/include/SDL:"
87 (or (getenv "CPATH") "")))
88 #t)))))
89 (inputs
90 `(("gtk+" ,gtk+-2)
91 ("librsvg" ,librsvg)
92 ("libxml2" ,libxml2)
93 ("sdl-mixer" ,sdl-mixer)
94 ("sqlite" ,sqlite)
95 ("glib:bin" ,glib)
96 ("python" ,python)))
97 (native-inputs
98 `(("intltool" ,intltool)
99 ("texinfo" ,texinfo)
100 ("texi2html" ,texi2html)
101 ("glib:bin" ,glib "bin")
102 ("pkg-config" ,pkg-config)))
103 (home-page "http://gcompris.net")
104 (synopsis "Educational software suite")
105 (description "GCompris is an educational software suite comprising of
106 numerous activities for children aged 2 to 10. Some of the activities are
107 game orientated, but nonetheless still educational. Below you can find a list
108 of categories with some of the activities available in that category.
109
110 @enumerate
111 @item computer discovery: keyboard, mouse, different mouse gestures, ...
112 @item arithmetic: table memory, enumeration, double entry table, mirror image, ...
113 @item science: the canal lock, the water cycle, the submarine, electric simulation ...
114 @item geography: place the country on the map
115 @item games: chess, memory, connect 4, oware, sudoku ...
116 @item reading: reading practice
117 @item other: learn to tell time, puzzle of famous paintings, vector drawing, cartoon making, ...
118 @end enumerate
119 ")
120 (license license:gpl3+)))
121
122 (define-public gcompris-qt
123 (package
124 (name "gcompris-qt")
125 (version "0.96")
126 (source
127 (origin
128 (method url-fetch)
129 (uri (string-append
130 "https://gcompris.net/download/qt/src/gcompris-qt-"
131 version ".tar.xz"))
132 (sha256
133 (base32 "06483il59l46ny2w771sg45dgzjwv1ph7vidzzbj0wb8wbk2rg52"))))
134 (build-system cmake-build-system)
135 (arguments
136 `(#:phases
137 (modify-phases %standard-phases
138 (add-before 'check 'start-xorg-server
139 (lambda* (#:key inputs #:allow-other-keys)
140 ;; The test suite requires a running X server.
141 (system (string-append (assoc-ref inputs "xorg-server")
142 "/bin/Xvfb :1 &"))
143 (setenv "DISPLAY" ":1")
144 #t))
145 (add-after 'install 'wrap-executable
146 (lambda* (#:key inputs outputs #:allow-other-keys)
147 (let ((out (assoc-ref outputs "out")))
148 (wrap-program (string-append out "/bin/gcompris-qt")
149 `("QT_PLUGIN_PATH" ":" prefix
150 ,(map (lambda (label)
151 (string-append (assoc-ref inputs label)
152 "/lib/qt5/plugins"))
153 '("qtbase" "qtdeclarative" "qtmultimedia" "qtsvg")))
154 `("QML2_IMPORT_PATH" ":" prefix
155 ,(map (lambda (label)
156 (string-append (assoc-ref inputs label)
157 "/lib/qt5/qml"))
158 '("qtdeclarative" "qtgraphicaleffects"
159 "qtmultimedia" "qtquickcontrols"))))
160 #t))))
161 #:configure-flags (list "-DQML_BOX2D_MODULE=disabled"
162 "-DBUILD_TESTING=TRUE")))
163 (native-inputs
164 `(("extra-cmake-modules" ,extra-cmake-modules)
165 ("gettext" ,gettext-minimal)
166 ("perl" ,perl)
167 ("qttools" ,qttools)
168 ("xorg-server" ,xorg-server)))
169 (inputs
170 `(("openssl" ,openssl)
171 ("python-2" ,python-2)
172 ("qtbase" ,qtbase)
173 ("qtdeclarative" ,qtdeclarative)
174 ("qtgraphicaleffects" ,qtgraphicaleffects)
175 ("qtmultimedia" ,qtmultimedia)
176 ("qtquickcontrols" ,qtquickcontrols)
177 ("qtsensors" ,qtsensors)
178 ("qtsvg" ,qtsvg)
179 ("qtxmlpatterns" ,qtxmlpatterns)))
180 (home-page "https://gcompris.net/index-en.html")
181 (synopsis "Educational games for small children")
182 (description
183 "Gcompris offers a large collection of educational games for small
184 children, designed to be a unified interface to integrate more educational
185 games. Language-oriented games contain vocabulary, sounds, and voices for
186 many different languages.
187 Currently available boards include:
188 @enumerate
189 @item learning how to use a mouse and keyboard
190 @item learning simple arithmetic
191 @item learning how to read an analog clock
192 @item recognize letters after hearing their names
193 @item reading practice
194 @item small games (memory games, jigsaw puzzles, ...)
195 @end enumerate\n")
196 (license license:gpl3+)))
197
198 (define-public tipp10
199 (package
200 (name "tipp10")
201 (version "2.1.0")
202 (source (origin
203 (method url-fetch)
204 ;; guix download is not able to handle the download links on the
205 ;; home-page, which use '<meta http-equiv="refresh" …>'
206 (uri (string-append "mirror://debian/pool/main/"
207 "t/tipp10/tipp10_2.1.0.orig.tar.gz"))
208 (sha256
209 (base32
210 "0d387b404j88gsv6kv0rb7wxr23v5g5vl6s5l7602x8pxf7slbbx"))
211 (patches (search-patches "tipp10-fix-compiling.patch"
212 "tipp10-remove-license-code.patch"))))
213 (build-system cmake-build-system)
214 (arguments
215 `(#:tests? #f ; packages has no tests
216 #:phases
217 (modify-phases %standard-phases
218 (add-after 'unpack 'disable-new-version-check
219 (lambda _
220 ;; Make new version check to default to false.
221 ;; TODO: Remove the checkbox from the dialog and the check itself
222 (substitute* '("widget/settingspages.cpp" "widget/mainwindow.cpp")
223 (("settings.value(\"check_new_version\", true)")
224 "settings.value(\"check_new_version\", false)"))
225 #t))
226 (replace 'configure
227 (lambda* (#:key outputs #:allow-other-keys)
228 (let ((out (assoc-ref outputs "out")))
229 ;; Make program honor $PREFIX
230 (substitute* "tipp10.pro"
231 (("\\.path = /usr/") (string-append ".path = " out "/")))
232 (substitute* "def/defines.h"
233 (("\"/usr/") (string-append "\"" out "/")))
234 ;; Recreate Makefile
235 (invoke "qmake")))))))
236 (inputs
237 `(("qt4" ,qt-4)
238 ("sqlite" ,sqlite)))
239 (home-page "https://www.tipp10.com/")
240 (synopsis "Touch typing tutor")
241 (description "Tipp10 is a touch typing tutor. The ingenious thing about
242 the software is its intelligence feature: characters that are mistyped are
243 repeated more frequently. Beginners will find their way around right away so
244 they can start practicing without a hitch.
245
246 Useful support functions and an extensive progress tracker, topical lessons
247 and the ability to create your own practice lessons make learning to type
248 easy.")
249 (license license:gpl2)))
250
251 (define-public snap
252 (package
253 (name "snap")
254 (version "5.0.8")
255 (source
256 (origin
257 (method git-fetch)
258 (uri (git-reference
259 (url "https://github.com/jmoenig/Snap.git")
260 (commit (string-append "v" version))))
261 (file-name (git-file-name name version))
262 (sha256
263 (base32
264 "0fwfssdgv3mfzyv8hw1a1z5ky1yn0p59kyl6l9fxsm4w2ckgyizd"))))
265 (build-system trivial-build-system)
266 (arguments
267 `(#:modules ((guix build utils))
268 #:builder
269 (begin
270 (use-modules (guix build utils))
271 (let* ((source (assoc-ref %build-inputs "source"))
272 (out (assoc-ref %outputs "out"))
273 (share (string-append out "/share/snap")))
274 (copy-recursively source share)
275 ;; Replace the sole minified file in the package.
276 (with-directory-excursion (string-append share "/src")
277 (delete-file "FileSaver.min.js")
278 (symlink (string-append (assoc-ref %build-inputs "js-filesaver")
279 "/share/javascript/FileSaver.min.js")
280 "FileSaver.min.js"))
281 ;; Create a "snap" executable.
282 (let* ((bin (string-append out "/bin"))
283 (script (string-append bin "/snap"))
284 (snap (string-append share "/snap.html"))
285 (bash (string-append (assoc-ref %build-inputs "bash")
286 "/bin/sh"))
287 (xdg-open (string-append (assoc-ref %build-inputs "xdg-utils")
288 "/bin/xdg-open")))
289 (mkdir-p bin)
290 (call-with-output-file script
291 (lambda (port)
292 (format port "#!~a\n~a '~a'" bash xdg-open snap)))
293 (chmod script #o555)))
294 #t)))
295 (inputs
296 `(("bash" ,bash-minimal)
297 ("js-filesaver" ,js-filesaver)
298 ("xdg-utils" ,xdg-utils)))
299 (home-page "https://snap.berkeley.edu")
300 (synopsis "Visual, blocks based programming language")
301 (description "Snap! (formerly BYOB) is a visual, drag-and-drop
302 programming language. It is an extended reimplementation of Scratch (a
303 project of the Lifelong Kindergarten Group at the MIT Media Lab) that
304 allows you to Build Your Own Blocks. It also features first class
305 lists, first class procedures, and continuations. These added
306 capabilities make it suitable for a serious introduction to computer
307 science for high school or college students.
308
309 This package provides a @command{snap} executable calling @command{xdg-open}
310 to open the application in a web browser, for offline usage.")
311 (license license:agpl3+)))
312
313 (define-public toutenclic
314 (package
315 (name "toutenclic")
316 (version "7.00")
317 (source
318 (origin
319 (method url-fetch)
320 (uri (string-append "http://www.bipede.fr/downloads/logiciels/"
321 "ToutEnClic-" version "-src.zip"))
322 (sha256
323 (base32 "0xg24p925rl5bfqsq3jb2lrkidb0f3kbmay5iyxxmjsn3ra0blyh"))))
324 (build-system python-build-system)
325 (arguments
326 `(#:tests? #f ; no tests
327 #:phases
328 (modify-phases %standard-phases
329 (delete 'build)
330 (replace 'install
331 (lambda* (#:key outputs #:allow-other-keys)
332 (let* ((out (assoc-ref outputs "out"))
333 (share (string-append out "/share/toutenclic"))
334 (pixmaps (string-append out "/share/pixmaps"))
335 (doc (string-append out "share/doc/" ,name "-" ,version))
336 (bin (string-append out "/bin"))
337 (executable "toutenclic"))
338 ;; Install icon.
339 (install-file "toutenclic.png" pixmaps)
340 ;; Move files into "share/" directory.
341 (for-each (lambda (f) (install-file f share))
342 (find-files "." "\\.py$"))
343 ;; Install documentation.
344 (install-file "ToutEnClic.pdf" doc)
345 ;; Create executable in "bin/".
346 (mkdir-p bin)
347 (with-directory-excursion bin
348 (symlink (string-append share "/" executable ".py")
349 executable)))
350 #t))
351 (add-after 'install 'create-desktop-file
352 (lambda* (#:key outputs #:allow-other-keys)
353 (let* ((out (assoc-ref outputs "out"))
354 (applications (string-append out "/share/applications")))
355 (mkdir-p applications)
356 (call-with-output-file
357 (string-append applications "/toutenclic.desktop")
358 (lambda (file)
359 (format file
360 "[Desktop Entry]~@
361 Name=ToutEnClic~@
362 Comment=For schooling without difference~@
363 Exec=~a/bin/toutenclic~@
364 TryExec=~@*~a/bin/toutenclic~@
365 Terminal=false~@
366 Icon=toutenclic~@
367 Type=Application~%"
368 out)))
369 #t))))))
370 (inputs `(("python-pyqt" ,python-pyqt)))
371 (synopsis "School tools for physically disabled children")
372 (description "ToutEnClic is intended to facilitate the schooling
373 of physically disabled children in ordinary schools. It is both
374 a multi-page virtual exercise book and a kit including pencil,
375 scissors, glue, ruler, compass, protractor and square. A virtual
376 keyboard is also available if the child does not have any other
377 specialized device.")
378 (home-page "https://bipede.fr/contrib/")
379 (license license:gpl3)))
380
381 (define-public childsplay
382 (package
383 (name "childsplay")
384 (version "3.4")
385 (source (origin
386 (method url-fetch)
387 (uri (string-append
388 "mirror://sourceforge/schoolsplay/"
389 "childsplay-" version ".tgz"))
390 (sha256
391 (base32
392 "0z7yp2swjnbz51vn2zyfnjn40jq38l5mbh15yafmx1z3vn2z1m77"))))
393 (build-system python-build-system)
394 (arguments
395 `(#:python ,python-2
396 #:tests? #f
397 #:phases
398 (modify-phases %standard-phases
399 (add-after 'unpack 'unbundle-dejavu-font
400 (lambda* (#:key inputs #:allow-other-keys)
401 (let* ((dejavu-dir
402 (string-append (assoc-ref inputs "font-dejavu")
403 "/share/fonts/truetype"))
404 (dejavu-font
405 (string-append dejavu-dir
406 "/DejaVuSansCondensed-Bold.ttf")))
407 (substitute* "SPConstants.py"
408 (("^(TTF(BOLD)? = ).*" _ prefix)
409 (string-append prefix "'" dejavu-font "'\n")))
410 (for-each (lambda (f) (delete-file f))
411 (find-files "lib/SPData" "DejaVu"))
412 #t)))
413 (delete 'build)
414 (replace 'install
415 (lambda* (#:key outputs #:allow-other-keys)
416 (let* ((out (assoc-ref outputs "out"))
417 (pixmaps (string-append out "/share/pixmaps"))
418 (share (string-append out "/share/childsplay"))
419 (doc (string-append out "/share/doc/" ,name "-",version)))
420 ;; Install icon.
421 (install-file "lib/SPData/themes/childsplay/logo_cp.svg" pixmaps)
422 ;; Install data.
423 (mkdir-p share)
424 (for-each (lambda (f)
425 (copy-recursively f (string-append share "/" f)))
426 '("alphabet-sounds" "lib" "locale" "SPWidgets"))
427 (for-each (lambda (f) (install-file f share))
428 (find-files "." "\\.(py|dev|db)$"))
429 ;; Install documentation.
430 (mkdir-p doc)
431 (copy-recursively "docs" doc)
432 #t)))
433 (add-after 'install 'create-executable
434 (lambda* (#:key outputs inputs #:allow-other-keys)
435 (let* ((python (string-append (assoc-ref inputs "python")
436 "/bin/python"))
437 (out (assoc-ref outputs "out"))
438 (bin (string-append out "/bin"))
439 (executable (string-append bin "/childsplay")))
440 (mkdir-p bin)
441 (call-with-output-file executable
442 (lambda (file)
443 (format file
444 "~a ~a"
445 python
446 (string-append out "/share/childsplay/childsplay.py"))))
447 (chmod executable #o555)
448 #t)))
449 (add-after 'install 'create-desktop-file
450 (lambda* (#:key outputs #:allow-other-keys)
451 (let* ((out (assoc-ref outputs "out"))
452 (applications (string-append out "/share/applications")))
453 (mkdir-p applications)
454 (call-with-output-file
455 (string-append applications "/childsplay.desktop")
456 (lambda (file)
457 (format file
458 "[Desktop Entry]~@
459 Name=Childsplay~@
460 Comment=Suite of educational games for young children~@
461 Comment[ca]=Conjunt de jocs educatius per a xiquets~@
462 Comment[es]=Conjunto de juegos educativos para niños~@
463 Comment[de]=Sammlung mit lehrreichen Spielen für kleine Kinder~@
464 Exec=~a/bin/childsplay.py~@
465 Terminal=false~@
466 Icon=logo_cp.svg~@
467 Type=Application~@
468 Categories=Application;Game;Education;KidsGame;~@
469 Keywords=suite;children;games;young;educational;~%"
470 out)))
471 #t))))))
472 (inputs
473 `(("font-dejavu" ,font-dejavu)
474 ("pygame" ,python2-pygame)
475 ("sqlalchemy" ,python2-sqlalchemy)))
476 (synopsis "Suite of educational games for young children")
477 (description "Childsplay is a collection of educational activities
478 for young children. Childsplay can be used at home, kindergartens and
479 pre-schools. Childsplay is a fun and safe way to let young children
480 use the computer and at the same time teach them a little math,
481 letters of the alphabet, spelling, eye-hand coordination, etc.")
482 (home-page "http://www.schoolsplay.org")
483 (license license:gpl3+)))
484
485 (define-public fet
486 (package
487 (name "fet")
488 (version "5.39.0")
489 (source (origin
490 (method url-fetch)
491 (uri (string-append "https://www.lalescu.ro/liviu/fet/download/"
492 "fet-" version ".tar.bz2"))
493 (sha256
494 (base32
495 "100bmggkychqs2cavqxy7015lr4icw6k99qb03im0v4jasqqmyix"))))
496 (build-system gnu-build-system)
497 (arguments
498 `(#:phases
499 (modify-phases %standard-phases
500 (add-after 'unpack 'fix-hardcoded-directories
501 (lambda* (#:key outputs #:allow-other-keys)
502 (substitute* (list "fet.pro"
503 "src/src.pro"
504 "src/src-cl.pro"
505 "src/interface/fet.cpp")
506 (("/usr") (assoc-ref outputs "out")))
507 #t))
508 (replace 'configure
509 (lambda _ (invoke "qmake" "fet.pro"))))))
510 (inputs
511 `(("qtbase" ,qtbase)))
512 (home-page "https://www.lalescu.ro/liviu/fet/")
513 (synopsis "Timetabling software")
514 (description "FET is a program for automatically scheduling the
515 timetable of a school, high-school or university. It uses a fast and
516 efficient timetabling algorithm.
517
518 Usually, FET is able to solve a complicated timetable in maximum 5-20
519 minutes. For simpler timetables, it may take a shorter time, under
520 5 minutes (in some cases, a matter of seconds). For extremely
521 difficult timetables, it may take a longer time, a matter of hours.")
522 (license license:agpl3+)))
523