From de2729bd962616c86c4a3c1c29a1eb9cfd7ab199 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 25 Jan 2023 20:52:05 -0500 Subject: [PATCH] gnu: rpm: Set localstatedir to /var. * gnu/packages/package-management.scm (rpm) [configure-flags]: Add --localstatedir=/var. [phases] {patch-build-system}: New phase. --- gnu/packages/package-management.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 85c1c3a9fa..820c9bb468 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -842,13 +842,22 @@ features of Stow with some extensions.") (outputs '("out" "debug")) (build-system gnu-build-system) (arguments - '(#:configure-flags '("--enable-python") + '(#:configure-flags '("--enable-python" + ;; The RPM database must be writable. + "--localstatedir=/var") #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-lua-check (lambda _ (substitute* "configure" (("lua >= ?.?") - "lua-5.3 >= 5.3"))))))) + "lua-5.3 >= 5.3")))) + (add-after 'unpack 'patch-build-system + (lambda _ + ;; The build system attempts to create /var in the build + ;; chroot, and fails. + (substitute* "Makefile.in" + ((".*MKDIR_P) \\$\\(DESTDIR)\\$\\(localstatedir.*") + ""))))))) (native-inputs (list pkg-config python))