unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Raghav Gururajan <rg@raghavgururajan.name>
Cc: 47274@debbugs.gnu.org
Subject: [bug#47274] Linphone Packages
Date: Sun, 28 Mar 2021 00:01:33 -0400	[thread overview]
Message-ID: <87czvkq63m.fsf_-_@gmail.com> (raw)
In-Reply-To: <66991ebb-4074-efab-4331-1ed195d55d26@raghavgururajan.name> (Raghav Gururajan's message of "Sun, 21 Mar 2021 21:48:59 -0400")

Hi!

Raghav Gururajan <rg@raghavgururajan.name> writes:

> [39. text/x-patch; 0038-gnu-Add-build.patch]...

I had an old package of build from 2020 with a more fleshed out
description, so I've pushed that version instead as commit 65719505b8.

> From c6e27b74e1f90985513167b52cd0e0f9cc54aa73 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Thu, 18 Mar 2021 13:57:53 -0400
> Subject: [PATCH 39/53] gnu: Add libcutl.
>
> * gnu/packages/codesynthesis.scm (libcutl): New variable.
> ---
>  gnu/packages/codesynthesis.scm | 44 ++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/codesynthesis.scm b/gnu/packages/codesynthesis.scm
> index 7cb9a427a5..a264692c19 100644
> --- a/gnu/packages/codesynthesis.scm
> +++ b/gnu/packages/codesynthesis.scm
> @@ -19,6 +19,8 @@
>
>  (define-module (gnu packages codesynthesis)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages pkg-config)

pkg-config turned out not to be needed.

> +  #:use-module (gnu packages xml)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
>    #:use-module (guix download)
> @@ -53,3 +55,45 @@
>  implemented on top of GNU make.")
>      (home-page "https://www.codesynthesis.com/projects/libxsd-frontend/")
>      (license license:gpl2+)))
> +
> +(define-public libcutl
> +  (package
> +    (name "libcutl")
> +    (version "1.10.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://www.codesynthesis.com/download/libcutl/"
> +                           (version-major+minor version)
> +                           "/libcutl-" version ".tar.bz2"))
> +       (sha256
> +        (base32 "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j"))
> +       (modules '((guix build utils)))
> +       (snippet
> +        `(begin
> +           ;; Remove bundled sources.
> +           (with-directory-excursion "cutl/details"
> +             (for-each delete-file-recursively
> +                       ;; FIXME: Boost_RegEx isn't being detected.
> +                       (list
> +                        ;; "boost"
> +                        "expat")))
> +           #t))))

I removed the trailing #t.

> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:configure-flags
> +       (list
> +        "--disable-static"
> +        ;; "--with-external-boost"
> +        "--with-external-expat")))
> +    (native-inputs
> +     `(("pkg-config" ,pkg-config)))

Removed the native-inputs field.

> +    (inputs
> +     `(;; ("boost" ,boost)
> +       ("expat" ,expat)))
> +    (synopsis "C++ utility library")
> +    (description "@package{libcutl} is a C++ utility library.  It contains a
> +collection of generic and independent components such as meta-programming tests,
> +smart pointers, containers, compiler building blocks, etc.")
> +    (home-page "https://www.codesynthesis.com/projects/libcutl/")
> +    (license license:expat)))
> --
> 2.31.0

And pushed as ae479f1834.

> From e3abe6dbfcbd6bfb352694fd5efcb9db9da6dce6 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Thu, 18 Mar 2021 14:00:13 -0400
> Subject: [PATCH 40/53] gnu: Add libxsd-frontend.
>
> * gnu/packages/codesynthesis.scm (libxsd-frontend): New variable.
> ---
>  gnu/packages/codesynthesis.scm | 54 ++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/codesynthesis.scm b/gnu/packages/codesynthesis.scm
> index a264692c19..f24fb760de 100644
> --- a/gnu/packages/codesynthesis.scm
> +++ b/gnu/packages/codesynthesis.scm
> @@ -97,3 +97,57 @@ collection of generic and independent components such as meta-programming tests,
>  smart pointers, containers, compiler building blocks, etc.")
>      (home-page "https://www.codesynthesis.com/projects/libcutl/")
>      (license license:expat)))
> +
> +(define-public libxsd-frontend
> +  (package
> +    (name "libxsd-frontend")
> +    (version "2.0.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://www.codesynthesis.com/download/"
> +                           "libxsd-frontend/" (version-major+minor version)
> +                           "/libxsd-frontend-" version ".tar.bz2"))
> +       (sha256
> +        (base32 "1nmzchsvwvn66jpmcx18anzyl1a3l309x1ld4zllrg37ijc31fim"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:test-target "test"
> +       #:imported-modules
> +       ((guix build copy-build-system)
> +        ,@%gnu-build-system-modules)
> +       #:modules
> +       (((guix build copy-build-system)
> +         #:prefix copy:)
> +        (guix build gnu-build-system)
> +        (guix build utils))
> +       #: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")))
> +             #t))

I could turn this patch phase into a make flag:

--8<---------------cut here---------------start------------->8---
        #:modules (((guix build copy-build-system) #:prefix copy:)
                   (guix build gnu-build-system)
                   (guix build utils))
+       #:make-flags (list (string-append "--include-dir="
+                                         (assoc-ref %build-inputs "build")
+                                         "/include/"))
        #: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")))))
          (delete 'configure)
          (replace 'install
--8<---------------cut here---------------end--------------->8---


> +         (delete 'configure)
> +         (replace 'install
> +           (lambda args
> +             (apply (assoc-ref copy:%standard-phases 'install)
> +                    #:install-plan
> +                    '(("xsd-frontend" "include/xsd-frontend"
> +                       #:include-regexp ("\\.?xx$"))
> +                      ("xsd-frontend" "lib"
> +                       #:include-regexp ("\\.so$")))
> +                    args))))))
> +    (native-inputs
> +     `(("build" ,build)
> +       ("pkg-config" ,pkg-config)))

Removed pkg-config, which was not needed.

> +    (inputs
> +     `(("libcutl" ,libcutl)
> +       ("libxerces-c" ,xerces-c)))
> +    (synopsis "XSD Front-end")
> +    (description "@package{libxsd-frontend} is a compiler frontend
> for the W3C

Replaced @package by @code, as the former is not valid Texinfo markup.

> +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+)))
> --
> 2.31.0

And pushed as 111004cc58.

>
> 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")))

I used the same --include-dir make flag trick here.

> +             (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))

Dropped the #t, added a comment and added the prefix to the default
regexp group bound to 'all', like this:

+             ;; Add the namespace prefix, to avoid errors such as "error:
+             ;; ‘iterate_and_dispatch’ was not declared in this scope".
+             (substitute* (find-files "." "\\.?xx$")
+               (("add \\(typeid \\(type\\), \\*this\\);" all)
+                (string-append "traverser_map<B>::" all))
+               (("iterate_and_dispatch \\(s\\.names_begin.*;" all)
+                (string-append "edge_dispatcher::" all)))))

> +         (delete 'configure))))
> +    (native-inputs
> +     `(("build" ,build)
> +       ("pkg-config" ,pkg-config)))

Removed pkg-config, which was not needed.

> +    (inputs
> +     `(("libcutl" ,libcutl)))
> +    (synopsis "Command Line Interface (CLI) definition language")
> +    (description "@package{cli} is a domain-specific language (DSL)
> for defining

s/@package/@code/, as for the previous package.

> +command line interfaces of C++ programs.  It allows you to describe the options
> +that your program supports, their types, default values, and documentation.")
> +    (home-page "https://codesynthesis.com/projects/cli/")
> +    (license license:expat)))
> --
> 2.31.0

And pushed as commit f649a0a557.

>
> From d46ed1d4bd1d85ad5c89d2c713f387714f152358 Mon Sep 17 00:00:00 2001
> From: Raghav Gururajan <rg@raghavgururajan.name>
> Date: Thu, 18 Mar 2021 15:51:18 -0400
> Subject: [PATCH 42/53] gnu: Add xsd.
>
> * gnu/packages/codesynthesis.scm (xsd): New variable.
> ---
>  gnu/packages/codesynthesis.scm | 48 ++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>
> diff --git a/gnu/packages/codesynthesis.scm b/gnu/packages/codesynthesis.scm
> index b70e53cd7c..58f4fa9301 100644
> --- a/gnu/packages/codesynthesis.scm
> +++ b/gnu/packages/codesynthesis.scm
> @@ -19,6 +19,7 @@
>
>  (define-module (gnu packages codesynthesis)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages onc-rpc)
>    #:use-module (gnu packages pkg-config)
>    #:use-module (gnu packages xml)
>    #:use-module ((guix licenses) #:prefix license:)
> @@ -196,3 +197,50 @@ command line interfaces of C++ programs.  It allows you to describe the options
>  that your program supports, their types, default values, and documentation.")
>      (home-page "https://codesynthesis.com/projects/cli/")
>      (license license:expat)))
> +
> +(define-public xsd
> +  (package
> +    (name "xsd")
> +    (version "4.0.0")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://www.codesynthesis.com/download/"
> +                           "xsd/" (version-major+minor version)
> +                           "/xsd-" version ".tar.bz2"))
> +       (sha256
> +        (base32 "1hi9ppxd34np8ydv1h0vgc2qpdmgcd1cdzgk30aidv670xjg91fx"))))
> +    (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")))
> +             #t))

I added a doc output to hold the multi-megabyte documentation and
examples and used the same make flag trick to allow finding build-0.3
files:

+    (outputs '("out" "doc"))            ;3.8 MiB of doc and examples
+    (arguments
+     `(#:test-target "test"
+       #:make-flags (list (string-append "--include-dir="
+                                         (assoc-ref %build-inputs "build")
+                                         "/include/")
+                          (string-append "install_prefix="
+                                         (assoc-ref %outputs "out")))
+       #:phases (modify-phases %standard-phases
+                  (add-after 'install 'move-doc
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out"))
+                            (doc (assoc-ref outputs "doc")))
+                        (mkdir-p (string-append doc "/share/doc"))
+                        (rename-file (string-append out "/share/doc/xsd")
+                                     (string-append doc "/share/doc/xsd-"
+                                                    ,version)))))
+                  (delete 'configure))))

> +         (delete 'configure))))
> +    (native-inputs
> +     `(("build" ,build)
> +       ("cli" ,cli)
> +       ("pkg-config" ,pkg-config)))

Dropped pkg-config here as well.

> +    (inputs
> +     `(("libcutl" ,libcutl)
> +       ("libnsl" ,libnsl)
> +       ("libxsd-frontend" ,libxsd-frontend)))
> +    (propagated-inputs
> +     `(("libexpat" ,expat)
> +       ("libxerces-c" ,xerces-c)))

I removed expat from propagated-inputs, as the xsd generated code
default to using xerces-c.  Someone wanting to use expat could add it
manually.  I've also added a comment like this, as it was not clear to
me initially why propagation was useful:

    (propagated-inputs
     ;; The code XSD generates requires the following library at run time;
     ;; propagate it for convenience.
     `(("xerces-c" ,xerces-c)))

> +    (synopsis "XML Schema to C++ translator")
> +    (description "@package{xsd} is a W3C XML Schema to C++ translator.  It
> +generates vocabulary-specific, statically-typed C++ mappings/bindings from XML
> +Schema definitions.  It supports two C++ mappings: in-memory C++/Tree and
> +event-driven C++/Parser.")
> +    (home-page "https://codesynthesis.com/projects/xsd/")
> +    (license license:gpl2+)))

For this package, I also had an unfinished version locally; the
description was slightly more accurate, with an extra comment for the
license:

+    (synopsis "XML Data Binding for C++")
+    (description "CodeSynthesis XSD (also known as libxsd or xsdcxx) is an XML
+Schema to C++ data binding compiler.  Provided with an XML instance
+specification (XML Schema), it generates C++ classes that represent the given
+vocabulary as well as XML parsing and serialization code.  The data stored in
+XML can then be accessed using types and functions that semantically
+correspond to an application domain rather than dealing with the intricacies
+of reading and writing XML.")
+    (home-page "https://codesynthesis.com/projects/xsd/")
+    ;; Exceptions are made to allow using the generated source files as well
+    ;; as the libxsd library in free software projects whose license is
+    ;; incompatible with the GPL v2.  Refer to the file named FLOSSE for the
+    ;; details.

So I've used those parts and pushed as commit 510e24f973.

Phew.  I've now reached the core bits of the review, to be continued.

Thanks :-)

Maxim




  parent reply	other threads:[~2021-03-28  4:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  4:26 [bug#47274] Linphone Packages Raghav Gururajan via Guix-patches via
2021-03-21  6:13 ` Raghav Gururajan via Guix-patches via
2021-03-22  1:48   ` Raghav Gururajan via Guix-patches via
2021-03-22  4:44     ` Raghav Gururajan via Guix-patches via
2021-03-22  4:59       ` Raghav Gururajan via Guix-patches via
2021-03-29  4:03         ` Maxim Cournoyer
2021-03-29  6:05           ` Raghav Gururajan via Guix-patches via
2021-03-29 18:38             ` Maxim Cournoyer
2021-03-29 18:47               ` Raghav Gururajan via Guix-patches via
2021-03-24  4:12       ` Maxim Cournoyer
2021-03-25 13:07       ` Maxim Cournoyer
2021-03-29  5:16         ` Raghav Gururajan via Guix-patches via
2021-03-27  2:13       ` Maxim Cournoyer
2021-03-29  5:52         ` Raghav Gururajan via Guix-patches via
2021-03-27  5:05       ` Maxim Cournoyer
2021-03-29  5:53         ` Raghav Gururajan via Guix-patches via
2021-03-27  5:11       ` Maxim Cournoyer
2021-03-28  4:05         ` Raghav Gururajan via Guix-patches via
2021-03-28  4:43           ` Maxim Cournoyer
2021-03-29  6:02             ` Raghav Gururajan via Guix-patches via
2021-03-29  5:53         ` Raghav Gururajan via Guix-patches via
2021-03-28  0:52       ` Maxim Cournoyer
2021-03-29  5:55         ` Raghav Gururajan via Guix-patches via
2021-03-29  5:44       ` bug#47274: " Maxim Cournoyer
2021-03-29  6:13         ` [bug#47274] " Raghav Gururajan via Guix-patches via
2021-03-29 18:39           ` Maxim Cournoyer
2021-03-25  1:55     ` Maxim Cournoyer
2021-03-29  5:13       ` Raghav Gururajan via Guix-patches via
2021-03-28  4:01     ` Maxim Cournoyer [this message]
2021-03-29  6:01       ` Raghav Gururajan via Guix-patches via
2021-03-29  5:19     ` Maxim Cournoyer
2021-03-29  6:12       ` Raghav Gururajan via Guix-patches via
2021-03-24  2:25 ` Maxim Cournoyer
2021-03-29  5:07   ` Raghav Gururajan via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czvkq63m.fsf_-_@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=47274@debbugs.gnu.org \
    --cc=rg@raghavgururajan.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).