From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH 2/3] gnu: Add murmur-hash. Date: Fri, 17 Jun 2016 11:23:20 +1000 Message-ID: <1466126601-30932-3-git-send-email-donttrustben@gmail.com> References: <1466126601-30932-1-git-send-email-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDiVa-00080Q-KN for Guix-devel@gnu.org; Thu, 16 Jun 2016 21:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDiVY-0000us-FR for Guix-devel@gnu.org; Thu, 16 Jun 2016 21:23:41 -0400 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:33358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDiVY-0000uo-83 for Guix-devel@gnu.org; Thu, 16 Jun 2016 21:23:40 -0400 Received: by mail-pf0-x236.google.com with SMTP id i123so21384924pfg.0 for ; Thu, 16 Jun 2016 18:23:40 -0700 (PDT) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id pk18sm32320490pab.27.2016.06.16.18.23.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jun 2016 18:23:38 -0700 (PDT) In-Reply-To: <1466126601-30932-1-git-send-email-donttrustben@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel@gnu.org * gnu/packages/textutils.scm (murmur-hash): New variable. --- gnu/packages/textutils.scm | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/textutils.scm b/gnu/packages/textutils.scm index ebcf4b9..ce83c4d 100644 --- a/gnu/packages/textutils.scm +++ b/gnu/packages/textutils.scm @@ -373,3 +373,42 @@ runs Word\".") (description "UTF8-CPP is a C++ library for handling UTF-8 encoded text in a portable way.") (license license:boost1.0))) + +(define-public murmur-hash + ;; There are no releases so package directly from a git commit. + (let ((commit "61a0530f28277f2e850bfc39600ce61d02b518de")) + (package + (name "murmur-hash") + (version (string-append "0-1." (string-take commit 7))) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/aappleby/smhasher.git") + (commit commit))) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1hasigzz5dyx8dzf1arzwahhph2p4vnsq32wlyh99nga2z4hd8si")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion "src" + (let ((out (string-append + (assoc-ref outputs "out") + "/include"))) + (install-file "MurmurHash3.cpp" out) + (install-file "MurmurHash3.h" out))) + #t))))) + (home-page "https://github.com/aappleby/smhasher") + (synopsis "Non-cryptographic hash function for lookup") + (description + "MurmurHash is a non-cryptographic hash function suitable for general +hash-based lookup. The name comes from two basic operations, multiply (MU) +and rotate (R), used in its inner loop.") + (license license:public-domain)))) -- 2.7.4