mirror of
				https://codeberg.org/hako/Rosenthal.git
				synced 2025-11-04 03:34:37 +00:00 
			
		
		
		
	maint: Clean up compatibility layer.
* modules/rosenthal/packages/rust-crates.scm (crate-name->package-name) (define-cargo-inputs, crate-source): Remove, as they are available in (guix build-system cargo). * modules/rosenthal/utils/cargo.scm (rosenthal-cargo-inputs): Define using cargo-inputs. * modules/rosenthal/utils/download.scm (go-mod-vendor): Stop accessing nss-certs from (gnu packages certs) module.
This commit is contained in:
		
							parent
							
								
									70ee09ec65
								
							
						
					
					
						commit
						9aa77c91b2
					
				@ -15,37 +15,6 @@
 | 
			
		||||
;;; This file is managed by ‘guix import’.  DO NOT add definitions manually.
 | 
			
		||||
;;;
 | 
			
		||||
 | 
			
		||||
(define* (crate-name->package-name name)
 | 
			
		||||
  (downstream-package-name "rust-" name))
 | 
			
		||||
 | 
			
		||||
(define* (crate-source name version hash #:key (patches '()) (snippet #f))
 | 
			
		||||
  (origin
 | 
			
		||||
    (method url-fetch)
 | 
			
		||||
    (uri (crate-uri name version))
 | 
			
		||||
    (file-name
 | 
			
		||||
     (string-append (crate-name->package-name name) "-" version ".tar.gz"))
 | 
			
		||||
    (sha256 (base32 hash))
 | 
			
		||||
    (modules '((guix build utils)))
 | 
			
		||||
    (patches patches)
 | 
			
		||||
    (snippet snippet)))
 | 
			
		||||
 | 
			
		||||
(define-syntax define-cargo-inputs
 | 
			
		||||
  (syntax-rules (=>)
 | 
			
		||||
    ((_ lookup inputs ...)
 | 
			
		||||
     (define lookup
 | 
			
		||||
       (let ((table (make-hash-table)))
 | 
			
		||||
         (letrec-syntax ((record
 | 
			
		||||
                          (syntax-rules (=>)
 | 
			
		||||
                            ((_) #t)
 | 
			
		||||
                            ((_ (name => lst) rest (... ...))
 | 
			
		||||
                             (begin
 | 
			
		||||
                               (hashq-set! table 'name (filter identity lst))
 | 
			
		||||
                               (record rest (... ...)))))))
 | 
			
		||||
           (record inputs ...)
 | 
			
		||||
           (lambda (name)
 | 
			
		||||
             "Return the inputs for NAME."
 | 
			
		||||
             (hashq-ref table name))))))))
 | 
			
		||||
 | 
			
		||||
;;;
 | 
			
		||||
;;; Rust dependencies fetched from crates.io and non-workspace development
 | 
			
		||||
;;; snapshots.
 | 
			
		||||
 | 
			
		||||
@ -3,15 +3,9 @@
 | 
			
		||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
 | 
			
		||||
 | 
			
		||||
(define-module (rosenthal utils cargo)
 | 
			
		||||
  #:use-module (guix diagnostics)
 | 
			
		||||
  #:use-module (guix i18n)
 | 
			
		||||
  #:use-module (srfi srfi-26)
 | 
			
		||||
  #:use-module (guix build-system cargo)
 | 
			
		||||
  #:export (rosenthal-cargo-inputs))
 | 
			
		||||
 | 
			
		||||
(define* (rosenthal-cargo-inputs name #:key (module '(rosenthal packages rust-crates)))
 | 
			
		||||
  "Lookup Cargo inputs for NAME defined in MODULE, return an empty list if
 | 
			
		||||
unavailable."
 | 
			
		||||
  (let ((lookup (module-ref (resolve-interface module) 'lookup-cargo-inputs)))
 | 
			
		||||
    (or (lookup name)
 | 
			
		||||
        (begin
 | 
			
		||||
          (warning (G_ "no Cargo inputs available for '~a'~%") name)
 | 
			
		||||
          '()))))
 | 
			
		||||
(define rosenthal-cargo-inputs
 | 
			
		||||
  (cut cargo-inputs <> #:module '(rosenthal packages rust-crates)))
 | 
			
		||||
 | 
			
		||||
@ -15,10 +15,7 @@
 | 
			
		||||
(define* (go-mod-vendor #:key go)
 | 
			
		||||
  (lambda* (src hash-algo hash #:optional name #:key (system (%current-system)))
 | 
			
		||||
    (define nss-certs
 | 
			
		||||
      (or (false-if-exception
 | 
			
		||||
           (module-ref (resolve-interface '(gnu packages nss)) 'nss-certs))
 | 
			
		||||
          (false-if-exception
 | 
			
		||||
           (module-ref (resolve-interface '(gnu packages certs)) 'nss-certs))))
 | 
			
		||||
      (module-ref (resolve-interface '(gnu packages nss)) 'nss-certs))
 | 
			
		||||
 | 
			
		||||
    (gexp->derivation
 | 
			
		||||
     (or name "vendored-go-dependencies")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user