1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-16 12:00:35 +02:00

gnu: mergerfs: Clean up arguments.

* gnu/packages/file-systems.scm (mergerfs)[arguments]: Remove some
incorrect comments & rewrite code accordingly.  Pass the PREFIX as a
make flag.
This commit is contained in:
Tobias Geerinckx-Rice 2021-07-09 02:56:08 +02:00
parent 478104c398
commit 7292585f3c
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1391,32 +1391,28 @@ On Guix System, you will need to invoke the included shell scripts as
(arguments (arguments
`(#:make-flags `(#:make-flags
(list (string-append "CC=" ,(cc-for-target)) (list (string-append "CC=" ,(cc-for-target))
(string-append "CXX=" ,(cxx-for-target))) (string-append "CXX=" ,(cxx-for-target))
#:tests? #f ; No tests exist. (string-append "PREFIX=" (assoc-ref %outputs "out")))
#:tests? #f ; all require a kernel with FUSE loaded
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (delete 'configure) ; no configure script
(add-after 'unpack 'fix-paths (add-after 'unpack 'set-file-names
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(setenv "CC" "gcc") (substitute* "libfuse/Makefile"
;; These were copied from the package libfuse. (("/sbin") "$(EXEC_PREFIX)/sbin")
(substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c") (("chown") "true") ; disallowed in the build environment
(("strip") "true")) ; breaks cross-compilation
;; These were copied from the fuse package.
(substitute* '("libfuse/lib/mount_util.c"
"libfuse/util/mount_util.c")
(("/bin/(u?)mount" _ maybe-u) (("/bin/(u?)mount" _ maybe-u)
(string-append (assoc-ref inputs "util-linux") (string-append (assoc-ref inputs "util-linux")
"/bin/" maybe-u "mount"))) "/bin/" maybe-u "mount")))
(substitute* '("libfuse/util/mount.mergerfs.c") (substitute* '("libfuse/util/mount.mergerfs.c")
(("/bin/sh" command) (("/bin/sh" command)
(string-append (assoc-ref inputs "bash-minimal") command))) (string-append (assoc-ref inputs "bash-minimal") command))))))))
;; The Makefile does not allow overriding PREFIX via make variables. ;; Mergerfs bundles a heavily modified copy of fuse.
(substitute* '("Makefile" "libfuse/Makefile")
(("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
(("= /sbin") "= $(EXEC_PREFIX)/sbin")
;; cannot chown as build user
(("chown root(:root)?") "true")
;; Breaks cross-compilation.
(("strip") "true"))
#t)))))
;; mergerfs bundles a heavily modified copy of libfuse.
(inputs (inputs
`(("bash-minimal" ,bash-minimal) `(("bash-minimal" ,bash-minimal)
("util-linux" ,util-linux))) ("util-linux" ,util-linux)))