diff mbox series

[bug#66424] gnu: libxkbcommon: Fix cross-compile.

Message ID 62c95fe412c55e9350adff139ff33cb6fe91db68.1696864062.git.zhengjunjie@iscas.ac.cn
State New
Headers show
Series [bug#66424] gnu: libxkbcommon: Fix cross-compile. | expand

Commit Message

Zheng Junjie Oct. 9, 2023, 3:07 p.m. UTC
* gnu/packages/xdisorg.scm (libxkbcommon): Fix cross-compile.
[native-inputs]: When cross-compile add PKG-CONFIG-FOR-BUILD.
---
 gnu/packages/xdisorg.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


base-commit: 9b77bd0b9b4f3de69390da0ba7db5b9dbc01e554

Comments

John Kehayias Oct. 12, 2023, 6:07 p.m. UTC | #1
Hello,

(CC'ing authors of two related commits too)

On Mon, Oct 09, 2023 at 11:07 PM, Zheng Junjie wrote:

> * gnu/packages/xdisorg.scm (libxkbcommon): Fix cross-compile.
> [native-inputs]: When cross-compile add PKG-CONFIG-FOR-BUILD.
> ---
>  gnu/packages/xdisorg.scm | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
> index db948a9318..84bdcad031 100644
> --- a/gnu/packages/xdisorg.scm
> +++ b/gnu/packages/xdisorg.scm
> @@ -527,9 +527,13 @@ (define-public libxkbcommon
>             wayland-protocols
>             xkeyboard-config))
>      (native-inputs
> -     (list bison doxygen pkg-config python
> -           ;; wayland-scanner is required at build time.
> -           wayland))
> +     (append
> +      (if (%current-target-system)
> +          (list pkg-config-for-build)
> +          '())
> +      (list bison doxygen pkg-config python
> +            ;; wayland-scanner is required at build time.
> +            wayland)))
>      (arguments
>       (list #:configure-flags
>             #~(list (string-append "-Dxkb-config-root="
>
> base-commit: 9b77bd0b9b4f3de69390da0ba7db5b9dbc01e554

When searching the log it looked like this had already been done on
core-updates in 5841ac3981a3a08968704728cef14accd14e7a1c (Marius) but I
was confused when I didn't see it. Looks like the pkg-config-for-build
was dropped (accidentally?) in 5841ac3981a3a08968704728cef14accd14e7a1c
(Maxim)

Is this still needed?

And if so, I can do it on mesa-updates very soon, since libx11 and
libxpm will be ungrafted and related packages (like mesa) updated too.
Or we can leave it to core-updates if that makes more sense.

WDYT?

Thanks!
John
Maxim Cournoyer Oct. 13, 2023, 2:49 p.m. UTC | #2
Hi John,

John Kehayias <john.kehayias@protonmail.com> writes:

> Hello,
>
> (CC'ing authors of two related commits too)
>
> On Mon, Oct 09, 2023 at 11:07 PM, Zheng Junjie wrote:
>
>> * gnu/packages/xdisorg.scm (libxkbcommon): Fix cross-compile.
>> [native-inputs]: When cross-compile add PKG-CONFIG-FOR-BUILD.
>> ---
>>  gnu/packages/xdisorg.scm | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
>> index db948a9318..84bdcad031 100644
>> --- a/gnu/packages/xdisorg.scm
>> +++ b/gnu/packages/xdisorg.scm
>> @@ -527,9 +527,13 @@ (define-public libxkbcommon
>>             wayland-protocols
>>             xkeyboard-config))
>>      (native-inputs
>> -     (list bison doxygen pkg-config python
>> -           ;; wayland-scanner is required at build time.
>> -           wayland))
>> +     (append
>> +      (if (%current-target-system)
>> +          (list pkg-config-for-build)
>> +          '())
>> +      (list bison doxygen pkg-config python
>> +            ;; wayland-scanner is required at build time.
>> +            wayland)))
>>      (arguments
>>       (list #:configure-flags
>>             #~(list (string-append "-Dxkb-config-root="
>>
>> base-commit: 9b77bd0b9b4f3de69390da0ba7db5b9dbc01e554
>
> When searching the log it looked like this had already been done on
> core-updates in 5841ac3981a3a08968704728cef14accd14e7a1c (Marius) but I
> was confused when I didn't see it. Looks like the pkg-config-for-build
> was dropped (accidentally?) in 5841ac3981a3a08968704728cef14accd14e7a1c
> (Maxim)
>
> Is this still needed?

On the top of my head, I thought pkg-config-for-build had been obsolete
by the pkg-config symbol being dynamically bound to something that makes
sense for the context it's used in, via some macro trickery.  I may have
misunderstood things.

> And if so, I can do it on mesa-updates very soon, since libx11 and
> libxpm will be ungrafted and related packages (like mesa) updated too.
> Or we can leave it to core-updates if that makes more sense.

I guess it depends which branch is expected to be the shortest lived
one; I'm giving about a month to let more time for core-updates to merge
interesting bits and build the branch and fix breakage. Take this with a
grain of salt; it's not fixed in stone.

Thanks,

Maxim
Zheng Junjie Oct. 14, 2023, 5:30 p.m. UTC | #3
> 在 2023年10月13日,22:50,Maxim Cournoyer <maxim.cournoyer@gmail.com> 写道:
> 
> 
> On the top of my head, I thought pkg-config-for-build had been obsolete
> by the pkg-config symbol being dynamically bound to something that makes
> sense for the context it's used in, via some macro trickery.  I may have
> misunderstood things

For cross build, 

pkg-config -> xxxx-pkg-config
pkg-config-for-build -> pkg-config

libxkbcommon require wayland-scanner to generate c file, this is why need pkg-config-for-build, pkg-config is require by find library. Is different ,so libxkbcommon need both on cross build.
John Kehayias Oct. 14, 2023, 9:02 p.m. UTC | #4
Hi,

On Sun, Oct 15, 2023 at 01:30 AM, zhengjunjie@iscas.ac.cn wrote:

>> 在 2023年10月13日,22:50,Maxim Cournoyer <maxim.cournoyer@gmail.com> 写道:
>>
>>
>> On the top of my head, I thought pkg-config-for-build had been obsolete
>> by the pkg-config symbol being dynamically bound to something that makes
>> sense for the context it's used in, via some macro trickery.  I may have
>> misunderstood things
>
> For cross build,
>
> pkg-config -> xxxx-pkg-config
> pkg-config-for-build -> pkg-config
>
> libxkbcommon require wayland-scanner to generate c file, this is why
> need pkg-config-for-build, pkg-config is require by find library. Is
> different ,so libxkbcommon need both on cross build.

I'm not a cross-builder so I'll rely on you all for this.

If this change depends on other things in core-updates I'll leave it,
or if cross-building has had changes on core-updates. If it is just
something that can be done based on current master, I can cherry pick
the change from core-updates and apply this patch on mesa-updates.

What will work for everyone here?

I think my timeline will be quicker but I don't think this is
critical? I was just starting to gather what to apply on the mesa
branch, just waiting for the next mesa release (normally very quick
but current series has been delayed).

Thanks!
John
John Kehayias Oct. 16, 2023, 2:28 a.m. UTC | #5
Hi all,

cc'ing Efraim too, since...

On Sun, Oct 15, 2023 at 01:30 AM, zhengjunjie@iscas.ac.cn wrote:

>> 在 2023年10月13日,22:50,Maxim Cournoyer <maxim.cournoyer@gmail.com> 写道:
>>
>>
>> On the top of my head, I thought pkg-config-for-build had been obsolete
>> by the pkg-config symbol being dynamically bound to something that makes
>> sense for the context it's used in, via some macro trickery.  I may have
>> misunderstood things
>
> For cross build,
>
> pkg-config -> xxxx-pkg-config
> pkg-config-for-build -> pkg-config
>
> libxkbcommon require wayland-scanner to generate c file, this is why
> need pkg-config-for-build, pkg-config is require by find library. Is
> different ,so libxkbcommon need both on cross build.

looks like the same change was made on master in
bc1634a197dc9ab7aa0dead8c7449bb5db09cea6. Along with other commits
then to do the same thing to other similar packages.

So, I'm closing as I believe this is done but figured I'd loop in
Efraim in case there was anything else on this matter to discuss.

Thanks all!
John
Efraim Flashner Oct. 16, 2023, 4:42 a.m. UTC | #6
On Mon, Oct 16, 2023 at 02:28:13AM +0000, John Kehayias wrote:
> Hi all,
> 
> cc'ing Efraim too, since...
> 
> On Sun, Oct 15, 2023 at 01:30 AM, zhengjunjie@iscas.ac.cn wrote:
> 
> >> 在 2023年10月13日,22:50,Maxim Cournoyer <maxim.cournoyer@gmail.com> 写道:
> >>
> >>
> >> On the top of my head, I thought pkg-config-for-build had been obsolete
> >> by the pkg-config symbol being dynamically bound to something that makes
> >> sense for the context it's used in, via some macro trickery.  I may have
> >> misunderstood things
> >
> > For cross build,
> >
> > pkg-config -> xxxx-pkg-config
> > pkg-config-for-build -> pkg-config
> >
> > libxkbcommon require wayland-scanner to generate c file, this is why
> > need pkg-config-for-build, pkg-config is require by find library. Is
> > different ,so libxkbcommon need both on cross build.
> 
> looks like the same change was made on master in
> bc1634a197dc9ab7aa0dead8c7449bb5db09cea6. Along with other commits
> then to do the same thing to other similar packages.
> 
> So, I'm closing as I believe this is done but figured I'd loop in
> Efraim in case there was anything else on this matter to discuss.

Oh no! I really need to get better about checking the bug tracker to see
if someone else has already worked through changes I'm thinking of.

I tried a bit of pkg-config hackery/trickery for a bunch of the
packages, even messing with the meson cross definitions file, but it
turned out that pkg-config-for-build did the exact wrapping that was
needed AND it provided a symlink from (pkg-config-for-target) to
"pkg-config", which was what meson needed.

I'll cherry-pick the commits over to core-updates and then do some of
the fixups to make everything cleaner.
Maxim Cournoyer Oct. 16, 2023, 1:48 p.m. UTC | #7
Hi Efraim,

Efraim Flashner <efraim@flashner.co.il> writes:

[...]

>> looks like the same change was made on master in
>> bc1634a197dc9ab7aa0dead8c7449bb5db09cea6. Along with other commits
>> then to do the same thing to other similar packages.
>> 
>> So, I'm closing as I believe this is done but figured I'd loop in
>> Efraim in case there was anything else on this matter to discuss.
>
> Oh no! I really need to get better about checking the bug tracker to see
> if someone else has already worked through changes I'm thinking of.
>
> I tried a bit of pkg-config hackery/trickery for a bunch of the
> packages, even messing with the meson cross definitions file, but it
> turned out that pkg-config-for-build did the exact wrapping that was
> needed AND it provided a symlink from (pkg-config-for-target) to
> "pkg-config", which was what meson needed.
>
> I'll cherry-pick the commits over to core-updates and then do some of
> the fixups to make everything cleaner.

Thanks for the resolution, and sorry for the regression I had
introduced.
diff mbox series

Patch

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index db948a9318..84bdcad031 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -527,9 +527,13 @@  (define-public libxkbcommon
            wayland-protocols
            xkeyboard-config))
     (native-inputs
-     (list bison doxygen pkg-config python
-           ;; wayland-scanner is required at build time.
-           wayland))
+     (append
+      (if (%current-target-system)
+          (list pkg-config-for-build)
+          '())
+      (list bison doxygen pkg-config python
+            ;; wayland-scanner is required at build time.
+            wayland)))
     (arguments
      (list #:configure-flags
            #~(list (string-append "-Dxkb-config-root="