Subject: bug#49943: closed (Re: bug#49943: [PATCH] gnu: Add openboard)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 22 Mar 2022 20:17:01 +0000

Your bug report

#49943: [PATCH] gnu: Add openboard

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
49943: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49943
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#49943: [PATCH] gnu: Add openboard
From: Maxim Cournoyer <[email-masked]>
To: Maxime Devos <[email-masked]>
Cc: Nicolas Goaziou <[email-masked]>, [email-masked]
Date: Tue, 22 Mar 2022 16:16:50 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Maxim Cournoyer <[email-masked]> writes:

> Hi Nicolas and Maxime,
>
> Maxime Devos <[email-masked]> 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

Subject: [PATCH] gnu: Add openboard
From: Nicolas Goaziou <[email-masked]>
To: [email-masked]
Date: Sun, 08 Aug 2021 16:47:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

This patch provides openboard package definition. 

I tested it a bit, it mostly works but crashes (segmentation fault) on
some functions (e.g., when pressing the "Web" button or opening the
online tutorial). It is usable, tho.

Feedback and improvements welcome.

Regards,
-- 
Nicolas Goaziou
>From d2d2d80ccb0197eeec6a40e35e5bd05f8ce77341 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <[email-masked]>
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