-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Add additional Flatpak build scripts
- Loading branch information
Showing
6 changed files
with
128 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"app-id": "org.duckstation.duckstation", | ||
"runtime": "org.kde.Platform", | ||
"runtime-version": "6.5", | ||
"sdk": "org.kde.Sdk", | ||
"sdk-extensions": [ | ||
"org.freedesktop.Sdk.Extension.llvm16" | ||
], | ||
"command": "duckstation-qt", | ||
"finish-args": [ | ||
"--device=all", | ||
"--allow=bluetooth", | ||
"--share=network", | ||
"--share=ipc", | ||
"--socket=fallback-x11", | ||
"--socket=wayland", | ||
"--socket=pulseaudio", | ||
"--talk-name=org.freedesktop.ScreenSaver" | ||
], | ||
"modules": [ | ||
"modules/20-sdl2.json", | ||
"modules/21-libbacktrace.json", | ||
{ | ||
"name": "duckstation", | ||
"buildsystem": "cmake", | ||
"build-options": { | ||
"strip": false, | ||
"no-debuginfo": true, | ||
"config-opts": [ | ||
"-DCMAKE_BUILD_TYPE=Release", | ||
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON", | ||
"-DBUILD_NOGUI_FRONTEND=OFF", | ||
"-DBUILD_QT_FRONTEND=ON", | ||
"-DBUILD_TESTS=OFF", | ||
"-DCMAKE_C_COMPILER=/usr/lib/sdk/llvm16/bin/clang", | ||
"-DCMAKE_CXX_COMPILER=/usr/lib/sdk/llvm16/bin/clang++", | ||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-fuse-ld=lld", | ||
"-DCMAKE_MODULE_LINKER_FLAGS_INIT=-fuse-ld=lld", | ||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-fuse-ld=lld", | ||
"-DDISABLE_GEN_SCM_VERSION=ON" | ||
] | ||
}, | ||
"sources": [ | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/stenzek/duckstation.git", | ||
"branch": "master", | ||
"commit": "@GIT_HASH@" | ||
}, | ||
{ | ||
"type": "file", | ||
"path": "org.duckstation.duckstation.metainfo.xml" | ||
}, | ||
{ | ||
"type": "file", | ||
"path": "scmversion.cpp", | ||
"dest": "src/scmversion" | ||
} | ||
], | ||
"post-install": [ | ||
"cp -a \"${FLATPAK_BUILDER_BUILDDIR}/bin\" ${FLATPAK_DEST}", | ||
"install -Dm644 scripts/duckstation-qt.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/org.duckstation.duckstation.png", | ||
"install -Dm644 scripts/duckstation-qt.desktop ${FLATPAK_DEST}/share/applications/org.duckstation.duckstation.desktop", | ||
"desktop-file-edit --set-key=Icon --set-value=org.duckstation.duckstation ${FLATPAK_DEST}/share/applications/org.duckstation.duckstation.desktop", | ||
"install -Dm644 org.duckstation.duckstation.metainfo.xml ${FLATPAK_DEST}/share/metainfo/org.duckstation.duckstation.metainfo.xml" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/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") | ||
|
||
rm -fr "${OUTDIR}/modules" | ||
cp -a "${SCRIPTDIR}/modules" "${OUTDIR}/modules" | ||
cp "${SCRIPTDIR}/flathub.json" "${OUTDIR}/${APPID}.json" | ||
|
||
pushd "${SCRIPTDIR}" | ||
GIT_DATE=$(git log -1 --pretty=%cd --date=short) | ||
GIT_VERSION=$(git tag --points-at HEAD) | ||
GIT_HASH=$(git rev-parse HEAD) | ||
|
||
if [[ "${GIT_VERSION}" == "" ]]; then | ||
GIT_VERSION=$(git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude previous-latest | tr -d '\r\n') | ||
if [[ "${GIT_VERSION}" == "" ]]; then | ||
GIT_VERSION=$(git rev-parse HEAD) | ||
fi | ||
fi | ||
"${SCRIPTDIR}/../../scripts/generate-metainfo.sh" "${OUTDIR}/${APPID}.metainfo.xml" | ||
popd | ||
|
||
# Change App ID, because flathub uses the wrong name. | ||
sed -i -e "s/org.duckstation.duckstation/org.duckstation.DuckStation/g" "${OUTDIR}/${APPID}.json" "${OUTDIR}/${APPID}.metainfo.xml" | ||
|
||
# Fill in version details. | ||
sed -i -e "s/@GIT_VERSION@/${GIT_VERSION}/" "${OUTDIR}/${APPID}.json" | ||
sed -i -e "s/@GIT_DATE@/${GIT_DATE}/" "${OUTDIR}/${APPID}.json" | ||
sed -i -e "s/@GIT_HASH@/${GIT_HASH}/" "${OUTDIR}/${APPID}.json" | ||
|
||
# Apparently we don't have git history. | ||
pushd "${OUTDIR}" | ||
"${SCRIPTDIR}/../../src/scmversion/gen_scmversion.sh" | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters