From 962caa65490e3f2d3fc9653a6965789cf2c7026e Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Wed, 16 Oct 2024 17:06:37 -0600
Subject: [PATCH] cosmic-files: add gettext dependency

---
 recipes/tools/cosmic-files/recipe.toml | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/recipes/tools/cosmic-files/recipe.toml b/recipes/tools/cosmic-files/recipe.toml
index c1c5eeab5..62f4e51cd 100644
--- a/recipes/tools/cosmic-files/recipe.toml
+++ b/recipes/tools/cosmic-files/recipe.toml
@@ -4,9 +4,26 @@ branch = "master"
 
 [build]
 template = "custom"
+dependencies = [
+    "gettext",
+    "libiconv",
+]
 script = """
-cookbook_cargo --no-default-features --features winit
-mkdir -pv "${COOKBOOK_STAGE}/ui/apps"
+export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
+export GETTEXT_STATIC=1
+# 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,winit \
+    -- \
+    -L "${COOKBOOK_SYSROOT}/lib" \
+    -C link-arg="-liconv"
+mkdir -pv "${COOKBOOK_STAGE}/usr/bin/"
+cp -v "target/${TARGET}/release/cosmic-files" "${COOKBOOK_STAGE}/usr/bin/"
+mkdir -pv "${COOKBOOK_STAGE}/ui/apps/"
 cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/ui/apps/20_cosmic-files"
 #TODO: install with just?
 APPID="com.system76.CosmicFiles"
-- 
GitLab