diff mbox series

[bug#37988,3/6] gnu: Add r-rprotobuflib.

Message ID 20191030102531.12495-3-zimon.toutoune@gmail.com
State Accepted
Headers show
Series Add flowWorkspace from BioConductor | expand

Commit Message

Simon Tournier Oct. 30, 2019, 10:25 a.m. UTC
* gnu/packages/bioconductor.scm (r-rprotobuflib): New variable.
---
 gnu/packages/bioconductor.scm | 39 +++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

Ricardo Wurmus Oct. 30, 2019, 11:39 a.m. UTC | #1
Hi,

thank you for the patches!

> * gnu/packages/bioconductor.scm (r-rprotobuflib): New variable.

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         ;; Contains unverified binaries:
> +         ;; src/win/lib/{i386,x64}/libprotobuf.a
> +         (add-after 'unpack 'remove-win-folder
> +           (lambda _
> +             (delete-file-recursively "src/win")
> +             #t))

This should be done in a snippet instead.

> +         ;; Fix non-conventional packaging.
> +         ;; The dependency to protobuf-2.6.0 is included as tgz and build
> +         ;; by the R package itself.
> +         (add-after 'unpack 'fix-wrong-hard-coded
> +           (lambda _
> +             (with-directory-excursion "src"
> +               (invoke "tar" "xf" "protobuf-2.6.0.tgz"))
> +             (substitute* "src/protobuf-2.6.0/configure"
> +               (("#! /bin/sh") (string-append "#!" (which "sh"))))
> +             #t)))))

Can we just use our protobuf package instead of using the bundled sources?

> +    (description "This package provides the headers and static library of
> +Protocol buffers 2.6.0 for other R packages to compile and link
> against.")

I would prefer not to mention the specific version here.
Simon Tournier Oct. 30, 2019, 1:29 p.m. UTC | #2
Hi Ricardo,

Thank you for reviewing.

On Wed, 30 Oct 2019 at 12:39, Ricardo Wurmus <rekado@elephly.net> wrote:

> > * gnu/packages/bioconductor.scm (r-rprotobuflib): New variable.
>
> > +    (arguments
> > +     `(#:phases
> > +       (modify-phases %standard-phases
> > +         ;; Contains unverified binaries:
> > +         ;; src/win/lib/{i386,x64}/libprotobuf.a
> > +         (add-after 'unpack 'remove-win-folder
> > +           (lambda _
> > +             (delete-file-recursively "src/win")
> > +             #t))
>
> This should be done in a snippet instead.

What does it mean?


> > +         ;; Fix non-conventional packaging.
> > +         ;; The dependency to protobuf-2.6.0 is included as tgz and build
> > +         ;; by the R package itself.
> > +         (add-after 'unpack 'fix-wrong-hard-coded
> > +           (lambda _
> > +             (with-directory-excursion "src"
> > +               (invoke "tar" "xf" "protobuf-2.6.0.tgz"))
> > +             (substitute* "src/protobuf-2.6.0/configure"
> > +               (("#! /bin/sh") (string-append "#!" (which "sh"))))
> > +             #t)))))

> Can we just use our protobuf package instead of using the bundled sources?

I do not know and I have not tried yet.
The package claims the dependency to 2.6.0 and we do not have this one.
As said in the cover letter to these patches, we could patch to
correctly package without the bundle source and this is IMHO the way
to go. However it is more work and it is better to have the package
available than no package at all.

Well, I will give another look to see if a quick improvement can be done. :-0



All the best,
simon
diff mbox series

Patch

diff --git a/gnu/packages/bioconductor.scm b/gnu/packages/bioconductor.scm
index 92e5d3ec0b..7c1761852c 100644
--- a/gnu/packages/bioconductor.scm
+++ b/gnu/packages/bioconductor.scm
@@ -6166,3 +6166,42 @@  data.")
     (synopsis "Visualization for flow cytometry data")
     (description "This package provides visualization tools for flow cytometry data.")
     (license license:artistic2.0)))
+
+(define-public r-rprotobuflib
+  (package
+    (name "r-rprotobuflib")
+    (version "1.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (bioconductor-uri "RProtoBufLib" version))
+       (sha256
+        (base32
+         "1vhwxw7281n5wpg30ik3m1gwarfmj4b8cqxdvj0sck44yx24lphg"))))
+    (properties
+     `((upstream-name . "RProtoBufLib")))
+    (build-system r-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Contains unverified binaries:
+         ;; src/win/lib/{i386,x64}/libprotobuf.a
+         (add-after 'unpack 'remove-win-folder
+           (lambda _
+             (delete-file-recursively "src/win")
+             #t))
+         ;; Fix non-conventional packaging.
+         ;; The dependency to protobuf-2.6.0 is included as tgz and build
+         ;; by the R package itself.
+         (add-after 'unpack 'fix-wrong-hard-coded
+           (lambda _
+             (with-directory-excursion "src"
+               (invoke "tar" "xf" "protobuf-2.6.0.tgz"))
+             (substitute* "src/protobuf-2.6.0/configure"
+               (("#! /bin/sh") (string-append "#!" (which "sh"))))
+             #t)))))
+    (home-page "https://bioconductor.org/packages/RProtoBufLib")
+    (synopsis "C++ headers and static libraries of Protocol buffers")
+    (description "This package provides the headers and static library of
+Protocol buffers 2.6.0 for other R packages to compile and link against.")
+    (license license:bsd-3)))