import: utils: Trim patch version from names.
This remove the patch version from generated package names. For example 'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'. * guix/import/utils.scm (package->definition): Trim patch version from generated package names. * tests/crate.scm: (cargo>guix-package, cargo-recursive-import): Likewise.
This commit is contained in:
		
							parent
							
								
									50fbb3f032
								
							
						
					
					
						commit
						9a48e35be8
					
				
					 3 changed files with 21 additions and 19 deletions
				
			
		| 
						 | 
					@ -159,7 +159,8 @@ and LICENSE."
 | 
				
			||||||
    (map
 | 
					    (map
 | 
				
			||||||
     (match-lambda
 | 
					     (match-lambda
 | 
				
			||||||
      ((name version)
 | 
					      ((name version)
 | 
				
			||||||
       (list (crate-name->package-name name) version)))
 | 
					       (list (crate-name->package-name name)
 | 
				
			||||||
 | 
					             (version-major+minor version))))
 | 
				
			||||||
     inputs))
 | 
					     inputs))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (let* ((port (http-fetch (crate-uri name version)))
 | 
					  (let* ((port (http-fetch (crate-uri name version)))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -269,9 +269,10 @@ package definition."
 | 
				
			||||||
      ('package ('name name) ('version version) . rest)
 | 
					      ('package ('name name) ('version version) . rest)
 | 
				
			||||||
      ('let _ ('package ('name name) ('version version) . rest)))
 | 
					      ('let _ ('package ('name name) ('version version) . rest)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
     `(define-public ,(string->symbol (if append-version?
 | 
					     `(define-public ,(string->symbol
 | 
				
			||||||
                                          (string-append name "-" version)
 | 
					                       (if append-version?
 | 
				
			||||||
                                          version))
 | 
					                           (string-append name "-" (version-major+minor version))
 | 
				
			||||||
 | 
					                           version))
 | 
				
			||||||
        ,guix-package))))
 | 
					        ,guix-package))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (build-system-modules)
 | 
					(define (build-system-modules)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -352,7 +352,7 @@
 | 
				
			||||||
             (_ (error "Unexpected URL: " url)))))
 | 
					             (_ (error "Unexpected URL: " url)))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        (match (crate->guix-package "foo")
 | 
					        (match (crate->guix-package "foo")
 | 
				
			||||||
          ((define-public 'rust-foo-1.0.3
 | 
					          ((define-public 'rust-foo-1.0
 | 
				
			||||||
             (package (name "rust-foo")
 | 
					             (package (name "rust-foo")
 | 
				
			||||||
                      (version "1.0.3")
 | 
					                      (version "1.0.3")
 | 
				
			||||||
                      (source
 | 
					                      (source
 | 
				
			||||||
| 
						 | 
					@ -369,7 +369,7 @@
 | 
				
			||||||
                        (#:skip-build? #t
 | 
					                        (#:skip-build? #t
 | 
				
			||||||
                         #:cargo-inputs
 | 
					                         #:cargo-inputs
 | 
				
			||||||
                         (("rust-leaf-alice"
 | 
					                         (("rust-leaf-alice"
 | 
				
			||||||
                           ('unquote 'rust-leaf-alice-0.7.5))))))
 | 
					                           ('unquote 'rust-leaf-alice-0.7))))))
 | 
				
			||||||
                      (home-page "http://example.com")
 | 
					                      (home-page "http://example.com")
 | 
				
			||||||
                      (synopsis "summary")
 | 
					                      (synopsis "summary")
 | 
				
			||||||
                      (description "summary")
 | 
					                      (description "summary")
 | 
				
			||||||
| 
						 | 
					@ -433,7 +433,7 @@
 | 
				
			||||||
        (match (crate-recursive-import "root")
 | 
					        (match (crate-recursive-import "root")
 | 
				
			||||||
          ;; rust-intermediate-b has no dependency on the rust-leaf-alice
 | 
					          ;; rust-intermediate-b has no dependency on the rust-leaf-alice
 | 
				
			||||||
          ;; package, so this is a valid ordering
 | 
					          ;; package, so this is a valid ordering
 | 
				
			||||||
          (((define-public 'rust-leaf-alice-0.7.5
 | 
					          (((define-public 'rust-leaf-alice-0.7
 | 
				
			||||||
              (package
 | 
					              (package
 | 
				
			||||||
                (name "rust-leaf-alice")
 | 
					                (name "rust-leaf-alice")
 | 
				
			||||||
                (version "0.7.5")
 | 
					                (version "0.7.5")
 | 
				
			||||||
| 
						 | 
					@ -452,7 +452,7 @@
 | 
				
			||||||
                (synopsis "summary")
 | 
					                (synopsis "summary")
 | 
				
			||||||
                (description "summary")
 | 
					                (description "summary")
 | 
				
			||||||
                (license (list license:expat license:asl2.0))))
 | 
					                (license (list license:expat license:asl2.0))))
 | 
				
			||||||
            (define-public 'rust-leaf-bob-3.0.1
 | 
					            (define-public 'rust-leaf-bob-3.0
 | 
				
			||||||
              (package
 | 
					              (package
 | 
				
			||||||
                (name "rust-leaf-bob")
 | 
					                (name "rust-leaf-bob")
 | 
				
			||||||
                (version "3.0.1")
 | 
					                (version "3.0.1")
 | 
				
			||||||
| 
						 | 
					@ -471,7 +471,7 @@
 | 
				
			||||||
                (synopsis "summary")
 | 
					                (synopsis "summary")
 | 
				
			||||||
                (description "summary")
 | 
					                (description "summary")
 | 
				
			||||||
                (license (list license:expat license:asl2.0))))
 | 
					                (license (list license:expat license:asl2.0))))
 | 
				
			||||||
            (define-public 'rust-intermediate-b-1.2.3
 | 
					            (define-public 'rust-intermediate-b-1.2
 | 
				
			||||||
              (package
 | 
					              (package
 | 
				
			||||||
                (name "rust-intermediate-b")
 | 
					                (name "rust-intermediate-b")
 | 
				
			||||||
                (version "1.2.3")
 | 
					                (version "1.2.3")
 | 
				
			||||||
| 
						 | 
					@ -489,12 +489,12 @@
 | 
				
			||||||
                 ('quasiquote (#:skip-build? #t
 | 
					                 ('quasiquote (#:skip-build? #t
 | 
				
			||||||
                               #:cargo-inputs
 | 
					                               #:cargo-inputs
 | 
				
			||||||
                               (("rust-leaf-bob"
 | 
					                               (("rust-leaf-bob"
 | 
				
			||||||
                                 ('unquote 'rust-leaf-bob-3.0.1))))))
 | 
					                                 ('unquote 'rust-leaf-bob-3.0))))))
 | 
				
			||||||
                (home-page "http://example.com")
 | 
					                (home-page "http://example.com")
 | 
				
			||||||
                (synopsis "summary")
 | 
					                (synopsis "summary")
 | 
				
			||||||
                (description "summary")
 | 
					                (description "summary")
 | 
				
			||||||
                (license (list license:expat license:asl2.0))))
 | 
					                (license (list license:expat license:asl2.0))))
 | 
				
			||||||
            (define-public 'rust-intermediate-a-1.0.42
 | 
					            (define-public 'rust-intermediate-a-1.0
 | 
				
			||||||
              (package
 | 
					              (package
 | 
				
			||||||
                (name "rust-intermediate-a")
 | 
					                (name "rust-intermediate-a")
 | 
				
			||||||
                (version "1.0.42")
 | 
					                (version "1.0.42")
 | 
				
			||||||
| 
						 | 
					@ -512,16 +512,16 @@
 | 
				
			||||||
                 ('quasiquote (#:skip-build? #t
 | 
					                 ('quasiquote (#:skip-build? #t
 | 
				
			||||||
                               #:cargo-inputs
 | 
					                               #:cargo-inputs
 | 
				
			||||||
                               (("rust-intermediate-b"
 | 
					                               (("rust-intermediate-b"
 | 
				
			||||||
                                 ('unquote 'rust-intermediate-b-1.2.3))
 | 
					                                 ('unquote 'rust-intermediate-b-1.2))
 | 
				
			||||||
                                ("rust-leaf-alice"
 | 
					                                ("rust-leaf-alice"
 | 
				
			||||||
                                 ('unquote 'rust-leaf-alice-0.7.5))
 | 
					                                 ('unquote 'rust-leaf-alice-0.7))
 | 
				
			||||||
                                ("rust-leaf-bob"
 | 
					                                ("rust-leaf-bob"
 | 
				
			||||||
                                 ('unquote 'rust-leaf-bob-3.0.1))))))
 | 
					                                 ('unquote 'rust-leaf-bob-3.0))))))
 | 
				
			||||||
                (home-page "http://example.com")
 | 
					                (home-page "http://example.com")
 | 
				
			||||||
                (synopsis "summary")
 | 
					                (synopsis "summary")
 | 
				
			||||||
                (description "summary")
 | 
					                (description "summary")
 | 
				
			||||||
                (license (list license:expat license:asl2.0))))
 | 
					                (license (list license:expat license:asl2.0))))
 | 
				
			||||||
            (define-public 'rust-root-1.0.4
 | 
					            (define-public 'rust-root-1.0
 | 
				
			||||||
              (package
 | 
					              (package
 | 
				
			||||||
                (name "rust-root")
 | 
					                (name "rust-root")
 | 
				
			||||||
                (version "1.0.4")
 | 
					                (version "1.0.4")
 | 
				
			||||||
| 
						 | 
					@ -538,13 +538,13 @@
 | 
				
			||||||
                (arguments
 | 
					                (arguments
 | 
				
			||||||
                 ('quasiquote (#:cargo-inputs
 | 
					                 ('quasiquote (#:cargo-inputs
 | 
				
			||||||
                               (("rust-intermediate-a"
 | 
					                               (("rust-intermediate-a"
 | 
				
			||||||
                                 ('unquote 'rust-intermediate-a-1.0.42))
 | 
					                                 ('unquote 'rust-intermediate-a-1.0))
 | 
				
			||||||
                                ("rust-intermediate-b"
 | 
					                                ("rust-intermediate-b"
 | 
				
			||||||
                                 ('unquote 'rust-intermediate-b-1.2.3))
 | 
					                                 ('unquote 'rust-intermediate-b-1.2))
 | 
				
			||||||
                                ("rust-leaf-alice"
 | 
					                                ("rust-leaf-alice"
 | 
				
			||||||
                                 ('unquote 'rust-leaf-alice-0.7.5))
 | 
					                                 ('unquote 'rust-leaf-alice-0.7))
 | 
				
			||||||
                                ("rust-leaf-bob"
 | 
					                                ("rust-leaf-bob"
 | 
				
			||||||
                                 ('unquote 'rust-leaf-bob-3.0.1))))))
 | 
					                                 ('unquote 'rust-leaf-bob-3.0))))))
 | 
				
			||||||
                (home-page "http://example.com")
 | 
					                (home-page "http://example.com")
 | 
				
			||||||
                (synopsis "summary")
 | 
					                (synopsis "summary")
 | 
				
			||||||
                (description "summary")
 | 
					                (description "summary")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue