From 34a2896d26e478b45a2fabc05a9bf1f53beb578b Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 2 Feb 2026 13:20:34 +0700 Subject: [PATCH] Fix cosmic apps deps, add rpath-link to RUSTFLAGS --- recipes/tools/cosmic-edit/recipe.toml | 7 +++++++ recipes/tools/cosmic-files/recipe.toml | 14 +++----------- recipes/tools/cosmic-settings/recipe.toml | 14 +++----------- recipes/tools/cosmic-store/recipe.toml | 3 +-- recipes/tools/cosmic-term/recipe.toml | 5 +++++ recipes/wip/web/servo/recipe.toml | 2 -- src/cook/script.rs | 2 +- 7 files changed, 20 insertions(+), 27 deletions(-) diff --git a/recipes/tools/cosmic-edit/recipe.toml b/recipes/tools/cosmic-edit/recipe.toml index e8885eebc..bb8133289 100644 --- a/recipes/tools/cosmic-edit/recipe.toml +++ b/recipes/tools/cosmic-edit/recipe.toml @@ -4,8 +4,15 @@ branch = "master" [build] template = "custom" +dependencies = [ + "gettext", + "libxkbcommon", +] script = """ +DYNAMIC_INIT +export GETTEXT_DIR="${COOKBOOK_SYSROOT}/usr" cookbook_cargo --no-default-features + mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps" cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/usr/share/ui/apps/30_cosmic-edit" #TODO: install with just? diff --git a/recipes/tools/cosmic-files/recipe.toml b/recipes/tools/cosmic-files/recipe.toml index 6ecb0649a..7804f4213 100644 --- a/recipes/tools/cosmic-files/recipe.toml +++ b/recipes/tools/cosmic-files/recipe.toml @@ -10,17 +10,9 @@ dependencies = [ ] script = """ DYNAMIC_INIT -export GETTEXT_DIR="${COOKBOOK_SYSROOT}" -# Hack to link libiconv, which gettext-sys does not link -"${COOKBOOK_CARGO}" rustc \ - --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ - --release \ - --bin cosmic-files \ - --no-default-features \ - --features desktop \ - -- \ - -L "${COOKBOOK_SYSROOT}/lib" \ - -C link-arg="-liconv" +export GETTEXT_DIR="${COOKBOOK_SYSROOT}/usr" +cookbook_cargo --no-default-features + mkdir -pv "${COOKBOOK_STAGE}/usr/bin/" cp -v "target/${TARGET}/release/cosmic-files" "${COOKBOOK_STAGE}/usr/bin/" mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps/" diff --git a/recipes/tools/cosmic-settings/recipe.toml b/recipes/tools/cosmic-settings/recipe.toml index d2f96703f..50c9d8cc9 100644 --- a/recipes/tools/cosmic-settings/recipe.toml +++ b/recipes/tools/cosmic-settings/recipe.toml @@ -6,21 +6,13 @@ branch = "master" template = "custom" dependencies = [ "gettext", - "libiconv", "libxkbcommon", ] script = """ DYNAMIC_INIT -export GETTEXT_DIR="${COOKBOOK_SYSROOT}" -# Hack to link libiconv, which gettext-sys does not link -"${COOKBOOK_CARGO}" rustc \ - --manifest-path "${COOKBOOK_SOURCE}/cosmic-settings/Cargo.toml" \ - --release \ - --bin cosmic-settings \ - --no-default-features \ - -- \ - -L "${COOKBOOK_SYSROOT}/lib" \ - -C link-arg="-liconv" +export GETTEXT_DIR="${COOKBOOK_SYSROOT}/usr" +(COOKBOOK_SOURCE+="/cosmic-settings" cookbook_cargo --no-default-features) + mkdir -pv "${COOKBOOK_STAGE}/usr/bin/" cp -v "target/${TARGET}/release/cosmic-settings" "${COOKBOOK_STAGE}/usr/bin/" #TODO: install with just? diff --git a/recipes/tools/cosmic-store/recipe.toml b/recipes/tools/cosmic-store/recipe.toml index 1eb1406f1..c8af9d572 100644 --- a/recipes/tools/cosmic-store/recipe.toml +++ b/recipes/tools/cosmic-store/recipe.toml @@ -6,14 +6,13 @@ branch = "master" template = "custom" dependencies = [ "gettext", - "libxkbcommon", "openssl1", ] script = """ DYNAMIC_INIT export GETTEXT_DIR="${COOKBOOK_SYSROOT}" -export GETTEXT_STATIC=1 cookbook_cargo --no-default-features --features desktop,pkgar + #TODO: install with just? APPID="com.system76.CosmicStore" mkdir -pv "${COOKBOOK_STAGE}/usr/share/applications/" diff --git a/recipes/tools/cosmic-term/recipe.toml b/recipes/tools/cosmic-term/recipe.toml index 692963974..4fd348dcd 100644 --- a/recipes/tools/cosmic-term/recipe.toml +++ b/recipes/tools/cosmic-term/recipe.toml @@ -4,9 +4,14 @@ branch = "master" [build] template = "custom" +dependencies = [ + "gettext", +] script = """ DYNAMIC_INIT +export GETTEXT_DIR=${COOKBOOK_SYSROOT}/usr cookbook_cargo --no-default-features + mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps" cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/usr/share/ui/apps/10_cosmic-term" #TODO: install with just? diff --git a/recipes/wip/web/servo/recipe.toml b/recipes/wip/web/servo/recipe.toml index 7fd039967..17d42d0b8 100644 --- a/recipes/wip/web/servo/recipe.toml +++ b/recipes/wip/web/servo/recipe.toml @@ -34,8 +34,6 @@ export PKG_CONFIG_PATH_x86_64_unknown_redox="${COOKBOOK_SYSROOT}/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_redox="${COOKBOOK_SYSROOT}/lib/pkgconfig" # rsync -a -v ${COOKBOOK_SYSROOT}/usr/share/pkgconfig/*.pc ${COOKBOOK_SYSROOT}/lib/pkgconfig/ -export RUSTFLAGS="$RUSTFLAGS -L native=${COOKBOOK_SYSROOT}/lib -C link-arg=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" - #TODO: mozjs-sys and mozangle uses clang, it won't know our prefix C libraries, so here's the workaround PREFIX_INCLUDE="$COOKBOOK_HOST_SYSROOT/$TARGET/include" export CLANGFLAGS="-I $PREFIX_INCLUDE/c++/13.2.0 -I $PREFIX_INCLUDE/c++/13.2.0/$TARGET -I $PREFIX_INCLUDE/c++/13.2.0/backward -I $PREFIX_INCLUDE" diff --git a/src/cook/script.rs b/src/cook/script.rs index e9e7209f0..0de395d81 100644 --- a/src/cook/script.rs +++ b/src/cook/script.rs @@ -41,7 +41,7 @@ function DYNAMIC_INIT { # TODO: check paths for spaces export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib -L${COOKBOOK_SYSROOT}/lib" - export RUSTFLAGS="-C target-feature=-crt-static" + export RUSTFLAGS="-C target-feature=-crt-static -L native=${COOKBOOK_SYSROOT}/lib -C link-arg=-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" export COOKBOOK_DYNAMIC=1 }