summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorZheng Junjie <z572@z572.online>2025-06-19 23:40:05 +0800
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-07-01 08:48:51 +0100
commit6b861d4b621cee4d8507541b0efda401c5bbc91a (patch)
tree05c92d0d156615f32d099e65ba585508bfff0f5a /guix/import
parentd8a61d2b0b81d17e9183a0e0124f2fd3d1aa0a86 (diff)
import: nuget: Use beautify-description and beautify-synopsis.
* guix/import/nuget.scm(non-empty-string-or-false): New procedure. * guix/import/nuget.scm (nuget->guix-package): Use beautify-description and beautify-synopsis. Change-Id: Ie3b4b676499558af5e6742b91a40d93624f2caf9 Reviewed-by: Danny Milosavljevic <dannym@friendly-machines.com> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'guix/import')
-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")