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

[build]
template = "custom"
dependencies = [
    "ffmpeg6",
    "gettext",
    "glib",
    "gstreamer",
    "libffi",
    "libiconv",
    "pcre2",
    "zlib",
]
script = """
DYNAMIC_INIT
"${COOKBOOK_CARGO}" rustc \
    --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
    --release \
    --bin cosmic-player \
    --no-default-features \
    -- \
    -C link-args="-lgmodule-2.0 -lffi -liconv -lpcre2-8 -lz"
mkdir -pv "${COOKBOOK_STAGE}/usr/bin/"
cp -v "target/${TARGET}/release/cosmic-player" "${COOKBOOK_STAGE}/usr/bin/"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/ui/apps/"
cp -v "${COOKBOOK_RECIPE}/manifest" "${COOKBOOK_STAGE}/usr/share/ui/apps/cosmic-player"
#TODO: install with just?
APPID="com.system76.CosmicPlayer"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/applications/"
cp -v "${COOKBOOK_SOURCE}/res/${APPID}.desktop" "${COOKBOOK_STAGE}/usr/share/applications/"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/metainfo/"
cp -v "${COOKBOOK_SOURCE}/res/${APPID}.metainfo.xml" "${COOKBOOK_STAGE}/usr/share/metainfo/"
mkdir -pv "${COOKBOOK_STAGE}/usr/share/icons/"
cp -rv "${COOKBOOK_SOURCE}/res/icons/hicolor/" "${COOKBOOK_STAGE}/usr/share/icons/"
"""
