Subject: Re: bug#52284: Partially unifying packages and inferior packages

From: Ludovic Courtès <[email-masked]>
Date: Mon, 06 Dec 2021 14:14:33 +0100

Hi,

Maxime Devos <[email-masked]> skribis:

> (define (inferior-package->package inf)
>   ;; TODO: somehow make sure no inheritance happens on this package
>   (package
>     (name (inferior-package-name inf))
>     (version (inferior-package-version inf))
>     (replacement (and=> (inferior-package-replacement inf) inferior-package->package))
>     (source #f) ; TODO
>     (build-system inferior-package-build-system)
>     (arguments `(#:inferior-package ,inf))
>     (synopsis (inferior-package-synopsis inf))
>     (description (inferior-package-description inf))
>     (home-page (inferior-package-home-page inf))
>     (location (inferior-package-location inf))
>     (inputs (map inferior-inputs->inputs (inferior-package-inputs inf)))
>     (native-inputs (map inferior-inputs->inputs (inferior-package-native-inputs inf)))
>     (propagated-inputs (map inferior-inputs->inputs (inferior-package-propagated-inputs inf)))
>     (transitive-propagated-inputs (map inferior-inputs->inputs (inferior-package-transitive-propagated-inputs inf)))    
>     (native-search-paths (propagated-package-native-search-paths inf))
>     (search-paths (propagated-package-search-paths inf))
>     (license #f)) ; TODO

That’s a clever hack!

Longer-term, I think it would be nice(r) to use a type hierarchy somehow
so <inferior-package> instances can truly be used anywhere a <package>
is expected.

Thanks,
Ludo’.