WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: gtk4 extension on armv7l (RaspberryPi)  (Read 327 times)

Offline yvs

  • Newbie
  • *
  • Posts: 19
gtk4 extension on armv7l (RaspberryPi)
« on: July 07, 2024, 07:54:03 PM »
Hi everyone,

trying to compile gtk4 app on RaspberryPi3B+ (armv7l) got these complains from pkg-config:
Quote
% pkg-config --cflags gtk4

Package xcursor was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcursor.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcursor', required by 'gtk4', not found

Package xcomposite was not found in the pkg-config search path.
Perhaps you should add the directory containing `xcomposite.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcomposite', required by 'gtk4', not found

Package xinerama was not found in the pkg-config search path.
Perhaps you should add the directory containing `xinerama.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xinerama', required by 'gtk4', not found

After added 'libXcursor-dev libXcomposite-dev libXinerama-dev' to gtk4-dev dependencies
building started and quickly finished because of GTK_MAJOR_VERSION is less than 4. It became a bit confusing.
Then toggling off GTK4 version checking I got (despite that gtk3.98.2 is almost gtk4) there's still too mush difference in API, too many functions need to be replaced or rewritten in gtk3 style to get it works, not sure if gtk3.98 should be named gtk4 (after trying to adapt gtk4 code to gtk3.98.2 api).

Has anyone tried to build a bit more compat gtk4 extension for armv7l? (to not spend time on it if that's unlikely to build successfully)
« Last Edit: July 07, 2024, 08:10:08 PM by yvs »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11322
Re: gtk4 extension on armv7l (RaspberryPi)
« Reply #1 on: July 07, 2024, 09:56:02 PM »
Hi yvs
Unfortunately, when some packages change major versions (i.e. 3.x.x to 4.x.x) it
causes breakage elsewhere.

... (despite that gtk3.98.2 is almost gtk4) ...
I think version numbering can continue to go up like this:
Code: [Select]
gtk3.98.2
gtk3.99.0
gtk3.100.0
 ...
gtk3.150.0
 ...
gtk3.200.0
 ...
gtk3.500.0

Quote
... not sure if gtk3.98 should be named gtk4 ...
GTK version numbers are used to document changes. You can't just arbitrarily
rename GTK like that.

Maybe try finding a slightly older version of the app that depends on an
older version of GTK.

It's also possible there was some kind of packaging error. I unpacked
gtk4-dev.tcz and the  pkgconfig/gtk4.pc  file contained the following:
Code: [Select]
----- Snip -----
gtk_binary_version=4.0.0
gtk_host=arm-linux

Name: GTK
Description: GTK Graphical UI Library
Version: 3.98.2
 ----- Snip -----
I don't know enough about it to say one way or the other, but
based on what I see in the x86_64 versions of gtk3-dev and
gtk4-dev, I'd expect the  UI Library Version  number should be
greater than or equal to the  gtk_binary_version  number.

Maybe Juanito can provide more insight.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14642
Re: gtk4 extension on armv7l (RaspberryPi)
« Reply #2 on: July 08, 2024, 02:48:50 AM »
As you’ve discovered, the gtk4 extension is a very early version, updating it to something more recent would probably involve updating some of its dependencies as well.

I can take a look, but it wouldn’t be before a week or so.

Offline yvs

  • Newbie
  • *
  • Posts: 19
Re: gtk4 extension on armv7l (RaspberryPi)
« Reply #3 on: July 09, 2024, 02:15:05 PM »
@Rich
> Maybe try finding a slightly older version of the app that depends on an older version of GTK.
>
  Gtk is a bit oversophisticated, gtk2/3/4 could be considered as toolkits with different concepts and distinct API, so that an app for gtk2 or gtk3 it's rather different one.  If I got it correctly gtk3.9x is a transit version (already not gtk3 but not gtk4 yet), suppose that it's easier to build needed libs than adapt to transit versions.

@Juanito
> updating it to something more recent would probably involve updating some of its dependencies as well.
>
  On purpose of test on RPI3B+ I've locally built gtk4.12.5 (last one that's not overvulkanised and still with default GL renderer) completed with cairo and pango update too, it works (at least with a couple apps that I tried to build and run).