From bd51a7d5fa7059863774b910fa39cd2d9327be1e Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:30:56 -0400 Subject: [PATCH] Refactor assets and config directories --- .github/workflows/CI.yml | 8 ++++---- CMakeLists.txt | 7 +++++++ .../linux/flatpak/com.github.sunshinestream.sunshine.yml | 6 +++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8d9e7ad5..a4d67abe 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -137,9 +137,9 @@ jobs: matrix: include: # package these differently - type: cpack - CMAKE_INSTALL_PREFIX: '' - SUNSHINE_ASSETS_DIR: '/usr/local/sunshine/assets' - SUNSHINE_CONFIG_DIR: '/usr/local/sunshine/config' + CMAKE_INSTALL_PREFIX: '/usr/local/sunshine' + SUNSHINE_ASSETS_DIR: 'assets' + SUNSHINE_CONFIG_DIR: 'config' EXTRA_ARGS: '' - type: appimage CMAKE_INSTALL_PREFIX: '/usr' @@ -370,7 +370,7 @@ jobs: mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_PORTFILE=ON .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/sunshine -DSUNSHINE_ASSETS_DIR=assets -DSUNSHINE_CONFIG_DIR=config -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_PORTFILE=ON .. make -j ${nproc} - name: Package MacOS diff --git a/CMakeLists.txt b/CMakeLists.txt index 72386de6..0e083567 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -414,6 +414,13 @@ if(NOT SUNSHINE_CONFIG_DIR) set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config") endif() +if(CMAKE_INSTALL_PREFIX) + if(NOT ${SUNSHINE_CONFIGURE_APPIMAGE}) + set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}") + set(SUNSHINE_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_CONFIG_DIR}") + endif() +endif() + list(APPEND CBS_EXTERNAL_LIBRARIES cbs) diff --git a/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml b/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml index 228d14d5..7d6b92fe 100644 --- a/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml +++ b/packaging/linux/flatpak/com.github.sunshinestream.sunshine.yml @@ -196,9 +196,9 @@ modules: config-opts: - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/app/bin - - -DCMAKE_INSTALL_PREFIX='' - - -DSUNSHINE_CONFIG_DIR=/app/config - - -DSUNSHINE_ASSETS_DIR=/app/assets + - -DCMAKE_INSTALL_PREFIX='/app' + - -DSUNSHINE_ASSETS_DIR=assets + - -DSUNSHINE_CONFIG_DIR=config - -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine - -DSUNSHINE_ENABLE_WAYLAND=ON - -DSUNSHINE_ENABLE_X11=ON