Skip to content

Build fixes for distribution packages (GTK 4.20, system locale dir) - #178

Merged
Ivshti merged 2 commits into
Stremio:mainfrom
switch87:distro-packaging
Oct 18, 2026
Merged

Ivshti merged 2 commits into
Stremio:mainfrom
switch87:distro-packaging

Conversation

@switch87

@switch87 switch87 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #169.

Rebased on main. The schema install and the locale output dir from #169 are covered by 4cba0be / b8d63a3 (GSETTINGS_SCHEMA_DIR / GETTEXT_DIR in .cargo/config.toml), so that commit is gone. Two commits are left:

  1. GTK 4.20 / libadwaita 1.8 instead of 4.22 / 1.9 (Cargo.toml). The code uses no newer API: cargo clippy --all --no-deps -- -D warnings and cargo build --release pass on current main against GTK 4.20.4 and libadwaita 1.8.7. Distributions that don't ship GTK 4.22 yet can then build it.

  2. Build-time system locale dir (src/main.rs). Outside Flatpak the app binds its text domain to GETTEXT_DIR, which is also where build.rs writes the catalogs. A package builds into its work dir but installs the catalogs to /usr/share/locale, so the installed app wouldn't find them, and pointing GETTEXT_DIR at /usr/share/locale would make the build write outside its sandbox. STREMIO_LOCALEDIR=/usr/share/locale at build time (option_env!) now sets the runtime dir on its own. Flatpak still wins when FLATPAK_ID is set; without the variable GETTEXT_DIR is used as before.

A distribution build then looks like:

STREMIO_LOCALEDIR=/usr/share/locale cargo build --release
install -Dm644 target/schemas/gschemas.compiled ...   # or the .gschema.xml + glib-compile-schemas
install -Dm644 target/locale/<lang>/LC_MESSAGES/stremio.mo -t /usr/share/locale/<lang>/LC_MESSAGES/

Checked: cargo fmt --all -- --check and clippy pass; with the variable set the binary carries /usr/share/locale, without it behaves as on main.

@tymmesyde

Copy link
Copy Markdown
Member

Hi,i updated the main branch with changes related to yours
It will now output the schemas and locales to the target folder
Those paths can be changed by setting GSETTINGS_SCHEMA_DIR and GETTEXT_DIR https://github.com/Stremio/stremio-linux-shell/blob/main/.cargo/config.toml#L4-L5

The code uses no API newer than GTK 4.20 and libadwaita 1.8: cargo
check, clippy and a build pass with the v4_20 / v1_8 features. Lower
requirements let distributions that don't ship GTK 4.22 yet build it.

Refs Stremio#169
Outside Flatpak the app binds its text domain to GETTEXT_DIR, the
directory build.rs writes the compiled catalogs to (target/locale by
default). A distribution package builds into its work dir but installs
the catalogs to /usr/share/locale, so the installed app never finds
them. STREMIO_LOCALEDIR at build time now sets the runtime directory
separately; without it nothing changes.

Refs Stremio#169
@switch87 switch87 changed the title Build fixes for distribution packages (GTK 4.20, schema install, system locale dir) Build fixes for distribution packages (GTK 4.20, system locale dir) Oct 13, 2026
@switch87

Copy link
Copy Markdown
Contributor Author

Thanks @tymmesyde! 4cba0be and b8d63a3 solve the schema install and the locale output dir from #169, so I dropped my schema commit and rebased on main. Two things from #169 are left in this PR: building against GTK 4.20 / libadwaita 1.8 (nothing newer is used), and STREMIO_LOCALEDIR to set the runtime locale dir separately from GETTEXT_DIR, because a package writes the catalogs to its build dir but installs them to /usr/share/locale.

@Ivshti
Ivshti merged commit d7b2c91 into Stremio:main Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gentoo package available; three build issues affecting distro packaging

3 participants