build-system: asdf: Improve install phase for CL source packages.

* guix/build/asdf-build-system.scm (install)[parent-source]: Add support for
  package names not containing a hyphen.
This commit is contained in:
Guillaume Le Vaillant 2020-09-15 22:00:29 +02:00
parent 12df8b7b88
commit e0d9103f41
No known key found for this signature in database
GPG Key ID: 6BE8208ADF21FE3F

View File

@ -124,9 +124,10 @@ if it's present in the native-inputs."
(package-name->name+version
(strip-store-file-name output)))
(define (no-prefix pkgname)
(if (string-index pkgname #\-)
(string-drop pkgname (1+ (string-index pkgname #\-)))
pkgname))
(let ((index (string-index pkgname #\-)))
(if index
(string-drop pkgname (1+ index))
pkgname)))
(define parent
(match (assoc package-name inputs
(lambda (key alist-car)
@ -142,8 +143,10 @@ if it's present in the native-inputs."
(define parent-source
(and parent
(string-append parent "/share/common-lisp/"
(string-take parent-name
(string-index parent-name #\-)))))
(let ((index (string-index parent-name #\-)))
(if index
(string-take parent-name index)
parent-name)))))
(define (first-subdirectory directory) ; From gnu-build-system.
"Return the file name of the first sub-directory of DIRECTORY."