diff mbox series

[bug#61865,7/8] gnu: libotf: fix cross-compile.

Message ID tencent_7AFC01EB8C947B94A8D4526FDAA4B665DD0A@qq.com
State New
Headers show
Series fix some packages cross-compile | expand

Commit Message

Z572 Feb. 28, 2023, 8:33 a.m. UTC
* gnu/packages/fontutils.scm(libotf): fix cross-compile.
[native-inputs]:
add freetype, when cross-compile, add libtool, autoconf automake.
[arguments]: when cross-compile, add phase to fix rpl_malloc undefined reference
---
 gnu/packages/fontutils.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

Comments

Efraim Flashner June 4, 2023, 12:19 p.m. UTC | #1
This one I didn't apply. I don't believe adding freetype as a
native-input is correct but I could see adding it as an input. In the
end libotf links to freetype, and we don't want it to link to the one in
native-inputs.

I don't think the phase is the correct way to do this. I didn't see any
error related to it when I was building it before applying the patch,
and I made it pretty far after overriding the location of
freetype-config.

On Tue, Feb 28, 2023 at 04:33:39PM +0800, Z572 via Guix-patches via wrote:
> * gnu/packages/fontutils.scm(libotf): fix cross-compile.
> [native-inputs]:
> add freetype, when cross-compile, add libtool, autoconf automake.
> [arguments]: when cross-compile, add phase to fix rpl_malloc undefined reference
> ---
>  gnu/packages/fontutils.scm | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
> index 72621cc006..d451f5e504 100644
> --- a/gnu/packages/fontutils.scm
> +++ b/gnu/packages/fontutils.scm
> @@ -1392,7 +1392,22 @@ (define-public libotf
>                 (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
>      (build-system gnu-build-system)
>      (native-inputs
> -     (list pkg-config))
> +     (append (if (%current-target-system)
> +                 (list libtool
> +                       autoconf automake)
> +                 '())
> +             (list pkg-config freetype)))
> +    (arguments (if (%current-target-system)
> +                   (list
> +                    #:phases
> +                    #~(modify-phases %standard-phases
> +                        (add-after 'unpack 'fix-rpl_malloc
> +                          (lambda _
> +                            (substitute* "configure.ac"
> +                              (("AC_FUNC_MALLOC")
> +                               ""))
> +                            (invoke "sh" "autogen.sh")))))
> +                   '()))
>      (propagated-inputs
>       (list freetype))
>      (home-page "https://www.nongnu.org/m17n/")
> -- 
> 2.39.1
> 
> 
> 
>
diff mbox series

Patch

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index 72621cc006..d451f5e504 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -1392,7 +1392,22 @@  (define-public libotf
                (base32 "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8"))))
     (build-system gnu-build-system)
     (native-inputs
-     (list pkg-config))
+     (append (if (%current-target-system)
+                 (list libtool
+                       autoconf automake)
+                 '())
+             (list pkg-config freetype)))
+    (arguments (if (%current-target-system)
+                   (list
+                    #:phases
+                    #~(modify-phases %standard-phases
+                        (add-after 'unpack 'fix-rpl_malloc
+                          (lambda _
+                            (substitute* "configure.ac"
+                              (("AC_FUNC_MALLOC")
+                               ""))
+                            (invoke "sh" "autogen.sh")))))
+                   '()))
     (propagated-inputs
      (list freetype))
     (home-page "https://www.nongnu.org/m17n/")