nonguix: Refactor ld.so.conf creation for nonguix containers.
* nonguix/multiarch-container.scm (packages->ld.so.conf): Delete the function. (package-directories->ld.so.conf): New function. As TODO statement says, we are going to accept not the package objects but pure directories, which we can get via file-append function. * nongnu/packages/steam-client.scm (%steam-fhs-union-64, %steam-fhs-union-32): Move definitions to appropriate variables. Use them with file-append function to provide lib directories for steam-ld.so.conf * nongnu/packages/steam-client.scm (steam-ld.so.conf): Take advantage of file-append and specify exact directories we want.
This commit is contained in:
parent
10e3c2bcae
commit
31f2146716
|
@ -234,19 +234,29 @@ implementation with gogdl and Amazon Games using Nile.")
|
||||||
("which" ,which) ; Heroic complains about trying to use which (though works).
|
("which" ,which) ; Heroic complains about trying to use which (though works).
|
||||||
("gtk+" ,gtk+))) ; Required for Heroic interface (gtk filechooser schema).
|
("gtk+" ,gtk+))) ; Required for Heroic interface (gtk filechooser schema).
|
||||||
|
|
||||||
(define steam-ld.so.conf
|
(define %steam-fhs-union-64
|
||||||
(packages->ld.so.conf
|
(fhs-union `(,@steam-client-libs
|
||||||
(list (fhs-union steam-container-libs
|
,@steam-gameruntime-libs
|
||||||
#:name "fhs-union-64")
|
,@fhs-min-libs)
|
||||||
(fhs-union steam-container-libs
|
#:name "fhs-union-64"))
|
||||||
|
|
||||||
|
(define %steam-fhs-union-32
|
||||||
|
(fhs-union `(,@steam-client-libs
|
||||||
|
,@steam-gameruntime-libs
|
||||||
|
,@fhs-min-libs)
|
||||||
#:name "fhs-union-32"
|
#:name "fhs-union-32"
|
||||||
#:system "i686-linux"))))
|
#:system "i686-linux"))
|
||||||
|
|
||||||
|
(define steam-ld.so.conf
|
||||||
|
(package-directories->ld.so.conf
|
||||||
|
#~(#$(file-append %steam-fhs-union-64 "/lib")
|
||||||
|
#$(file-append %steam-fhs-union-32 "/lib"))))
|
||||||
|
|
||||||
(define steam-ld.so.cache
|
(define steam-ld.so.cache
|
||||||
(ld.so.conf->ld.so.cache steam-ld.so.conf))
|
(ld.so.conf->ld.so.cache steam-ld.so.conf))
|
||||||
|
|
||||||
(define steam-nvidia-ld.so.conf
|
(define steam-nvidia-ld.so.conf
|
||||||
(packages->ld.so.conf
|
(package-directories->ld.so.conf
|
||||||
(list (fhs-union steam-nvidia-container-libs
|
(list (fhs-union steam-nvidia-container-libs
|
||||||
#:name "fhs-union-64")
|
#:name "fhs-union-64")
|
||||||
(fhs-union steam-nvidia-container-libs
|
(fhs-union steam-nvidia-container-libs
|
||||||
|
@ -263,13 +273,8 @@ implementation with gogdl and Amazon Games using Nile.")
|
||||||
(run "/bin/steam")
|
(run "/bin/steam")
|
||||||
(ld.so.conf steam-ld.so.conf)
|
(ld.so.conf steam-ld.so.conf)
|
||||||
(ld.so.cache steam-ld.so.cache)
|
(ld.so.cache steam-ld.so.cache)
|
||||||
(union64
|
(union64 %steam-fhs-union-64)
|
||||||
(fhs-union steam-container-libs
|
(union32 %steam-fhs-union-32)
|
||||||
#:name "fhs-union-64"))
|
|
||||||
(union32
|
|
||||||
(fhs-union steam-container-libs
|
|
||||||
#:name "fhs-union-32"
|
|
||||||
#:system "i686-linux"))
|
|
||||||
(link-files '("share"))
|
(link-files '("share"))
|
||||||
(description "Steam is a digital software distribution platform created by
|
(description "Steam is a digital software distribution platform created by
|
||||||
Valve. This package provides a script for launching Steam in a Guix container
|
Valve. This package provides a script for launching Steam in a Guix container
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
fhs-min-libs
|
fhs-min-libs
|
||||||
fhs-union
|
fhs-union
|
||||||
ld.so.conf->ld.so.cache
|
ld.so.conf->ld.so.cache
|
||||||
packages->ld.so.conf
|
package-directories->ld.so.conf
|
||||||
nonguix-container->package))
|
nonguix-container->package))
|
||||||
|
|
||||||
(define-record-type* <nonguix-container>
|
(define-record-type* <nonguix-container>
|
||||||
|
@ -150,30 +150,19 @@
|
||||||
"-f" #$ld-conf ; Use #$ld-conf as configuration file.
|
"-f" #$ld-conf ; Use #$ld-conf as configuration file.
|
||||||
"-C" #$output)))))) ; Use #$output as cache file.
|
"-C" #$output)))))) ; Use #$output as cache file.
|
||||||
|
|
||||||
(define (packages->ld.so.conf packages)
|
(define (package-directories->ld.so.conf directories)
|
||||||
"Takes a list of package objects and returns a file-like object for ld.so.conf
|
"Takes a list of directories and returns a file-like object containing
|
||||||
in the Guix store"
|
a ld.so.conf file with all directories in it."
|
||||||
(computed-file
|
(computed-file
|
||||||
"ld.so.conf"
|
"ld.so.conf"
|
||||||
#~(begin
|
#~(begin
|
||||||
;; Need to quote "#$packages" as #$packages tries to "apply" the first item to the rest, like a procedure.
|
(with-output-to-file #$output
|
||||||
(let* ((packages '#$packages)
|
(lambda ()
|
||||||
;; Add "/lib" to each package.
|
(for-each (lambda (dir)
|
||||||
;; TODO Make this more general for other needed directories.
|
(display dir)
|
||||||
(dirs-lib
|
(newline))
|
||||||
(lambda (packages)
|
'#$directories))))))
|
||||||
(map (lambda (package)
|
|
||||||
(string-append package "/lib"))
|
|
||||||
packages)))
|
|
||||||
(fhs-lib-dirs
|
|
||||||
(dirs-lib packages)))
|
|
||||||
(call-with-output-file #$output
|
|
||||||
(lambda (port)
|
|
||||||
(for-each (lambda (directory)
|
|
||||||
(display directory port)
|
|
||||||
(newline port))
|
|
||||||
fhs-lib-dirs)))
|
|
||||||
#$output))))
|
|
||||||
|
|
||||||
(define (nonguix-container->package container)
|
(define (nonguix-container->package container)
|
||||||
"Return a package with wrapper script to launch the supplied container object
|
"Return a package with wrapper script to launch the supplied container object
|
||||||
|
|
Loading…
Reference in New Issue
Block a user