summaryrefslogtreecommitdiff
path: root/guix/import/nuget.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import/nuget.scm')
-rw-r--r--guix/import/nuget.scm19
1 files changed, 14 insertions, 5 deletions
diff --git a/guix/import/nuget.scm b/guix/import/nuget.scm
index 8a16525b2d..72fba7971d 100644
--- a/guix/import/nuget.scm
+++ b/guix/import/nuget.scm
@@ -49,8 +49,7 @@
#:use-module (guix http-client)
#:use-module (guix memoization)
#:use-module (guix utils)
- #:use-module ((guix import utils)
- #:select (factorize-uri snake-case recursive-import flatten))
+ #:use-module (guix import utils)
#:use-module (guix import json)
#:use-module (guix base32)
#:use-module (guix build utils)
@@ -62,6 +61,13 @@
#:export (nuget->guix-package
nuget-recursive-import))
+;; copy from guix/import/pypi.scm
+(define non-empty-string-or-false
+ (match-lambda
+ ("" #f)
+ ((? string? str) str)
+ ((or 'null #f) #f)))
+
;;; See also <https://learn.microsoft.com/en-us/nuget/concepts/package-versioning?tabs=semver20sort>.
;;; Therefore, excluding prerelease and metadata labels, a version string is Major.Minor.Patch.Revision.
;;; As per version normalization described above, if Revision is zero, it is omitted from the normalized version string.
@@ -320,9 +326,12 @@ s-expression and a flat list of its dependency names (strings)."
(values #f '())
(let* ((name (assoc-ref entry "id"))
(guix-name (nuget-name->guix-name name))
- (description (assoc-ref entry "description"))
- (synopsis (or (assoc-ref entry "summary")
- description))
+ (description (beautify-description
+ (non-empty-string-or-false
+ (assoc-ref entry "description"))))
+ (synopsis (beautify-synopsis
+ (non-empty-string-or-false
+ (assoc-ref entry "summary"))))
(home-page (or (assoc-ref entry "projectUrl")
(string-append "https://www.nuget.org/packages/" name)))
(license (license-prefix (or (and=> (assoc-ref entry "licenseExpression")