Skip to content

Commit ebbf998

Browse files
committed
fix: build pruduction manifest on CI & update install versions inREADME
1 parent bfae5d5 commit ebbf998

File tree

7 files changed

+71
-22
lines changed

7 files changed

+71
-22
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Rustfmt
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v6
1414
- uses: actions-rs/toolchain@v1
1515
with:
1616
profile: minimal
@@ -26,13 +26,12 @@ jobs:
2626
name: Flatpak
2727
runs-on: ubuntu-latest
2828
container:
29-
image: bilelmoussaoui/flatpak-github-actions:gnome-46
29+
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
3030
options: --privileged
3131
steps:
32-
- uses: actions/checkout@v4
33-
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
34-
with:
35-
bundle: gtk-rust-template.flatpak
36-
manifest-path: build-aux/com.belmoussaoui.GtkRustTemplate.Devel.json
37-
run-tests: true
38-
cache-key: flatpak-builder-${{ github.sha }}
32+
- uses: actions/checkout@v6
33+
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
34+
with:
35+
bundle: gtk-rust-template.flatpak
36+
manifest-path: build-aux/com.belmoussaoui.GtkRustTemplate.json
37+
cache-key: flatpak-builder-${{ github.sha }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ A new directory named `contrast` containing the generated project
6161
Make sure you have `flatpak` and `flatpak-builder` installed. Then run the commands below. Replace `<application_id>` with the value you entered during project creation. Please note that these commands are just for demonstration purposes. Normally this would be handled by your IDE, such as GNOME Builder or VS Code with the Flatpak extension.
6262

6363
```shell
64-
flatpak install --user org.gnome.Sdk//49 org.gnome.Platform//49 org.freedesktop.Sdk.Extension.rust-stable//24.08 org.freedesktop.Sdk.Extension.llvm18//23.08
64+
flatpak install --user org.gnome.Sdk//49 org.gnome.Platform//49 org.freedesktop.Sdk.Extension.rust-stable//25.08 org.freedesktop.Sdk.Extension.llvm21//25.08
6565
flatpak-builder --user flatpak_app build-aux/<application_id>.Devel.json
6666
```
6767

build-aux/com.belmoussaoui.GtkRustTemplate.Devel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sdk": "org.gnome.Sdk",
66
"sdk-extensions": [
77
"org.freedesktop.Sdk.Extension.rust-stable",
8-
"org.freedesktop.Sdk.Extension.llvm20"
8+
"org.freedesktop.Sdk.Extension.llvm21"
99
],
1010
"command": "gtk-rust-template",
1111
"finish-args": [
@@ -18,7 +18,7 @@
1818
"--env=RUST_BACKTRACE=1"
1919
],
2020
"build-options": {
21-
"append-path": "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm20/bin",
21+
"append-path": "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm21/bin",
2222
"build-args": [
2323
"--share=network"
2424
],
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"id": "com.belmoussaoui.GtkRustTemplate",
3+
"runtime": "org.gnome.Platform",
4+
"runtime-version": "49",
5+
"sdk": "org.gnome.Sdk",
6+
"sdk-extensions": [
7+
"org.freedesktop.Sdk.Extension.rust-stable",
8+
"org.freedesktop.Sdk.Extension.llvm21"
9+
],
10+
"command": "gtk-rust-template",
11+
"finish-args": [
12+
"--share=ipc",
13+
"--socket=fallback-x11",
14+
"--socket=wayland",
15+
"--device=dri",
16+
"--env=RUST_LOG=gtk_rust_template=debug",
17+
"--env=G_MESSAGES_DEBUG=none",
18+
"--env=RUST_BACKTRACE=1"
19+
],
20+
"build-options": {
21+
"append-path": "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm21/bin",
22+
"build-args": ["--share=network"],
23+
"env": {
24+
"CARGO_REGISTRIES_CRATES_IO_PROTOCOL": "sparse",
25+
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER": "clang",
26+
"CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold",
27+
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER": "clang",
28+
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS": "-C link-arg=-fuse-ld=/usr/lib/sdk/rust-stable/bin/mold"
29+
},
30+
"test-args": ["--socket=x11", "--share=network"]
31+
},
32+
"modules": [
33+
{
34+
"name": "gtk-rust-template",
35+
"buildsystem": "meson",
36+
"run-tests": true,
37+
"config-opts": ["-Dprofile=development"],
38+
"sources": [
39+
{
40+
"type": "dir",
41+
"path": "../"
42+
}
43+
]
44+
}
45+
]
46+
}

create-project.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/env python3
22

33
import os
4-
import sys
5-
import subprocess
4+
import platform
65
import shutil
7-
from pathlib import Path
6+
import subprocess
7+
import sys
88
import urllib.request
99
import zipfile
10-
import subprocess
11-
import platform
10+
from pathlib import Path
1211

1312
print("Welcome to GTK Rust Template")
1413
while True:
@@ -68,9 +67,11 @@
6867
exit()
6968

7069
if online:
71-
zip_destination, _ = urllib.request.urlretrieve(files_url, current_dir / "relm4-template.zip")
70+
zip_destination, _ = urllib.request.urlretrieve(
71+
files_url, current_dir / "relm4-template.zip"
72+
)
7273

73-
with zipfile.ZipFile(zip_destination, 'r') as zip_ref:
74+
with zipfile.ZipFile(zip_destination, "r") as zip_ref:
7475
zip_ref.extractall(current_dir)
7576

7677
os.remove(zip_destination)
@@ -153,7 +154,9 @@
153154

154155
for file in files_to_rename:
155156
current_path = project_dir / file
156-
new_path = project_dir / file.parent / str(file.name).replace(CURRENT_APP_ID, app_id)
157+
new_path = (
158+
project_dir / file.parent / str(file.name).replace(CURRENT_APP_ID, app_id)
159+
)
157160
shutil.move(current_path, new_path)
158161

159162

@@ -202,4 +205,4 @@
202205
subprocess.Popen(["xdg-open", current_dir])
203206
else:
204207
print("Failed to open project path, unsupported operating system.")
205-
print("Created project at: " + current_dir)
208+
print("Created project at: ", current_dir)

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in
4343
pkg-config
4444
rust-analyzer
4545
wrapGAppsHook4
46-
appstream-glib
46+
appstream
4747
desktop-file-utils
4848
rustPlatform.cargoSetupHook
4949
];

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ in
3030
ninja
3131
parted
3232
gettext
33+
appstream
3334
pkg-config
3435
gdk-pixbuf
3536
libadwaita

0 commit comments

Comments
 (0)