Subject: Re: [bug#36477] [PATCH 27/31] gnu: pkg-config: Fix cross-compilation.

From: Ricardo Wurmus <[email-masked]>
Date: Thu, 25 Jul 2019 21:04:24 +0200

Mathieu Othacehe <[email-masked]> writes:

>> Are these indicative of a problem in our cross stack, or a bug in the
>> pkg-config build system/code?
>>
>> LGTM anyway.
>
> No those bits seems to be needed because of a problem in pkg-config
> itself. See this nixpkg pkg-config package snippet:
>
> --8<---------------cut here---------------start------------->8---
>   configureFlags = [ "--with-internal-glib" ]
>     ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]
>        # Can't run these tests while cross-compiling
>     ++ optional (stdenv.hostPlatform != stdenv.buildPlatform)
>        [ "glib_cv_stack_grows=no"
>          "glib_cv_uscore=no"
>          "ac_cv_func_posix_getpwuid_r=yes"
>          "ac_cv_func_posix_getgrgid_r=yes"
>        ];
> --8<---------------cut here---------------end--------------->8---

In this case it would be good to add a comment so that our future selves
won’t be confused.

Thanks!

-- 
Ricardo