diff mbox series

[bug#49943] gnu: Add openboard

Message ID 87czj02don.fsf@nicolasgoaziou.fr
State Accepted
Headers show
Series [bug#49943] gnu: Add openboard | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Nicolas Goaziou March 5, 2022, 11:16 p.m. UTC
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> So a better suggestion with the above in mind would be to package it
> using the non-released 1.7-dev development branch which relies already
> on qtwebengine instead of qtwebkit.
>
> Would you like to give it a spin?

I have put this together. It doesn't crash anymore and relies on
qtwebengine, but some parts of it (e.g., interactive activities) are not
working properly. Not sure if that's related, but I see messages like

  QIODevice::read
  (QFile,"/gnu/store/…-openboard-1.7.0-a0255/share/openboard/library/interactivities/Dice.wgt"):device
  not open

on stderr.

Anyway, I attach the new package definition.

Regards,

Comments

M March 6, 2022, 9:03 a.m. UTC | #1
Nicolas Goaziou schreef op zo 06-03-2022 om 00:16 [+0100]:
> +            (add-after 'unpack 'fix-hard-coded-env
> +              (lambda* (#:key inputs #:allow-other-keys)
> +                (substitute*
> "src/frameworks/UBPlatformUtils_linux.cpp"
> +                  (("/usr/bin/env") (search-input-file inputs
> "/bin/env")))))

You have to add 'coreutils-minimal' (or 'coreutils') to 'inputs',
otherwise 'search-input-file' will fail when cross-compiling because
'bin/env' (from 'coreutils') is not among the inputs, whereas it is in
the (implicit) native-inputs when compiling natively and native-inputs
are merged into inputs when compiling natively.

Greetings,
Maxime.
Maxim Cournoyer March 8, 2022, 4:53 a.m. UTC | #2
Hi Nicolas and Maxime,

Maxime Devos <maximedevos@telenet.be> writes:

> Nicolas Goaziou schreef op zo 06-03-2022 om 00:16 [+0100]:
>> +            (add-after 'unpack 'fix-hard-coded-env
>> +              (lambda* (#:key inputs #:allow-other-keys)
>> +                (substitute*
>> "src/frameworks/UBPlatformUtils_linux.cpp"
>> +                  (("/usr/bin/env") (search-input-file inputs
>> "/bin/env")))))
>
> You have to add 'coreutils-minimal' (or 'coreutils') to 'inputs',
> otherwise 'search-input-file' will fail when cross-compiling because
> 'bin/env' (from 'coreutils') is not among the inputs, whereas it is in
> the (implicit) native-inputs when compiling natively and native-inputs
> are merged into inputs when compiling natively.

I've tested it, and it was for the most part functional (only the
"games" add-on that I could integrate to the main screen didn't render
fully, perhaps because my WebGL support was marked as blacklisted (I use
the nouveau driver)).

LGTM, with the above comment from Maxime addressed!

Thank you!

Maxim
Maxim Cournoyer March 22, 2022, 8:16 p.m. UTC | #3
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Nicolas and Maxime,
>
> Maxime Devos <maximedevos@telenet.be> writes:
>
>> Nicolas Goaziou schreef op zo 06-03-2022 om 00:16 [+0100]:
>>> +            (add-after 'unpack 'fix-hard-coded-env
>>> +              (lambda* (#:key inputs #:allow-other-keys)
>>> +                (substitute*
>>> "src/frameworks/UBPlatformUtils_linux.cpp"
>>> +                  (("/usr/bin/env") (search-input-file inputs
>>> "/bin/env")))))
>>
>> You have to add 'coreutils-minimal' (or 'coreutils') to 'inputs',
>> otherwise 'search-input-file' will fail when cross-compiling because
>> 'bin/env' (from 'coreutils') is not among the inputs, whereas it is in
>> the (implicit) native-inputs when compiling natively and native-inputs
>> are merged into inputs when compiling natively.
>
> I've tested it, and it was for the most part functional (only the
> "games" add-on that I could integrate to the main screen didn't render
> fully, perhaps because my WebGL support was marked as blacklisted (I use
> the nouveau driver)).
>
> LGTM, with the above comment from Maxime addressed!

I went ahead and adjusted the version string to be monotonic, added
coreutils-minimal as an input, and pushed as 96b2da8cde.

Thanks,

Closing.

Maxim
diff mbox series

Patch

From 862ed34a048362c2682d82c32ea8c0ec4b2d6399 Mon Sep 17 00:00:00 2001
Message-Id: <862ed34a048362c2682d82c32ea8c0ec4b2d6399.1646522108.git.mail@nicolasgoaziou.fr>
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Sun, 6 Mar 2022 00:14:25 +0100
Subject: [PATCH v2] gnu: Add openboard.

* gnu/packages/education.scm (openboard): New variable.
---
 gnu/packages/education.scm | 126 +++++++++++++++++++++++++++++++++++++
 1 file changed, 126 insertions(+)

diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm
index 6fe79b99ca..891ffaf28b 100644
--- a/gnu/packages/education.scm
+++ b/gnu/packages/education.scm
@@ -543,6 +543,132 @@  (define-public childsplay
     (home-page "http://www.schoolsplay.org")
     (license license:gpl3+)))
 
+(define-public openboard
+  (let ((commit "3bd40ebe67c665950fffa4a7cee4943919f04add"))
+    (package
+      (name "openboard")
+      (version "1.7.0-a0255")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/OpenBoard-org/OpenBoard")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0kh2i02qgankda9ygq01bkm58fd2p6mcaddvw0ny901dg7a0qkbr"))))
+      (build-system qt-build-system)
+      (arguments
+       (list
+        #: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(\\);)" _ beg end)
+                   (string-append beg "true" end))
+                  (("(appLookForOpenSankoreInstall = .*?)true(\\);)" _ beg end)
+                   (string-append beg "false" end)))))
+            (add-after 'unpack 'fix-build-error
+              ;; XXX: `errorOpeningVirtualKeyboard' variable is only
+              ;; defined when building for OSX.  Yet,
+              ;; "UBBoardController.cpp" relies on it unconditionally,
+              ;; resulting in a build failure.  Here, we get rid of
+              ;; that variable, assuming it is always false (its
+              ;; default value when building for OSX).
+              (lambda _
+                (substitute* "src/board/UBBoardController.cpp"
+                  (("if \\(!UBPlatformUtils::errorOpeningVirtualKeyboard\\)")
+                   ""))))
+            (add-after 'unpack 'fix-hard-coded-env
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "src/frameworks/UBPlatformUtils_linux.cpp"
+                  (("/usr/bin/env") (search-input-file inputs "/bin/env")))))
+            (add-after 'unpack 'fix-library-path
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "OpenBoard.pro"
+                  (("/usr/include/quazip")
+                   (search-input-directory inputs "/include/quazip5"))
+                  (("/usr/include/poppler")
+                   (search-input-directory inputs "/include/poppler")))))
+            (replace 'configure
+              (lambda _
+                (invoke "qmake" "OpenBoard.pro")))
+            (replace 'install
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let* ((share (string-append #$output "/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 #$output "/bin")))
+                    (mkdir-p bin)
+                    (symlink (string-append openboard "/OpenBoard")
+                             (string-append bin "/openboard")))))))))
+      (native-inputs
+       (list qttools))
+      (inputs
+       (list alsa-lib
+             ffmpeg
+             freetype
+             lame
+             libass
+             libfdk
+             libressl
+             libtheora
+             libva
+             libvorbis
+             libvpx
+             libx264
+             opus
+             poppler
+             qtbase-5
+             qtdeclarative
+             qtmultimedia
+             qtsvg
+             qtwebchannel
+             qtwebengine
+             qtxmlpatterns
+             quazip-0
+             sdl
+             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 omnitux
   (package
     (name "omnitux")
-- 
2.34.0