diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 341554b687..9d0d23f9c8 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2017 Nikita ;;; Copyright © 2017, 2018, 2020–2022 Tobias Geerinckx-Rice ;;; Copyright © 2018 Ricardo Wurmus -;;; Copyright © 2018, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2018, 2019, 2020, 2021, 2023 Ludovic Courtès ;;; Copyright © 2019, 2020, 2022 Marius Bakke ;;; Copyright © 2020 Roel Janssen ;;; Copyright © 2020, 2021 Nicolas Goaziou @@ -100,13 +100,23 @@ (define-public freetype `(#:configure-flags (list "--enable-freetype-config") #:disallowed-references (,pkg-config) #:phases - (modify-phases %standard-phases - (add-after 'install 'remove-reference-to-pkg-config - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/bin/freetype-config") - (((search-input-file inputs "/bin/pkg-config")) - "pkg-config")))))))) + ;; TODO: Keep only the first variant on the next core rebuild cycle. + ,(if (%current-target-system) + '(modify-phases %standard-phases + (add-after 'install 'remove-reference-to-pkg-config + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/bin/freetype-config") + (("/([a-zA-Z0-9/\\._-]+)/bin/([a-zA-Z0-9_-]+)pkg-config" + _ store target) + "pkg-config")))))) + '(modify-phases %standard-phases + (add-after 'install 'remove-reference-to-pkg-config + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/bin/freetype-config") + (((search-input-file inputs "/bin/pkg-config")) + "pkg-config"))))))))) (native-inputs (list pkg-config)) (propagated-inputs