gnu: pkg-config: Memoize 'cross-pkg-config'.
When running: guix build --target=arm-linux-gnueabihf gdb -nd this reduces the number of hits in the 'add-data-to-store' cache from 205 (25%) to 163 (21%). * gnu/packages/pkg-config.scm (cross-pkg-config): Turn into an 'mlambda'.
This commit is contained in:
parent
537b2daba9
commit
7de9471707
1 changed files with 35 additions and 32 deletions
|
@ -22,6 +22,7 @@
|
|||
#:use-module (guix download)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system trivial)
|
||||
#:use-module (guix memoization)
|
||||
#:export (pkg-config))
|
||||
|
||||
;; This is the "primitive" pkg-config package. People should use `pkg-config'
|
||||
|
@ -65,12 +66,14 @@ on where to find glib (or other libraries). It is language-agnostic, so
|
|||
it can be used for defining the location of documentation tools, for
|
||||
instance.")))
|
||||
|
||||
(define (cross-pkg-config target)
|
||||
(define cross-pkg-config
|
||||
(mlambda (target)
|
||||
"Return a pkg-config for TARGET, essentially just a wrapper called
|
||||
`TARGET-pkg-config', as `configure' scripts like it."
|
||||
;; See <http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/cross-compiling.html>
|
||||
;; for details.
|
||||
(package (inherit %pkg-config)
|
||||
(package
|
||||
(inherit %pkg-config)
|
||||
(name (string-append (package-name %pkg-config) "-" target))
|
||||
(build-system trivial-build-system)
|
||||
(arguments
|
||||
|
@ -102,7 +105,7 @@ instance.")))
|
|||
|
||||
;; Ignore native inputs, and set `PKG_CONFIG_PATH' for target inputs.
|
||||
(native-search-paths '())
|
||||
(search-paths (package-native-search-paths %pkg-config))))
|
||||
(search-paths (package-native-search-paths %pkg-config)))))
|
||||
|
||||
(define (pkg-config-for-target target)
|
||||
"Return a pkg-config package for TARGET, which may be either #f for a native
|
||||
|
|
Reference in a new issue