From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: [PATCH 4/6] gnu: Add rocksdb. Date: Sun, 15 Jan 2017 21:33:36 +0100 Message-ID: <20170115203338.19769-5-mbakke@fastmail.com> References: <20170115203338.19769-1-mbakke@fastmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSrV9-0002h6-53 for guix-devel@gnu.org; Sun, 15 Jan 2017 15:34:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSrV8-0002VP-0R for guix-devel@gnu.org; Sun, 15 Jan 2017 15:34:07 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:45914) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cSrV7-0002VG-S1 for guix-devel@gnu.org; Sun, 15 Jan 2017 15:34:05 -0500 In-Reply-To: <20170115203338.19769-1-mbakke@fastmail.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 Cc: Marius Bakke * gnu/packages/databases.scm (rocksdb): New variable. --- gnu/packages/databases.scm | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 4bbe55bab..610749d98 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -54,8 +54,10 @@ #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages gnupg) #:use-module (gnu packages python) + #:use-module (gnu packages parallel) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages popt) #:use-module (gnu packages rdf) #:use-module (gnu packages xml) #:use-module (gnu packages bison) @@ -480,6 +482,90 @@ types are supported, as is encryption.") (license gpl3+) (home-page "http://www.gnu.org/software/recutils/"))) +(define-public rocksdb + (package + (name "rocksdb") + (version "5.0.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/facebook/rocksdb" + "/archive/v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0kija4q6nbkjaj1x94q6qb73abgc5i49rakppxj3a368pg9nwz54")) + (modules '((guix build utils))) + (snippet + '(begin + ;; TODO: unbundle gtest. + (delete-file "build_tools/gnu_parallel") + #t)))) + (build-system gnu-build-system) + (arguments + '(#:make-flags (list "CC=gcc" + ;; Make the resulting library position-independent so the + ;; static version can be included in shared objects. + "EXTRA_CXXFLAGS=-fPIC" + (string-append "INSTALL_PATH=" + (assoc-ref %outputs "out"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-source + (lambda _ + (substitute* "Makefile" + (("build_tools/gnu_parallel") "parallel") + (("#!/bin/sh") (string-append "#!" (which "sh")))) + #t)) + (delete 'configure) + (add-before 'check 'disable-failing-tests + (lambda _ + (substitute* "Makefile" + ;; These tests reliably fail due to "Too many open files". + (("^[[:blank:]]+env_test[[:blank:]]+\\\\") "\\") + (("^[[:blank:]]+persistent_cache_test[[:blank:]]+\\\\") "\\")) + #t)) + (add-after 'check 'build-release-libraries + ;; The 'check' target depends on the default target which + ;; is compiled with debug symbols. The 'install' target depends + ;; on custom release targets so we build them here for clarity. + ;; TODO: Add debug output. + (lambda* (#:key (make-flags '()) #:allow-other-keys) + ;; Prevent the build from adding machine-specific optimizations. + ;; This does not work if passed as a make flag... + (setenv "PORTABLE" "1") + (and (zero? (apply system* "make" "static_lib" make-flags)) + (zero? (apply system* "make" "shared_lib" make-flags))))) + (add-after 'install 'move-static-library + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (static (assoc-ref outputs "static")) + (slib (string-append static "/lib"))) + (mkdir-p slib) + (for-each (lambda (file) + (install-file file slib) + (delete-file file)) + (find-files lib "\\.l?a$")) + #t)))))) + (outputs + '("out" "static")) + (native-inputs + `(("parallel" ,parallel) + ("perl" ,perl) + ("procps" ,procps) + ("python" ,python-2))) + (inputs + `(("bzip2" ,bzip2) + ("gflags" ,gflags) + ("snappy" ,snappy) + ("zlib" ,zlib))) + (home-page "http://rocksdb.org/") + (synopsis "Persistent key-value store for fast storage") + (description + "RocksDB is an embeddable, persistent key-value storage library that is +designed for flash and RAM storage.") + (license bsd-3))) + (define-public sparql-query (package (name "sparql-query") -- 2.11.0