import cran: Check if pkg-config is needed.

* guix/import/cran.scm (needs-pkg-config?): New procedure.
(description->package): Use it.
This commit is contained in:
Ricardo Wurmus 2017-04-05 18:42:08 +02:00
parent a0f43208cb
commit 17a69cf623
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 13 additions and 5 deletions

View File

@ -235,6 +235,13 @@ contain a zlib linker flag."
tarball "-lz" tarball "-lz"
"*/src/Makevars*" "*/src/configure*" "*/configure*")) "*/src/Makevars*" "*/src/configure*" "*/configure*"))
(define (needs-pkg-config? tarball)
"Return #T if any of the Makevars files in the src directory of the TARBALL
reference the pkg-config tool."
(tarball-files-match-pattern?
tarball "pkg-config"
"*/src/Makevars*" "*/src/configure*" "*/configure*"))
(define (description->package repository meta) (define (description->package repository meta)
"Return the `package' s-expression for an R package published on REPOSITORY "Return the `package' s-expression for an R package published on REPOSITORY
from the alist META, which was derived from the R package's DESCRIPTION file." from the alist META, which was derived from the R package's DESCRIPTION file."
@ -284,11 +291,12 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
(build-system r-build-system) (build-system r-build-system)
,@(maybe-inputs sysdepends) ,@(maybe-inputs sysdepends)
,@(maybe-inputs (map guix-name propagate) 'propagated-inputs) ,@(maybe-inputs (map guix-name propagate) 'propagated-inputs)
,@(if (needs-fortran? tarball) ,@(maybe-inputs
`((native-inputs (,'quasiquote `(,@(if (needs-fortran? tarball)
,(list "gfortran" '("gfortran") '())
(list 'unquote 'gfortran))))) ,@(if (needs-pkg-config? tarball)
'()) '("pkg-config") '()))
'native-inputs)
(home-page ,(if (string-null? home-page) (home-page ,(if (string-null? home-page)
(string-append base-url name) (string-append base-url name)
home-page)) home-page))