mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2026-03-26 05:01:33 +00:00
refactor(cleanup): add installation logic to buildscript
This commit is contained in:
parent
e053d3dcab
commit
9e129aaf8d
11 changed files with 64 additions and 72 deletions
|
|
@ -1,13 +1,14 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(lsfg-vk LANGUAGES CXX)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# === user facing options
|
||||
option(LSFGVK_BUILD_VULKAN_LAYER
|
||||
"Build the Vulkan layer" ON)
|
||||
option(LSFGVK_BUILD_USER_INTERFACE
|
||||
"Build the user interface" ON)
|
||||
option(LSFGVK_BUILD_DEBUG_TOOL
|
||||
"Build the debug tool for testing and debugging" OFF)
|
||||
# === READ HERE FOR BUILD OPTIONS ===
|
||||
option(LSFGVK_BUILD_VULKAN_LAYER "Build the Vulkan layer" ON)
|
||||
option(LSFGVK_BUILD_USER_INTERFACE "Build the user interface" ON)
|
||||
option(LSFGVK_BUILD_DEBUG_TOOL "Build the debug tool" OFF)
|
||||
option(LSFGVK_INSTALL_DEVELOP "Install development files" OFF)
|
||||
option(LSFGVK_INSTALL_XDG_FILES "Install xdg app files" ON)
|
||||
# === READ HERE FOR BUILD OPTIONS ===
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
|
|
|||
|
|
@ -26,3 +26,11 @@ target_link_libraries(lsfg-vk-backend
|
|||
|
||||
set_target_properties(lsfg-vk-backend PROPERTIES
|
||||
CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
if(LSFGVK_INSTALL_DEVELOP)
|
||||
install(TARGETS lsfg-vk-backend
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(DIRECTORY "include/lsfg-vk-backend/"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lsfg-vk-backend"
|
||||
FILES_MATCHING PATTERN "*.hpp")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -21,3 +21,11 @@ target_include_directories(lsfg-vk-common
|
|||
|
||||
target_include_directories(lsfg-vk-common SYSTEM
|
||||
PRIVATE thirdparty/include)
|
||||
|
||||
if(LSFGVK_INSTALL_DEVELOP)
|
||||
install(TARGETS lsfg-vk-common
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(DIRECTORY "include/lsfg-vk-common/"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/lsfg-vk-common"
|
||||
FILES_MATCHING PATTERN "*.hpp")
|
||||
endif()
|
||||
|
|
|
|||
14
lsfg-vk-debug/layer_json.json
Normal file
14
lsfg-vk-debug/layer_json.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"file_format_version": "1.1.0",
|
||||
"layer": {
|
||||
"name": "VK_LAYER_LSFGVK_frame_generation",
|
||||
"description": "Lossless Scaling frame generation layer (debug)",
|
||||
"implementation_version": "2",
|
||||
"library_path": "liblsfg-vk-layer.so",
|
||||
"type": "GLOBAL",
|
||||
"api_version": "1.4.328",
|
||||
"disable_environment": {
|
||||
"DISABLE_LSFGVK": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,3 +11,15 @@ target_link_libraries(lsfg-vk-layer
|
|||
|
||||
set_target_properties(lsfg-vk-layer PROPERTIES
|
||||
CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
set(LSFGVK_LAYER_LIBRARY_PATH
|
||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/liblsfg-vk-layer.so")
|
||||
configure_file(
|
||||
"VkLayer_LSFGVK_frame_generation.json.in"
|
||||
"VkLayer_LSFGVK_frame_generation.json"
|
||||
@ONLY)
|
||||
|
||||
install(TARGETS lsfg-vk-layer
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/VkLayer_LSFGVK_frame_generation.json"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/vulkan/implicit_layer.d")
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"file_format_version": "1.1.0",
|
||||
"layer": {
|
||||
"name": "VK_LAYER_LS_frame_generation",
|
||||
"name": "VK_LAYER_LSFGVK_frame_generation",
|
||||
"description": "Lossless Scaling frame generation layer",
|
||||
"implementation_version": "2",
|
||||
"library_path": "liblsfg-vk-layer.so",
|
||||
"library_path": "@LSFGVK_LAYER_LIBRARY_PATH@",
|
||||
"type": "GLOBAL",
|
||||
"api_version": "1.4.328",
|
||||
"disable_environment": {
|
||||
|
|
@ -14,7 +14,7 @@ set(UI_RESOURCES
|
|||
"rsc/widgets/FileEdit.qml"
|
||||
"rsc/widgets/FlowSlider.qml"
|
||||
"rsc/widgets/List.qml"
|
||||
"rsc/icon.png"
|
||||
"rsc/gay.pancake.lsfg-vk-ui.png"
|
||||
"rsc/UI.qml")
|
||||
|
||||
qt_add_executable(lsfg-vk-ui ${UI_SOURCES})
|
||||
|
|
@ -37,3 +37,12 @@ target_link_libraries(lsfg-vk-ui
|
|||
PRIVATE lsfg-vk-common
|
||||
PRIVATE lsfg-vk-backend
|
||||
PRIVATE Qt6::Quick)
|
||||
|
||||
install(TARGETS lsfg-vk-ui
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
if(LSFGVK_INSTALL_XDG_FILES)
|
||||
install(FILES "rsc/gay.pancake.lsfg-vk-ui.png"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps")
|
||||
install(FILES "rsc/lsfg-vk-ui.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
endif()
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
|
@ -6,7 +6,7 @@ Comment=Easy to use configuration editor for lsfg-vk.
|
|||
Exec=lsfg-vk-ui %U
|
||||
Icon=gay.pancake.lsfg-vk-ui
|
||||
Terminal=false
|
||||
Categories=GTK;Settings;
|
||||
Categories=Settings;
|
||||
Keywords=gaming;graphics;configuration;
|
||||
StartupNotify=true
|
||||
StartupWMClass=gay.pancake.lsfg-vk-ui
|
||||
|
|
@ -10,7 +10,7 @@ using namespace lsfgvk::ui;
|
|||
|
||||
int main(int argc, char* argv[]) {
|
||||
const QGuiApplication app(argc, argv);
|
||||
QGuiApplication::setWindowIcon(QIcon(":/rsc/icon.png"));
|
||||
QGuiApplication::setWindowIcon(QIcon(":/rsc/gay.pancake.lsfg-vk-ui.png"));
|
||||
QGuiApplication::setApplicationName("lsfg-vk-ui");
|
||||
QGuiApplication::setApplicationDisplayName("lsfg-vk-ui");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
# AppImage build script provided by @Samueru-sama
|
||||
# (with removed aarch64 supported and removed update functionality, temporarily)
|
||||
|
||||
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-x86_64"
|
||||
URUNTIME_LITE="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-lite-x86_64"
|
||||
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-x86_64-aio"
|
||||
|
||||
VERSION=$(awk -F'=|"' '/^version/{print $3}' ./Cargo.toml)
|
||||
echo "$VERSION-dev" > ~/version
|
||||
|
||||
# grab required resources
|
||||
wget -O sharun-aio "$SHARUN"
|
||||
chmod +x sharun-aio
|
||||
|
||||
wget -O uruntime "$URUNTIME"
|
||||
wget -O uruntime-lite "$URUNTIME_LITE"
|
||||
chmod +x uruntime uruntime-lite
|
||||
|
||||
# build lsfg-vk-ui
|
||||
echo "Building lsfg-vk-ui..."
|
||||
cargo build --release
|
||||
|
||||
# deploy app directory
|
||||
echo "Deploying app directory..."
|
||||
mkdir -p AppDir
|
||||
cp -v rsc/*.desktop AppDir
|
||||
cp -v rsc/icon.png AppDir/lsfg-vk-ui.png
|
||||
cp -v rsc/icon.png AppDir/.DirIcon
|
||||
mkdir -p AppDir/shared/bin
|
||||
mv -v target/release/lsfg-vk-ui AppDir/shared/bin
|
||||
|
||||
cd AppDir
|
||||
xvfb-run -a ../sharun-aio l -p -v -e -s -k \
|
||||
shared/bin/lsfg-vk-ui \
|
||||
/usr/lib/*/libdecor* \
|
||||
/usr/lib/*/gdk-pixbuf-*/*/loaders/* \
|
||||
/usr/lib/*/gio/modules/libdconfsettings.so
|
||||
ln -fv ./sharun ./AppRun
|
||||
./sharun -g
|
||||
cd ..
|
||||
|
||||
# create appimage
|
||||
echo "Generating app image..."
|
||||
./uruntime --appimage-mkdwarfs -f \
|
||||
--set-owner 0 --set-group 0 \
|
||||
--no-history --no-create-timestamp \
|
||||
--compression zstd:level=22 -S26 -B8 \
|
||||
--header uruntime-lite \
|
||||
-i ./AppDir -o "./lsfg-vk-ui.AppImage"
|
||||
|
||||
# cleanup
|
||||
echo "Cleaning up..."
|
||||
rm -rf AppDir
|
||||
rm -f sharun-aio uruntime uruntime-lite
|
||||
|
||||
# done
|
||||
echo "Done"
|
||||
Loading…
Add table
Reference in a new issue