diff mbox series

gsettings-desktop-schemas.pc.in: use pc_sysrootdir for prefix

Message ID 20221229080810.98961-1-f_l_k@t-online.de
State New
Headers show
Series gsettings-desktop-schemas.pc.in: use pc_sysrootdir for prefix | expand

Commit Message

Markus Volk Dec. 29, 2022, 8:08 a.m. UTC
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 ...ktop-schemas.pc.in-use-pc_sysrootdir.patch | 34 +++++++++++++++++++
 .../gsettings-desktop-schemas_43.0.bb         |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch

Comments

Richard Purdie Dec. 31, 2022, 5:14 p.m. UTC | #1
On Thu, 2022-12-29 at 09:08 +0100, Markus Volk wrote:
> Signed-off-by: Markus Volk <f_l_k@t-online.de>
> ---
>  ...ktop-schemas.pc.in-use-pc_sysrootdir.patch | 34 +++++++++++++++++++
>  .../gsettings-desktop-schemas_43.0.bb         |  1 +
>  2 files changed, 35 insertions(+)
>  create mode 100644 meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
> 
> diff --git a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
> new file mode 100644
> index 0000000000..4bf38c1987
> --- /dev/null
> +++ b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
> @@ -0,0 +1,34 @@
> +From abd179df28adcdd9fac3d066aaccbd4c4cd135f5 Mon Sep 17 00:00:00 2001
> +From: Markus Volk <f_l_k@t-online.de>
> +Date: Thu, 29 Dec 2022 06:39:59 +0100
> +Subject: [PATCH] gsettings-desktop-schemas.pc.in: use pc_sysrootdir for prefix
> +
> +gnome-settings uses pkgconfig to find gdesktop-enums.h
> +https://github.com/GNOME/gnome-control-center/blob/4648296a706df83af984a918e5f14c3ece42f5fc/panels/background/meson.build#L22
> +
> +Adding pc-sysrootdir to prefix would allow to find the file also if we have a user defined sysroot.
> +
> +This will fix cross compilation of gnome-control-center with yocto/openembedded that otherwise fails like this:
> +
> +| ../gnome-control-center-43.2/panels/background/meson.build:27:0: ERROR: File /usr/include/gsettings-desktop-schemas/gdesktop-enums.h does not exist.
> +
> +Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/62]
> +
> +Signed-off-by: Markus Volk <f_l_k@t-online.de>
> +---
> + gsettings-desktop-schemas.pc.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/gsettings-desktop-schemas.pc.in b/gsettings-desktop-schemas.pc.in
> +index d611dc1..992fa55 100644
> +--- a/gsettings-desktop-schemas.pc.in
> ++++ b/gsettings-desktop-schemas.pc.in
> +@@ -1,4 +1,4 @@
> +-prefix=@prefix@
> ++prefix=${pc_sysrootdir}@prefix@
> + 
> + Name: gsettings-desktop-schemas
> + Description: Shared GSettings schemas for the desktop, including helper headers
> +-- 
> +2.34.1
> +

This doesn't look right to me. It would lead to an arms race where
every .pc file would need to start accounting for the sysroot. The
sysroot should really be handled at the calling site.

Cheers,

Richard
Ross Burton Jan. 3, 2023, 4:30 p.m. UTC | #2
Agreed, and commented on the MR.

Ross

