mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
snix: Use (guix licenses) variables.
* guix/snix.scm (snix-derivation->guix-package)[license-variable]: New procedure. Use it to determine the variable name for the license.
This commit is contained in:
parent
ab8ed44fce
commit
e7aa73ef09
1 changed files with 11 additions and 1 deletions
|
@ -393,6 +393,16 @@ (define (pretty-uri uri version)
|
|||
`(string-append ,@items))
|
||||
(x x)))
|
||||
|
||||
(define (license-variable license)
|
||||
;; Return the name of the (guix licenses) variable for LICENSE.
|
||||
(match license
|
||||
("GPLv2+" 'gpl2+)
|
||||
("GPLv3+" 'gpl3+)
|
||||
("LGPLv2+" 'lgpl2.1+)
|
||||
("LGPLv2.1+" 'lgpl2.1+)
|
||||
("LGPLv3+" 'lgpl3+)
|
||||
(_ license)))
|
||||
|
||||
(let* ((source (find-attribute-by-name "src" attributes))
|
||||
(urls (source-urls source))
|
||||
(sha256 (source-sha256 source))
|
||||
|
@ -426,7 +436,7 @@ (define (pretty-uri uri version)
|
|||
,(and=> (find-attribute-by-name "longDescription" meta)
|
||||
attribute-value))
|
||||
(license ,(and=> (find-attribute-by-name "license" meta)
|
||||
attribute-value)))
|
||||
(compose license-variable attribute-value))))
|
||||
loc))))))
|
||||
|
||||
(define (nixpkgs->guix-package nixpkgs attribute)
|
||||
|
|
Loading…
Reference in a new issue