all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add mongodb.
@ 2016-03-17 15:08 Roel Janssen
  2016-03-18 19:10 ` Leo Famulari
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Roel Janssen @ 2016-03-17 15:08 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: 0001-gnu-Add-mongodb.patch --]
[-- Type: text/x-patch, Size: 4982 bytes --]

From 47d5ad30c1e1e2a24b950236590e10bbf72c277e Mon Sep 17 00:00:00 2001
From: Roel Janssen <roel@gnu.org>
Date: Thu, 17 Mar 2016 16:06:40 +0100
Subject: [PATCH] gnu: Add mongodb.

* gnu/packages/databases.scm (mongodb): New variable.
* gnu/packages/patches/mongodb-add-version-file.patch: New file.
* gnu-system.am (dist_patch_DATA): Add patch file.
---
 gnu-system.am                                      |  1 +
 gnu/packages/databases.scm                         | 51 +++++++++++++++++++++-
 .../patches/mongodb-add-version-file.patch         | 10 +++++
 3 files changed, 60 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/mongodb-add-version-file.patch

diff --git a/gnu-system.am b/gnu-system.am
index 634093a..7517cc0 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -633,6 +633,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/mpc123-initialize-ao.patch		\
   gnu/packages/patches/mplayer2-theora-fix.patch		\
   gnu/packages/patches/module-init-tools-moduledir.patch	\
+  gnu/packages/patches/mongodb-add-version-file.patch		\
   gnu/packages/patches/mumps-build-parallelism.patch		\
   gnu/packages/patches/mupen64plus-ui-console-notice.patch	\
   gnu/packages/patches/mutt-store-references.patch		\
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 755bf4f..a3a3744 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2015 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,8 +47,8 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages jemalloc)
   #:use-module ((guix licenses)
-                #:select (gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft
-                          bsd-2 bsd-3 public-domain))
+                #:select (asl2.0 agpl3 gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style
+                          non-copyleft bsd-2 bsd-3 public-domain))
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -271,6 +272,52 @@ Language.")
 as a drop-in replacement of MySQL.")
     (license gpl2)))
 
+(define-public mongodb
+  (package
+    (name "mongodb")
+    (version "3.3.3")
+    (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 "01v16j8xbry7m7apwlhiqhgx3zyyk2kadyk2sr9m6k20wnh5j24y"))
+              (patches (list (search-patch "mongodb-add-version-file.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("scons" ,scons)
+       ("python" ,python-2)
+       ("perl" ,perl)))
+    (arguments
+     `(#:tests? #f ; There is no 'check' target.
+       #:phases
+       (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, "))))
+         (replace 'build
+           (lambda _
+             (zero? (system* "scons" "mongod" "mongo" "mongos"))))
+         (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 agpl3 asl2.0))))
+
 (define-public postgresql
   (package
     (name "postgresql")
diff --git a/gnu/packages/patches/mongodb-add-version-file.patch b/gnu/packages/patches/mongodb-add-version-file.patch
new file mode 100644
index 0000000..ffcb70e
--- /dev/null
+++ b/gnu/packages/patches/mongodb-add-version-file.patch
@@ -0,0 +1,10 @@
+This patch is used to replace the need for git.  It's a work-around
+for a problem described here: https://jira.mongodb.org/browse/SERVER-21317
+
+Patch by Roel Janssen <roel@gnu.org>
+--- a/version.json	1970-01-01 01:00:00.000000000 +0100
++++ b/version.json	2016-03-16 15:10:23.933578071 +0100
+@@ -0,0 +1,3 @@
++{
++    "version": "3.3.3-guix-"
++}
-- 
2.5.0


[-- Attachment #2: Type: text/plain, Size: 193 bytes --]

Dear Guix,

This is a patch to add MongoDB (server and client) tools.  I used a
three-line patch to fix the build process's reliance on Git and the
.git/ directory.

Kind regards,
Roel Janssen

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-16 20:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17 15:08 [PATCH] gnu: Add mongodb Roel Janssen
2016-03-18 19:10 ` Leo Famulari
2016-03-18 19:45 ` Thompson, David
2016-03-18 20:46   ` Ludovic Courtès
2016-03-19  9:19   ` Roel Janssen
2016-04-29 14:48     ` Ludovic Courtès
2016-04-30  0:06       ` Roel Janssen
2017-08-23  9:30 ` Christopher Baines
2017-09-15 17:24   ` [bug#28198] " Christopher Baines
2017-09-16 20:37     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.