~ruther/guix-cross-shells

4caa67738f0043ad65af48f0f0b653727ae47736 — Rutherther 2 days ago ab27b34
feat: Use inputs from bags in inputs-from

To support arbitrary build system with its all build inputs, use bags
instead of packages for obtaining inputs.
1 files changed, 39 insertions(+), 22 deletions(-)

M modules/cross-shells/cross-profile.scm
M modules/cross-shells/cross-profile.scm => modules/cross-shells/cross-profile.scm +39 -22
@@ 1,6 1,7 @@
(define-module (cross-shells cross-profile)
  #:use-module (srfi srfi-1)
  #:use-module (cross-shells cross-packages)
  #:use-module (guix build-system)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (guix records)


@@ 62,6 63,17 @@
(define transitive-inputs
  (@@ (guix packages) transitive-inputs))

(define (cross-profile-inputs-from->bags cross-profile)
  (match-record
      cross-profile <cross-profile>
      (target-system host-system inputs-from)
  (map
   (lambda (package)
     (package->bag package
                   host-system
                   target-system))
   inputs-from)))

(define (collect-cross-profile-target-inputs cross-profile)
  ;; Get all inputs (merged inputs and inputs-from inputs)
  ;; Also collect propagated inputs. Make sure only unique packages.


@@ 69,12 81,14 @@
  (match-record
      cross-profile <cross-profile>
      (target-inputs base-target-inputs host-system target-system)
    (map (lambda (input)
           (car (cdr input)))
         (transitive-inputs
              (append
               (base-target-inputs host-system target-system)
               target-inputs)))))
    (filter package?
            (map (lambda (input)
                   (car (cdr input)))
                 (transitive-inputs
                  (append
                   (base-target-inputs host-system target-system)
                   (apply append (map bag-target-inputs (cross-profile-inputs-from->bags cross-profile)))
                   target-inputs))))))

(define (collect-cross-profile-inputs cross-profile)
  ;; Get all inputs (merged inputs and inputs-from inputs)


@@ 83,28 97,31 @@
  (match-record
      cross-profile <cross-profile>
      (inputs inputs-from base-inputs host-system target-system)
      (map (lambda (input)
             (if (package? input)
                 input
                 (car (cdr input))))
         (transitive-inputs
              (append
               (base-inputs host-system target-system)
               (apply append (map package-inputs inputs-from))
               inputs)))))
    (filter package?
            (map (lambda (input)
                   (if (package? input)
                       input
                       (car (cdr input))))
                 (transitive-inputs
                  (append
                   (base-inputs host-system target-system)
                   (apply append (map bag-host-inputs (cross-profile-inputs-from->bags cross-profile)))
                   inputs))))))

(define (collect-cross-profile-native-inputs cross-profile)
  ;; Get all nativeinputs (merged native-inputs and inputs-from native-inputs)
  (match-record
      cross-profile <cross-profile>
      (native-inputs inputs-from base-native-inputs host-system target-system)
    (map (lambda (input)
           (car (cdr input)))
         (transitive-inputs
          (append
           (base-native-inputs host-system target-system)
           (apply append (map package-native-inputs inputs-from))
           native-inputs)))))
    (filter package?
            (map (lambda (input)
                   (car (cdr input)))
                 (transitive-inputs
                  (append
                   (base-native-inputs host-system target-system)
                   (apply append (map package-native-inputs inputs-from))
                   (apply append (map bag-build-inputs (cross-profile-inputs-from->bags cross-profile)))
                   native-inputs))))))

(define (collect-cross-profile-search-paths cross-profile)
  (match-record

Do not follow this link