From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOYEv-0004nU-Fk for guix-patches@gnu.org; Mon, 11 Dec 2017 19:16:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOYEs-0002Lb-9x for guix-patches@gnu.org; Mon, 11 Dec 2017 19:16:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:48794) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOYEs-0002LK-4A for guix-patches@gnu.org; Mon, 11 Dec 2017 19:16:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eOYEr-0004wE-M3 for guix-patches@gnu.org; Mon, 11 Dec 2017 19:16:01 -0500 Subject: [bug#29618] [PATCH] gnu: Add uthash. Resent-Message-ID: From: Marius Bakke In-Reply-To: <20171208184540.26410-1-me@tobias.gr> References: <20171208184540.26410-1-me@tobias.gr> Date: Tue, 12 Dec 2017 01:15:42 +0100 Message-ID: <87zi6ox0lt.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Tobias Geerinckx-Rice , 29618@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Tobias Geerinckx-Rice 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/datastructure= s.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 effi= cient data structures > based on RCU and lock-free algorithms. These structures include hash ta= bles, > 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/archiv= e/v" > + version ".tar.gz")) > + (sha256 > + (base32 > + "1la82gdlyl7m8ahdjirigwfh7zjgkc24cvydrqcri0vsvm8iv8rl")))) > + (build-system gnu-build-system) > + (native-inputs > + `(("perl" ,perl))) > + (arguments > + `(#:make-flags (list "CC=3Dgcc") > + #: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 thes= e .txt > + ;; files, could be stale, and updating them requires =E2= =80=98asciidoc=E2=80=98. > + (for-each (=CE=BB (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 (=CE=BB (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 mac= ros") > + (description > + "uthash implements a hash table and a few other basic data structur= es > +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 ke= y. > +Any C structure can be stored in a hash table by adding @code{UT_hash_ha= ndle} > +to the structure and choosing one or more fields to act as the key.") > + (license license:bsd-2))) > --=20 > 2.15.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlovH64ACgkQoqBt8qM6 VPrfFAf/bRjwq23lwdQd4SVs4TMlzM/QZEyNZgMA3/lDylHP9xV+2p65IXLuuj3e 9aODpVEaALBGQsFaecq5Snzt/AiZHWyxYMAkY9f4yL50pMOTiFaGn8ubIBskcCRC lve2tLEmdLjLIYYz78pYSJyi/hnNAnUktfeBWf4fV023+oYXB0S2Cryyk3/YBqkr 8bN6ju4iU0OheTaqZIAU1AEBoO1lCejUwigBs1PUh6kj/KrtWrZp/NcJzemOIKh/ 7DSbGm2Xyfdz1QYcwmgIGD8FS7xIqBb6pM8u714ihvXnXWd+00ufOPOhykBCp9dG 43jP0ePwuG4zB2HByuo0c7ddyf5I1g== =Ydv0 -----END PGP SIGNATURE----- --=-=-=--