guix-patches
[Top][All Lists]
Advanced

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

[bug#30214] [PATCH 06/10] gnu: Add go-gopkg.in-mgo.v2.


From: Christopher Baines
Subject: [bug#30214] [PATCH 06/10] gnu: Add go-gopkg.in-mgo.v2.
Date: Tue, 23 Jan 2018 20:21:58 +0000

* gnu/packages/databases.scm (go-gopkg.in-mgo.v2): New variable.
---
 gnu/packages/databases.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index c0cf41a5b..bc22fed37 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -49,6 +49,7 @@
 
 (define-module (gnu packages databases)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
@@ -94,6 +95,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system go)
   #:use-module (guix build-system perl)
   #:use-module (guix build-system python)
   #:use-module (guix build-system ruby)
@@ -173,6 +175,56 @@ store key/value pairs in a file in a manner similar to the 
Unix dbm library
 and provides interfaces to the traditional file format.")
     (license license:gpl3+)))
 
+(define-public go-gopkg.in-mgo.v2
+  (package
+    (name "go-gopkg.in-mgo.v2")
+    (version "2016.08.01")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/go-mgo/mgo/archive/r";
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "09li3qc5c5idw4qldy0yzfh1vwac3hpslnq96g3s3mld9wwpnmg2"))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "gopkg.in/mgo.v2"
+       #:unpack-path "gopkg.in"
+       ;; TODO: Starting mongo for running the tests currently fails
+       ;; Error parsing command line: unrecognised option '--chunkSize'
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'rename-archive
+           (lambda _
+             (rename-file
+              ,(string-append "src/gopkg.in/mgo-r" version)
+              "src/gopkg.in/mgo.v2")
+             #t))
+         (add-before 'check 'start-mongodb
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+                 (with-directory-excursion "src/gopkg.in/mgo.v2"
+                   (invoke "make" "startdb")))))
+         (add-after 'check 'stop'mongodb
+           (lambda* (#:key tests? #:allow-other-keys)
+             (if tests?
+                 (with-directory-excursion "src/gopkg.in/mgo.v2"
+                   (invoke "make" "stopdb"))))))))
+    (native-inputs
+     `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
+       ("mongodb" ,mongodb)
+       ("daemontools" ,daemontools)))
+    (synopsis "@code{mgo} offers a rich MongoDB driver for Go.")
+    (description
+     "@code{mgo} (pronounced as mango) is a MongoDB driver for the Go language.
+It implements a rich selection of features under a simple API following
+standard Go idioms.")
+    (home-page "http://labix.org/mgo";)
+    (license license:bsd-2)))
+
 (define-public bdb
   (package
     (name "bdb")
-- 
2.16.0






reply via email to

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