Subject: Re: bug#47274: Linphone Packages

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 26 Mar 2021 22:13:01 -0400

Hi, 
> From c9e23524c79159f78e4c4738cad9544cfe3ac1ce Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <[email-masked]>
> 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