gnu: ldb: Fix build on 32-bit systems.

* guix/utils.scm (target-64bit?): New procedure.
* gnu/packages/samba.scm (ldb)[inputs]: Only add LMDB on 64-bit systems.
[arguments]: Make #:tests? conditional on LMDB availability.
This commit is contained in:
Marius Bakke 2018-06-12 19:51:23 +02:00
parent 406c83f78d
commit 259341cf93
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
2 changed files with 13 additions and 2 deletions

View File

@ -362,7 +362,10 @@ many event types, including timers, signals, and the classic file descriptor eve
#t))))
(build-system gnu-build-system)
(arguments
'(#:phases
'(;; LMDB is only supported on 64-bit systems, yet the test suite
;; requires it.
#:tests? (assoc-ref %build-inputs "lmdb")
#:phases
(modify-phases %standard-phases
(replace 'configure
;; ldb use a custom configuration script that runs waf.
@ -382,7 +385,9 @@ many event types, including timers, signals, and the classic file descriptor eve
`(("talloc" ,talloc)
("tdb" ,tdb)))
(inputs
`(("lmdb" ,lmdb)
`(,@(if (target-64bit?)
`(("lmdb" ,lmdb))
'())
("popt" ,popt)
("tevent" ,tevent)))
(synopsis "LDAP-like embedded database")

View File

@ -7,6 +7,7 @@
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Marius Bakke <mbakke@fastmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -77,6 +78,7 @@
package-name->name+version
target-mingw?
target-arm32?
target-64bit?
version-compare
version>?
version>=?
@ -474,6 +476,10 @@ a character other than '@'."
(define (target-arm32?)
(string-prefix? "arm" (or (%current-target-system) (%current-system))))
(define (target-64bit?)
(let ((system (or (%current-target-system) (%current-system))))
(any (cut string-prefix? <> system) '("x86_64" "aarch64" "mips64" "ppc64"))))
(define version-compare
(let ((strverscmp
(let ((sym (or (dynamic-func "strverscmp" (dynamic-link))