Replace hardcoded paths for unix and...

- Add cache for flatpak job

Co-Authored-By: istori1 <107304850+istori1@users.noreply.github.com>
This commit is contained in:
ReenigneArcher
2022-06-17 16:30:59 -04:00
parent bd51a7d5fa
commit 2a13697fef
3 changed files with 23 additions and 16 deletions

View File

@@ -67,6 +67,12 @@ jobs:
remove-android: 'true' remove-android: 'true'
remove-haskell: 'true' remove-haskell: 'true'
- name: Cache flatpak-builder
uses: actions/cache@v3
with:
path: ./build/.flatpak-builder
key: ${{ runner.os }}-flatpak-builder
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -137,9 +143,9 @@ jobs:
matrix: matrix:
include: # package these differently include: # package these differently
- type: cpack - type: cpack
CMAKE_INSTALL_PREFIX: '/usr/local/sunshine' CMAKE_INSTALL_PREFIX: '/usr'
SUNSHINE_ASSETS_DIR: 'assets' SUNSHINE_ASSETS_DIR: 'local/sunshine/assets'
SUNSHINE_CONFIG_DIR: 'config' SUNSHINE_CONFIG_DIR: 'local/sunshine/config'
EXTRA_ARGS: '' EXTRA_ARGS: ''
- type: appimage - type: appimage
CMAKE_INSTALL_PREFIX: '/usr' CMAKE_INSTALL_PREFIX: '/usr'
@@ -370,7 +376,7 @@ jobs:
mkdir build mkdir build
cd build cd build
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 .. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DSUNSHINE_ASSETS_DIR=local/sunshine/assets -DSUNSHINE_CONFIG_DIR=local/sunshine/config -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} -DSUNSHINE_CONFIGURE_PORTFILE=ON ..
make -j ${nproc} make -j ${nproc}
- name: Package MacOS - name: Package MacOS

View File

@@ -5,6 +5,11 @@ project(Sunshine VERSION 0.14.0
HOMEPAGE_URL "https://sunshinestream.github.io" HOMEPAGE_URL "https://sunshinestream.github.io"
) )
option(SUNSHINE_CONFIGURE_APPIMAGE "Configure files required for AppImage." OFF)
option(SUNSHINE_CONFIGURE_FLATPAK "Configure files required for Flatpak." OFF)
option(SUNSHINE_CONFIGURE_PORTFILE "Configure MacOS Portfile." OFF)
option(SUNSHINE_CONFIGURE_ONLY "Configure special files only, then exit." OFF)
if(${SUNSHINE_CONFIGURE_APPIMAGE}) if(${SUNSHINE_CONFIGURE_APPIMAGE})
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY) configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
elseif(${SUNSHINE_CONFIGURE_FLATPAK}) elseif(${SUNSHINE_CONFIGURE_FLATPAK})
@@ -414,11 +419,9 @@ if(NOT SUNSHINE_CONFIG_DIR)
set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config") set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config")
endif() endif()
if(CMAKE_INSTALL_PREFIX) if(UNIX AND CMAKE_INSTALL_PREFIX AND NOT ${SUNSHINE_CONFIGURE_APPIMAGE})
if(NOT ${SUNSHINE_CONFIGURE_APPIMAGE}) set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}")
set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}") set(SUNSHINE_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_CONFIG_DIR}")
set(SUNSHINE_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_CONFIG_DIR}")
endif()
endif() endif()
list(APPEND CBS_EXTERNAL_LIBRARIES list(APPEND CBS_EXTERNAL_LIBRARIES
@@ -435,7 +438,7 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${OPENSSL_LIBRARIES} ${OPENSSL_LIBRARIES}
${PLATFORM_LIBRARIES}) ${PLATFORM_LIBRARIES})
if (NOT WIN32) if(NOT WIN32)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log) list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log)
endif() endif()
@@ -590,8 +593,8 @@ if(UNIX AND NOT APPLE)
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d")
install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
# Pre and post install # Pre and post install
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA

View File

@@ -191,11 +191,11 @@ modules:
- name: sunshine - name: sunshine
buildsystem: cmake buildsystem: cmake
no-make-install: false no-make-install: false
builddir: true
build-options: build-options:
cxxflags: -I/app/include/libevdev-1.0 cxxflags: -I${C_INCLUDE_PATH}/libevdev-1.0
config-opts: config-opts:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/app/bin
- -DCMAKE_INSTALL_PREFIX='/app' - -DCMAKE_INSTALL_PREFIX='/app'
- -DSUNSHINE_ASSETS_DIR=assets - -DSUNSHINE_ASSETS_DIR=assets
- -DSUNSHINE_CONFIG_DIR=config - -DSUNSHINE_CONFIG_DIR=config
@@ -204,8 +204,6 @@ modules:
- -DSUNSHINE_ENABLE_X11=ON - -DSUNSHINE_ENABLE_X11=ON
- -DSUNSHINE_ENABLE_DRM=ON - -DSUNSHINE_ENABLE_DRM=ON
- -DSUNSHINE_ENABLE_CUDA=ON - -DSUNSHINE_ENABLE_CUDA=ON
post-install:
- cp -f ./src_assets/linux/misc/85-sunshine-rules.rules /etc/udev/rules.d/
sources: sources:
- type: git - type: git
url: https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@.git url: https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@.git