diff mbox series

[bug#47274] Linphone Packages

Message ID cf75f6a8-fd76-cb05-0a46-903de3e882f6@raghavgururajan.name
State Accepted
Headers show
Series [bug#47274] Linphone Packages | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Raghav Gururajan March 22, 2021, 4:44 a.m. UTC
Hello Guix!

> HELP! The app crashes upon launch.

Fixed it in the attached patch-set. The app works now. \o/

Anyway, I think we can do something for the following, w.r.t 
linphone-desktop:
[1] Warnings. Fixing them might prevent them to become errors.
[2] Better solution than symlinks in 'post-install phase. Because 
linphone-desktop should be able to read files in /lib and /share of 
*all* of its dependencies. Not just for those we made symlinks for, 
which is a temporary fix.

Regarding [1], for one of the warnings, I tried creating symlink 
"{linphone-desktop}/lib" --> "{liblinphone}/lib", which worked. But is 
it the correct way?
Regarding [2], I tried wrapping the program with XDG_DATA_DIRS, but 
didn't work.

Regards,
RG.

Comments

Raghav Gururajan March 22, 2021, 4:59 a.m. UTC | #1
Hello Guix!

> Fixed it in the attached patch-set. The app works now. \o/

Spoke too soon. :/

New error now.

> Anyway, I think we can do something for the following, w.r.t 
> linphone-desktop:
> [1] Warnings. Fixing them might prevent them to become errors.
> [2] Better solution than symlinks in 'post-install phase. Because 
> linphone-desktop should be able to read files in /lib and /share of 
> *all* of its dependencies. Not just for those we made symlinks for, 
> which is a temporary fix.
> 
> Regarding [1], for one of the warnings, I tried creating symlink 
> "{linphone-desktop}/lib" --> "{liblinphone}/lib", which worked. But is 
> it the correct way?
> Regarding [2], I tried wrapping the program with XDG_DATA_DIRS, but 
> didn't work.

Looks like we need to do something about the [2]. The new error is 
because of that. I can fix this new error with another symlink, but new 
ones will keep happening.

Context:
The old error that I mentioned and fixed in my previous email is, 
"[Error]Core:linphone: Could not load grammar vcard_grammar because the 
file could not be located.".
The new error I am mentioning in this email is, "[Error]Core:linphone: 
Could not load grammar identity_grammar because the file could not be 
located."

Regards,
RG.
Maxim Cournoyer March 24, 2021, 4:12 a.m. UTC | #2
Hi again,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> From 4b03df1e5abf22da27c65e1f22ffe4be65377d29 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Sat, 13 Mar 2021 12:04:37 -0500
> Subject: [PATCH 02/53] gnu: bcunit: Update to 3.0.2-13.
>
> * gnu/packages/linphone.scm (bcunit) [source]: Switch to git repository.

Nitpick: there should be no space between (bcunit) and [source].

> [version]: Update to 3.0.2-13.
> [native-inputs]: Add perl.
> ---
>  gnu/packages/linphone.scm | 30 ++++++++++++++++++------------
>  1 file changed, 18 insertions(+), 12 deletions(-)
>
> diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
> index afa542412f..6d243d2073 100644
> --- a/gnu/packages/linphone.scm
> +++ b/gnu/packages/linphone.scm
> @@ -35,6 +35,7 @@
>    #:use-module (gnu packages gtk)
>    #:use-module (gnu packages image)
>    #:use-module (gnu packages linux)
> +  #:use-module (gnu packages perl)
>    #:use-module (gnu packages pulseaudio)
>    #:use-module (gnu packages python)
>    #:use-module (gnu packages python-xyz)
> @@ -57,28 +58,33 @@
>    #:use-module (guix build-system gnu))
>
>  (define-public bcunit
> -  (package
> -    (name "bcunit")
> -    (version "3.0.2")
> -    (source
> -     (origin
> -       (method url-fetch)
> -       (uri
> -        (string-append "https://www.linphone.org/releases/sources/" name
> -                       "/" name "-" version ".tar.gz"))
> -       (sha256
> -        (base32 "0ylchj8w98ic2fkqpxc6yk4s6s0h0ql2zsz5n49jd7126m4h8dqk"))))
> +  (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae")
> +        (revision "13"))

When not using an official release, a comment is in order to mention the
reason; in this case something like: "Use the latest commit as there
hasn't been a release in nearly 4 years." :-).

Also, why start the revision number at 13?  Perhaps the number of
commits since the last tagged release?  It's a detail, but since there
was no revision used before for this package, I'd expect it to start at
0.

> +    (package
> +      (name "bcunit")
> +      (version (git-version "3.0.2" revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "git://git.linphone.org/bcunit")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b"))))
>      (build-system cmake-build-system)
>      (arguments
>       '(#:tests? #f                      ; No test target
>         #:configure-flags
>         (list "-DENABLE_STATIC=NO")))    ; Not required
> +    (native-inputs
> +     `(("perl" ,perl)))

Seems Perl is not actually needed.

>      (synopsis "Belledonne Communications Unit Testing Framework")
>      (description "BCUnit is a fork of the defunct project CUnit, with several
>  fixes and patches applied.  It is an unit testing framework for writing,
                                     ^ a

>  administering, and running unit tests in C.")
>      (home-page "https://gitlab.linphone.org/BC/public/bcunit")
> -    (license license:lgpl2.0+)))
> +    (license license:lgpl2.0+))))
>
>  (define-public bctoolbox
>    (package

I ended up squashing all the bcunit changes in one, as I found it a bit
too micro to manage.

I've edited the result slightly, mostly taking out #t, the examples
output (examples are doc after all):

--8<---------------cut here---------------start------------->8---
1 file changed, 18 insertions(+), 26 deletions(-)
gnu/packages/linphone.scm | 44 ++++++++++++++++++--------------------------

modified   gnu/packages/linphone.scm
@@ -60,7 +60,7 @@
 
 (define-public bcunit
   (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae")
-        (revision "13"))
+        (revision "0"))
     (package
       (name "bcunit")
       (version (git-version "3.0.2" revision commit))
@@ -74,16 +74,14 @@
          (sha256
           (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b"))))
       (build-system cmake-build-system)
-      (outputs '("out" "doc" "example"))
+      (outputs '("out" "doc"))
       (arguments
-       `(#:configure-flags
-         (list
-          "-DENABLE_STATIC=NO"
-          "-DENABLE_CURSES=ON"
-          "-DENABLE_DOC=ON"
-          "-DENABLE_EXAMPLES=ON"
-          "-DENABLE_TEST=ON"
-          "-DENABLE_MEMTRACE=ON")
+       `(#:configure-flags (list "-DENABLE_STATIC=NO"
+                                 "-DENABLE_CURSES=ON"
+                                 "-DENABLE_DOC=ON"
+                                 "-DENABLE_EXAMPLES=ON"
+                                 "-DENABLE_TEST=ON"
+                                 "-DENABLE_MEMTRACE=ON")
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'patch-source
@@ -99,36 +97,30 @@
                  (("target_include_directories\\(bcunit_test PUBLIC Test\\)")
                   (string-append
                    "target_include_directories(bcunit_test PUBLIC Test)\n"
-                   "target_link_libraries(bcunit_test bcunit)")))
-               #t))
+                   "target_link_libraries(bcunit_test bcunit)")))))
            (replace 'check
              (lambda _
                (with-directory-excursion "BCUnit/Sources/Test"
-                 (invoke "./test_bcunit"))
-               #t))
-           (add-after 'install 'seperate-outputs
+                 (invoke "./test_bcunit"))))
+           (add-after 'install 'move-doc
              (lambda* (#:key outputs #:allow-other-keys)
-               (let* ((out (assoc-ref outputs "out"))
-                      (doc (assoc-ref outputs "doc"))
-                      (example (assoc-ref outputs "example")))
+               (let ((out (assoc-ref outputs "out"))
+                     (doc (assoc-ref outputs "doc")))
                  (for-each mkdir-p
                            `(,(string-append doc "/share/doc")
-                             ,(string-append example "/share/BCUnit")))
+                             ,(string-append doc "/share/BCUnit")))
                  (rename-file
                   (string-append out "/share/doc/BCUnit")
                   (string-append doc "/share/doc/BCUnit"))
                  (rename-file
                   (string-append out "/share/BCUnit/Examples")
-                  (string-append example "/share/BCUnit/Examples")))
-               #t)))))
-      (native-inputs
-       `(("perl" ,perl)))
+                  (string-append doc "/share/BCUnit/Examples"))))))))
       (inputs
        `(("ncurses" ,ncurses)))
       (synopsis "Belledonne Communications Unit Testing Framework")
-      (description "BCUnit is a fork of the defunct project CUnit, with several
-fixes and patches applied.  It is an unit testing framework for writing,
-administering, and running unit tests in C.")
+      (description "BCUnit is a fork of the defunct project CUnit, with
+several fixes and patches applied.  It is a unit testing framework for
+writing, administering, and running unit tests in C.")
       (home-page "https://gitlab.linphone.org/BC/public/bcunit")
       (license license:lgpl2.0+))))
--8<---------------cut here---------------end--------------->8---

I've also "normalized" the commit message in a way that I think is more
typical.  Arguments such as phases, configure-flags, and such are
typically enclosed in a conditional marker (square brakets); e.g.:

--8<---------------cut here---------------start------------->8---
gnu: bcunit: Update to 3.0.2-0.74021cc and enable more features.

* gnu/packages/linphone.scm (bcunit)[source]: Switch to git repository.
[version]: Update to 3.0.2-0.74021cc.
[outputs]: Add a "doc" output.
[arguments]: Remove the tests? argument, enabling tests.
[configure-flags]: Enable curses, doc, examples, tests and memtrace.
[phases]{patch-source, move-doc}: New phases.
{check}: Override phase.
[inputs]: Add ncurses.
[description]: Fix typo.
--8<---------------cut here---------------end--------------->8---

That's all very subjective, but hoping you get a feel :-).

After having verified that bcunit's dependent packages could still be
built fine and testing the resulting linphoneqt, I've pushed the
squashed bcunit series as commit c2a9b05f02.

Thank you!

Maxim
Maxim Cournoyer March 25, 2021, 1:07 p.m. UTC | #3
Hi Raghav,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> * gnu/packages/linphone.scm (ortp) [outputs]: New output "test".
> [arguments]<#:configure-flag>[-DENABLE_TESTS]: New flag.
> <#:phases>['seperate-outputs]: Modify.
> ---
>  gnu/packages/linphone.scm | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
> index 3273df02c2..98209ee982 100644
> --- a/gnu/packages/linphone.scm
> +++ b/gnu/packages/linphone.scm
> @@ -403,23 +403,30 @@ such as conferencing.")
>         (sha256
>          (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
>      (build-system cmake-build-system)
> -    (outputs '("out" "doc"))
> +    (outputs '("out" "doc" "test"))
>      (arguments
> -     `(#:tests? #f                      ; No test target
> +     `(#:tests? #f                      ; Require networking
>         #:configure-flags
>         (list
> -        "-DENABLE_STATIC=NO")
> +        "-DENABLE_STATIC=NO"
> +        "-DENABLE_TESTS=YES")
>         #:phases
>         (modify-phases %standard-phases
>           (add-after 'install 'seperate-outputs
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let* ((out (assoc-ref outputs "out"))
>                      (doc (assoc-ref outputs "doc"))
> -                    (doc-name (string-append ,name "-4.4.0")))
> -               (mkdir-p (string-append doc "/share/doc"))
> +                    (doc-name (string-append ,name "-4.4.0"))
> +                    (test (assoc-ref outputs "test")))
> +               (for-each mkdir-p
> +                         `(,(string-append doc "/share/doc")
> +                           ,(string-append test "/bin")))
>                 (rename-file
>                  (string-append out "/share/doc/" doc-name)
> -                (string-append doc "/share/doc/" doc-name)))
> +                (string-append doc "/share/doc/" doc-name))
> +               (rename-file
> +                (string-append out "/bin")
> +                (string-append test "/bin")))
>               #t)))))
>      (native-inputs
>       `(("dot" ,graphviz)
> -- 
> 2.31.0
>
> From 89e071f57db2da8deed0c19e722e8eec35b509a1 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Mon, 15 Mar 2021 22:19:47 -0400
> Subject: [PATCH 20/53] gnu: ortp: Seperate outputs.
>
> * gnu/packages/linphone.scm (ortp) [outputs]: New output "doc".
> [arguments]<#:phases>['seperate-outputs]: New phase.
> ---
>  gnu/packages/linphone.scm | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
> index fbe9d81d58..3273df02c2 100644
> --- a/gnu/packages/linphone.scm
> +++ b/gnu/packages/linphone.scm
> @@ -403,10 +403,24 @@ such as conferencing.")
>         (sha256
>          (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
>      (build-system cmake-build-system)
> +    (outputs '("out" "doc"))
>      (arguments
>       `(#:tests? #f                      ; No test target
>         #:configure-flags
> -       (list "-DENABLE_STATIC=NO")))    ; Not required
> +       (list
> +        "-DENABLE_STATIC=NO")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'install 'seperate-outputs
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (doc (assoc-ref outputs "doc"))
> +                    (doc-name (string-append ,name "-4.4.0")))
> +               (mkdir-p (string-append doc "/share/doc"))
> +               (rename-file
> +                (string-append out "/share/doc/" doc-name)
> +                (string-append doc "/share/doc/" doc-name)))
> +             #t)))))
>      (native-inputs
>       `(("dot" ,graphviz)
>         ("doxygen" ,doxygen)))
> -- 
> 2.31.0
>
> From aa8b9dbcca306c55bfd8335d8a8ee933cfa60654 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Mon, 15 Mar 2021 22:09:07 -0400
> Subject: [PATCH 19/53] gnu: ortp: Update to 4.4.34.
>
> * gnu/packages/linphone.scm (ortp) [source]: Switch to git repository.
> [version]: Update to 4.4.34.
> ---
>  gnu/packages/linphone.scm | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
> index f1bcae1208..fbe9d81d58 100644
> --- a/gnu/packages/linphone.scm
> +++ b/gnu/packages/linphone.scm
> @@ -392,15 +392,16 @@ such as conferencing.")
>  (define-public ortp
>    (package
>      (name "ortp")
> -    (version "1.0.2")
> +    (version "4.4.34")
>      (source
>       (origin
> -       (method url-fetch)
> -       (uri
> -        (string-append "https://www.linphone.org/releases/sources/" name
> -                       "/" name "-" version ".tar.gz"))
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "git://git.linphone.org/ortp")
> +             (commit version)))
> +       (file-name (git-file-name name version))
>         (sha256
> -        (base32 "016qg0lmdgmqh2kv19w9qhi4kkiyi5h1xp35g2s65b1j8ccm25d5"))))
> +        (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
>      (build-system cmake-build-system)
>      (arguments
>       `(#:tests? #f                      ; No test target

I suggest squashing these into one patch like this:

--8<---------------cut here---------------start------------->8---
1 file changed, 13 insertions(+), 17 deletions(-)
gnu/packages/linphone.scm | 30 +++++++++++++-----------------

modified   gnu/packages/linphone.scm
@@ -363,15 +363,15 @@ such as conferencing.")
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "git://git.linphone.org/ortp")
+             (url "https://gitlab.linphone.org/BC/public/ortp")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
         (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
     (build-system cmake-build-system)
-    (outputs '("out" "doc" "test"))
+    (outputs '("out" "doc" "tester"))
     (arguments
-     `(#:tests? #f                      ; Require networking
+     `(#:tests? #f                      ;requires networking
        #:configure-flags
        (list
         "-DENABLE_STATIC=NO"
@@ -380,20 +380,16 @@ such as conferencing.")
        (modify-phases %standard-phases
          (add-after 'install 'seperate-outputs
            (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (doc (assoc-ref outputs "doc"))
-                    (doc-name (string-append ,name "-4.4.0"))
-                    (test (assoc-ref outputs "test")))
-               (for-each mkdir-p
-                         `(,(string-append doc "/share/doc")
-                           ,(string-append test "/bin")))
-               (rename-file
-                (string-append out "/share/doc/" doc-name)
-                (string-append doc "/share/doc/" doc-name))
-               (rename-file
-                (string-append out "/bin")
-                (string-append test "/bin")))
-             #t)))))
+             (let ((out (assoc-ref outputs "out"))
+                   (doc (assoc-ref outputs "doc"))
+                   (doc-name (string-append ,name "-4.4.0"))
+                   (tester (assoc-ref outputs "tester")))
+               (for-each mkdir-p (list (string-append doc "/share/doc")
+                                       (string-append test "/bin")))
+               (rename-file (string-append out "/share/doc/" doc-name)
+                            (string-append doc "/share/doc/" doc-name))
+               (rename-file (string-append out "/bin")
+                            (string-append tester "/bin"))))))))
     (native-inputs
      `(("dot" ,graphviz)
        ("doxygen" ,doxygen)))
--8<---------------cut here---------------end--------------->8---

Was there a reason to version the doc using the hard-coded 4.4.0 version
string rather than the package version?

Thanks,

Maxim
Maxim Cournoyer March 27, 2021, 2:13 a.m. UTC | #4
Hi, 
> From c9e23524c79159f78e4c4738cad9544cfe3ac1ce Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Tue, 16 Mar 2021 15:51:11 -0400
> Subject: [PATCH 30/53] gnu: mediastreamer2: Update to 4.4.34.
>
> * gnu/packages/linphone.scm (mediastreamer2) [source]: Switch to git repository.
> [version]: Update to 4.4.34.
> [patches]: Remove field.
> [outputs]: Rename "tester" to "test".
> [arguments]<#:configure-flags>[-DENABLE_STRICT]: Remove flag.
> [-DENABLE_BV16]: Remove flag.
> [-DCMAKE_C_FLAGS]: Remove flag.
> [-DCMAKE_CXX_FLAGS]: Remove flag.
> <#:phases>['separate-outputs]: Modify.
> [native-inputs]: Replace python with python-wrapper.
> * gnu/packages/patches/mediastreamer2-srtp2.patch: Remove file.
> * gnu/local.mk (dist_patch_DATA): Remove it.
> ---
>  gnu/local.mk                                  |   1 -
>  gnu/packages/linphone.scm                     |  62 ++++---
>  .../patches/mediastreamer2-srtp2.patch        | 155 ------------------
>  3 files changed, 28 insertions(+), 190 deletions(-)
>  delete mode 100644 gnu/packages/patches/mediastreamer2-srtp2.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 3d4147a879..5a69518923 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1391,7 +1391,6 @@ dist_patch_DATA =						\
>    %D%/packages/patches/mcrypt-CVE-2012-4527.patch			\
>    %D%/packages/patches/libmemcached-build-with-gcc7.patch	\
>    %D%/packages/patches/libmhash-hmac-fix-uaf.patch		\
> -  %D%/packages/patches/mediastreamer2-srtp2.patch		\
>    %D%/packages/patches/mesa-skip-tests.patch			\
>    %D%/packages/patches/mescc-tools-boot.patch			\
>    %D%/packages/patches/meson-for-build-rpath.patch		\
> diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
> index e573e71932..025fd90c46 100644
> --- a/gnu/packages/linphone.scm
> +++ b/gnu/packages/linphone.scm
> @@ -569,56 +569,50 @@ API.  It also comprises a simple HTTP/HTTPS client implementation.")
>  (define-public mediastreamer2
>    (package
>      (name "mediastreamer2")
> -    (version "2.16.1")
> +    (version "4.4.34")
>      (source
>       (origin
> -       (method url-fetch)
> -       (uri
> -        (string-append "https://www.linphone.org/releases/sources/"
> -                       "mediastreamer/mediastreamer-" version ".tar.gz"))
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "git://git.linphone.org/mediastreamer2")
> +             (commit version)))
> +       (file-name (git-file-name name version))
>         (sha256
> -        (base32 "0whpqr69wz0pnzvragkpfblxhd0rds8k06c3mw5a0ag216a1yd9k"))
> -       (patches (search-patches "mediastreamer2-srtp2.patch"))))
> -    (outputs '("out" "doc" "tester"))
> +        (base32 "0989h3d0h7qrx4kjx8gg09j8c5hvvi3h8qi1iq1dqbppwbaxbz8c"))))
> +    (outputs '("out" "doc" "test"))

The change of the output name from tester to test seems arbitrary :-).
I'd argue that "tester" makes more sense as this outputs contains a
tester binary or command rather than a test suite.

>      (build-system cmake-build-system)
>      (arguments
>       `(#:tests? #f                      ; No test target
>         #:configure-flags
> -       (list "-DENABLE_STATIC=NO"      ; Not required
> -             "-DENABLE_STRICT=NO"      ; Would otherwise treat warnings as err
> -             "-DENABLE_BV16=NO"        ; Not available
> -             "-DCMAKE_C_FLAGS=-DMS2_GIT_VERSION=\\\"unknown\\\""
> -             "-DCMAKE_CXX_FLAGS=-DMS2_GIT_VERSION=\\\"unknown\\\"")
> +       (list
> +        "-DENABLE_STATIC=NO")
>         #:phases
>         (modify-phases %standard-phases
>           (add-after 'install 'separate-outputs
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let* ((out (assoc-ref outputs "out"))
> +                    (test (assoc-ref outputs "test"))
> +                    (test-name (string-append ,name "_tester"))
>                      (doc (assoc-ref outputs "doc"))
> -                    (tester (assoc-ref outputs "tester"))
> -                    (tester-name (string-append ,name "_tester")))
> -               ;; Copy the tester executable.

While it may seem obvious, I believe the comments helped the human brain
keep track of the process flow more cheaply; please don't remove them.

> -               (mkdir-p (string-append tester "/bin"))
> -               (rename-file (string-append out "/bin/" tester-name)
> -                            (string-append tester "/bin/" tester-name))
> -               ;; Copy the tester data files.
> -               (copy-recursively (string-append out "/share/" tester-name)
> -                                 (string-append tester "/share/" tester-name))
> -               (delete-file-recursively (string-append out "/share/"
> -                                                       tester-name))
> -               ;; Copy the HTML documentation.
> -               (copy-recursively (string-append out "/share/doc/"
> -                                                ,name "-" ,version "/html")
> -                                 (string-append doc "/share/doc/"
> -                                                ,name "-" ,version "/html"))
> -               (delete-file-recursively (string-append out "/share/doc/"
> -                                                       ,name "-" ,version
> -                                                       "/html"))
> -               #t))))))
> +                    (doc-name (string-append ,name "-4.4.0")))
> +               (for-each mkdir-p
> +                         `(,(string-append test "/bin")
> +                           ,(string-append test "/share")
> +                           ,(string-append doc "/share/doc")))
> +               (rename-file
> +                (string-append out "/bin/" test-name)
> +                (string-append test "/bin/" test-name))
> +               (rename-file
> +                (string-append out "/share/" test-name)
> +                (string-append test "/share/" test-name))
> +               (rename-file
> +                (string-append out "/share/doc/" doc-name)
> +                (string-append doc "/share/doc/" doc-name)))
> +             #t)))))
>      (native-inputs
>       `(("dot" ,graphviz)
>         ("doxygen" ,doxygen)
> -       ("python" ,python)))
> +       ("python" ,python-wrapper)))
>      (inputs
>       `(("alsa" ,alsa-lib)
>         ("bcg729" ,bcg729)

I've squashed this one with the home page update and license change, as
they are small and are related to the update.

I still there's still stuff depending on this to be reviewed before it
can be pushed, so I'm amassing a stack here... please be patient :-)

Thank you,

Maxim
Maxim Cournoyer March 27, 2021, 5:05 a.m. UTC | #5
Raghav Gururajan <rg@raghavgururajan.name> writes:

> Headers of soci has include-references to headers of these inputs.

This explanation would be better kept as a comment in the code :-).

> * gnu/packages/databases.scm (soci) [inputs]: Move to ...
> [propagated-inputs]: ... here.
> ---
>  gnu/packages/databases.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
> index 8be83f5cbe..76eb2357ef 100644
> --- a/gnu/packages/databases.scm
> +++ b/gnu/packages/databases.scm
> @@ -3777,7 +3777,7 @@ The drivers officially supported by @code{libdbi} are:
>                 (base32
>                  "14x2gjblkgpflv75wl144cyjp1sis5rbxnr9r2gj3yw16v2av0bp"))))
>      (build-system cmake-build-system)
> -    (inputs
> +    (propagated-inputs
>       `(("firebird" ,firebird)
>         ("postgresql" ,postgresql)
>         ("sqlite" ,sqlite)

Otherwise LGTM.
Maxim Cournoyer March 27, 2021, 5:11 a.m. UTC | #6
Hi,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> * gnu/packages/codesynthesis.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/codesythesis.scm (build): New variable.

Why create a new module for this?  We already have (gnu packages
build-tools), which seem a good home.

Maxim
Maxim Cournoyer March 28, 2021, 12:52 a.m. UTC | #7
Hello,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> From 2c1e262e549b928a624513e2c91b059b88b8e822 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Thu, 18 Mar 2021 14:33:34 -0400
> Subject: [PATCH 41/53] gnu: Add cli.
>
> * gnu/packages/codesynthesis.scm (cli): New variable.
> ---
>  gnu/packages/codesynthesis.scm | 45 ++++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>
> diff --git a/gnu/packages/codesynthesis.scm b/gnu/packages/codesynthesis.scm
> index f24fb760de..b70e53cd7c 100644
> --- a/gnu/packages/codesynthesis.scm
> +++ b/gnu/packages/codesynthesis.scm
> @@ -151,3 +151,48 @@ XML Schema definition language.  It includes a parser, semantic graph types and
>  a traversal mechanism.")
>      (home-page "https://www.codesynthesis.com/projects/libxsd-frontend/")
>      (license license:gpl2+)))
> +
> +(define-public cli
> +  (package
> +    (name "cli")
> +    (version "1.1.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://www.codesynthesis.com/download/"
> +                           "cli/" (version-major+minor version)
> +                           "/cli-" version ".tar.bz2"))
> +       (sha256
> +        (base32 "0bg0nsai2q4h3mldpnj0jz4iy4svs0bcfvmq0v0c9cdyknny606g"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:test-target "test"
> +       #:make-flags
> +       (list
> +        (string-append "install_prefix=" (assoc-ref %outputs "out")))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch
> +           (lambda _
> +             (substitute* (find-files "." "\\.make$")
> +               (("build-0\\.3")
> +                (string-append (assoc-ref %build-inputs "build")
> +                               "/include/build-0.3")))
> +             (substitute* (find-files "." "\\.?xx$")
> +               (("add \\(typeid \\(type\\), \\*this\\);")
> +                "traverser_map<B>::add (typeid (type), *this);")
> +               (("iterate_and_dispatch \\(s\\.names_begin \\(\\), s\\.names_end \\(\\), d\\);")
> +                "edge_dispatcher::iterate_and_dispatch (s.names_begin (), s.names_end (), d);"))
> +             #t))

What is the above substitution for?  A comment would be helpful!

Thanks,

Maxim
Raghav Gururajan March 28, 2021, 4:05 a.m. UTC | #8
Hi Maxim!

> Why create a new module for this?  We already have (gnu packages
> build-tools), which seem a good home.

The idea is similar to suckless.scm and linphone.scm. This project has 
produce multiple software, which are often inter-connected and/or 
inter-dependent. So created dedicated module for this project 'Code 
Synthesis'.

Also, I will be adding more of their packages to this module.

Regards,
RG.
Maxim Cournoyer March 28, 2021, 4:43 a.m. UTC | #9
Hello Raghav,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> Hi Maxim!
>
>> Why create a new module for this?  We already have (gnu packages
>> build-tools), which seem a good home.
>
> The idea is similar to suckless.scm and linphone.scm. This project has
> produce multiple software, which are often inter-connected and/or 
> inter-dependent. So created dedicated module for this project 'Code
> Synthesis'.
>
> Also, I will be adding more of their packages to this module.
>
> Regards,
> RG.

OK, thanks for the answer.

As I've answered on IRC, so far, the (gnu packgaes cpp) module seems
sufficient; it's a relatively small module itself.  The problem I see
with having codesynthesis as a module is that it'd be misleading as a
module name: not all their tools are about code synthesis (that's their
company name, but that's not obvious!  I got confused that way when
first looking at your patch series).

I've merged the codesynthesis packgaes in the cpp module already; if it
becomes a problem we can revisit this choice.

Thank you,

Maxim
Maxim Cournoyer March 29, 2021, 4:03 a.m. UTC | #10
Hi Raghav!

Raghav Gururajan <rg@raghavgururajan.name> writes:

> Hello Guix!
>
>> Fixed it in the attached patch-set. The app works now. \o/
>
> Spoke too soon. :/
>
> New error now.
>
>> Anyway, I think we can do something for the following, w.r.t
>> linphone-desktop:
>> [1] Warnings. Fixing them might prevent them to become errors.
>> [2] Better solution than symlinks in 'post-install phase. Because
>> linphone-desktop should be able to read files in /lib and /share of 
>> *all* of its dependencies. Not just for those we made symlinks for,
>> which is a temporary fix.
>> Regarding [1], for one of the warnings, I tried creating symlink 
>> "{linphone-desktop}/lib" --> "{liblinphone}/lib", which worked. But
>> is it the correct way?
>> Regarding [2], I tried wrapping the program with XDG_DATA_DIRS, but
>> didn't work.
>
> Looks like we need to do something about the [2]. The new error is
> because of that. I can fix this new error with another symlink, but
> new ones will keep happening.
>
> Context:
> The old error that I mentioned and fixed in my previous email is,
> "[Error]Core:linphone: Could not load grammar vcard_grammar because
> the file could not be located.".
> The new error I am mentioning in this email is, "[Error]Core:linphone:
> Could not load grammar identity_grammar because the file could not be 
> located."
>
> Regards,
> RG.

I think I've managed to fix the issue, with the following:

--8<---------------cut here---------------start------------->8---
 (let* ((out (assoc-ref outputs "out"))
                    (liblinphone (assoc-ref inputs "liblinphone"))
                    (grammar-dest (string-append out
                    "/share/belr/grammars")))
               [...]     
               (mkdir-p (dirname grammar-dest))
               (symlink (string-append liblinphone "/share/belr/grammars")
                        grammar-dest)
--8<---------------cut here---------------end--------------->8---

At least it launches now, and everything seems to work.

Will submit it soon!

Thank you :-)

Maxim
Raghav Gururajan March 29, 2021, 5:16 a.m. UTC | #11
Hi Maxim!

> I suggest squashing these into one patch like this:

Cool.

> Was there a reason to version the doc using the hard-coded 4.4.0 version
> string rather than the package version?

This package used the version-series (4.4.0), instead of version-string 
(4.4.X).

Regards,
RG.
Maxim Cournoyer March 29, 2021, 5:44 a.m. UTC | #12
Hi Raghav,

I've pushed the last 4 commits with a99932503e along the previous
reviewed ones to master, after checking that every dependents could
build fine.

Thanks again!

Closing.

Maxim
Raghav Gururajan March 29, 2021, 5:52 a.m. UTC | #13
Hi Maxim!

> The change of the output name from tester to test seems arbitrary :-).
> I'd argue that "tester" makes more sense as this outputs contains a
> tester binary or command rather than a test suite.

Agreed, as we discussed this in IRC.

> While it may seem obvious, I believe the comments helped the human brain
> keep track of the process flow more cheaply; please don't remove them.

Oops. sorry about that.

> I've squashed this one with the home page update and license change, as
> they are small and are related to the update.

Thanks!

Regards,
RG.
Raghav Gururajan March 29, 2021, 5:53 a.m. UTC | #14
Hi Maxim!

>> Headers of soci has include-references to headers of these inputs.
> 
> This explanation would be better kept as a comment in the code :-).

Agreed.

Regards,
RG.
Raghav Gururajan March 29, 2021, 5:53 a.m. UTC | #15
Hi Maxim!

> Why create a new module for this?  We already have (gnu packages
> build-tools), which seem a good home.

Agreed, as we discussed this in IRC.

Regards,
RG.
Raghav Gururajan March 29, 2021, 5:55 a.m. UTC | #16
Hi Maxim!

> What is the above substitution for?  A comment would be helpful!

It is for gcc 7+ and its related C++ standard support. The code was 
initially written for gcc 4.

Regards,
RG.
Raghav Gururajan March 29, 2021, 6:02 a.m. UTC | #17
Hi Maxim!

> As I've answered on IRC, so far, the (gnu packgaes cpp) module seems
> sufficient; it's a relatively small module itself.  The problem I see
> with having codesynthesis as a module is that it'd be misleading as a
> module name: not all their tools are about code synthesis (that's their
> company name, but that's not obvious!  I got confused that way when
> first looking at your patch series).

Agreed.

> I've merged the codesynthesis packgaes in the cpp module already; if it
> becomes a problem we can revisit this choice.

Sounds good.

Regards,
RG.
Raghav Gururajan March 29, 2021, 6:05 a.m. UTC | #18
Hi Maxim!

> I think I've managed to fix the issue, with the following:
> 
> --8<---------------cut here---------------start------------->8---
>   (let* ((out (assoc-ref outputs "out"))
>                      (liblinphone (assoc-ref inputs "liblinphone"))
>                      (grammar-dest (string-append out
>                      "/share/belr/grammars")))
>                 [...]
>                 (mkdir-p (dirname grammar-dest))
>                 (symlink (string-append liblinphone "/share/belr/grammars")
>                          grammar-dest)
> --8<---------------cut here---------------end--------------->8---
> 
> At least it launches now, and everything seems to work.

Thanks a lot. Btw, did you try restarting the app multiple-times? 
Different error (missing /share/stuff) popped-up, each time.

I also wonder why wrapping XDG_DATA_DIRS doesn't work, as it will give 
access to {all-inputs}/share/stuff.

Regards,
RG.
Raghav Gururajan March 29, 2021, 6:13 a.m. UTC | #19
Hi Maxim!

> Thanks again!
> 
> Closing.

Couldn't have done it without you.

Regards,
RG.
Maxim Cournoyer March 29, 2021, 6:38 p.m. UTC | #20
Hi Raghav,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> Hi Maxim!
>
>> I think I've managed to fix the issue, with the following:
>> --8<---------------cut here---------------start------------->8---
>>   (let* ((out (assoc-ref outputs "out"))
>>                      (liblinphone (assoc-ref inputs "liblinphone"))
>>                      (grammar-dest (string-append out
>>                      "/share/belr/grammars")))
>>                 [...]
>>                 (mkdir-p (dirname grammar-dest))
>>                 (symlink (string-append liblinphone "/share/belr/grammars")
>>                          grammar-dest)
>> --8<---------------cut here---------------end--------------->8---
>> At least it launches now, and everything seems to work.
>
> Thanks a lot. Btw, did you try restarting the app multiple-times?
> Different error (missing /share/stuff) popped-up, each time.

Yes! Both running the binary directly from the store or in a pure
environment, multiple times have worked after the above change.  Do you
experience failures still?

Maxim
Maxim Cournoyer March 29, 2021, 6:39 p.m. UTC | #21
Hi Raghav,

Raghav Gururajan <rg@raghavgururajan.name> writes:

> Hi Maxim!
>
>> Thanks again!
>> Closing.
>
> Couldn't have done it without you.

Thanks for taking the time to reply to each email, eh!

Have a great week,

Maxim
diff mbox series

Patch

From ff594dc1c83cdb6dd5661b03fbefe890d82b3e44 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <rg@raghavgururajan.name>
Date: Sat, 20 Mar 2021 00:01:26 -0400
Subject: [PATCH 53/53] gnu: msamr: Update to 1.1.3-11.

* gnu/packages/linphone.scm (msamr) [source]: Switch to git repository.
[version]: Update to 1.1.3-11.
[inputs]: Add bctoolbox.
---
 gnu/packages/linphone.scm | 56 +++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/linphone.scm b/gnu/packages/linphone.scm
index 11d4a3343e..042cbec601 100644
--- a/gnu/packages/linphone.scm
+++ b/gnu/packages/linphone.scm
@@ -1018,30 +1018,34 @@  WebRTC codec.  It includes features from WebRTC, such as, iSAC and AECM.")
       (license license:gpl2+))))
 
 (define-public msamr
-  (package
-    (name "msamr")
-    (version "1.1.3")
-    (source
-     (origin
-       (method url-fetch)
-       (uri
-        (string-append "https://www.linphone.org/releases/sources/plugins/"
-                       name "/" name "-" version ".tar.gz"))
-       (sha256
-        (base32 "16c9f3z4wnj73k7y8gb0fgpr4axsm7b5zrbjvy8vsgz9gyg3agm5"))))
-    (build-system cmake-build-system)
-    (arguments
-     `(#:tests? #f                      ; No test target
-       #:configure-flags
-       (list "-DENABLE_STATIC=NO"       ; Not required
-             "-DENABLE_WIDEBAND=YES")))
-    (inputs
-     `(("mediastreamer2" ,mediastreamer2)
-       ("opencoreamr" ,opencore-amr)
-       ("ortp" ,ortp)
-       ("voamrwbenc" ,vo-amrwbenc)))
-    (synopsis "Media Streamer AMR Codec")
-    (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
+  (let ((commit "5ab5c098299107048dfcbfc741f7392faef167bd")
+        (revision "11"))
+    (package
+      (name "msamr")
+      (version (git-version "1.1.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "git://git.linphone.org/msamr")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1g79lw1qi1mlw3v1b0cixmqiwjql81gz9naakb15n8pvaag9aaqm"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:tests? #f                    ; No test target
+         #:configure-flags
+         (list "-DENABLE_STATIC=NO"     ; Not required
+               "-DENABLE_WIDEBAND=YES")))
+      (inputs
+       `(("bctoolbox" ,bctoolbox)
+         ("mediastreamer2" ,mediastreamer2)
+         ("opencoreamr" ,opencore-amr)
+         ("ortp" ,ortp)
+         ("voamrwbenc" ,vo-amrwbenc)))
+      (synopsis "Media Streamer AMR Codec")
+      (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
 codec.  It is based on the opencore-amr implementation.")
-    (home-page "https://gitlab.linphone.org/BC/public/msamr")
-    (license license:gpl3+)))
+      (home-page "https://gitlab.linphone.org/BC/public/msamr")
+      (license license:gpl3+))))
-- 
2.31.0