Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake C++ GTK 3 Community Template #278

Merged
merged 6 commits into from
Jan 22, 2025

Conversation

leograba
Copy link
Member

@leograba leograba commented Nov 5, 2024

Create a CMake C++ GTK 3 community template (sponsored by Toradex, but not regularly maintained like the Toradex-supported ones).

This template is based on the cmakeConsole and modified inspired on the cppQML for enabling graphics.

This PR is a fork of #268 and depends on toradex/vscode-torizon-templates-documentation#16

@leograba leograba added the new-template Adding a new template label Nov 5, 2024
@leograba leograba self-assigned this Nov 5, 2024
@leograba leograba changed the title CMake C++ GTK 3 Community Template Draft: CMake C++ GTK 3 Community Template Nov 5, 2024
@leograba leograba marked this pull request as draft November 5, 2024 13:05
@leograba leograba changed the title Draft: CMake C++ GTK 3 Community Template CMake C++ GTK 3 Community Template Nov 5, 2024
@leograba leograba force-pushed the gtk3-community-template branch from 8a22c14 to ed27c67 Compare November 5, 2024 19:00
@leograba
Copy link
Member Author

leograba commented Nov 5, 2024

Tested on Local AMD64 and Torizon ARMv8.

This PR is ready for review.

@leograba leograba marked this pull request as ready for review November 5, 2024 19:05
@leograba leograba force-pushed the gtk3-community-template branch 3 times, most recently from 0490422 to dfe452b Compare November 13, 2024 10:57
RUN apt-get -q -y update && \
apt-get -q -y install \
cmake \
libgtk-3-dev:${IMAGE_ARCH} \
Copy link
Collaborator

@andreriesco andreriesco Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just found out that this does not work because for arm32, IMAGE_ARCH is arm, but apt uses :armhf. But this is a use case we need to support, not just for this template but for any template. Here there are two possible options:

  • Use if for the install, like in here
  • Modify the templates to have a torizonPackages.json, instead of creating it on project creation, to have at least the dependencies that depend on the architecture there
    Probably will be nice to quickly discuss this on a meeting (like on the grooming)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify the templates to have a torizonPackages.json, instead of creating it on project creation, to have at least the dependencies that depend on the architecture there

I like it. In fact, in my tests I was using the torizonPackages.json but then in the template I didn't use it because I thought this was a file that was mandatory to be left empty in the template. More or less like:

  • Keep the base required files for the template to work on the Dockerfile directly
  • Keep the torizonPackages.json only for the user

But not sure what makes most sense here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed with ddf6eae

apt-get install -y --no-install-recommends \
libgtk-3-0 \
RUN apt-get -y update && apt-get install -y --no-install-recommends \
libgtk-4-1 \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be GTK 4 and not GTK 3 here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my mistake!

Fixed by 7ad4338

@microhobby microhobby force-pushed the dev branch 14 times, most recently from 9f045f0 to 65ae09b Compare January 15, 2025 18:30
@microhobby microhobby force-pushed the dev branch 7 times, most recently from 97f62c0 to e169b0e Compare January 16, 2025 02:36
@andreriesco
Copy link
Collaborator

@leograba Please add a gtk3.png image at assets/img

@leograba
Copy link
Member Author

@leograba Please add a gtk3.png image at assets/img

This is done

microhobby and others added 6 commits January 21, 2025 13:57
For the new Slint templates, the status was updated to ok, as
we do not have any known issues with them.

Signed-off-by: Matheus Castello <[email protected]>
Create a template for GTK 3, based on the cmakeConsole.

Use the "torizon/wayland-gtk3" container as base for the runtime.

Signed-off-by: Leonardo Graboski Veiga <[email protected]>
Cross compilation had some issues with the GTK 4 template due to Debian
dependencies. To keep the GTK 3 and GTK 4 templates as close as
possible, move both to using native compilation (with the help of QEMU
emulation).

This also solves an issue with 32-bit Arm cross-compilation specific to
the IDE Templates variable substitution.

Signed-off-by: Leonardo Graboski Veiga <[email protected]>
Signed-off-by: Leonardo Graboski Veiga <[email protected]>
This was a mistake due to developing templates both for GTK 3 and 4.

Signed-off-by: Leonardo Graboski Veiga <[email protected]>
Signed-off-by: Matheus Castello <[email protected]>
@microhobby microhobby force-pushed the gtk3-community-template branch from a0ddf4b to a0508ae Compare January 22, 2025 00:41
@microhobby
Copy link
Collaborator

LGTM thanks @leograba !

@microhobby microhobby merged commit ac48608 into torizon:dev Jan 22, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-template Adding a new template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants