Subject: bug#48003: closed (Re: bug#48003: Add julia-gumbo with dependencies)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 03 May 2021 21:04:02 +0000

Your bug report

#48003: Add julia-gumbo with dependencies

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
48003: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=48003
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#48003: Add julia-gumbo with dependencies
From: Ludovic Courtès <[email-masked]>
To: Nicolò Balzarotti <[email-masked]>
Cc: [email-masked]
Date: Mon, 03 May 2021 23:03:18 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Ciao Nicolò,

Nicolò Balzarotti <[email-masked]> skribis:

>>>From ebd7c319ea086ccf43d65f0100f608ee87374dbf Mon Sep 17 00:00:00 2001
> From: nixo <[email-masked]>
> Date: Sat, 24 Apr 2021 19:33:27 +0200
> Subject: [PATCH 1/3] gnu: Add julia-abstracttrees.
>
> * gnu/packages/julia-xyz.scm (julia-abstracttrees): New variable.

[...]

>>>From 6e225f07e1380d42053df8ca9a40ed6997b0dd3f Mon Sep 17 00:00:00 2001
> From: nixo <[email-masked]>
> Date: Sat, 24 Apr 2021 21:52:54 +0200
> Subject: [PATCH 2/3] gnu: Add julia-gumbo-jll.
>
> * gnu/packages/julia-xyz.scm (julia-gumbo-jll): New variable.

[...]

>>>From 90d759ff8a8919763ded16800f5f82c61968976c Mon Sep 17 00:00:00 2001
> From: nixo <[email-masked]>
> Date: Sat, 24 Apr 2021 21:58:26 +0200
> Subject: [PATCH 3/3] gnu: Add julia-gumbo.
>
> * gnu/packages/julia-xyz.scm (julia-gumbo): New variable.

Applied, thanks!

> +    (description "@code{Gumbo.jl} is a Julia wrapper around Google's gumbo
> +library for parsing @code{HTML}.")

I removed @code above.  :-)

Ludo’.

Subject: Add julia-gumbo with dependencies
From: Nicolò Balzarotti <[email-masked]>
To: [email-masked]
Date: Sat, 24 Apr 2021 22:09:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi!

Three simple patches attached to have Gumbo.jl with its dependencies.

Thanks!

>From ebd7c319ea086ccf43d65f0100f608ee87374dbf Mon Sep 17 00:00:00 2001
From: nixo <[email-masked]>
Date: Sat, 24 Apr 2021 19:33:27 +0200
Subject: [PATCH 1/3] gnu: Add julia-abstracttrees.

* gnu/packages/julia-xyz.scm (julia-abstracttrees): New variable.
---
 gnu/packages/julia-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 9812162ce1..21815387de 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -51,6 +51,29 @@ implement FFTs (such as @code{FFTW.jl} or @code{FastTransforms.jl}) extend the
 types/functions defined in AbstractFFTs.")
     (license license:expat)))
 
+(define-public julia-abstracttrees
+  (package
+    (name "julia-abstracttrees")
+    (version "0.3.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/JuliaCollections/AbstractTrees.jl")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "16is5n2qa69cci34vfazxsa7ik6q0hbnnqrbrhkq8frh142f1xs8"))))
+    (build-system julia-build-system)
+    (home-page "https://juliacollections.github.io/AbstractTrees.jl/stable/")
+    (synopsis "Abstract Julia interfaces for working with trees")
+    (description "This Julia package provides several utilities for working
+with tree-like data structures.  Most importantly, it defines the
+@code{children} method that any package that contains such a data structure
+may import and extend in order to take advantage of any generic tree algorithm
+in this package.")
+    (license license:expat)))
+
 (define-public julia-adapt
   (package
     (name "julia-adapt")
-- 
2.31.1

>From 6e225f07e1380d42053df8ca9a40ed6997b0dd3f Mon Sep 17 00:00:00 2001
From: nixo <[email-masked]>
Date: Sat, 24 Apr 2021 21:52:54 +0200
Subject: [PATCH 2/3] gnu: Add julia-gumbo-jll.

* gnu/packages/julia-xyz.scm (julia-gumbo-jll): New variable.
---
 gnu/packages/julia-xyz.scm | 42 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 21815387de..582072e320 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -24,7 +24,8 @@
   #:use-module (guix build-system julia)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages maths)
-  #:use-module (gnu packages tls))
+  #:use-module (gnu packages tls)
+  #:use-module (gnu packages web))
 
 (define-public julia-abstractffts
   (package
@@ -647,6 +648,45 @@ functions (or any callable object, really) using forward mode automatic
 differentiation (AD).")
     (license license:expat)))
 
+(define-public julia-gumbo-jll
+  (package
+    (name "julia-gumbo-jll")
+    (version "0.10.1+1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/JuliaBinaryWrappers/Gumbo_jll.jl")
+             (commit (string-append "Gumbo-v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00a182x5hfpjzyvrxdn8wh4h67q899p5dzqp19a5s22si4g41k76"))))
+    (build-system julia-build-system)
+    (arguments
+     '(#:tests? #f ; no runtests
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'override-binary-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((gumbo (string-append (assoc-ref inputs "gumbo-parser"))))
+               (for-each
+                (lambda (wrapper)
+                  (substitute* wrapper
+                    (("(const libgumbo = )\"(.*)\"" all const libname)
+                     (string-append const "\"" gumbo "/lib/" libname "\"\n"))
+                    (("(global artifact_dir =).*" all m)
+                     (string-append m " \"" gumbo "\""))))
+                ;; There's a Julia file for each platform, override them all
+                (find-files "src/wrappers/" "\\.jl$"))))))))
+    (inputs
+     `(("gumbo-parser" ,gumbo-parser)))
+    (propagated-inputs
+     `(("julia-jllwrappers" ,julia-jllwrappers)))
+    (home-page "https://github.com/JuliaBinaryWrappers/Gumbo_jll.jl")
+    (synopsis "Gumbo HTML parsing library wrappers")
+    (description "This package provides a wrapper for Gumbo HTML parsing library.")
+    (license license:expat)))
+
 (define-public julia-http
   (package
     (name "julia-http")
-- 
2.31.1

>From 90d759ff8a8919763ded16800f5f82c61968976c Mon Sep 17 00:00:00 2001
From: nixo <[email-masked]>
Date: Sat, 24 Apr 2021 21:58:26 +0200
Subject: [PATCH 3/3] gnu: Add julia-gumbo.

* gnu/packages/julia-xyz.scm (julia-gumbo): New variable.
---
 gnu/packages/julia-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 582072e320..a8402f82dc 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -648,6 +648,29 @@ functions (or any callable object, really) using forward mode automatic
 differentiation (AD).")
     (license license:expat)))
 
+(define-public julia-gumbo
+  (package
+    (name "julia-gumbo")
+    (version "0.8.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/JuliaWeb/Gumbo.jl")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1g22dv3v7caakspv3pdahnqn937fzzsg9y87rj72hid9g8lxl1gm"))))
+    (build-system julia-build-system)
+    (propagated-inputs
+     `(("julia-abstracttrees" ,julia-abstracttrees)
+       ("julia-gumbo-jll" ,julia-gumbo-jll)))
+    (home-page "https://github.com/JuliaWeb/Gumbo.jl")
+    (synopsis "Julia wrapper around Google's gumbo C library for parsing HTML")
+    (description "@code{Gumbo.jl} is a Julia wrapper around Google's gumbo
+library for parsing @code{HTML}.")
+    (license license:expat)))
+
 (define-public julia-gumbo-jll
   (package
     (name "julia-gumbo-jll")
-- 
2.31.1