gnu: rpm: Restore localstatedir to /var.

Commit 51e1f76 migrated the build system to CMake, and in the process, the
localstatedir value became $prefix/var (inside the package prefix), which
is not useful as this place should be writable for proper operation.

* gnu/packages/package-management.scm (rpm) [#:phases]
{install-macros-file}: New phase.

Change-Id: I1d069243d3b1aff3b0cf0ae79ad5823f8c2a4aeb
This commit is contained in:
Maxim Cournoyer 2025-09-30 15:44:15 +09:00
parent 4c6b2da2ed
commit 87ebd01a05
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -18,7 +18,7 @@
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net> ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru> ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2021, 2022, 2023, 2025 Maxim Cournoyer <maxim@guixotic.coop>
;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com> ;;; Copyright © 2021 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2022, 2023 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2023 jgart <jgart@dismail.de> ;;; Copyright © 2023 jgart <jgart@dismail.de>
@ -1043,7 +1043,7 @@ features of Stow with some extensions.")
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
(list (list
#:tests? #f ; TEST need fhs envirnment. #:tests? #f ;tests require FHS environment
#:configure-flags #:configure-flags
#~(list #~(list
;; TODO: Add rpm-sequoia ;; TODO: Add rpm-sequoia
@ -1073,7 +1073,16 @@ features of Stow with some extensions.")
site))) site)))
(substitute* "plugins/CMakeLists.txt" (substitute* "plugins/CMakeLists.txt"
(("\\$[{]dbus-1_DATADIR[}]") (("\\$[{]dbus-1_DATADIR[}]")
(string-append #$output "/share")))))))) (string-append #$output "/share")))))
(add-after 'install 'install-macros-file
(lambda _
(define macros (string-append #$output "/etc/rpm/macros"))
(mkdir-p (dirname macros))
(call-with-output-file macros
(lambda (p)
(format p "\
%_var /var
%_localstatedir /var~%"))))))))
(native-inputs (native-inputs
(list pkg-config (list pkg-config
python python