From d2d2d80ccb0197eeec6a40e35e5bd05f8ce77341 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 8 Aug 2021 16:20:16 +0200 Subject: gnu: Add openboard. * gnu/packages/education.scm (openboard): New variable. --- gnu/packages/education.scm | 128 +++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index 2f38598cab..a80357c997 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -37,6 +37,7 @@ #:use-module (gnu packages databases) #:use-module (gnu packages flex) #:use-module (gnu packages fonts) + #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) #:use-module (gnu packages game-development) #:use-module (gnu packages gettext) @@ -48,8 +49,10 @@ #:use-module (gnu packages javascript) #:use-module (gnu packages kde) #:use-module (gnu packages kde-frameworks) ; extra-cmake-modules + #:use-module (gnu packages linux) #:use-module (gnu packages mp3) #:use-module (gnu packages ncurses) + #:use-module (gnu packages pdf) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -62,6 +65,7 @@ #:use-module (gnu packages texinfo) #:use-module (gnu packages tls) #:use-module (gnu packages video) + #:use-module (gnu packages xiph) #:use-module (gnu packages xorg) #:use-module (gnu packages xml) #:use-module ((guix licenses) #:prefix license:) @@ -389,6 +393,130 @@ This package provides a @command{snap} executable calling @command{xdg-open} to open the application in a web browser, for offline usage.") (license license:agpl3+))) +(define-public openboard + (package + (name "openboard") + (version "1.6.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/OpenBoard-org/OpenBoard") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1wvkd5zmv7d7ng3basm323zah9gqnj6v57kf31zjk1i0hcc9fl9s")))) + (build-system qt-build-system) + (arguments + `(#:tests? #f ;no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'set-initial-values + ;; Remove useless "Check for updates" action from menu. + ;; Also prevent pop-up window about importing Open Sankore + ;; documents since we don't package OpenBoard-Importer. + (lambda _ + (substitute* "src/core/UBSettings.cpp" + (("(appHideCheckForSoftwareUpdate = .*?)false(\\);)" _ start end) + (string-append start "true" end)) + (("(appLookForOpenSankoreInstall = .*?)true(\\);)" _ start end) + (string-append start "false" end))))) + (add-after 'unpack 'fix-hard-coded + (lambda* (#:key inputs #:allow-other-keys) + (let ((coreutils (assoc-ref inputs "coreutils"))) + (substitute* "src/frameworks/UBPlatformUtils_linux.cpp" + (("/usr/bin/env") + (string-append coreutils "/bin/env")))))) + (add-after 'unpack 'fix-library-path + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "OpenBoard.pro" + (("/usr/include/quazip") + (string-append (assoc-ref inputs "quazip") + "/include/quazip5")) + (("/usr/include/poppler") + (string-append (assoc-ref inputs "poppler") + "/include/poppler"))))) + (replace 'configure + (lambda _ + ;; XXX: Invoking "lrelease-pro" on "OpenBoard.pro" fails + ;; with "WARNING: Could not find qmake spec 'default'" + ;; error. So, we compile translations manually. + (for-each (lambda (f) (invoke "lrelease" f)) + (find-files "resources/i18n" "\\.ts$")) + (invoke "qmake" + "-spec" + ,(if (string-prefix? "x86_64" (%current-system)) + "linux-g++-64" + "linux-g++")))) + (replace 'install + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (share (string-append out "/share")) + (openboard (string-append share "/openboard")) + (i18n (string-append openboard "/i18n"))) + ;; Install data. + (with-directory-excursion "resources" + (for-each (lambda (directory) + (let ((target + (string-append openboard "/" directory))) + (mkdir-p target) + (copy-recursively directory target))) + '("customizations" "etc" "library")) + (mkdir-p i18n) + (for-each (lambda (f) + (install-file f i18n)) + (find-files "i18n" "\\.qm$"))) + ;; Install desktop file an icon. + (install-file "resources/images/OpenBoard.png" + (string-append share "/icons/hicolor/64x64/apps/")) + (make-desktop-entry-file + (string-append share "/applications/" ,name ".desktop") + #:name "OpenBoard" + #:comment "Interactive whiteboard application" + #:exec "openboard %f" + #:icon "OpenBoard" + #:mime-type "application/ubz" + #:categories '("Education")) + ;; Install executable. + (install-file "build/linux/release/product/OpenBoard" openboard) + (let ((bin (string-append out "/bin"))) + (mkdir-p bin) + (symlink (string-append openboard "/OpenBoard") + (string-append bin "/openboard"))))))))) + (native-inputs + `(("qttools" ,qttools))) + (inputs + `(("alsa-lib" ,alsa-lib) + ("ffmpeg" ,ffmpeg) + ("freetype" ,freetype) + ("lame" ,lame) + ("libass" ,libass) + ("libfdk" ,libfdk) + ("libressl" ,libressl) + ("libtheora" ,libtheora) + ("libva" ,libva) + ("libvorbis" ,libvorbis) + ("libvpx" ,libvpx) + ("libx264" ,libx264) + ("opus" ,opus) + ("poppler" ,poppler) + ("qtbase" ,qtbase-5) + ("qtmultimedia" ,qtmultimedia) + ("qtsvg" ,qtsvg) + ("qtwebkit" ,qtwebkit) + ("qtxmlpatterns" ,qtxmlpatterns) + ("quazip" ,quazip) + ("sdl" ,sdl) + ("zlib" ,zlib))) + (home-page "https://openboard.ch/") + (synopsis "Interactive whiteboard for schools and universities") + (description + "OpenBoard is a teaching software for interactive whiteboard +designed primarily for use in schools and universities. It can be +used both with interactive whiteboards or in a dual-screen setup with +a pen-tablet display and a beamer.") + (license license:gpl3))) + (define-public toutenclic (package (name "toutenclic") -- 2.32.0