summary refs log tree commit diff
path: root/gnu/packages/julia-xyz.scm
diff options
context:
space:
mode:
authornixo <nicolo@nixo.xyz>2021-04-24 21:52:54 +0200
committerLudovic Courtès <ludo@gnu.org>2021-05-03 23:10:02 +0200
commit74a7bb81f9f3df5be9bd34331697ea2479659d9f (patch)
tree3a07d3759c18e25e39138e61e5cdb3e2978f4749 /gnu/packages/julia-xyz.scm
parent64c1c497877d634a943e93c422b7beb61444b518 (diff)
downloadguix-74a7bb81f9f3df5be9bd34331697ea2479659d9f.tar.gz
gnu: Add julia-gumbo-jll.
* gnu/packages/julia-xyz.scm (julia-gumbo-jll): New variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/julia-xyz.scm')
-rw-r--r--gnu/packages/julia-xyz.scm42
1 files changed, 41 insertions, 1 deletions
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")