gnu: plocate: Build with "--sharedstatedir=/var".
authorykonai <mail@ykonai.net>
Fri, 1 Apr 2022 21:32:04 +0000 (23:32 +0200)
committerLudovic Courtès <ludo@gnu.org>
Tue, 5 Apr 2022 18:41:41 +0000 (20:41 +0200)
Current plocate package sets the --sharedstatedir to a store directory, which
causes updatedb and plocate to fail by default since the store is immutable.
This will set the default database path to /var/cache/plocate.db instead.

* gnu/packages/search.scm (plocate): Change build options.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
gnu/packages/search.scm

index 6f8d673..87f29c5 100644 (file)
@@ -487,8 +487,17 @@ conflict with slocate compatibility.")
     (arguments
      `(#:configure-flags
        (list
-        (string-append
-         "--sharedstatedir=" (assoc-ref %outputs "out") "/var"))))
+        ;; Put the database in /var/cache/plocate.db
+        "--sharedstatedir=/var"
+        "-Dinstall_systemd=false"
+        "-Ddbpath=cache/plocate.db")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'remove-cachedirtag
+           (lambda _
+             (substitute* "meson.build"
+               ;; Remove the script adding a "cachedirtag"
+               (("meson.add_install_script") "#")))))))
     (inputs
      (list liburing
            `(,zstd "lib")))