2023-09-28 16:09:19 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
APPID=org.duckstation.DuckStation
|
|
|
|
SCRIPTDIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
|
|
|
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
|
|
echo "Output directory must be provided as a parameter"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
OUTDIR=$(realpath "$1")
|
2023-09-30 02:38:21 +00:00
|
|
|
OUTMANIFEST="${OUTDIR}/${APPID}.json"
|
2023-09-28 16:09:19 +00:00
|
|
|
|
2023-09-30 02:38:21 +00:00
|
|
|
echo -n "Get revision: "
|
|
|
|
pushd "${SCRIPTDIR}" >/dev/null
|
2023-09-28 16:09:19 +00:00
|
|
|
GIT_HASH=$(git rev-parse HEAD)
|
2023-09-30 02:38:21 +00:00
|
|
|
popd >/dev/null
|
|
|
|
echo "${GIT_HASH}"
|
2023-09-28 16:09:19 +00:00
|
|
|
|
2023-09-30 02:38:21 +00:00
|
|
|
echo "Updating files in ${OUTDIR}..."
|
|
|
|
mkdir -p "${OUTDIR}"
|
|
|
|
rm -fr "${OUTDIR}/modules"
|
|
|
|
cp -a "${SCRIPTDIR}/modules" "${OUTDIR}/modules"
|
2023-09-28 16:09:19 +00:00
|
|
|
|
2023-09-30 02:38:21 +00:00
|
|
|
echo "Generate AppStream XML..."
|
|
|
|
"${SCRIPTDIR}/../../scripts/generate-metainfo.sh" "${OUTDIR}"
|
2023-09-28 16:09:19 +00:00
|
|
|
|
2023-09-30 02:38:21 +00:00
|
|
|
echo "Patching Manifest Sources..."
|
|
|
|
jq ".modules[2].sources = ["\
|
|
|
|
"{\"type\": \"git\", \"url\": \"https://github.com/stenzek/duckstation.git\", \"commit\": \"${GIT_HASH}\", \"disable-shallow-clone\": true},"\
|
|
|
|
"{\"type\": \"file\", \"path\": \"org.duckstation.DuckStation.metainfo.xml\", \"dest\": \"scripts/flatpak\"}]" \
|
|
|
|
"${SCRIPTDIR}/${APPID}.json" > "${OUTMANIFEST}"
|