GNU bug report logs - #29618
[PATCH] gnu: Add uthash.

Previous Next

Package: guix-patches;

Reported by: Tobias Geerinckx-Rice <me <at> tobias.gr>

Date: Fri, 8 Dec 2017 18:44:02 UTC

Severity: normal

Tags: patch

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29618 in the body.
You can then email your comments to 29618 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#29618; Package guix-patches. (Fri, 08 Dec 2017 18:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 08 Dec 2017 18:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add uthash.
Date: Fri,  8 Dec 2017 19:45:40 +0100
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#29618; Package guix-patches. (Mon, 11 Dec 2017 13:28:01 GMT) Full text and rfc822 format available.

Message #8 received at 29618 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 29618 <at> debbugs.gnu.org
Subject: Re: [bug#29618] [PATCH] gnu: Add uthash.
Date: Mon, 11 Dec 2017 14:27:33 +0100
Tobias Geerinckx-Rice <me <at> tobias.gr> skribis:

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

LGTM, thanks!

Ludo'.




Information forwarded to guix-patches <at> gnu.org:
bug#29618; Package guix-patches. (Tue, 12 Dec 2017 00:16:01 GMT) Full text and rfc822 format available.

Message #11 received at 29618 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>, 29618 <at> debbugs.gnu.org
Subject: Re: [bug#29618] [PATCH] gnu: Add uthash.
Date: Tue, 12 Dec 2017 01:15:42 +0100
[Message part 1 (text/plain, inline)]
Tobias Geerinckx-Rice <me <at> 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
[signature.asc (application/pgp-signature, inline)]

Reply sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
You have taken responsibility. (Tue, 12 Dec 2017 04:16:02 GMT) Full text and rfc822 format available.

Notification sent to Tobias Geerinckx-Rice <me <at> tobias.gr>:
bug acknowledged by developer. (Tue, 12 Dec 2017 04:16:02 GMT) Full text and rfc822 format available.

Message #16 received at 29618-done <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: mbakke <at> fastmail.com, ludo <at> gnu.org
Cc: 29618-done <at> debbugs.gnu.org
Subject: Re: [bug#29618] [PATCH] gnu: Add uthash.
Date: Tue, 12 Dec 2017 05:18:01 +0100
[Message part 1 (text/plain, inline)]
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

[signature.asc (application/pgp-signature, attachment)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 Jan 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.