> On 31 Dec 2022, at 17:14, Richard Purdie via lists.openembedded.org <richard.purdie=linuxfoundation.org@lists.openembedded.org> wrote:
> 
> On Thu, 2022-12-29 at 09:08 +0100, Markus Volk wrote:
>> Signed-off-by: Markus Volk <f_l_k@t-online.de>
>> ---
>> ...ktop-schemas.pc.in-use-pc_sysrootdir.patch | 34 +++++++++++++++++++
>> .../gsettings-desktop-schemas_43.0.bb         |  1 +
>> 2 files changed, 35 insertions(+)
>> create mode 100644 meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
>> 
>> diff --git a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
>> new file mode 100644
>> index 0000000000..4bf38c1987
>> --- /dev/null
>> +++ b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
>> @@ -0,0 +1,34 @@
>> +From abd179df28adcdd9fac3d066aaccbd4c4cd135f5 Mon Sep 17 00:00:00 2001
>> +From: Markus Volk <f_l_k@t-online.de>
>> +Date: Thu, 29 Dec 2022 06:39:59 +0100
>> +Subject: [PATCH] gsettings-desktop-schemas.pc.in: use pc_sysrootdir for prefix
>> +
>> +gnome-settings uses pkgconfig to find gdesktop-enums.h
>> +https://github.com/GNOME/gnome-control-center/blob/4648296a706df83af984a918e5f14c3ece42f5fc/panels/background/meson.build#L22
>> +
>> +Adding pc-sysrootdir to prefix would allow to find the file also if we have a user defined sysroot.
>> +
>> +This will fix cross compilation of gnome-control-center with yocto/openembedded that otherwise fails like this:
>> +
>> +| ../gnome-control-center-43.2/panels/background/meson.build:27:0: ERROR: File /usr/include/gsettings-desktop-schemas/gdesktop-enums.h does not exist.
>> +
>> +Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/62]
>> +
>> +Signed-off-by: Markus Volk <f_l_k@t-online.de>
>> +---
>> + gsettings-desktop-schemas.pc.in | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/gsettings-desktop-schemas.pc.in b/gsettings-desktop-schemas.pc.in
>> +index d611dc1..992fa55 100644
>> +--- a/gsettings-desktop-schemas.pc.in
>> ++++ b/gsettings-desktop-schemas.pc.in
>> +@@ -1,4 +1,4 @@
>> +-prefix=@prefix@
>> ++prefix=${pc_sysrootdir}@prefix@
>> + 
>> + Name: gsettings-desktop-schemas
>> + Description: Shared GSettings schemas for the desktop, including helper headers
>> +-- 
>> +2.34.1
>> +
> 
> This doesn't look right to me. It would lead to an arms race where
> every .pc file would need to start accounting for the sysroot. The
> sysroot should really be handled at the calling site.
> 
> Cheers,
> 
> Richard
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#175181): https://lists.openembedded.org/g/openembedded-core/message/175181
> Mute This Topic: https://lists.openembedded.org/mt/95933924/6875888
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
new file mode 100644
index 0000000000..4bf38c1987
--- /dev/null
+++ b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas/0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch
@@ -0,0 +1,34 @@ 
+From abd179df28adcdd9fac3d066aaccbd4c4cd135f5 Mon Sep 17 00:00:00 2001
+From: Markus Volk <f_l_k@t-online.de>
+Date: Thu, 29 Dec 2022 06:39:59 +0100
+Subject: [PATCH] gsettings-desktop-schemas.pc.in: use pc_sysrootdir for prefix
+
+gnome-settings uses pkgconfig to find gdesktop-enums.h
+https://github.com/GNOME/gnome-control-center/blob/4648296a706df83af984a918e5f14c3ece42f5fc/panels/background/meson.build#L22
+
+Adding pc-sysrootdir to prefix would allow to find the file also if we have a user defined sysroot.
+
+This will fix cross compilation of gnome-control-center with yocto/openembedded that otherwise fails like this:
+
+| ../gnome-control-center-43.2/panels/background/meson.build:27:0: ERROR: File /usr/include/gsettings-desktop-schemas/gdesktop-enums.h does not exist.
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas/-/merge_requests/62]
+
+Signed-off-by: Markus Volk <f_l_k@t-online.de>
+---
+ gsettings-desktop-schemas.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gsettings-desktop-schemas.pc.in b/gsettings-desktop-schemas.pc.in
+index d611dc1..992fa55 100644
+--- a/gsettings-desktop-schemas.pc.in
++++ b/gsettings-desktop-schemas.pc.in
+@@ -1,4 +1,4 @@
+-prefix=@prefix@
++prefix=${pc_sysrootdir}@prefix@
+ 
+ Name: gsettings-desktop-schemas
+ Description: Shared GSettings schemas for the desktop, including helper headers
+-- 
+2.34.1
+
diff --git a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_43.0.bb b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_43.0.bb
index 966a67fead..09aec42ded 100644
--- a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_43.0.bb
+++ b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_43.0.bb
@@ -13,4 +13,5 @@  GNOMEBASEBUILDCLASS = "meson"
 
 inherit gnomebase gsettings gobject-introspection gettext
 
+SRC_URI += "file://0001-gsettings-desktop-schemas.pc.in-use-pc_sysrootdir.patch"
 SRC_URI[archive.sha256sum] = "5d5568282ab38b95759d425401f7476e56f8cbf2629885587439f43bd0b84bbe"