From 781dd2de230e37e1dc05c992936125655fdf842f Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 20 Feb 2022 12:30:17 +0200 Subject: gnu: postgresql-13: Fix building on riscv64-linux. * gnu/packages/databases.scm (postgresql-13)[arguments]: Add phase when buidling for riscv64-linux to apply a patch. [native-inputs]: When building for riscv64-linux add patch and patch file. * gnu/packages/patches/postgresql-riscv-spinlocks.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/packages/databases.scm | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'gnu/packages/databases.scm') diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index c71f208f2b..21f6e605a7 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -1278,7 +1278,29 @@ pictures, sounds, or video.") version "/postgresql-" version ".tar.bz2")) (sha256 (base32 - "1kf0gcsrl5n25rjlvkh87aywmn28kbwvakm5c7j1qpr4j01y34za")))))) + "1kf0gcsrl5n25rjlvkh87aywmn28kbwvakm5c7j1qpr4j01y34za")))) + (arguments + (if (target-riscv64?) + `(,@(substitute-keyword-arguments (package-arguments postgresql-14) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'apply-riscv-spinlock-patch + ;; The patch is applied in this custom phase and not via the + ;; "origin" object above to avoid rebuilding a large number + ;; of packages on other platforms. + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch-file + #$(local-file + (search-patch + "postgresql-riscv-spinlocks.patch")))) + (invoke "patch" "-p1" "-i" patch-file)))))))) + `(,@(package-arguments postgresql-14)))) + (native-inputs + (if (target-riscv64?) + (list + (local-file (search-patch "postgresql-riscv-spinlocks.patch")) + patch) + '())))) (define-public postgresql-11 (package -- cgit v1.2.3