summary refs log tree commit diff
path: root/gnu/packages/web.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-12-28 14:15:50 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-12-28 19:05:32 +0100
commitf1552ab3a49327658a1c47fc2f591def3e3e1edf (patch)
treeab901a1c4c43e02ee8c2de37756c4b911543a1b2 /gnu/packages/web.scm
parentf44305bc137d38b6536f644bde49824c9c8540a8 (diff)
downloadguix-f1552ab3a49327658a1c47fc2f591def3e3e1edf.tar.gz
gnu: Add clearsilver.
* gnu/packages/web.scm (clearsilver): New variable.
Diffstat (limited to 'gnu/packages/web.scm')
-rw-r--r--gnu/packages/web.scm86
1 files changed, 86 insertions, 0 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1c8e4a64a1..d1564bb4e8 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -6490,6 +6490,92 @@ Rust with GTK.  It currently supports the Gemini, Gopher and Finger
 protocols.")
     (license license:expat)))
 
+(define-public clearsilver
+  (package
+    (name "clearsilver")
+    (version "0.11.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/blong42/clearsilver/")
+             (commit "fbe4926ba9a756163fd1539ff6eee3522cf1f5d8")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "02ad43gmqwy7wmh71mh5pk6gl1lax76sjnf42sknj0ijdga170kl"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:tests? #false ;there is not test target and tests are run during build
+      #:configure-flags
+      '(list "--disable-java" "--disable-python")
+      #:phases
+      '(modify-phases %standard-phases
+         (add-after 'unpack 'prepare-streamhtmlparser
+           (lambda* (#:key inputs #:allow-other-keys)
+             (copy-recursively (assoc-ref inputs "streamhtmlparser")
+                               (string-append (getcwd) "/streamhtmlparser"))
+             (for-each make-file-writable
+                       (find-files "streamhtmlparser" "."
+                                   #:directories? #t))))
+         (add-after 'unpack 'pre-bootstrap
+           (lambda _
+             ;; We don't need the Java stuff
+             (substitute* "configure.in"
+               (("AC_JNI_INCLUDE_DIR") ""))
+
+             ;; This script will call /bin/sh, so it's easier to just
+             ;; bootstrap manually.
+             (delete-file "autogen.sh")
+             (substitute* "rules.mk.in"
+               (("@PTHREAD_LIBS@") "-lpthread")
+               (("@PTHREAD_CFLAGS@") "")
+               (("@PTHREAD_CC@") "gcc"))
+
+             ;; The GNU variadic macros actually work, whereas the C99
+             ;; implementation fails to build.
+             (substitute* "util/neo_misc.h"
+               (("#define USE_C99_VARARG_MACROS") "#define USE_GNUC_VARARG_MACROS"))
+
+             (setenv "CFLAGS" "-fPIC")
+
+             ;; This directory is created some time during the build, but the
+             ;; early libtool processes assume the directory exists.  When
+             ;; they are run first they copy the libraries themselves to the
+             ;; file "libs" instead of moving them into the directory.
+             (mkdir-p "libs")))
+         (add-after 'build 'build-documentation
+           (lambda _ (invoke "make" "man")))
+         (add-after 'install 'install-streamhtmlparser
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (with-directory-excursion "streamhtmlparser"
+               (apply invoke "make" "-j" (if parallel-build?
+                                             (number->string (parallel-job-count))
+                                             "1")
+                      "install" make-flags)))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("python" ,python-2)
+       ("streamhtmlparser"
+        ,(let ((commit "551109ac02a31957a0e776416774c7b515b4b7c7"))
+           (origin
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/google/streamhtmlparser/")
+                   (commit commit)))
+             (file-name (git-file-name "streamhtmlparser" commit))
+             (sha256
+              (base32
+               "0bmrdakk930q3m8fmq0xcy7n7cdvlk1xma4z9204919hvb1gk9md")))))))
+    (home-page "https://github.com/blong42/clearsilver")
+    (synopsis "CGI kit and HTML templating system")
+    (description
+     "This package includes Clearsilver, the CGI kit and HTML templating
+system.")
+    (license license:bsd-3)))
+
 (define-public python-py-ubjson
   (package
     (name "python-py-ubjson")