[bug#36477,v2,27/61] gnu: pkg-config: Fix cross-compilation.
diff mbox series

Message ID 20190821085455.18508-27-m.othacehe@gmail.com
State New
Headers show
Series
  • Add --target support to guix system
Related show

Commit Message

Mathieu Othacehe Aug. 21, 2019, 8:54 a.m. UTC
* gnu/packages/pkg-config.scm (%pkg-config)[arguments]: Add configure-flags
to disable tests that fail when cross-compiling.
---
 gnu/packages/pkg-config.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/gnu/packages/pkg-config.scm b/gnu/packages/pkg-config.scm
index 6fc19a975d..329a63658a 100644
--- a/gnu/packages/pkg-config.scm
+++ b/gnu/packages/pkg-config.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -48,7 +49,17 @@ 
              (base32
               "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"))))
    (build-system gnu-build-system)
-   (arguments `(#:configure-flags '("--with-internal-glib")))
+   (arguments
+    `(#:configure-flags
+      '("--with-internal-glib"
+        ;; Those variables are guessed incorrectly when cross-compiling.
+        ;; See: https://developer.gimp.org/api/2.0/glib/glib-cross-compiling.html.
+        ,@(if (%current-target-system)
+              '("glib_cv_stack_grows=no"
+                "glib_cv_uscore=no"
+                "ac_cv_func_posix_getpwuid_r=yes"
+                "ac_cv_func_posix_getgrgid_r=yes")
+              '()))))
    (native-search-paths
     (list (search-path-specification
            (variable "PKG_CONFIG_PATH")