gnu: databases: Return #t from all phases.

* gnu/packages/databases.scm (4store, go-gopkg.in-mgo.v2, mongodb)
(sparql-query, tdb, sqlcipher, python-sqlparse, mongo-tools): Return #t from
all phases, use invoke where appropriate, and remove vestigial plumbing.
This commit is contained in:
Mark H Weaver 2018-06-27 22:24:08 -04:00
parent 9f6f726c7f
commit 96272e2822
No known key found for this signature in database
GPG key ID: 7CEF29847562C516

View file

@ -153,7 +153,7 @@ (define-public 4store
(modify-phases %standard-phases
(add-after 'unpack 'generate-configure
(lambda _
(zero? (system* "sh" "autogen.sh")))))))
(invoke "sh" "autogen.sh"))))))
;; http://www.4store.org has been down for a while now.
(home-page "https://github.com/4store/4store")
(synopsis "Clustered RDF storage and query engine")
@ -207,14 +207,16 @@ (define-public go-gopkg.in-mgo.v2
(delete 'reset-gzip-timestamps)
(add-before 'check 'start-mongodb
(lambda* (#:key tests? #:allow-other-keys)
(or (not tests?)
(with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "startdb")))))
(when tests?
(with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "startdb")))
#t))
(add-after 'check 'stop'mongodb
(lambda* (#:key tests? #:allow-other-keys)
(or (not tests?)
(with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "stopdb"))))))))
(when tests?
(with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "stopdb")))
#t)))))
(native-inputs
`(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
("mongodb" ,mongodb)
@ -511,28 +513,27 @@ (define-public mongodb
(setenv "TZDIR"
(string-append (assoc-ref inputs "tzdata")
"/share/zoneinfo"))
(or (not tests?)
;; Note that with the tests, especially the unittests, the
;; build can take up to ~45GB of space, as many tests are
;; individual executable files, with some being hundreds of
;; megabytes in size.
(begin
(apply
invoke `("scons" ,@common-options "dbtest" "unittests"))
(substitute* "build/unittests.txt"
;; TODO: Don't run the async_stream_test, as it hangs
(("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
"")
;; TODO: This test fails
;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
(("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
""))
(invoke "python" "buildscripts/resmoke.py"
"--suites=dbtest,unittests"
(format #f "--jobs=~a" (parallel-job-count)))))))
(when tests?
;; Note that with the tests, especially the unittests, the
;; build can take up to ~45GB of space, as many tests are
;; individual executable files, with some being hundreds of
;; megabytes in size.
(apply invoke `("scons" ,@common-options "dbtest" "unittests"))
(substitute* "build/unittests.txt"
;; TODO: Don't run the async_stream_test, as it hangs
(("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
"")
;; TODO: This test fails
;; Expected 0UL != disks.size() (0 != 0) @src/mongo/util/procparser_test.cpp:476
(("^build\\/opt\\/mongo\\/util\\/procparser\\_test\n$")
""))
(invoke "python" "buildscripts/resmoke.py"
"--suites=dbtest,unittests"
(format #f "--jobs=~a" (parallel-job-count))))
#t))
(replace 'install
(lambda _
(let ((bin (string-append (assoc-ref %outputs "out") "/bin")))
(lambda* (#:key outputs #:allow-other-keys)
(let ((bin (string-append (assoc-ref outputs "out") "/bin")))
(install-file "mongod" bin)
(install-file "mongos" bin)
(install-file "mongo" bin))
@ -1118,7 +1119,8 @@ (define-public sparql-query
(lambda _
(substitute* "Makefile"
(("^gitrev :=.*$")
(string-append "gitrev = \"v" ,version "\"")))))
(string-append "gitrev = \"v" ,version "\"")))
#t))
;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
;; This replacement does the same thing, except for using $PREFIX/bin
;; instead.
@ -1127,14 +1129,13 @@ (define-public sparql-query
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(install-file "sparql-query" bin)
(system* "ln" "--symbolic"
(string-append bin "/sparql-query")
(string-append bin "/sparql-update")))))
(symlink (string-append bin "/sparql-query")
(string-append bin "/sparql-update")))
#t))
(replace 'check
(lambda* (#:key make-flags #:allow-other-keys)
(and
(zero? (apply system* "make" `(,@make-flags "scan-test")))
(zero? (system "./scan-test"))))))))
(apply invoke "make" `(,@make-flags "scan-test"))
(invoke "./scan-test"))))))
(home-page "https://github.com/tialaramex/sparql-query/")
(synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
(description "Sparql-query is a command-line tool for accessing SPARQL
@ -1259,8 +1260,8 @@ (define-public tdb
(let ((out (assoc-ref outputs "out")))
;; The 'configure' script is a wrapper for Waf and
;; doesn't recognize things like '--enable-fast-install'.
(zero? (system* "./configure"
(string-append "--prefix=" out)))))))))
(invoke "./configure"
(string-append "--prefix=" out))))))))
(native-inputs
`(;; TODO: Build the documentation.
;; ("docbook-xsl" ,docbook-xsl)
@ -2009,8 +2010,7 @@ (define-public sqlcipher
(assoc-ref %standard-phases 'check))
(replace 'check
(lambda _
(zero?
(system* "./testfixture" "test/crypto.test")))))))
(invoke "./testfixture" "test/crypto.test"))))))
(home-page "https://www.zetetic.net/sqlcipher/")
(synopsis
"Library providing transparent encryption of SQLite database files")
@ -2805,7 +2805,7 @@ (define-public python-sqlparse
`(#:phases
(modify-phases %standard-phases
(replace 'check
(lambda _ (zero? (system* "py.test")))))))
(lambda _ (invoke "py.test"))))))
(native-inputs
`(("python-pytest" ,python-pytest)))
(home-page "https://github.com/andialbrecht/sqlparse")
@ -2872,41 +2872,46 @@ (define-public mongo-tools
(delete 'install-source)
(replace 'build
(lambda _
(every (lambda (tool)
(let ((command
`("go" "build"
;; This is where the tests expect to find the
;; executables
"-o" ,(string-append
"src/github.com/mongodb/mongo-tools/bin/"
tool)
"-v"
"-tags=\"ssl sasl\""
"-ldflags"
"-extldflags=-Wl,-z,now,-z,relro"
,(string-append
"src/github.com/mongodb/mongo-tools/"
tool "/main/" tool ".go"))))
(simple-format #t "build: running ~A\n"
(string-join command))
(apply invoke command)))
all-tools)))
(for-each (lambda (tool)
(let ((command
`("go" "build"
;; This is where the tests expect to find the
;; executables
"-o" ,(string-append
"src/github.com/mongodb/mongo-tools/bin/"
tool)
"-v"
"-tags=\"ssl sasl\""
"-ldflags"
"-extldflags=-Wl,-z,now,-z,relro"
,(string-append
"src/github.com/mongodb/mongo-tools/"
tool "/main/" tool ".go"))))
(simple-format #t "build: running ~A\n"
(string-join command))
(apply invoke command)))
all-tools)
#t))
(replace 'check
(lambda _
(with-directory-excursion "src"
(every (lambda (tool)
(invoke
"go" "test" "-v"
(string-append "github.com/mongodb/mongo-tools/" tool)))
all-tools))))
(for-each (lambda (tool)
(invoke
"go" "test" "-v"
(string-append "github.com/mongodb/mongo-tools/"
tool)))
all-tools))
#t))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(for-each (lambda (tool)
(install-file
(string-append "src/github.com/mongodb/mongo-tools/bin/" tool)
(string-append "src/github.com/mongodb/mongo-tools/bin/"
tool)
(string-append (assoc-ref outputs "out")
"/bin")))
all-tools)))))))
all-tools)
#t))))))
(native-inputs
`(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)