Subject: [PATCH] gnu: bdb: fix the cross build.
From: 路辉 <[email-masked]>
To: guix-patches <[email-masked]>
Date: Fri, 16 Sep 2022 15:04:23 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

From d9bc4d42ca2d5a06def537d143c85c289bdb9c39 Mon Sep 17 00:00:00 2001
From: Lu Hui <[email-masked]>
Date: Fri, 16 Sep 2022 23:02:28 +0800
Subject: [PATCH] gnu: bdb: fix the cross build.

* gnu/packages/dbm.scm (bdb): fix cross build
---
 gnu/packages/dbm.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/dbm.scm b/gnu/packages/dbm.scm
index 8b6804aa92..2d3cce9e15 100644
--- a/gnu/packages/dbm.scm
+++ b/gnu/packages/dbm.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
 ;;; Copyright © 2021 Leo Le Bouter <[email-masked]>
 ;;; Copyright © 2021 Maxime Devos <[email-masked]>
+;;; Copyright © 2021 LuHui <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -65,7 +66,8 @@ (define-public bdb-4.8
          ;; for "--build", but not for "--host", so update config.sub.
          ,@(if (and (%current-target-system)
                     (or (target-ppc64le? (%current-target-system))
-                        (target-aarch64? (%current-target-system))))
+                        (target-aarch64? (%current-target-system))
+                        (target-riscv64? (%current-target-system))))
                `((add-after 'unpack 'update-config.sub
                    (lambda* (#:key native-inputs #:allow-other-keys)
                      (delete-file "dist/config.sub")
@@ -118,7 +120,8 @@ (define-public bdb-4.8
     (native-inputs
      (if (and (%current-target-system)
               (or (target-ppc64le? (%current-target-system))
-                  (target-aarch64? (%current-target-system))))
+                  (target-aarch64? (%current-target-system))
+                  (target-riscv64? (%current-target-system))))
          `(("config" ,config)) ; for config.sub
          '()))
     (synopsis "Berkeley database")
-- 
2.37.3