aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/databases.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-02-02 10:52:24 -0500
committerLeo Famulari <leo@famulari.name>2017-02-02 10:52:24 -0500
commite8c83d04e176f205b30b3d470f22ee5e1c686331 (patch)
tree30a95626ea31414a6319b93f50eea1e69b87a619 /gnu/packages/databases.scm
parentd9b4cbc2a168ca3d248c5abf1f1d14c1808e6a20 (diff)
parentde643f0c15677665acce73db9c28c5488e623633 (diff)
downloadpatches-e8c83d04e176f205b30b3d470f22ee5e1c686331.tar
patches-e8c83d04e176f205b30b3d470f22ee5e1c686331.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/databases.scm')
-rw-r--r--gnu/packages/databases.scm91
1 files changed, 90 insertions, 1 deletions
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 2638b229df..050ed0e19b 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -55,15 +55,17 @@
#: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)
#:use-module (gnu packages jemalloc)
#:use-module ((guix licenses)
#:select (gpl2 gpl3 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
- bsd-2 bsd-3 public-domain))
+ bsd-2 bsd-3 public-domain asl2.0))
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
@@ -510,6 +512,93 @@ 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.2")
+ (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
+ "1jj8b50w8jr3bnyjzk2hmlzq9x49yihjilx3xlq2rfdx3q9x4fay"))
+ (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-Makefile
+ (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 shared and
+ ;; static 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 'delete-static-library
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (lib (string-append out "/lib")))
+ (for-each (lambda (file)
+ (delete-file file))
+ (find-files lib "\\.l?a$"))
+ #t))))))
+ (native-inputs
+ `(("parallel" ,parallel)
+ ("perl" ,perl)
+ ("procps" ,procps)
+ ("python" ,python-2)))
+ (inputs
+ `(("bzip2" ,bzip2)
+ ("gflags" ,gflags)
+ ("jemalloc" ,jemalloc)
+ ("lz4" ,lz4)
+ ("snappy" ,snappy)
+ ("zlib" ,zlib)))
+ (home-page "http://rocksdb.org/")
+ (synopsis "Persistent key-value store for fast storage")
+ (description
+ "RocksDB is a library that forms the core building block for a fast
+key-value server, especially suited for storing data on flash drives. It
+has a @dfn{Log-Structured-Merge-Database} (LSM) design with flexible tradeoffs
+between @dfn{Write-Amplification-Factor} (WAF), @dfn{Read-Amplification-Factor}
+(RAF) and @dfn{Space-Amplification-Factor} (SAF). It has multi-threaded
+compactions, making it specially suitable for storing multiple terabytes of
+data in a single database. RocksDB is partially based on @code{LevelDB}.")
+ ;; RocksDB is BSD-3 and the JNI adapter is Apache 2.0.
+ (license (list bsd-3 asl2.0))))
+
(define-public sparql-query
(package
(name "sparql-query")