Subject: Re: bug#59237: [PATCH 0/3] Add LLVM/Clang 15.0.4.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 15 Nov 2022 11:33:22 +0100

Maxim Cournoyer <[email-masked]> skribis:

> * gnu/packages/llvm.scm (clang-from-llvm*): New helper.
> (clang-15): New variable.

[...]

> +;;; TODO: Integrate into original on core-updates, perhaps with an extra
> +;;; option such as #:build-shared-libs? documented as a legacy feature.
> +(define* (clang-from-llvm* llvm clang-runtime
> +                           #:optional hash
> +                           #:key (patches '()) tools-extra
> +                           (properties
> +                            (append `((release-monitoring-url
> +                                       . ,%llvm-release-monitoring-url))
> +                                    (clang-properties (package-version llvm)))))

[...]

> +          #~(modify-phases #$phases
> +              ;; Like the original, sans BUILD_SHARED_LIBS patching.
> +              #$@(if tools-extra

How about making it an option of ‘clang-from-llvm’ then, like suggested
above?

In ‘clang-from-llvm’, we’d have:

  `((add-after 'unpack 'add-tools-extra
      (lambda* …
        ,@(if tools-need-build-shared-libs-patch?
              `((substitute* …))
              '()
        #t))))

That’d factorize things while avoiding a full rebuild.

Ludo’.