[source]
git = "https://github.com/pop-os/cosmic-settings.git"
branch = "master"

[build]
template = "custom"
dependencies = [
    "gettext",
    "libxkbcommon",
]
script = """
DYNAMIC_INIT
export GETTEXT_DIR="${COOKBOOK_SYSROOT}/usr"
(COOKBOOK_SOURCE+="/cosmic-settings" cookbook_cargo --no-default-features \
    --config 'patch.crates-io.rustix.git = "https://github.com/bytecodealliance/rustix"' \
    --config 'patch.crates-io.rustix.rev = "8bf15a0"')

mkdir -pv "${COOKBOOK_STAGE}/usr/bin/"
cp -v "target/${TARGET}/release/cosmic-settings" "${COOKBOOK_STAGE}/usr/bin/"
#TODO: install with just?
APPID="com.system76.CosmicSettings"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/applications/"
sed 's/Categories=COSMIC/Categories=Settings/' "${COOKBOOK_SOURCE}/resources/applications/${APPID}.desktop" > "${COOKBOOK_STAGE}/usr/share/applications/${APPID}.desktop"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/metainfo/"
cp -v "${COOKBOOK_SOURCE}/resources/${APPID}.metainfo.xml" "${COOKBOOK_STAGE}/usr/share/metainfo/"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/"
cp -rv "${COOKBOOK_SOURCE}/resources/default_schema/" "${COOKBOOK_STAGE}/usr/share/cosmic/"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/icons/"
cp -rv "${COOKBOOK_SOURCE}/resources/icons/" "${COOKBOOK_STAGE}/usr/share/icons/hicolor/"
"""
