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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

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 2 times, most recently from 1d12caa to 0490422 Compare November 13, 2024 10:56
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]>
@leograba leograba force-pushed the gtk3-community-template branch from 0490422 to dfe452b Compare November 13, 2024 10:57
This is a Community template fostered by Toradex.

Signed-off-by: Leonardo Graboski Veiga <[email protected]>
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

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]>
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.

2 participants