Subject: [bug#47274] Linphone Packages

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 25 Mar 2021 09:07:15 -0400

Hi Raghav,

Raghav Gururajan <[email-masked]> 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 <[email-masked]>
> 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 <[email-masked]>
> 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