guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: gnu: Add libwuya.


From: guix-commits
Subject: 02/03: gnu: Add libwuya.
Date: Tue, 13 Oct 2020 22:28:24 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit 9acf79b25861b75a92ea8c32eb926e465ba5b20a
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Oct 13 15:15:59 2020 -0400

    gnu: Add libwuya.
    
    * gnu/packages/c.scm (libwuya): New variable.
---
 gnu/packages/c.scm | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index c1ae98d..493d993 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -40,6 +40,7 @@
   #:use-module (gnu packages perl)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages lua)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages python)
@@ -257,6 +258,64 @@ string formatting and autoresizing, option and config file 
parsing, type
 checking casts and more.")
     (license license:lgpl2.1+)))
 
+(define-public libwuya
+  ;; This commit is the one before "wuy_pool.h" was removed from libwuya,
+  ;; which libleak currently requires.
+  (let ((revision "1")
+        (commit "883502041044f4616cfbf75c8f2bb60059f704a9"))
+    (package
+      (name "libwuya")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/WuBingzheng/libwuya";)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1xrsqbgr13g2v0ag165ryp7xrwzv41xfygzk2a3445ca98c1qpdc"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ;no test suite
+         #:phases (modify-phases %standard-phases
+                    (add-after 'unpack 'patch-lua-includes
+                      (lambda _
+                        (substitute* '("wuy_cflua.h" "wuy_cflua.c")
+                          (("<lua5\\.1/") "<"))
+                        #t))
+                    (add-after 'unpack 'add--fPIC-to-CFLAGS
+                      (lambda _
+                        (substitute* "Makefile"
+                          (("CFLAGS[^\n]*" all)
+                           (string-append all " -fPIC")))
+                        #t))
+                    (add-before 'build 'set-CC
+                      (lambda _
+                        (setenv "CC" "gcc")
+                        #t))
+                    (delete 'configure) ;no configure script
+                    (replace 'install
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (include-dir (string-append out "/include"))
+                               (headers (find-files "." "\\.h$")))
+                          (for-each (lambda (h)
+                                      (install-file h include-dir))
+                                    headers)
+                          (install-file "libwuya.a" (string-append out "/lib"))
+                          #t))))))
+      (inputs `(("lua" ,lua)))
+      (home-page "https://github.com/WuBingzheng/libwuya/";)
+      (synopsis "C library implementing various data structures")
+      (description "The @code{libwuya} library implements data structures such
+as dictionaries, skip lists, and memory pools.")
+      ;; There is no clear information as to what license this is distributed
+      ;; under, but it is included (bundled) with libleak from the same author
+      ;; under the GNU GPL v2 or later license, so use this here until it is
+      ;; clarified (see: https://github.com/WuBingzheng/libwuya/issues/2).
+      (license license:gpl2+))))
+
 (define-public packcc
   (package
     (name "packcc")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]