summaryrefslogtreecommitdiff
path: root/gnu/packages/databases.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-02-20 12:30:17 +0200
committerEfraim Flashner <efraim@flashner.co.il>2022-02-20 12:34:23 +0200
commit781dd2de230e37e1dc05c992936125655fdf842f (patch)
tree20c303dcfbf333f7f59bd2f2494d249db394cac7 /gnu/packages/databases.scm
parentbc11d9ceb231068ed3aad8b33a28b895c6520af4 (diff)
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.
Diffstat (limited to 'gnu/packages/databases.scm')
-rw-r--r--gnu/packages/databases.scm24
1 files changed, 23 insertions, 1 deletions
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