Automatically configure sunshine.service during build

This commit is contained in:
loki 2020-01-30 16:09:13 +01:00
parent 58e0ee4ade
commit 7f1b157a5d
3 changed files with 8 additions and 3 deletions

View File

@ -102,7 +102,11 @@ else()
${X11_INCLUDE_DIR}
/usr/include/libevdev-1.0)
if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH)
set(SUNSHINE_EXECUTABLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/sunshine")
endif()
configure_file(gen-deb.in gen-deb @ONLY)
configure_file(sunshine.service.in sunshine.service @ONLY)
endif()
set(Boost_USE_STATIC_LIBS ON)

View File

@ -30,7 +30,7 @@ before_build:
build_script:
- cmd: set OLDPATH=%PATH%
- cmd: set PATH=C:\msys64\mingw64\bin
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=/etc/sunshine ..
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_EXECUTABLE_PATH=sunshine -DSUNSHINE_ASSETS_DIR=/etc/sunshine ..
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
- sh: make -j$(nproc)
- cmd: mingw32-make -j2
@ -38,10 +38,11 @@ build_script:
after_build:
- sh: ./gen-deb
- cmd: Del ..\assets\apps_linux.json ..\assets\sunshine.service
- cmd: Del ..\assets\apps_linux.json
- cmd: 7z a Sunshine-Windows.zip ..\assets
- cmd: 7z a Sunshine-Windows.zip sunshine.exe
- cmd: 7z a Sunshine-Windows.zip tools\dxgi-info.exe
- cmd: 7z a Sunshine-Windows.zip tools\audio-info.exe
- cmd: appveyor PushArtifact Sunshine-Windows.zip
- sh: appveyor PushArtifact package-deb/sunshine.deb
- sh: appveyor PushArtifact sunshine.service

View File

@ -7,7 +7,7 @@ Environment="DISPLAY=:0"
Type=simple
# wait for Xorg
ExecStartPre=/bin/sh -c 'while ! pgrep Xorg; do sleep 2; done'
ExecStart=/home/%u/Github/sunshine/cmake-build-release/sunshine
ExecStart=@SUNSHINE_EXECUTABLE_PATH@
[Install]
WantedBy=default.target