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 @@
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'generate-configure (add-after 'unpack 'generate-configure
(lambda _ (lambda _
(zero? (system* "sh" "autogen.sh"))))))) (invoke "sh" "autogen.sh"))))))
;; http://www.4store.org has been down for a while now. ;; http://www.4store.org has been down for a while now.
(home-page "https://github.com/4store/4store") (home-page "https://github.com/4store/4store")
(synopsis "Clustered RDF storage and query engine") (synopsis "Clustered RDF storage and query engine")
@ -207,14 +207,16 @@ and provides interfaces to the traditional file format.")
(delete 'reset-gzip-timestamps) (delete 'reset-gzip-timestamps)
(add-before 'check 'start-mongodb (add-before 'check 'start-mongodb
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(or (not tests?) (when tests?
(with-directory-excursion "src/gopkg.in/mgo.v2" (with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "startdb"))))) (invoke "make" "startdb")))
#t))
(add-after 'check 'stop'mongodb (add-after 'check 'stop'mongodb
(lambda* (#:key tests? #:allow-other-keys) (lambda* (#:key tests? #:allow-other-keys)
(or (not tests?) (when tests?
(with-directory-excursion "src/gopkg.in/mgo.v2" (with-directory-excursion "src/gopkg.in/mgo.v2"
(invoke "make" "stopdb")))))))) (invoke "make" "stopdb")))
#t)))))
(native-inputs (native-inputs
`(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1) `(("go-gopkg.in-check.v1" ,go-gopkg.in-check.v1)
("mongodb" ,mongodb) ("mongodb" ,mongodb)
@ -511,14 +513,12 @@ applications.")
(setenv "TZDIR" (setenv "TZDIR"
(string-append (assoc-ref inputs "tzdata") (string-append (assoc-ref inputs "tzdata")
"/share/zoneinfo")) "/share/zoneinfo"))
(or (not tests?) (when tests?
;; Note that with the tests, especially the unittests, the ;; Note that with the tests, especially the unittests, the
;; build can take up to ~45GB of space, as many tests are ;; build can take up to ~45GB of space, as many tests are
;; individual executable files, with some being hundreds of ;; individual executable files, with some being hundreds of
;; megabytes in size. ;; megabytes in size.
(begin (apply invoke `("scons" ,@common-options "dbtest" "unittests"))
(apply
invoke `("scons" ,@common-options "dbtest" "unittests"))
(substitute* "build/unittests.txt" (substitute* "build/unittests.txt"
;; TODO: Don't run the async_stream_test, as it hangs ;; TODO: Don't run the async_stream_test, as it hangs
(("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$") (("^build\\/opt\\/mongo\\/executor\\/async\\_stream\\_test\n$")
@ -529,10 +529,11 @@ applications.")
"")) ""))
(invoke "python" "buildscripts/resmoke.py" (invoke "python" "buildscripts/resmoke.py"
"--suites=dbtest,unittests" "--suites=dbtest,unittests"
(format #f "--jobs=~a" (parallel-job-count))))))) (format #f "--jobs=~a" (parallel-job-count))))
#t))
(replace 'install (replace 'install
(lambda _ (lambda* (#:key outputs #:allow-other-keys)
(let ((bin (string-append (assoc-ref %outputs "out") "/bin"))) (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
(install-file "mongod" bin) (install-file "mongod" bin)
(install-file "mongos" bin) (install-file "mongos" bin)
(install-file "mongo" bin)) (install-file "mongo" bin))
@ -1118,7 +1119,8 @@ data in a single database. RocksDB is partially based on @code{LevelDB}.")
(lambda _ (lambda _
(substitute* "Makefile" (substitute* "Makefile"
(("^gitrev :=.*$") (("^gitrev :=.*$")
(string-append "gitrev = \"v" ,version "\""))))) (string-append "gitrev = \"v" ,version "\"")))
#t))
;; The install phase of the Makefile assumes $PREFIX/usr/local/bin. ;; The install phase of the Makefile assumes $PREFIX/usr/local/bin.
;; This replacement does the same thing, except for using $PREFIX/bin ;; This replacement does the same thing, except for using $PREFIX/bin
;; instead. ;; instead.
@ -1127,14 +1129,13 @@ data in a single database. RocksDB is partially based on @code{LevelDB}.")
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))) (bin (string-append out "/bin")))
(install-file "sparql-query" bin) (install-file "sparql-query" bin)
(system* "ln" "--symbolic" (symlink (string-append bin "/sparql-query")
(string-append bin "/sparql-query") (string-append bin "/sparql-update")))
(string-append bin "/sparql-update"))))) #t))
(replace 'check (replace 'check
(lambda* (#:key make-flags #:allow-other-keys) (lambda* (#:key make-flags #:allow-other-keys)
(and (apply invoke "make" `(,@make-flags "scan-test"))
(zero? (apply system* "make" `(,@make-flags "scan-test"))) (invoke "./scan-test"))))))
(zero? (system "./scan-test"))))))))
(home-page "https://github.com/tialaramex/sparql-query/") (home-page "https://github.com/tialaramex/sparql-query/")
(synopsis "Command-line tool for accessing SPARQL endpoints over HTTP") (synopsis "Command-line tool for accessing SPARQL endpoints over HTTP")
(description "Sparql-query is a command-line tool for accessing SPARQL (description "Sparql-query is a command-line tool for accessing SPARQL
@ -1259,8 +1260,8 @@ is in the public domain.")
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
;; The 'configure' script is a wrapper for Waf and ;; The 'configure' script is a wrapper for Waf and
;; doesn't recognize things like '--enable-fast-install'. ;; doesn't recognize things like '--enable-fast-install'.
(zero? (system* "./configure" (invoke "./configure"
(string-append "--prefix=" out))))))))) (string-append "--prefix=" out))))))))
(native-inputs (native-inputs
`(;; TODO: Build the documentation. `(;; TODO: Build the documentation.
;; ("docbook-xsl" ,docbook-xsl) ;; ("docbook-xsl" ,docbook-xsl)
@ -2009,8 +2010,7 @@ can autogenerate peewee models using @code{pwiz}, a model generator.")
(assoc-ref %standard-phases 'check)) (assoc-ref %standard-phases 'check))
(replace 'check (replace 'check
(lambda _ (lambda _
(zero? (invoke "./testfixture" "test/crypto.test"))))))
(system* "./testfixture" "test/crypto.test")))))))
(home-page "https://www.zetetic.net/sqlcipher/") (home-page "https://www.zetetic.net/sqlcipher/")
(synopsis (synopsis
"Library providing transparent encryption of SQLite database files") "Library providing transparent encryption of SQLite database files")
@ -2805,7 +2805,7 @@ is designed to have a low barrier to entry.")
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'check (replace 'check
(lambda _ (zero? (system* "py.test"))))))) (lambda _ (invoke "py.test"))))))
(native-inputs (native-inputs
`(("python-pytest" ,python-pytest))) `(("python-pytest" ,python-pytest)))
(home-page "https://github.com/andialbrecht/sqlparse") (home-page "https://github.com/andialbrecht/sqlparse")
@ -2872,7 +2872,7 @@ transforms idiomatic python function calls to well-formed SQL queries.")
(delete 'install-source) (delete 'install-source)
(replace 'build (replace 'build
(lambda _ (lambda _
(every (lambda (tool) (for-each (lambda (tool)
(let ((command (let ((command
`("go" "build" `("go" "build"
;; This is where the tests expect to find the ;; This is where the tests expect to find the
@ -2890,23 +2890,28 @@ transforms idiomatic python function calls to well-formed SQL queries.")
(simple-format #t "build: running ~A\n" (simple-format #t "build: running ~A\n"
(string-join command)) (string-join command))
(apply invoke command))) (apply invoke command)))
all-tools))) all-tools)
#t))
(replace 'check (replace 'check
(lambda _ (lambda _
(with-directory-excursion "src" (with-directory-excursion "src"
(every (lambda (tool) (for-each (lambda (tool)
(invoke (invoke
"go" "test" "-v" "go" "test" "-v"
(string-append "github.com/mongodb/mongo-tools/" tool))) (string-append "github.com/mongodb/mongo-tools/"
all-tools)))) tool)))
all-tools))
#t))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(for-each (lambda (tool) (for-each (lambda (tool)
(install-file (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") (string-append (assoc-ref outputs "out")
"/bin"))) "/bin")))
all-tools))))))) all-tools)
#t))))))
(native-inputs (native-inputs
`(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass) `(("go-github.com-howeyc-gopass" ,go-github.com-howeyc-gopass)
("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags) ("go-github.com-jessevdk-go-flags" ,go-github.com-jessevdk-go-flags)