From 259341cf93de80533d212cb73e5e652aa4bc716c Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Tue, 12 Jun 2018 19:51:23 +0200 Subject: [PATCH] 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. --- gnu/packages/samba.scm | 9 +++++++-- guix/utils.scm | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index abbfdd83c4..e10f00a83b 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -362,7 +362,10 @@ (define-public ldb #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 @@ (define-public ldb `(("talloc" ,talloc) ("tdb" ,tdb))) (inputs - `(("lmdb" ,lmdb) + `(,@(if (target-64bit?) + `(("lmdb" ,lmdb)) + '()) ("popt" ,popt) ("tevent" ,tevent))) (synopsis "LDAP-like embedded database") diff --git a/guix/utils.scm b/guix/utils.scm index e9efea5866..a5de9605e7 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2015 David Thompson ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2018 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ (define-module (guix utils) package-name->name+version target-mingw? target-arm32? + target-64bit? version-compare version>? version>=? @@ -474,6 +476,10 @@ (define* (target-mingw? #:optional (target (%current-target-system))) (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))