unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29618] [PATCH] gnu: Add uthash.
@ 2017-12-08 18:45 Tobias Geerinckx-Rice
  2017-12-11 13:27 ` Ludovic Courtès
  2017-12-12  0:15 ` Marius Bakke
  0 siblings, 2 replies; 4+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-12-08 18:45 UTC (permalink / raw)
  To: 29618

* gnu/packages/datastructures.scm (uthash): New public variable.
---
 gnu/packages/datastructures.scm | 54 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
index 36318ee04..7db2fc82a 100644
--- a/gnu/packages/datastructures.scm
+++ b/gnu/packages/datastructures.scm
@@ -116,3 +116,57 @@ with the number of cores.  liburcu-cds provides efficient data structures
 based on RCU and lock-free algorithms.  These structures include hash tables,
 queues, stacks, and doubly-linked lists.")
     (license license:lgpl2.1+)))
+
+(define-public uthash
+  (package
+    (name "uthash")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (file-name (string-append name "-" version ".tar.gz"))
+       (uri (string-append "https://github.com/troydhanson/uthash/archive/v"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1la82gdlyl7m8ahdjirigwfh7zjgkc24cvydrqcri0vsvm8iv8rl"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)))
+    (arguments
+     `(#:make-flags (list "CC=gcc")
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)            ; nothing to configure
+         (delete 'build)                ; nothing to build
+         (replace 'check
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (with-directory-excursion "tests"
+               (zero? (apply system* "make"
+                             make-flags)))))
+         (replace 'install
+           ;; There is no top-level Makefile to do this for us.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/" ,name))
+                    (include (string-append out "/include")))
+               ;; Don't install HTML files: they are generated from these .txt
+               ;; files, could be stale, and updating them requires ‘asciidoc‘.
+               (for-each (λ (file) (install-file file doc))
+                         (append (list "LICENSE")
+                                 (find-files "doc" "\\.txt$")))
+               (for-each (λ (file) (install-file file include))
+                         (find-files "src" "\\.h$"))))))))
+    (home-page "https://troydhanson.github.io/uthash/")
+    (synopsis
+     "Hash tables, lists, and other data structures implemented as C macros")
+    (description
+     "uthash implements a hash table and a few other basic data structures
+as C preprocessor macros.  It aims to be minimalistic and efficient: it's
+around 1,000 lines of code which, being macros, inline automatically.
+
+Unlike function calls with fixed prototypes, macros operate on untyped
+arguments.  Thus, they are able to work with any type of structure or key.
+Any C structure can be stored in a hash table by adding @code{UT_hash_handle}
+to the structure and choosing one or more fields to act as the key.")
+    (license license:bsd-2)))
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#29618] [PATCH] gnu: Add uthash.
  2017-12-08 18:45 [bug#29618] [PATCH] gnu: Add uthash Tobias Geerinckx-Rice
@ 2017-12-11 13:27 ` Ludovic Courtès
  2017-12-12  0:15 ` Marius Bakke
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-12-11 13:27 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 29618

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> * gnu/packages/datastructures.scm (uthash): New public variable.

LGTM, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#29618] [PATCH] gnu: Add uthash.
  2017-12-08 18:45 [bug#29618] [PATCH] gnu: Add uthash Tobias Geerinckx-Rice
  2017-12-11 13:27 ` Ludovic Courtès
@ 2017-12-12  0:15 ` Marius Bakke
  2017-12-12  4:18   ` bug#29618: " Tobias Geerinckx-Rice
  1 sibling, 1 reply; 4+ messages in thread
From: Marius Bakke @ 2017-12-12  0:15 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, 29618

[-- Attachment #1: Type: text/plain, Size: 3506 bytes --]

Tobias Geerinckx-Rice <me@tobias.gr> writes:

> * gnu/packages/datastructures.scm (uthash): New public variable.
> ---
>  gnu/packages/datastructures.scm | 54 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/datastructures.scm b/gnu/packages/datastructures.scm
> index 36318ee04..7db2fc82a 100644
> --- a/gnu/packages/datastructures.scm
> +++ b/gnu/packages/datastructures.scm
> @@ -116,3 +116,57 @@ with the number of cores.  liburcu-cds provides efficient data structures
>  based on RCU and lock-free algorithms.  These structures include hash tables,
>  queues, stacks, and doubly-linked lists.")
>      (license license:lgpl2.1+)))
> +
> +(define-public uthash
> +  (package
> +    (name "uthash")
> +    (version "2.0.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (file-name (string-append name "-" version ".tar.gz"))
> +       (uri (string-append "https://github.com/troydhanson/uthash/archive/v"
> +                           version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "1la82gdlyl7m8ahdjirigwfh7zjgkc24cvydrqcri0vsvm8iv8rl"))))
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("perl" ,perl)))
> +    (arguments
> +     `(#:make-flags (list "CC=gcc")
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)            ; nothing to configure
> +         (delete 'build)                ; nothing to build
> +         (replace 'check
> +           (lambda* (#:key make-flags #:allow-other-keys)
> +             (with-directory-excursion "tests"
> +               (zero? (apply system* "make"
> +                             make-flags)))))
> +         (replace 'install
> +           ;; There is no top-level Makefile to do this for us.
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (doc (string-append out "/share/doc/" ,name))
> +                    (include (string-append out "/include")))
> +               ;; Don't install HTML files: they are generated from these .txt
> +               ;; files, could be stale, and updating them requires ‘asciidoc‘.
> +               (for-each (λ (file) (install-file file doc))
> +                         (append (list "LICENSE")
> +                                 (find-files "doc" "\\.txt$")))

Just FYI: In 'core-updates', there is now a phase that installs license
files automatically.

> +               (for-each (λ (file) (install-file file include))
> +                         (find-files "src" "\\.h$"))))))))

Return #t here.  LGTM!

> +    (home-page "https://troydhanson.github.io/uthash/")
> +    (synopsis
> +     "Hash tables, lists, and other data structures implemented as C macros")
> +    (description
> +     "uthash implements a hash table and a few other basic data structures
> +as C preprocessor macros.  It aims to be minimalistic and efficient: it's
> +around 1,000 lines of code which, being macros, inline automatically.
> +
> +Unlike function calls with fixed prototypes, macros operate on untyped
> +arguments.  Thus, they are able to work with any type of structure or key.
> +Any C structure can be stored in a hash table by adding @code{UT_hash_handle}
> +to the structure and choosing one or more fields to act as the key.")
> +    (license license:bsd-2)))
> -- 
> 2.15.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#29618: [PATCH] gnu: Add uthash.
  2017-12-12  0:15 ` Marius Bakke
@ 2017-12-12  4:18   ` Tobias Geerinckx-Rice
  0 siblings, 0 replies; 4+ messages in thread
From: Tobias Geerinckx-Rice @ 2017-12-12  4:18 UTC (permalink / raw)
  To: mbakke, ludo; +Cc: 29618-done


[-- Attachment #1.1: Type: text/plain, Size: 226 bytes --]

Ludo', Marius,

Thanks to both of you for the review.

Pushed as cc3ac162c558a51c90b76b84b081a15e28d0baad. I've removed the
explicit LICENSE file installation, which indeed belongs elsewhere.

Kind regards,

T G-R


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 248 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-12  4:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 18:45 [bug#29618] [PATCH] gnu: Add uthash Tobias Geerinckx-Rice
2017-12-11 13:27 ` Ludovic Courtès
2017-12-12  0:15 ` Marius Bakke
2017-12-12  4:18   ` bug#29618: " Tobias Geerinckx-Rice

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).