guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#28198] [PATCH 2/4] gnu: Add mongodb.


From: Christopher Baines
Subject: [bug#28198] [PATCH 2/4] gnu: Add mongodb.
Date: Wed, 23 Aug 2017 10:25:14 +0100

* gnu/packages/databases.scm (mongodb): 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 77abed691..9d98da3c0 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -66,8 +66,10 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages rdf)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages serialization)
   #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages xml)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -314,6 +316,90 @@ and generic API, and was originally intended for use with 
dynamic web
 applications.")
     (license license:bsd-3)))
 
+(define-public mongodb
+  (package
+    (name "mongodb")
+    (version "3.4.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/mongodb/mongo/archive/r";
+                                  version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32 
"1ccd6azplqpi9pp3l6fsi8240kkgagq5j6c2dksppjn7slk1kdy8"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("scons" ,scons)
+       ("python" ,python-2)
+       ("openssl" ,openssl)
+       ("boost" ,boost)
+       ("snappy" ,snappy)
+       ("zlib" ,zlib)
+       ("pcre" ,pcre)
+       ("valgrind" ,valgrind)
+       ("yaml-cpp" ,yaml-cpp)
+       ("perl" ,perl)))
+    (arguments
+     `(#:tests? #f ;; TODO: Check phase currently fails
+       #:phases
+       (let ((common-options
+              `(;; "--use-system-tcmalloc" TODO: Missing gperftools
+                "--use-system-pcre"
+                ;; TODO
+                ;; build/opt/mongo/db/fts/unicode/string.o failed: Error 1
+                ;; "--use-system-boost"
+                "--use-system-snappy"
+                "--use-system-zlib"
+                "--use-system-valgrind"
+                ;; "--use-system-stemmer" TODO: Missing relevant package
+                "--use-system-yaml"
+                "--disable-warnings-as-errors"
+                ,(format #f "--jobs=~a" (parallel-job-count))
+                "--ssl")))
+         (modify-phases %standard-phases
+           (delete 'configure) ; There is no configure phase
+           (add-after 'unpack 'scons-propagate-environment
+             (lambda _
+               ;; Modify the SConstruct file to arrange for
+               ;; environment variables to be propagated.
+               (substitute* "SConstruct"
+                 (("^env = Environment\\(")
+                  "env = Environment(ENV=os.environ, "))))
+           (add-after 'unpack 'create-version-file
+             (lambda _
+               (call-with-output-file "version.json"
+                 (lambda (port)
+                   (display ,(simple-format #f "{
+    \"version\": \"~A\"
+}" version) port)))))
+           (replace 'build
+             (lambda _
+               (zero? (apply system*
+                             `("scons"
+                               ,@common-options
+                               "mongod" "mongo" "mongos")))))
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (or (not tests?)
+                   (zero? (apply system*
+                                 `("scons"
+                                   ,@common-options
+                                   "dbtest" "unittests"))))))
+           (replace 'install
+             (lambda _
+               (let ((bin  (string-append (assoc-ref %outputs "out") "/bin")))
+                 (install-file "mongod" bin)
+                 (install-file "mongos" bin)
+                 (install-file "mongo" bin))))))))
+    (home-page "https://www.mongodb.org/";)
+    (synopsis "High performance and high availability document database")
+    (description
+     "Mongo is a high-performance, high availability, schema-free
+document-oriented database.  A key goal of MongoDB is to bridge the gap
+between key/value stores (which are fast and highly scalable) and traditional
+RDBMS systems (which are deep in functionality).")
+    (license (list license:agpl3 license:asl2.0))))
+
 (define-public mysql
   (package
     (name "mysql")
-- 
2.14.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]