mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Compare commits
368 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1b112cafd | ||
|
|
949506208e | ||
|
|
84ae033a37 | ||
|
|
8509ee72c3 | ||
|
|
8a853fc79d | ||
|
|
c665e211cd | ||
|
|
1e6d9da2d6 | ||
|
|
71d249b32e | ||
|
|
bfdcfbb357 | ||
|
|
660d8e191c | ||
|
|
5af39cbbb0 | ||
|
|
f34e3b03fb | ||
|
|
4428054d03 | ||
|
|
b210356dfd | ||
|
|
1905163b26 | ||
|
|
3cab7e1067 | ||
|
|
42a990a12b | ||
|
|
5f3a466631 | ||
|
|
e1efdadce1 | ||
|
|
2183f8eb0f | ||
|
|
3df9f3de17 | ||
|
|
cf5460bd80 | ||
|
|
3113de6bfe | ||
|
|
6e9aac3b83 | ||
|
|
f932d6c18c | ||
|
|
d0ce0a67f2 | ||
|
|
a82a9f8ada | ||
|
|
548eeb8889 | ||
|
|
dcdd716a57 | ||
|
|
dc491fa5d4 | ||
|
|
322da7ea30 | ||
|
|
a043dfcf6c | ||
|
|
3ee511cabb | ||
|
|
c9c93a265a | ||
|
|
b484060831 | ||
|
|
894cb6507e | ||
|
|
4769a9348b | ||
|
|
7ad91e2dab | ||
|
|
c1b4dccd7e | ||
|
|
166f9f73e0 | ||
|
|
1295096568 | ||
|
|
db55ff8ea1 | ||
|
|
88d67277f6 | ||
|
|
83c8a460e1 | ||
|
|
cc0ac47f29 | ||
|
|
272368b59c | ||
|
|
87856862dd | ||
|
|
b5ec178cd6 | ||
|
|
49afefc43f | ||
|
|
e2bb1a720a | ||
|
|
cd89808a21 | ||
|
|
9f0af0f8ae | ||
|
|
afd52ba5e0 | ||
|
|
87f01fc0b8 | ||
|
|
952d961871 | ||
|
|
ef2ca538a3 | ||
|
|
f9b2686547 | ||
|
|
35cdc2c89b | ||
|
|
3baace6711 | ||
|
|
afe661db56 | ||
|
|
b6ae848bb5 | ||
|
|
64b52205ab | ||
|
|
93315f280e | ||
|
|
9b66a5a16b | ||
|
|
09c9a1a16b | ||
|
|
b4703efbef | ||
|
|
264c9272df | ||
|
|
79ce11fe72 | ||
|
|
9213037ad4 | ||
|
|
25a64bff44 | ||
|
|
f51a84c9ec | ||
|
|
907798f9da | ||
|
|
7f53388304 | ||
|
|
43525415fd | ||
|
|
96b3bf30f6 | ||
|
|
8e63b2523a | ||
|
|
e1f0e3a719 | ||
|
|
6800fc00f4 | ||
|
|
e0f2d3affc | ||
|
|
ac1feb386c | ||
|
|
de091570b9 | ||
|
|
99f9174353 | ||
|
|
b40d414346 | ||
|
|
eedcd49713 | ||
|
|
418d3cc76c | ||
|
|
cf6107971d | ||
|
|
62af7d255c | ||
|
|
d4a4096bba | ||
|
|
5e5ae0b4b8 | ||
|
|
636a928fc0 | ||
|
|
5f9101f72d | ||
|
|
f9040a55d5 | ||
|
|
674a9da166 | ||
|
|
2298cbbe20 | ||
|
|
58ed5ba3ce | ||
|
|
f7d4f49809 | ||
|
|
43fa4100d2 | ||
|
|
b3a1615170 | ||
|
|
b421c8e2e9 | ||
|
|
977a4d3d4a | ||
|
|
642c4a9ed7 | ||
|
|
83ea433857 | ||
|
|
0ac67f13d7 | ||
|
|
f32387f67e | ||
|
|
6980ee36b3 | ||
|
|
e04ed497a6 | ||
|
|
7b8abc49e2 | ||
|
|
53bd9ea82b | ||
|
|
adeb99f8c2 | ||
|
|
65b557d003 | ||
|
|
ccd568af3e | ||
|
|
749bfa89ef | ||
|
|
663a92ce33 | ||
|
|
8b0e6a28c2 | ||
|
|
9a95ce5132 | ||
|
|
7dc8546c25 | ||
|
|
30c178baa1 | ||
|
|
911035c711 | ||
|
|
6000b85b1a | ||
|
|
d661568536 | ||
|
|
c4e3687c01 | ||
|
|
a6b8371178 | ||
|
|
f546ee8551 | ||
|
|
db28239939 | ||
|
|
9f87401173 | ||
|
|
4100f790ee | ||
|
|
a4acaf15b0 | ||
|
|
0de52efdb1 | ||
|
|
1d242aed7c | ||
|
|
4d3c9b0be8 | ||
|
|
8164c09ea0 | ||
|
|
b464902f25 | ||
|
|
844f041a58 | ||
|
|
de628e843e | ||
|
|
de6779ed83 | ||
|
|
2afa3a4390 | ||
|
|
094ab4eb1a | ||
|
|
c184f16e28 | ||
|
|
15aca474eb | ||
|
|
d963bd1daa | ||
|
|
d38392aea0 | ||
|
|
b7ef109d95 | ||
|
|
dc8bda0e1b | ||
|
|
7cc5e1345c | ||
|
|
49147694de | ||
|
|
58a71bf3e7 | ||
|
|
5ac84fd03f | ||
|
|
1439c8d951 | ||
|
|
ce9934ca52 | ||
|
|
7451c1bd17 | ||
|
|
7340f7660b | ||
|
|
a9af8472df | ||
|
|
b5fa9bb1be | ||
|
|
f850b037bc | ||
|
|
da3c39e9e3 | ||
|
|
7d4df19cdc | ||
|
|
d19c883067 | ||
|
|
42eda48ce4 | ||
|
|
fd0dc9ab8e | ||
|
|
1415c8b200 | ||
|
|
8ba3c073e7 | ||
|
|
92f1313993 | ||
|
|
2b3c514aad | ||
|
|
819501c4e7 | ||
|
|
3b2226c4ea | ||
|
|
00405892cb | ||
|
|
3cd3d261e9 | ||
|
|
4f07672cfa | ||
|
|
25e21ee807 | ||
|
|
270d4ddffe | ||
|
|
46dede3381 | ||
|
|
7019756fa1 | ||
|
|
a1d8cc2296 | ||
|
|
c61b31e8a6 | ||
|
|
802e5c79fa | ||
|
|
6b64149591 | ||
|
|
8fc8884dbc | ||
|
|
2b76111e51 | ||
|
|
54221ae938 | ||
|
|
f07171315f | ||
|
|
f4074341a5 | ||
|
|
9c4763af75 | ||
|
|
6dc10a4d60 | ||
|
|
4b332d6fa0 | ||
|
|
12a361a3d9 | ||
|
|
840013ec78 | ||
|
|
e45452b9bc | ||
|
|
8509260194 | ||
|
|
2a13697fef | ||
|
|
bd51a7d5fa | ||
|
|
1cf0360520 | ||
|
|
4a0d632c6e | ||
|
|
d336de68a2 | ||
|
|
1175a3184e | ||
|
|
dde56c2bb7 | ||
|
|
7da652e299 | ||
|
|
3663e35ecf | ||
|
|
e78ec5c2ce | ||
|
|
70ae7a2fa9 | ||
|
|
651d75fce7 | ||
|
|
c3dfcc1f11 | ||
|
|
a02d314dde | ||
|
|
b5fd69a9ed | ||
|
|
2d969c2ccc | ||
|
|
211b25848f | ||
|
|
d051b58190 | ||
|
|
ab0a6b5fa6 | ||
|
|
0c827690ec | ||
|
|
f5d7cf7692 | ||
|
|
dd73f45175 | ||
|
|
e86207606a | ||
|
|
ca21e6a8ac | ||
|
|
9990b9b04b | ||
|
|
341bc98730 | ||
|
|
1a1cf20152 | ||
|
|
7a5890469c | ||
|
|
65c4f01998 | ||
|
|
676b5559ec | ||
|
|
e9b46201fd | ||
|
|
9b4fc8a270 | ||
|
|
7cb0286414 | ||
|
|
3b41888c66 | ||
|
|
4a65d2cafc | ||
|
|
34f1e89366 | ||
|
|
91cf3bcdcc | ||
|
|
e7ec6050d9 | ||
|
|
0f3eaf0f84 | ||
|
|
c75efd3999 | ||
|
|
f2934c620b | ||
|
|
4f6b001483 | ||
|
|
de3c37969f | ||
|
|
c719ddfc31 | ||
|
|
a5e56cf47d | ||
|
|
84fd2c5766 | ||
|
|
68ba1db24a | ||
|
|
ca00949851 | ||
|
|
88925c705f | ||
|
|
c2752262e5 | ||
|
|
496e51d93a | ||
|
|
6c04065ba7 | ||
|
|
fff419a7ff | ||
|
|
a3e3da3136 | ||
|
|
49bfd2ba1f | ||
|
|
93aebf461a | ||
|
|
c409022df5 | ||
|
|
c4441db606 | ||
|
|
0d0496adf3 | ||
|
|
ca6f02c953 | ||
|
|
8b86abfceb | ||
|
|
5135c16bda | ||
|
|
e6d6d47be1 | ||
|
|
639af4f08a | ||
|
|
12bf5cffc5 | ||
|
|
6741997e59 | ||
|
|
369a941c48 | ||
|
|
2a69385aed | ||
|
|
31f7faa6a5 | ||
|
|
dc4393a583 | ||
|
|
5eb3e7c75f | ||
|
|
6858f9c8d4 | ||
|
|
af342c8cc9 | ||
|
|
4e4a5c8df8 | ||
|
|
cc2d982ceb | ||
|
|
e2bef750b4 | ||
|
|
ffdcf0fea8 | ||
|
|
2ea414d1d4 | ||
|
|
c4977b5393 | ||
|
|
13c2dce3f1 | ||
|
|
b0a02a5985 | ||
|
|
b0df4eabd1 | ||
|
|
ceb7f5f41a | ||
|
|
aa46b8e293 | ||
|
|
63a83cdf7a | ||
|
|
bd033f9e15 | ||
|
|
62ca9c31a0 | ||
|
|
e8ef708034 | ||
|
|
ec450be8b5 | ||
|
|
d4df041210 | ||
|
|
ced0029abc | ||
|
|
a9cf0ebf18 | ||
|
|
3d6611fd50 | ||
|
|
74736c6b76 | ||
|
|
0e0b2ce366 | ||
|
|
3b49deac25 | ||
|
|
734400dc77 | ||
|
|
ef9abf2f15 | ||
|
|
b286c06144 | ||
|
|
521335c387 | ||
|
|
780339d91b | ||
|
|
b332633b07 | ||
|
|
4cd1014bac | ||
|
|
7a1e5f43d9 | ||
|
|
c4054c75a7 | ||
|
|
f36d81954b | ||
|
|
eacae3954e | ||
|
|
56cf3e4ede | ||
|
|
293ee266af | ||
|
|
536df759ae | ||
|
|
4bdf8375cc | ||
|
|
a6921fffad | ||
|
|
1ad0c93ad8 | ||
|
|
97f333c970 | ||
|
|
b854807d40 | ||
|
|
a9b9d1bd09 | ||
|
|
0044ec1d52 | ||
|
|
9c976a23de | ||
|
|
9930880ee6 | ||
|
|
82e1b61a31 | ||
|
|
5bb197ccfc | ||
|
|
20c0426ace | ||
|
|
0a9cc511ed | ||
|
|
2a7af03f9a | ||
|
|
7910ac78a5 | ||
|
|
67762aa445 | ||
|
|
7f22774e08 | ||
|
|
cbafe09396 | ||
|
|
615f7e5875 | ||
|
|
3f309832f7 | ||
|
|
719f4cef59 | ||
|
|
da582198db | ||
|
|
04a2ecaff4 | ||
|
|
3b8b4653e9 | ||
|
|
ea27955b16 | ||
|
|
e223ba53f9 | ||
|
|
907d0bfcd5 | ||
|
|
a014391ae7 | ||
|
|
84584c950b | ||
|
|
f1d82a7d09 | ||
|
|
01155ef4a3 | ||
|
|
88cf616a48 | ||
|
|
b3cdadca86 | ||
|
|
3bd9f6b710 | ||
|
|
e28cc5e645 | ||
|
|
045970bcc5 | ||
|
|
6fca2c593c | ||
|
|
e61bbe87b4 | ||
|
|
80ebc9982e | ||
|
|
9a2689692a | ||
|
|
a31c6c4cd0 | ||
|
|
1f79f4ed12 | ||
|
|
6da0483951 | ||
|
|
3abb199697 | ||
|
|
4c7afc05c7 | ||
|
|
222e53781d | ||
|
|
8d4bd87ad2 | ||
|
|
861331be1c | ||
|
|
2fa2afed56 | ||
|
|
5e910b5fab | ||
|
|
1520cb7bf9 | ||
|
|
4b658cd86b | ||
|
|
f6311ceb3f | ||
|
|
9b2321a722 | ||
|
|
1e91356155 | ||
|
|
fb7a3a0758 | ||
|
|
c2d4ffdaed | ||
|
|
c5e6b84e3d | ||
|
|
68f35f6ab1 | ||
|
|
2b450839a1 | ||
|
|
df3e7c5ca1 | ||
|
|
a4fa42fa96 | ||
|
|
d6183430ef | ||
|
|
f54a32feac | ||
|
|
37edcb1b55 | ||
|
|
320b691086 | ||
|
|
5163ec93b4 | ||
|
|
2be7790415 | ||
|
|
27d2735454 | ||
|
|
361e5f7ea7 |
@@ -1,8 +1,13 @@
|
||||
---
|
||||
# This file is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveAssignments: Consecutive
|
||||
AlignOperands: Align
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
@@ -10,7 +15,7 @@ AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Always
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Always
|
||||
AllowShortIfStatementsOnASingleLine: WithoutElse
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterReturnType: None
|
||||
@@ -23,6 +28,7 @@ BraceWrapping:
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
@@ -57,7 +63,7 @@ SpaceBeforeParens: Never
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInAngles: Never
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
|
||||
1
.docker_platforms
Normal file
1
.docker_platforms
Normal file
@@ -0,0 +1 @@
|
||||
linux/amd64
|
||||
16
.dockerignore
Normal file
16
.dockerignore
Normal file
@@ -0,0 +1,16 @@
|
||||
# ignore git files
|
||||
.git*
|
||||
|
||||
# ignore hidden files
|
||||
.*
|
||||
|
||||
# ignore repo directories and files
|
||||
docs/
|
||||
packaging/
|
||||
scripts/
|
||||
tools/
|
||||
crowdin.yml
|
||||
|
||||
# ignore dev directories
|
||||
build/
|
||||
venv/
|
||||
7
.flake8
Normal file
7
.flake8
Normal file
@@ -0,0 +1,7 @@
|
||||
[flake8]
|
||||
filename =
|
||||
*.py,
|
||||
*.pys
|
||||
max-line-length = 120
|
||||
extend-exclude =
|
||||
venv/
|
||||
94
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
94
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -1,3 +1,4 @@
|
||||
---
|
||||
name: Bug Report
|
||||
description: Create a bug report to help us improve.
|
||||
body:
|
||||
@@ -5,7 +6,22 @@ body:
|
||||
attributes:
|
||||
value: >
|
||||
**THIS IS NOT THE PLACE TO ASK FOR SUPPORT!**
|
||||
Please use [Github Discussions](https://github.com/SunshineStream/Sunshine/discussions) for support issues.
|
||||
Please use our [Support Center](https://app.lizardbyte.dev/support) for support issues.
|
||||
Non actionable bug reports will be locked and closed!
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is your issue described in the documentation?
|
||||
description: Please read our [documentation](https://docs.lizardbyte.dev/projects/sunshine)
|
||||
options:
|
||||
- label: I have read the documentation
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
@@ -23,35 +39,68 @@ body:
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Add any other context about the bug here.
|
||||
- type: input
|
||||
- type: dropdown
|
||||
id: os
|
||||
attributes:
|
||||
label: Sunshine Host Operating System and Version
|
||||
placeholder: eg. Windows 10, macOS 10.15, Ubuntu 20.04, etc.
|
||||
label: Host Operating System
|
||||
description: What version operating system are you running the software on?
|
||||
options:
|
||||
- Docker
|
||||
- Linux
|
||||
- macOS
|
||||
- Windows
|
||||
- other, n/a
|
||||
- type: input
|
||||
id: os-version
|
||||
attributes:
|
||||
label: Operating System Version
|
||||
description: Provide the version of the operating system. Additionally a build number would be helpful.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: architecture
|
||||
- type: dropdown
|
||||
id: os-architecture
|
||||
attributes:
|
||||
label: Architecture
|
||||
placeholder: e.g. 32 bit, 64 bit, arm
|
||||
validations:
|
||||
required: true
|
||||
options:
|
||||
- 32 bit
|
||||
- 64 bit
|
||||
- arm
|
||||
- other, n/a
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Sunshine Version
|
||||
placeholder: eg. 0.11.1
|
||||
label: Sunshine commit or version
|
||||
placeholder: eg. 0.14.0
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
- type: dropdown
|
||||
id: package_type
|
||||
attributes:
|
||||
label: Package
|
||||
description: The package you installed
|
||||
options:
|
||||
- Linux - AppImage
|
||||
- Linux - deb
|
||||
- Linux - flatpak
|
||||
- Linux - rpm
|
||||
- macOS - dmg
|
||||
- macOS - Portfile
|
||||
- macOS - pkg
|
||||
- Windows - installer
|
||||
- Windows - portable
|
||||
- other (not listed)
|
||||
- other (self built)
|
||||
- other (fork of this repo)
|
||||
- type: dropdown
|
||||
id: graphics_type
|
||||
attributes:
|
||||
label: GPU Type
|
||||
description: The type of the installed graphics card.
|
||||
placeholder: e.g. Intel, AMD, Nvidia
|
||||
validations:
|
||||
required: true
|
||||
options:
|
||||
- AMD
|
||||
- Intel
|
||||
- Nvidia
|
||||
- none (software encoding)
|
||||
- type: input
|
||||
id: graphics_model
|
||||
attributes:
|
||||
@@ -72,11 +121,20 @@ body:
|
||||
id: capture_method
|
||||
attributes:
|
||||
label: Capture Method (Linux Only)
|
||||
description: The driver/mesa version of the installed graphics card.
|
||||
placeholder: e.g. PipeWire/KVM/X11
|
||||
description: If on Linux, the capture method being used.
|
||||
placeholder: e.g. PipeWire/KVM/X11/KMS
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: |
|
||||
Please copy and paste any relevant log output. This will be automatically formatted into code,
|
||||
so no need for backticks.
|
||||
render: Shell
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Make sure to close your issue when it's solved! If you found the solution yourself please comment so that others benefit from it.
|
||||
Make sure to close your issue when it's solved! If you found the solution yourself please comment
|
||||
so that others benefit from it.
|
||||
|
||||
17
.github/ISSUE_TEMPLATE/config.yml
vendored
17
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,13 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Github Discussions
|
||||
url: https://github.com/SunshineStream/Sunshine/discussions
|
||||
about: General discussion, support, feature requests and more!
|
||||
- name: Discord support
|
||||
url: https://discord.com/invite/CGg5JxN
|
||||
about: Ask question about Sunshine in Discord
|
||||
- name: Support Center
|
||||
url: https://app.lizardbyte.dev/support
|
||||
about: Official LizardByte support
|
||||
- name: Feature request
|
||||
url: https://app.lizardbyte.dev/feedback
|
||||
about: Share your suggestions or ideas to help us improve
|
||||
|
||||
38
.github/dependabot.yml
vendored
Normal file
38
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "00:00"
|
||||
target-branch: "nightly"
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "00:00"
|
||||
target-branch: "nightly"
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "00:00"
|
||||
target-branch: "nightly"
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "00:00"
|
||||
target-branch: "nightly"
|
||||
open-pull-requests-limit: 10
|
||||
9
.github/label-actions.yml
vendored
9
.github/label-actions.yml
vendored
@@ -1,13 +1,16 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Configuration for Label Actions - https://github.com/dessant/label-actions
|
||||
|
||||
added:
|
||||
comment: >
|
||||
This feature has been added and will be available in the next release.
|
||||
|
||||
fixed:
|
||||
comment: >
|
||||
This issue has been fixed and will be available in the next release.
|
||||
|
||||
invalid:duplicate:
|
||||
comment: >
|
||||
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue.
|
||||
@@ -23,7 +26,7 @@ invalid:support:
|
||||
comment: >
|
||||
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
|
||||
However, this issue appears to be a support request. Please use our
|
||||
[Discord Server](https://discord.com/invite/CGg5JxN) to get help. Thanks.
|
||||
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
|
||||
close: true
|
||||
lock: true
|
||||
lock-reason: 'off-topic'
|
||||
|
||||
24
.github/pr_release_template.md
vendored
Normal file
24
.github/pr_release_template.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
## Description
|
||||
<!--- Please include a summary of the changes. --->
|
||||
This PR was created automatically.
|
||||
|
||||
|
||||
### Screenshot
|
||||
<!--- Include screenshots if the changes are UI-related. --->
|
||||
|
||||
|
||||
### Issues Fixed or Closed
|
||||
<!--- Close issue example: `- Closes #1` --->
|
||||
<!--- Fix bug issue example: `- Fixes #2` --->
|
||||
<!--- Resolve issue example: `- Resolves #3` --->
|
||||
|
||||
|
||||
## Type of Change
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] Documentation update (changes to documentation)
|
||||
- [ ] Repository update (changes to repository files)
|
||||
|
||||
## Changelog Summary
|
||||
<!--- Summarize all the changes in a bulleted list. --->
|
||||
26
.github/pull_request_template.md
vendored
26
.github/pull_request_template.md
vendored
@@ -1,26 +0,0 @@
|
||||
## Description
|
||||
|
||||
Please include a summary of the changes.
|
||||
|
||||
### Screenshot
|
||||
|
||||
Include screenshots if the changes are UI-related.
|
||||
|
||||
### Issues Fixed or Closed
|
||||
|
||||
- Fixes #(issue)
|
||||
|
||||
## Type of Change
|
||||
|
||||
Please delete options that are not relevant.
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] My code follows the style guidelines of this project
|
||||
- [ ] I have performed a self-review of my own code
|
||||
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||
- [ ] I have added or updated the documentation blocks for new or existing components
|
||||
1019
.github/workflows/CI.yml
vendored
1019
.github/workflows/CI.yml
vendored
File diff suppressed because it is too large
Load Diff
31
.github/workflows/auto-create-pr.yml
vendored
Normal file
31
.github/workflows/auto-create-pr.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Auto create PR
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'nightly'
|
||||
|
||||
jobs:
|
||||
create_pr:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: repo-sync/pull-request@v2
|
||||
with:
|
||||
source_branch: "" # should be "nightly" as it's the triggering branch
|
||||
destination_branch: "master"
|
||||
pr_title: "Pulling ${{ github.ref_name }} into master"
|
||||
pr_template: ".github/pr_release_template.md"
|
||||
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
|
||||
pr_draft: true
|
||||
pr_allow_empty: false
|
||||
github_token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
59
.github/workflows/automerge.yml
vendored
Normal file
59
.github/workflows/automerge.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Automerge PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
autoapprove:
|
||||
if: >
|
||||
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
|
||||
contains(fromJson('["LizardByte-bot"]'), github.actor)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Autoapproving
|
||||
uses: hmarr/auto-approve-action@v3
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: Label autoapproved
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
script: |
|
||||
github.rest.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['autoapproved', 'autoupdate']
|
||||
})
|
||||
|
||||
automerge:
|
||||
needs: [autoapprove]
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: automerge-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
steps:
|
||||
- name: Automerging
|
||||
uses: pascalgn/automerge-action@v0.15.5
|
||||
env:
|
||||
BASE_BRANCHES: nightly
|
||||
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
|
||||
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
|
||||
MERGE_LABELS: ""
|
||||
MERGE_METHOD: "squash"
|
||||
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
|
||||
MERGE_DELETE_BRANCH: true
|
||||
MERGE_ERROR_FAIL: true
|
||||
MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }}
|
||||
MERGE_RETRIES: "240" # 1 hour
|
||||
MERGE_RETRY_SLEEP: "15000" # 15 seconds
|
||||
32
.github/workflows/autoupdate.yml
vendored
Normal file
32
.github/workflows/autoupdate.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
# This workflow is designed to work with:
|
||||
# - automerge workflows
|
||||
|
||||
# It uses GitHub Action that auto-updates pull requests branches, when changes are pushed to their destination branch.
|
||||
# Auto-updating to the latest destination branch works only in the context of upstream repo and not forks.
|
||||
|
||||
name: autoupdate
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'nightly'
|
||||
|
||||
jobs:
|
||||
autoupdate-for-bot:
|
||||
name: Autoupdate autoapproved PR created in the upstream
|
||||
if: startsWith(github.repository, 'LizardByte/')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update
|
||||
uses: docker://chinthakagodawita/autoupdate-action:v1
|
||||
env:
|
||||
GITHUB_TOKEN: '${{ secrets.GH_BOT_TOKEN }}'
|
||||
PR_FILTER: "labelled"
|
||||
PR_LABELS: "autoupdate"
|
||||
PR_READY_STATE: "ready_for_review"
|
||||
MERGE_CONFLICT_ACTION: "ignore"
|
||||
203
.github/workflows/ci-docker.yml
vendored
Normal file
203
.github/workflows/ci-docker.yml
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: CI Docker
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
push:
|
||||
branches: [master, nightly]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check_dockerfile:
|
||||
name: Check Dockerfile
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check
|
||||
id: check
|
||||
run: |
|
||||
if [ -f "./Dockerfile" ]
|
||||
then
|
||||
FOUND=true
|
||||
else
|
||||
FOUND=false
|
||||
fi
|
||||
|
||||
echo "dockerfile=${FOUND}" >> $GITHUB_OUTPUT
|
||||
|
||||
outputs:
|
||||
dockerfile: ${{ steps.check.outputs.dockerfile }}
|
||||
|
||||
lint_dockerfile:
|
||||
name: Lint Dockerfile
|
||||
needs: [check_dockerfile]
|
||||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Hadolint
|
||||
id: hadolint
|
||||
uses: hadolint/hadolint-action@v2.1.0
|
||||
with:
|
||||
dockerfile: ./Dockerfile
|
||||
ignore: DL3008,DL3013,DL3016,DL3018,DL3028,DL3059
|
||||
output-file: ./hadolint.log
|
||||
verbose: true
|
||||
|
||||
- name: Log
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Hadolint outcome: ${{ steps.hadolint.outcome }}" >> $GITHUB_STEP_SUMMARY
|
||||
cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
check_changelog:
|
||||
name: Check Changelog
|
||||
needs: [check_dockerfile]
|
||||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Verify Changelog
|
||||
id: verify_changelog
|
||||
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
|
||||
# base_ref for pull request check, ref for push
|
||||
uses: LizardByte/.github/actions/verify_changelog@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
outputs:
|
||||
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
|
||||
|
||||
docker:
|
||||
name: Docker
|
||||
needs: [check_dockerfile, check_changelog]
|
||||
if: ${{ needs.check_dockerfile.outputs.dockerfile == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Prepare
|
||||
id: prepare
|
||||
env:
|
||||
NEXT_VERSION: ${{ needs.check_changelog.outputs.next_version }}
|
||||
run: |
|
||||
# get branch name
|
||||
BRANCH=${GITHUB_HEAD_REF}
|
||||
|
||||
if [ -z "$BRANCH" ]
|
||||
then
|
||||
echo "This is a PUSH event"
|
||||
BRANCH=${{ github.ref_name }}
|
||||
fi
|
||||
|
||||
# determine to push image to dockerhub and ghcr or not
|
||||
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
|
||||
PUSH=true
|
||||
else
|
||||
PUSH=false
|
||||
fi
|
||||
|
||||
# setup the tags
|
||||
REPOSITORY=${{ github.repository }}
|
||||
BASE_TAG=$(echo $REPOSITORY | tr '[:upper:]' '[:lower:]')
|
||||
COMMIT=${{ github.sha }}
|
||||
|
||||
TAGS="${BASE_TAG}:${COMMIT:0:7},ghcr.io/${BASE_TAG}:${COMMIT:0:7}"
|
||||
|
||||
if [[ $GITHUB_REF == refs/heads/master ]]; then
|
||||
TAGS="${TAGS},${BASE_TAG}:latest,ghcr.io/${BASE_TAG}:latest"
|
||||
TAGS="${TAGS},${BASE_TAG}:master,ghcr.io/${BASE_TAG}:master"
|
||||
elif [[ $GITHUB_REF == refs/heads/nightly ]]; then
|
||||
TAGS="${TAGS},${BASE_TAG}:nightly,ghcr.io/${BASE_TAG}:nightly"
|
||||
else
|
||||
TAGS="${TAGS},${BASE_TAG}:test,ghcr.io/${BASE_TAG}:test"
|
||||
fi
|
||||
|
||||
if [[ ${NEXT_VERSION} != "" ]]; then
|
||||
TAGS="${TAGS},${BASE_TAG}:${NEXT_VERSION},ghcr.io/${BASE_TAG}:${NEXT_VERSION}"
|
||||
fi
|
||||
|
||||
# read the platforms from `.docker_platforms`
|
||||
PLATFORMS=$(<.docker_platforms)
|
||||
|
||||
echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
|
||||
echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
|
||||
echo "commit=${COMMIT}" >> $GITHUB_OUTPUT
|
||||
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
|
||||
echo "push=${PUSH}" >> $GITHUB_OUTPUT
|
||||
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set Up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
|
||||
- name: Cache Docker Layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GH_BOT_NAME }}
|
||||
password: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./
|
||||
file: ./Dockerfile
|
||||
push: ${{ steps.prepare.outputs.push }}
|
||||
platforms: ${{ steps.prepare.outputs.platforms }}
|
||||
build-args: |
|
||||
BRANCH=${{ steps.prepare.outputs.branch }}
|
||||
BUILD_DATE=${{ steps.prepare.outputs.build_date }}
|
||||
BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }}
|
||||
COMMIT=${{ steps.prepare.outputs.commit }}
|
||||
tags: ${{ steps.prepare.outputs.tags }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
|
||||
- name: Update Docker Hub Description
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
uses: peter-evans/dockerhub-description@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported
|
||||
repository: ${{ env.BASE_TAG }}
|
||||
short-description: ${{ github.event.repository.description }}
|
||||
readme-filepath: ./DOCKER_README.md
|
||||
60
.github/workflows/cpp-clang-format-lint.yml
vendored
Normal file
60
.github/workflows/cpp-clang-format-lint.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Clang Format Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
check_src:
|
||||
name: Check src
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check
|
||||
id: check
|
||||
run: |
|
||||
if [ -d "./src" ]
|
||||
then
|
||||
FOUND=true
|
||||
else
|
||||
FOUND=false
|
||||
fi
|
||||
|
||||
echo "src=${FOUND}" >> $GITHUB_OUTPUT
|
||||
|
||||
outputs:
|
||||
src: ${{ steps.check.outputs.src }}
|
||||
|
||||
lint:
|
||||
name: Clang Format Lint
|
||||
needs: [check_src]
|
||||
if: ${{ needs.check_src.outputs.src == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Clang format lint
|
||||
uses: DoozyX/clang-format-lint-action@v0.14
|
||||
with:
|
||||
source: './src'
|
||||
extensions: 'cpp,h,m,mm'
|
||||
clangFormatVersion: 13
|
||||
style: file
|
||||
inplace: false
|
||||
|
||||
- name: Upload Artifacts
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: clang-format-fixes
|
||||
path: src/
|
||||
58
.github/workflows/issues-stale.yml
vendored
58
.github/workflows/issues-stale.yml
vendored
@@ -1,3 +1,8 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Stale Issues / PRs
|
||||
|
||||
on:
|
||||
@@ -6,45 +11,46 @@ on:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
name: Check Issues / PRs
|
||||
name: Check Stale Issues / PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Stale
|
||||
uses: actions/stale@v3
|
||||
uses: actions/stale@v6
|
||||
with:
|
||||
stale-issue-message: >
|
||||
This issue is stale because it has been open for 30 days with no activity.
|
||||
Remove the stale label or comment, otherwise this will be closed in 5 days.
|
||||
close-issue-message: >
|
||||
This issue was closed because it has been stalled for 5 days with no activity.
|
||||
stale-issue-label: 'stale'
|
||||
exempt-issue-labels: 'added,fixed,type:enhancement,status:awaiting-triage,status:in-progress'
|
||||
stale-pr-message: >
|
||||
This PR is stale because it has been open for 30 days with no activity.
|
||||
Remove the stale label or comment, otherwise this will be closed in 5 days.
|
||||
This issue was closed because it has been stalled for 10 days with no activity.
|
||||
close-pr-message: >
|
||||
This PR was closed because it has been stalled for 5 days with no activity.
|
||||
This PR was closed because it has been stalled for 10 days with no activity.
|
||||
days-before-stale: 90
|
||||
days-before-close: 10
|
||||
exempt-all-assignees: true
|
||||
exempt-issue-labels: 'added,fixed'
|
||||
exempt-pr-labels: 'dependencies,l10n'
|
||||
stale-issue-label: 'stale'
|
||||
stale-issue-message: >
|
||||
This issue is stale because it has been open for 90 days with no activity.
|
||||
Comment or remove the stale label, otherwise this will be closed in 10 days.
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'status:in-progress'
|
||||
days-before-stale: 30
|
||||
days-before-close: 5
|
||||
stale-pr-message: >
|
||||
This PR is stale because it has been open for 90 days with no activity.
|
||||
Comment or remove the stale label, otherwise this will be closed in 10 days.
|
||||
repo-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
- name: Invalid Template
|
||||
uses: actions/stale@v3
|
||||
uses: actions/stale@v6
|
||||
with:
|
||||
stale-issue-message: >
|
||||
Invalid issues template.
|
||||
close-issue-message: >
|
||||
This issue was closed because the the template was not completed after 5 days.
|
||||
stale-issue-label: 'invalid:template-incomplete'
|
||||
skip-stale-issue-message: true
|
||||
stale-pr-message: >
|
||||
Invalid PR template.
|
||||
close-pr-message: >
|
||||
This PR was closed because the the template was not completed after 5 days.
|
||||
stale-pr-label: 'invalid:template-incomplete'
|
||||
exempt-pr-labels: 'status:in-progress'
|
||||
skip-stale-pr-message: true
|
||||
only-labels: 'invalid:template-incomplete'
|
||||
days-before-stale: 0
|
||||
days-before-close: 5
|
||||
exempt-pr-labels: 'dependencies,l10n'
|
||||
only-labels: 'invalid:template-incomplete'
|
||||
stale-issue-label: 'invalid:template-incomplete'
|
||||
stale-issue-message: >
|
||||
Invalid issues template.
|
||||
stale-pr-label: 'invalid:template-incomplete'
|
||||
stale-pr-message: >
|
||||
Invalid PR template.
|
||||
repo-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
11
.github/workflows/issues.yml
vendored
11
.github/workflows/issues.yml
vendored
@@ -1,10 +1,15 @@
|
||||
name: Label Actions
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled, unlabeled]
|
||||
discussion:
|
||||
types: [ labeled, unlabeled ]
|
||||
types: [labeled, unlabeled]
|
||||
|
||||
jobs:
|
||||
label:
|
||||
@@ -14,4 +19,4 @@ jobs:
|
||||
- name: Label Actions
|
||||
uses: dessant/label-actions@v2
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
github-token: ${{ secrets.GH_BOT_TOKEN }}
|
||||
|
||||
98
.github/workflows/localize.yml
vendored
Normal file
98
.github/workflows/localize.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
name: localize
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [nightly]
|
||||
paths: # prevents workflow from running unless these files change
|
||||
- '.github/workflows/localize.yml'
|
||||
- 'src/**'
|
||||
- 'locale/sunshine.po'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
file: ./locale/sunshine.po
|
||||
|
||||
jobs:
|
||||
localize:
|
||||
name: Update Localization
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Python 3.9
|
||||
uses: actions/setup-python@v4 # https://github.com/actions/setup-python
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Set up Python 3.9 Dependencies
|
||||
run: |
|
||||
cd ./scripts
|
||||
python -m pip install --upgrade pip setuptools
|
||||
python -m pip install -r requirements.txt
|
||||
|
||||
- name: Set up xgettext
|
||||
run: |
|
||||
sudo apt-get update -y && \
|
||||
sudo apt-get --reinstall install -y \
|
||||
gettext
|
||||
|
||||
- name: Update Strings
|
||||
run: |
|
||||
# first, try to remove existing file as xgettext does not remove unused translations
|
||||
if [ -f "${{ env.file }}" ];
|
||||
then
|
||||
rm ${{ env.file }}
|
||||
echo "new_file=false" >> $GITHUB_ENV
|
||||
else
|
||||
echo "new_file=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# extract the new strings
|
||||
python ./scripts/_locale.py --extract
|
||||
|
||||
- name: git diff
|
||||
if: ${{ env.new_file == 'false' }}
|
||||
run: |
|
||||
# disable the pager
|
||||
git config --global pager.diff false
|
||||
|
||||
# print the git diff
|
||||
git diff locale/sunshine.po
|
||||
|
||||
# set the variable with minimal output, replacing `\t` with ` `
|
||||
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
|
||||
echo "git_diff=${OUTPUT}" >> $GITHUB_ENV
|
||||
|
||||
- name: git reset
|
||||
# only run if a single line changed (date/time) and file already existed
|
||||
if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }}
|
||||
run: |
|
||||
git reset --hard
|
||||
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create/Update Pull Request
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
add-paths: |
|
||||
locale/*.po
|
||||
token: ${{ secrets.GH_BOT_TOKEN }} # must trigger PR tests
|
||||
commit-message: New localization template
|
||||
branch: localize/update
|
||||
delete-branch: true
|
||||
base: nightly
|
||||
title: New Babel Updates
|
||||
body: |
|
||||
Update report
|
||||
- Updated ${{ steps.date.outputs.date }}
|
||||
- Auto-generated by [create-pull-request][1]
|
||||
|
||||
[1]: https://github.com/peter-evans/create-pull-request
|
||||
labels: |
|
||||
babel
|
||||
l10n
|
||||
40
.github/workflows/pull-requests.yml
vendored
40
.github/workflows/pull-requests.yml
vendored
@@ -1,3 +1,8 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Pull Requests
|
||||
|
||||
on:
|
||||
@@ -5,31 +10,18 @@ on:
|
||||
types: [opened, synchronize, edited, reopened]
|
||||
|
||||
jobs:
|
||||
check-branch:
|
||||
check-pull-request:
|
||||
name: Check Pull Request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Branch check
|
||||
if: ( github.head_ref == 'repo-sync/common-repo-files/default' && github.base_ref == 'master' ) || ( github.head_ref == 'nightly' && github.base_ref == 'master' )
|
||||
run: |
|
||||
echo Base: "$GITHUB_BASE_REF"
|
||||
echo Head: "$GITHUB_HEAD_REF"
|
||||
echo "branch=True" >> $GITHUB_ENV
|
||||
|
||||
- name: Comment on Pull Request
|
||||
uses: mshick/add-pr-comment@v1
|
||||
if: github.base_ref != 'nightly' && env.branch != 'True'
|
||||
- uses: Vankka/pr-target-branch-action@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
message: Pull requests must be made to the `nightly` branch. Thanks.
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repo-token-user-login: 'github-actions[bot]'
|
||||
|
||||
- name: Fail Workflow
|
||||
if: github.base_ref != 'nightly' && env.branch != 'True'
|
||||
run: |
|
||||
echo Base: "$GITHUB_BASE_REF"
|
||||
echo Head: "$GITHUB_HEAD_REF"
|
||||
exit 1
|
||||
target: master
|
||||
exclude: nightly # Don't prevent going from nightly -> master
|
||||
change-to: nightly
|
||||
comment: |
|
||||
Your PR was set to `master`, PRs should be sent to `nightly`.
|
||||
The base branch of this PR has been automatically changed to `nightly`.
|
||||
Please check that there are no merge conflicts
|
||||
|
||||
31
.github/workflows/python-flake8.yml
vendored
Normal file
31
.github/workflows/python-flake8.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: flake8
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
flake8:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4 # https://github.com/actions/setup-python
|
||||
with:
|
||||
python-version: '3.10'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools flake8
|
||||
|
||||
- name: Test with flake8
|
||||
run: |
|
||||
python -m flake8 --verbose
|
||||
22
.github/workflows/release-notifier-moonlight.yml
vendored
Normal file
22
.github/workflows/release-notifier-moonlight.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Release Notifications (Moonlight)
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
discord:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: discord
|
||||
uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord
|
||||
with:
|
||||
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }}
|
||||
nodetail: true
|
||||
nofail: false
|
||||
username: ${{ secrets.DISCORD_USERNAME }}
|
||||
avatar_url: ${{ secrets.ORG_LOGO_URL }}
|
||||
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
|
||||
description: ${{ github.event.release.body }}
|
||||
color: 0xFF4500
|
||||
81
.github/workflows/release-notifier.yml
vendored
Normal file
81
.github/workflows/release-notifier.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Release Notifications
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#onevent_nametypes
|
||||
|
||||
jobs:
|
||||
discord:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: discord
|
||||
uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord
|
||||
with:
|
||||
webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
|
||||
nodetail: true
|
||||
nofail: false
|
||||
username: ${{ secrets.DISCORD_USERNAME }}
|
||||
avatar_url: ${{ secrets.ORG_LOGO_URL }}
|
||||
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
|
||||
description: ${{ github.event.release.body }}
|
||||
color: 0xFF4500
|
||||
|
||||
facebook_group:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: facebook-post-action
|
||||
uses: ReenigneArcher/facebook-post-action@v1 # https://github.com/ReenigneArcher/facebook-post-action
|
||||
with:
|
||||
page_id: ${{ secrets.FACEBOOK_GROUP_ID }}
|
||||
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
|
||||
message: |
|
||||
${{ github.event.repository.name }} ${{ github.ref_name }} Released
|
||||
${{ github.event.release.body }}
|
||||
url: ${{ github.event.release.html_url }}
|
||||
|
||||
facebook_page:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: facebook-post-action
|
||||
uses: ReenigneArcher/facebook-post-action@v1 # https://github.com/ReenigneArcher/facebook-post-action
|
||||
with:
|
||||
page_id: ${{ secrets.FACEBOOK_PAGE_ID }}
|
||||
access_token: ${{ secrets.FACEBOOK_ACCESS_TOKEN }}
|
||||
message: |
|
||||
${{ github.event.repository.name }} ${{ github.ref_name }} Released
|
||||
${{ github.event.release.body }}
|
||||
url: ${{ github.event.release.html_url }}
|
||||
|
||||
reddit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: reddit
|
||||
uses: bluwy/release-for-reddit-action@v1 # https://github.com/bluwy/release-for-reddit-action
|
||||
with:
|
||||
username: ${{ secrets.REDDIT_USERNAME }}
|
||||
password: ${{ secrets.REDDIT_PASSWORD }}
|
||||
app-id: ${{ secrets.REDDIT_CLIENT_ID }}
|
||||
app-secret: ${{ secrets.REDDIT_CLIENT_SECRET }}
|
||||
subreddit: ${{ secrets.REDDIT_SUBREDDIT }}
|
||||
title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released
|
||||
url: ${{ github.event.release.html_url }}
|
||||
flair-id: ${{ secrets.REDDIT_FLAIR_ID }} # https://www.reddit.com/r/<subreddit>>/api/link_flair.json
|
||||
comment: ${{ github.event.release.body }}
|
||||
|
||||
twitter:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: twitter
|
||||
uses: ethomson/send-tweet-action@v1 # https://github.com/ethomson/send-tweet-action
|
||||
with:
|
||||
consumer-key: ${{ secrets.TWITTER_API_KEY }}
|
||||
consumer-secret: ${{ secrets.TWITTER_API_SECRET }}
|
||||
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
|
||||
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
|
||||
status: ${{ github.event.release.html_url }}
|
||||
61
.github/workflows/yaml-lint.yml
vendored
Normal file
61
.github/workflows/yaml-lint.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
# This action is centrally managed in https://github.com/<organization>/.github/
|
||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: yaml lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
yaml-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Find additional files
|
||||
id: find-files
|
||||
run: |
|
||||
# space separated list of files
|
||||
FILES=.clang-format
|
||||
|
||||
# empty placeholder
|
||||
FOUND=""
|
||||
|
||||
for FILE in ${FILES}; do
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
FOUND="$FOUND $FILE"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "found=${FOUND}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: yaml lint
|
||||
id: yaml-lint
|
||||
uses: ibiqlik/action-yamllint@v3
|
||||
with:
|
||||
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
|
||||
config_data: |
|
||||
extends: default
|
||||
rules:
|
||||
comments:
|
||||
level: error
|
||||
line-length:
|
||||
max: 120
|
||||
truthy:
|
||||
# GitHub uses "on" for workflow event triggers
|
||||
# .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning"
|
||||
allowed-values: ['true', 'false', 'on']
|
||||
check-keys: true
|
||||
level: warning
|
||||
file_or_dir: . ${{ steps.find-files.outputs.found }}
|
||||
|
||||
- name: Log
|
||||
if: failure()
|
||||
run: |
|
||||
cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY
|
||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -10,11 +10,15 @@ cmake-build*
|
||||
.idea
|
||||
|
||||
# Extra FontAwesome files
|
||||
/assets/web/fonts/fontawesome-free-web/css/*.css
|
||||
!/assets/web/fonts/fontawesome-free-web/css/*min.css
|
||||
/assets/web/fonts/fontawesome-free-web/js/
|
||||
/assets/web/fonts/fontawesome-free-web/less/
|
||||
/assets/web/fonts/fontawesome-free-web/metadata/
|
||||
/assets/web/fonts/fontawesome-free-web/scss/
|
||||
/assets/web/fonts/fontawesome-free-web/sprites/
|
||||
/assets/web/fonts/fontawesome-free-web/svgs/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*.css
|
||||
!/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*min.css
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/js/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/less/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/metadata/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/scss/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/sprites/
|
||||
/src_assets/common/assets/web/fonts/fontawesome-free-web/svgs/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -13,3 +13,6 @@
|
||||
[submodule "third-party/nv-codec-headers"]
|
||||
path = third-party/nv-codec-headers
|
||||
url = https://github.com/FFmpeg/nv-codec-headers
|
||||
[submodule "third-party/TPCircularBuffer"]
|
||||
path = third-party/TPCircularBuffer
|
||||
url = https://github.com/michaeltyson/TPCircularBuffer
|
||||
|
||||
45
.readthedocs.yaml
Normal file
45
.readthedocs.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
# .readthedocs.yaml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the version of Python
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: "3.10"
|
||||
|
||||
## apt packages required packages to run cmake on sunshine, note that additional packages are required
|
||||
# apt_packages:
|
||||
# - cmake
|
||||
# - ffmpeg
|
||||
# - libboost-filesystem-dev
|
||||
# - libboost-log-dev
|
||||
# - libboost-thread-dev
|
||||
|
||||
## run cmake
|
||||
# jobs:
|
||||
# pre_build:
|
||||
# - cmake .
|
||||
|
||||
## Include the submodules, required for cmake
|
||||
# submodules:
|
||||
# include: all
|
||||
# recursive: true
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
builder: html
|
||||
configuration: docs/source/conf.py
|
||||
fail_on_warning: true
|
||||
|
||||
# Using Sphinx, build docs in additional formats
|
||||
formats: all
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: ./docs/requirements.txt
|
||||
system_packages: true
|
||||
56
CHANGELOG.md
56
CHANGELOG.md
@@ -1,5 +1,61 @@
|
||||
# Changelog
|
||||
|
||||
## [0.15.0] - 2022-10-30
|
||||
### Added
|
||||
- (Windows) Add firewall rules scripts
|
||||
- (Windows) Automatically add and remove firewall rules at install/uninstall
|
||||
- (Windows) Automatically add and remove service at install/uninstall
|
||||
- (Docker) Official image added
|
||||
- (Linux) Add aarch64 flatpak package
|
||||
### Changed
|
||||
- (Windows/Linux/MacOS) - Move default config and apps file to assets directory
|
||||
- (MacOS) Bump boost to 1.80 for macport builds
|
||||
- (Linux) Remove backup and restore of config files
|
||||
### Fixed
|
||||
- (Linux) - Create sunshine config directory if it doesn't exist
|
||||
- (Linux) Remove portable home and config directories for AppImage
|
||||
- (Windows) Include service install and uninstall scripts again
|
||||
- (Windows) Automatically delete start menu entry upon uninstall
|
||||
- (Windows) Automatically delete program install directory upon uninstall, with user prompt
|
||||
- (Linux) Handle the case of no default audio sink
|
||||
- (Windows/Linux/MacOS) Fix default image paths
|
||||
- (Linux) Fix CUDA RGBA to NV12 conversion
|
||||
|
||||
## [0.14.1] - 2022-08-09
|
||||
### Added
|
||||
- (Linux) Flatpak package added
|
||||
- (Linux) AUR package automated updates
|
||||
- (Windows) Winget package automated updates
|
||||
### Changed
|
||||
- (General) Moved repo to @LizardByte GitHub org
|
||||
- (WebUI) Fixed button spacing on home page
|
||||
- (WebUI) Added Discord WidgetBot Crate
|
||||
### Fixed
|
||||
- (Linux/Mac) Default config and app files now copied to user home directory
|
||||
- (Windows) Default config and app files now copied to working directory
|
||||
|
||||
## [0.14.0] - 2022-06-15
|
||||
### Added
|
||||
- (Documentation) Added Sphinx documentation available at https://sunshinestream.readthedocs.io/en/latest/
|
||||
- (Development) Initial support for Localization
|
||||
- (Linux) Add rpm package as release asset
|
||||
- (MacOS) Add Portfile as release asset
|
||||
- (Windows) Add DwmFlush() call to improve capture
|
||||
- (Windows) Add Windows installer
|
||||
### Fixed
|
||||
- (AMD) Fixed hwdevice being destroyed before context
|
||||
- (Linux) Added missing dependencies to AppImage
|
||||
- (Linux) Fixed rumble events causing game to freeze
|
||||
- (Linux) Improved Pulse/Pipewire compatibility
|
||||
- (Linux) Moved to single deb package
|
||||
- (MacOS) Fixed missing TPCircularBuffer submodule
|
||||
- (Stream) Properly catch exceptions in stream broadcast handlers
|
||||
- (Stream/Video) AVPacket fix
|
||||
|
||||
## [0.13.0] - 2022-02-27
|
||||
### Added
|
||||
- (MacOS) Initial support for MacOS (#40)
|
||||
|
||||
## [0.12.0] - 2022-02-13
|
||||
### Added
|
||||
- New command line argument `--version`
|
||||
|
||||
449
CMakeLists.txt
449
CMakeLists.txt
@@ -1,8 +1,38 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(Sunshine VERSION 0.12.0)
|
||||
project(Sunshine VERSION 0.15.0
|
||||
DESCRIPTION "Sunshine is a Gamestream host for Moonlight."
|
||||
HOMEPAGE_URL "https://app.lizardbyte.dev"
|
||||
)
|
||||
|
||||
set(PROJECT_LONG_DESCRIPTION "Sunshine is a self hosted, low latency, cloud gaming solution with support for AMD, \
|
||||
Intel, and Nvidia GPUs. It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield. \
|
||||
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.")
|
||||
|
||||
option(SUNSHINE_CONFIGURE_APPIMAGE "Configuration specific for AppImage." OFF)
|
||||
option(SUNSHINE_CONFIGURE_AUR "Configure files required for AUR." OFF)
|
||||
option(SUNSHINE_CONFIGURE_FLATPAK_MAN "Configure manifest file required for Flatpak build." OFF)
|
||||
option(SUNSHINE_CONFIGURE_FLATPAK "Configuration specific 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})
|
||||
configure_file(packaging/linux/sunshine.desktop sunshine.desktop @ONLY)
|
||||
elseif(${SUNSHINE_CONFIGURE_AUR})
|
||||
configure_file(packaging/linux/aur/PKGBUILD PKGBUILD @ONLY)
|
||||
elseif(${SUNSHINE_CONFIGURE_FLATPAK_MAN})
|
||||
configure_file(packaging/linux/flatpak/dev.lizardbyte.sunshine.yml dev.lizardbyte.sunshine.yml @ONLY)
|
||||
elseif(${SUNSHINE_CONFIGURE_PORTFILE})
|
||||
configure_file(packaging/macos/Portfile Portfile @ONLY)
|
||||
endif()
|
||||
|
||||
# return if configure only is set
|
||||
if(${SUNSHINE_CONFIGURE_ONLY})
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src_assets")
|
||||
|
||||
if(WIN32)
|
||||
# Ugly hack to compile with #include <qos2.h>
|
||||
@@ -11,6 +41,22 @@ if(WIN32)
|
||||
PQOS_FLOWID=UINT32*
|
||||
QOS_NON_ADAPTIVE_FLOW=2)
|
||||
endif()
|
||||
if(APPLE)
|
||||
macro(ADD_FRAMEWORK fwname appname)
|
||||
find_library(FRAMEWORK_${fwname}
|
||||
NAMES ${fwname}
|
||||
PATHS ${CMAKE_OSX_SYSROOT}/System/Library
|
||||
PATH_SUFFIXES Frameworks
|
||||
NO_DEFAULT_PATH)
|
||||
if( ${FRAMEWORK_${fwname}} STREQUAL FRAMEWORK_${fwname}-NOTFOUND)
|
||||
MESSAGE(ERROR ": Framework ${fwname} not found")
|
||||
else()
|
||||
TARGET_LINK_LIBRARIES(${appname} "${FRAMEWORK_${fwname}}/${fwname}")
|
||||
MESSAGE(STATUS "Framework ${fwname} found at ${FRAMEWORK_${fwname}}")
|
||||
endif()
|
||||
endmacro(ADD_FRAMEWORK)
|
||||
endif()
|
||||
|
||||
add_subdirectory(third-party/moonlight-common-c/enet)
|
||||
add_subdirectory(third-party/Simple-Web-Server)
|
||||
|
||||
@@ -23,7 +69,9 @@ include_directories(third-party/miniupnp)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
if(NOT APPLE)
|
||||
set(Boost_USE_STATIC_LIBS ON)
|
||||
endif()
|
||||
find_package(Boost COMPONENTS log filesystem REQUIRED)
|
||||
|
||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-missing-braces -Wno-maybe-uninitialized -Wno-sign-compare)
|
||||
@@ -40,33 +88,31 @@ if(WIN32)
|
||||
INPUT "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
|
||||
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pre-compiled)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||
|
||||
|
||||
if(NOT DEFINED SUNSHINE_PREPARED_BINARIES)
|
||||
set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled/windows")
|
||||
endif()
|
||||
|
||||
add_compile_definitions(SUNSHINE_PLATFORM="windows")
|
||||
add_subdirectory(tools) #This is temporary, only tools for Windows are needed, for now
|
||||
|
||||
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_windows.json")
|
||||
add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now
|
||||
|
||||
include_directories(third-party/ViGEmClient/include)
|
||||
|
||||
if(NOT DEFINED SUNSHINE_ICON_PATH)
|
||||
set(SUNSHINE_ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sunshine.ico")
|
||||
endif()
|
||||
configure_file(sunshine/platform/windows/windows.rs.in windows.rc @ONLY)
|
||||
configure_file(src/platform/windows/windows.rs.in windows.rc @ONLY)
|
||||
set(PLATFORM_TARGET_FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/windows.rc"
|
||||
sunshine/platform/windows/publish.cpp
|
||||
sunshine/platform/windows/misc.h
|
||||
sunshine/platform/windows/misc.cpp
|
||||
sunshine/platform/windows/input.cpp
|
||||
sunshine/platform/windows/display.h
|
||||
sunshine/platform/windows/display_base.cpp
|
||||
sunshine/platform/windows/display_vram.cpp
|
||||
sunshine/platform/windows/display_ram.cpp
|
||||
sunshine/platform/windows/audio.cpp
|
||||
src/platform/windows/publish.cpp
|
||||
src/platform/windows/misc.h
|
||||
src/platform/windows/misc.cpp
|
||||
src/platform/windows/input.cpp
|
||||
src/platform/windows/display.h
|
||||
src/platform/windows/display_base.cpp
|
||||
src/platform/windows/display_vram.cpp
|
||||
src/platform/windows/display_ram.cpp
|
||||
src/platform/windows/audio.cpp
|
||||
third-party/ViGEmClient/src/ViGEmClient.cpp
|
||||
third-party/ViGEmClient/include/ViGEm/Client.h
|
||||
third-party/ViGEmClient/include/ViGEm/Common.h
|
||||
@@ -102,13 +148,57 @@ if(WIN32)
|
||||
ws2_32
|
||||
d3d11 dxgi D3DCompiler
|
||||
setupapi
|
||||
dwmapi
|
||||
)
|
||||
|
||||
set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650")
|
||||
set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-misleading-indentation -Wno-class-memaccess")
|
||||
elseif(APPLE)
|
||||
add_compile_definitions(SUNSHINE_PLATFORM="macos")
|
||||
|
||||
option(SUNSHINE_MACOS_PACKAGE "Should only be used when creating a MACOS package/dmg." OFF)
|
||||
|
||||
link_directories(/opt/local/lib)
|
||||
link_directories(/usr/local/lib)
|
||||
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
|
||||
|
||||
find_package(FFmpeg REQUIRED)
|
||||
FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
|
||||
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation )
|
||||
FIND_LIBRARY(CORE_MEDIA_LIBRARY CoreMedia )
|
||||
FIND_LIBRARY(CORE_VIDEO_LIBRARY CoreVideo )
|
||||
FIND_LIBRARY(FOUNDATION_LIBRARY Foundation )
|
||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
${APP_SERVICES_LIBRARY}
|
||||
${AV_FOUNDATION_LIBRARY}
|
||||
${CORE_MEDIA_LIBRARY}
|
||||
${CORE_VIDEO_LIBRARY}
|
||||
${FOUNDATION_LIBRARY})
|
||||
|
||||
set(PLATFORM_INCLUDE_DIRS
|
||||
${Boost_INCLUDE_DIR})
|
||||
|
||||
set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist)
|
||||
|
||||
set(PLATFORM_TARGET_FILES
|
||||
src/platform/macos/av_audio.h
|
||||
src/platform/macos/av_audio.m
|
||||
src/platform/macos/av_img_t.h
|
||||
src/platform/macos/av_video.h
|
||||
src/platform/macos/av_video.m
|
||||
src/platform/macos/display.mm
|
||||
src/platform/macos/input.cpp
|
||||
src/platform/macos/microphone.mm
|
||||
src/platform/macos/misc.cpp
|
||||
src/platform/macos/misc.h
|
||||
src/platform/macos/nv12_zero_device.cpp
|
||||
src/platform/macos/nv12_zero_device.h
|
||||
src/platform/macos/publish.cpp
|
||||
third-party/TPCircularBuffer/TPCircularBuffer.c
|
||||
third-party/TPCircularBuffer/TPCircularBuffer.h
|
||||
${APPLE_PLIST_FILE})
|
||||
else()
|
||||
add_compile_definitions(SUNSHINE_PLATFORM="linux")
|
||||
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_linux.json")
|
||||
|
||||
option(SUNSHINE_ENABLE_DRM "Enable KMS grab if available" ON)
|
||||
option(SUNSHINE_ENABLE_X11 "Enable X11 grab if available" ON)
|
||||
@@ -153,14 +243,14 @@ else()
|
||||
if(X11_FOUND)
|
||||
add_compile_definitions(SUNSHINE_BUILD_X11)
|
||||
include_directories(${X11_INCLUDE_DIR})
|
||||
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/x11grab.cpp)
|
||||
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/x11grab.cpp)
|
||||
endif()
|
||||
|
||||
if(CUDA_FOUND)
|
||||
include_directories(third-party/nvfbc)
|
||||
list(APPEND PLATFORM_TARGET_FILES
|
||||
sunshine/platform/linux/cuda.cu
|
||||
sunshine/platform/linux/cuda.cpp
|
||||
src/platform/linux/cuda.cu
|
||||
src/platform/linux/cuda.cpp
|
||||
third-party/nvfbc/NvFBC.h)
|
||||
|
||||
add_compile_definitions(SUNSHINE_BUILD_CUDA)
|
||||
@@ -170,7 +260,7 @@ else()
|
||||
add_compile_definitions(SUNSHINE_BUILD_DRM)
|
||||
include_directories(${LIBDRM_INCLUDE_DIRS} ${LIBCAP_INCLUDE_DIRS})
|
||||
list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES} ${LIBCAP_LIBRARIES})
|
||||
list(APPEND PLATFORM_TARGET_FILES sunshine/platform/linux/kmsgrab.cpp)
|
||||
list(APPEND PLATFORM_TARGET_FILES src/platform/linux/kmsgrab.cpp)
|
||||
list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1)
|
||||
elseif(LIBDRM_FOUND)
|
||||
message(WARNING "Found libdrm, yet there is no libcap")
|
||||
@@ -212,40 +302,40 @@ else()
|
||||
|
||||
list(APPEND PLATFORM_LIBRARIES ${WAYLAND_LIBRARIES})
|
||||
list(APPEND PLATFORM_TARGET_FILES
|
||||
sunshine/platform/linux/wlgrab.cpp
|
||||
sunshine/platform/linux/wayland.cpp)
|
||||
src/platform/linux/wlgrab.cpp
|
||||
src/platform/linux/wayland.cpp)
|
||||
endif()
|
||||
if(NOT ${X11_FOUND} AND NOT (${LIBDRM_FOUND} AND ${LIBCAP_FOUND}) AND NOT ${WAYLAND_FOUND} AND NOT ${})
|
||||
message(FATAL_ERROR "Couldn't find either x11, wayland, cuda or (libdrm and libcap)")
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_TARGET_FILES
|
||||
sunshine/platform/linux/publish.cpp
|
||||
sunshine/platform/linux/vaapi.h
|
||||
sunshine/platform/linux/vaapi.cpp
|
||||
sunshine/platform/linux/cuda.h
|
||||
sunshine/platform/linux/graphics.h
|
||||
sunshine/platform/linux/graphics.cpp
|
||||
sunshine/platform/linux/misc.h
|
||||
sunshine/platform/linux/misc.cpp
|
||||
sunshine/platform/linux/audio.cpp
|
||||
sunshine/platform/linux/input.cpp
|
||||
sunshine/platform/linux/x11grab.h
|
||||
sunshine/platform/linux/wayland.h
|
||||
src/platform/linux/publish.cpp
|
||||
src/platform/linux/vaapi.h
|
||||
src/platform/linux/vaapi.cpp
|
||||
src/platform/linux/cuda.h
|
||||
src/platform/linux/graphics.h
|
||||
src/platform/linux/graphics.cpp
|
||||
src/platform/linux/misc.h
|
||||
src/platform/linux/misc.cpp
|
||||
src/platform/linux/audio.cpp
|
||||
src/platform/linux/input.cpp
|
||||
src/platform/linux/x11grab.h
|
||||
src/platform/linux/wayland.h
|
||||
third-party/glad/src/egl.c
|
||||
third-party/glad/src/gl.c
|
||||
third-party/glad/include/EGL/eglplatform.h
|
||||
third-party/glad/include/KHR/khrplatform.h
|
||||
third-party/glad/include/glad/gl.h
|
||||
third-party/glad/include/glad/egl.h)
|
||||
|
||||
|
||||
list(APPEND PLATFORM_LIBRARIES
|
||||
dl
|
||||
evdev
|
||||
pulse
|
||||
pulse-simple
|
||||
)
|
||||
|
||||
|
||||
include_directories(
|
||||
/usr/include/libevdev-1.0
|
||||
third-party/nv-codec-headers/include
|
||||
@@ -254,7 +344,6 @@ else()
|
||||
if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH)
|
||||
set(SUNSHINE_EXECUTABLE_PATH "sunshine")
|
||||
endif()
|
||||
configure_file(gen-deb.in gen-deb @ONLY)
|
||||
configure_file(sunshine.service.in sunshine.service @ONLY)
|
||||
endif()
|
||||
|
||||
@@ -268,47 +357,47 @@ set(SUNSHINE_TARGET_FILES
|
||||
third-party/moonlight-common-c/src/Rtsp.h
|
||||
third-party/moonlight-common-c/src/RtspParser.c
|
||||
third-party/moonlight-common-c/src/Video.h
|
||||
sunshine/upnp.cpp
|
||||
sunshine/upnp.h
|
||||
sunshine/cbs.cpp
|
||||
sunshine/utility.h
|
||||
sunshine/uuid.h
|
||||
sunshine/config.h
|
||||
sunshine/config.cpp
|
||||
sunshine/main.cpp
|
||||
sunshine/main.h
|
||||
sunshine/crypto.cpp
|
||||
sunshine/crypto.h
|
||||
sunshine/nvhttp.cpp
|
||||
sunshine/nvhttp.h
|
||||
sunshine/httpcommon.cpp
|
||||
sunshine/httpcommon.h
|
||||
sunshine/confighttp.cpp
|
||||
sunshine/confighttp.h
|
||||
sunshine/rtsp.cpp
|
||||
sunshine/rtsp.h
|
||||
sunshine/stream.cpp
|
||||
sunshine/stream.h
|
||||
sunshine/video.cpp
|
||||
sunshine/video.h
|
||||
sunshine/input.cpp
|
||||
sunshine/input.h
|
||||
sunshine/audio.cpp
|
||||
sunshine/audio.h
|
||||
sunshine/platform/common.h
|
||||
sunshine/process.cpp
|
||||
sunshine/process.h
|
||||
sunshine/network.cpp
|
||||
sunshine/network.h
|
||||
sunshine/move_by_copy.h
|
||||
sunshine/task_pool.h
|
||||
sunshine/thread_pool.h
|
||||
sunshine/thread_safe.h
|
||||
sunshine/sync.h
|
||||
sunshine/round_robin.h
|
||||
src/upnp.cpp
|
||||
src/upnp.h
|
||||
src/cbs.cpp
|
||||
src/utility.h
|
||||
src/uuid.h
|
||||
src/config.h
|
||||
src/config.cpp
|
||||
src/main.cpp
|
||||
src/main.h
|
||||
src/crypto.cpp
|
||||
src/crypto.h
|
||||
src/nvhttp.cpp
|
||||
src/nvhttp.h
|
||||
src/httpcommon.cpp
|
||||
src/httpcommon.h
|
||||
src/confighttp.cpp
|
||||
src/confighttp.h
|
||||
src/rtsp.cpp
|
||||
src/rtsp.h
|
||||
src/stream.cpp
|
||||
src/stream.h
|
||||
src/video.cpp
|
||||
src/video.h
|
||||
src/input.cpp
|
||||
src/input.h
|
||||
src/audio.cpp
|
||||
src/audio.h
|
||||
src/platform/common.h
|
||||
src/process.cpp
|
||||
src/process.h
|
||||
src/network.cpp
|
||||
src/network.h
|
||||
src/move_by_copy.h
|
||||
src/task_pool.h
|
||||
src/thread_pool.h
|
||||
src/thread_safe.h
|
||||
src/sync.h
|
||||
src/round_robin.h
|
||||
${PLATFORM_TARGET_FILES})
|
||||
|
||||
set_source_files_properties(sunshine/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
|
||||
set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -326,24 +415,29 @@ string(TOUPPER "x${CMAKE_BUILD_TYPE}" BUILD_TYPE)
|
||||
if("${BUILD_TYPE}" STREQUAL "XDEBUG")
|
||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -O0 -ggdb3)
|
||||
if(WIN32)
|
||||
set_source_files_properties(sunshine/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
|
||||
set_source_files_properties(src/nvhttp.cpp PROPERTIES COMPILE_FLAGS -O2)
|
||||
endif()
|
||||
else()
|
||||
add_definitions(-DNDEBUG)
|
||||
list(APPEND SUNSHINE_COMPILE_OPTIONS -O3)
|
||||
endif()
|
||||
|
||||
# setup assets directory
|
||||
if(NOT SUNSHINE_ASSETS_DIR)
|
||||
set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets")
|
||||
set(SUNSHINE_ASSETS_DIR "assets")
|
||||
endif()
|
||||
if(UNIX)
|
||||
set(SUNSHINE_ASSETS_DIR "${CMAKE_INSTALL_PREFIX}/${SUNSHINE_ASSETS_DIR}")
|
||||
endif()
|
||||
|
||||
if(NOT SUNSHINE_CONFIG_DIR)
|
||||
set(SUNSHINE_CONFIG_DIR "${SUNSHINE_ASSETS_DIR}")
|
||||
# use relative assets path for AppImage... maybe for all unix
|
||||
if(${SUNSHINE_CONFIGURE_APPIMAGE})
|
||||
string(REPLACE "${CMAKE_INSTALL_PREFIX}" ".${CMAKE_INSTALL_PREFIX}" SUNSHINE_ASSETS_DIR_DEF ${SUNSHINE_ASSETS_DIR})
|
||||
else()
|
||||
set(SUNSHINE_ASSETS_DIR_DEF "${SUNSHINE_ASSETS_DIR}")
|
||||
endif()
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR_DEF}")
|
||||
|
||||
if(NOT SUNSHINE_DEFAULT_DIR)
|
||||
set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}")
|
||||
endif()
|
||||
|
||||
list(APPEND CBS_EXTERNAL_LIBRARIES
|
||||
cbs)
|
||||
@@ -352,7 +446,6 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
libminiupnpc-static
|
||||
${CBS_EXTERNAL_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
stdc++fs
|
||||
enet
|
||||
opus
|
||||
${FFMPEG_LIBRARIES}
|
||||
@@ -360,15 +453,12 @@ list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
|
||||
${OPENSSL_LIBRARIES}
|
||||
${PLATFORM_LIBRARIES})
|
||||
|
||||
if (NOT WIN32)
|
||||
if(NOT WIN32)
|
||||
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES Boost::log)
|
||||
endif()
|
||||
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}")
|
||||
list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_DEFAULT_DIR="${SUNSHINE_DEFAULT_DIR}")
|
||||
add_executable(sunshine ${SUNSHINE_TARGET_FILES})
|
||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES})
|
||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
||||
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
||||
set_target_properties(sunshine PROPERTIES CXX_STANDARD 17
|
||||
VERSION ${PROJECT_VERSION}
|
||||
@@ -380,8 +470,187 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD)
|
||||
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${APPLE_PLIST_FILE})
|
||||
endif()
|
||||
|
||||
foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS)
|
||||
list(APPEND SUNSHINE_COMPILE_OPTIONS_CUDA "$<$<COMPILE_LANGUAGE:CUDA>:--compiler-options=${flag}>")
|
||||
endforeach()
|
||||
|
||||
target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>)
|
||||
|
||||
# CPACK / Packaging
|
||||
|
||||
# Common options
|
||||
set(CPACK_PACKAGE_NAME "Sunshine")
|
||||
set(CPACK_PACKAGE_VENDOR "LizardByte")
|
||||
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts)
|
||||
set(CPACK_PACKAGE_CONTACT "https://app.lizardbyte.dev")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/LizardByte")
|
||||
set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION})
|
||||
set(CPACK_PACKAGE_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL})
|
||||
set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE)
|
||||
set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_STRIP_FILES YES)
|
||||
|
||||
# Platform specific options
|
||||
if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html
|
||||
install(TARGETS sunshine RUNTIME DESTINATION "." COMPONENT application)
|
||||
|
||||
# Adding tools
|
||||
install(TARGETS dxgi-info RUNTIME DESTINATION "tools" COMPONENT dxgi)
|
||||
install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio)
|
||||
install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc)
|
||||
|
||||
# scripts
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/firewall/" DESTINATION "scripts" COMPONENT firewall)
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/misc/service/" DESTINATION "scripts" COMPONENT service)
|
||||
|
||||
# Sunshine assets
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets)
|
||||
|
||||
# set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp
|
||||
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/
|
||||
string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here
|
||||
|
||||
# Extra install commands
|
||||
# Sets permissions on the installed folder so that we can write in it
|
||||
# Install service
|
||||
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||
ExecWait 'icacls \\\"$INSTDIR\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)'
|
||||
ExecWait '\\\"$INSTDIR\\\\scripts\\\\add-firewall-rule.bat\\\"'
|
||||
ExecWait '\\\"$INSTDIR\\\\scripts\\\\install-service.bat\\\"'
|
||||
")
|
||||
|
||||
# Extra uninstall commands
|
||||
# Uninstall service
|
||||
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
|
||||
"${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||
ExecWait '\\\"$INSTDIR\\\\scripts\\\\delete-firewall-rule.bat\\\"'
|
||||
ExecWait '\\\"$INSTDIR\\\\scripts\\\\uninstall-service.bat\\\"'
|
||||
MessageBox MB_YESNO|MB_ICONQUESTION 'Do you want to completely remove the directory $INSTDIR and all of its contents?' IDNO NoDelete
|
||||
RMDir /r \\\"$INSTDIR\\\" ; skipped if no
|
||||
NoDelete:
|
||||
")
|
||||
|
||||
# Adding an option for the start menu and PATH
|
||||
set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but is not working https://gitlab.kitware.com/cmake/cmake/-/issues/15635
|
||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe")
|
||||
set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_CREATE_ICONS_EXTRA}
|
||||
CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe'
|
||||
")
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||
"${CPACK_NSIS_DELETE_ICONS_EXTRA}
|
||||
Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\${CMAKE_PROJECT_NAME}.lnk'
|
||||
")
|
||||
|
||||
# Checking for previous installed versions
|
||||
# set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed
|
||||
|
||||
set(CPACK_NSIS_HELP_LINK "https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html")
|
||||
set(CPACK_NSIS_URL_INFO_ABOUT "${CMAKE_PROJECT_HOMEPAGE_URL}")
|
||||
set(CPACK_NSIS_CONTACT "${CMAKE_PROJECT_HOMEPAGE_URL}/support")
|
||||
|
||||
# Setting components groups and dependencies
|
||||
# sunshine binary
|
||||
set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "${CMAKE_PROJECT_NAME} main application.")
|
||||
set(CPACK_COMPONENT_APPLICATION_GROUP "core")
|
||||
set(CPACK_COMPONENT_APPLICATION_REQUIRED true)
|
||||
set(CPACK_COMPONENT_APPLICATION_DEPENDS assets)
|
||||
|
||||
# assets
|
||||
set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "assets")
|
||||
set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.")
|
||||
set(CPACK_COMPONENT_ASSETS_GROUP "core")
|
||||
set(CPACK_COMPONENT_ASSETS_REQUIRED true)
|
||||
|
||||
# audio tool
|
||||
set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info")
|
||||
set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool providing information about sound devices.")
|
||||
set(CPACK_COMPONENT_AUDIO_GROUP "tools")
|
||||
|
||||
# display tool
|
||||
set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info")
|
||||
set(CPACK_COMPONENT_DXGI_DESCRIPTION "CLI tool providing information about graphics cards and displays.")
|
||||
set(CPACK_COMPONENT_DXGI_GROUP "tools")
|
||||
|
||||
# service
|
||||
set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc")
|
||||
set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool providing ability to enable/disable the Sunshine service.")
|
||||
set(CPACK_COMPONENT_SUNSHINESVC_GROUP "tools")
|
||||
|
||||
# service scripts
|
||||
set(CPACK_COMPONENT_SERVICE_DISPLAY_NAME "service-scripts")
|
||||
set(CPACK_COMPONENT_SERVICE_DESCRIPTION "Scripts to enable/disable the service.")
|
||||
set(CPACK_COMPONENT_SERVICE_GROUP "scripts")
|
||||
set(CPACK_COMPONENT_SERVICE_DEPENDS sunshinesvc)
|
||||
|
||||
# firewall scripts
|
||||
set(CPACK_COMPONENT_FIREWALL_DISPLAY_NAME "firewall-scripts")
|
||||
set(CPACK_COMPONENT_FIREWALL_DESCRIPTION "Scripts to enable or disable firewall rules.")
|
||||
set(CPACK_COMPONENT_FIREWALL_GROUP "scripts")
|
||||
endif()
|
||||
if(APPLE)
|
||||
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
|
||||
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}")
|
||||
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
|
||||
# set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine")
|
||||
endif()
|
||||
if(APPLE AND SUNSHINE_MACOS_PACKAGE) # TODO
|
||||
set(prefix "${CMAKE_PROJECT_NAME}.app/Contents")
|
||||
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
|
||||
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
|
||||
install(TARGETS sunshine
|
||||
BUNDLE DESTINATION . COMPONENT Runtime
|
||||
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)
|
||||
elseif(UNIX)
|
||||
# Installation destination dir
|
||||
set(CPACK_SET_DESTDIR true)
|
||||
if(NOT CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/share/sunshine")
|
||||
endif()
|
||||
|
||||
install(TARGETS sunshine RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
|
||||
if(APPLE)
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
else()
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
if(${SUNSHINE_CONFIGURE_APPIMAGE} OR ${SUNSHINE_CONFIGURE_FLATPAK})
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user")
|
||||
else()
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules" DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
||||
endif()
|
||||
|
||||
# Post install
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
|
||||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst")
|
||||
|
||||
# Dependencies
|
||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
||||
96
DOCKER_README.md
Normal file
96
DOCKER_README.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# Docker
|
||||
|
||||
## Build your own containers
|
||||
This image provides a method for you to easily use the latest Sunshine release in your own docker projects. It is not
|
||||
intended to use as a standalone container at this point, and should be considered experimental.
|
||||
|
||||
```dockerfile
|
||||
FROM lizardbyte/sunshine
|
||||
|
||||
# install Steam, Wayland, etc.
|
||||
|
||||
ENTRYPOINT steam && sunshine
|
||||
```
|
||||
|
||||
## Where used
|
||||
This is a list of docker projects using Sunshine. Something missing? Let us know about it!
|
||||
|
||||
- [Games on Whales](https://games-on-whales.github.io)
|
||||
|
||||
## Port and Volume mappings
|
||||
Examples are below of the required mappings. The configuration file will be saved to `/config` in the container.
|
||||
|
||||
### Using docker run
|
||||
Create and run the container (substitute your `<values>`):
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name=<image_name> \
|
||||
--restart=unless-stopped
|
||||
-e PUID=<uid> \
|
||||
-e PGID=<gid> \
|
||||
-e TZ=<timezone> \
|
||||
-v <path to data>:/config \
|
||||
-p 47984-47990:47984-47990/tcp \
|
||||
-p 48010:48010 \
|
||||
-p 47998-48000:47998-48000/udp \
|
||||
<image>
|
||||
```
|
||||
|
||||
### Using docker-compose
|
||||
Create a `docker-compose.yml` file with the following contents (substitute your `<values>`):
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
<image_name>:
|
||||
image: <image>
|
||||
container_name: sunshine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- <path to data>:/config
|
||||
environment:
|
||||
- PUID=<uid>
|
||||
- PGID=<gid>
|
||||
- TZ=<timezone>
|
||||
ports:
|
||||
- "47984-47990:47984-47990/tcp"
|
||||
- "48010:48010"
|
||||
- "47998-48000:47998-48000/udp"
|
||||
```
|
||||
|
||||
### Parameters
|
||||
You must substitute the `<values>` with your own settings.
|
||||
|
||||
Parameters are split into two halves separated by a colon. The left side represents the host and the right side the
|
||||
container.
|
||||
|
||||
**Example:** `-p external:internal` - This shows the port mapping from internal to external of the container.
|
||||
Therefore `-p 47990:47990` would expose port `47990` from inside the container to be accessible from the host's IP on
|
||||
port `47990` (e.g. `http://<host_ip>:47990`). The internal port must be `47990`, but the external port may be changed
|
||||
(e.g. `-p 8080:47990`). All the ports listed in the `docker run` and `docker-compose` examples are required.
|
||||
|
||||
|
||||
| Parameter | Function | Example Value | Required |
|
||||
|-----------------------------|---------------------------|--------------------|----------|
|
||||
| `-p <port>:47990` | Web UI Port | `47990` | True |
|
||||
| `-v <path to data>:/config` | Volume mapping | `/home/sunshine` | True |
|
||||
| `-e PUID=<uid>` | User ID | `1001` | False |
|
||||
| `-e PGID=<gid>` | Group ID | `1001` | False |
|
||||
| `-e TZ=<timezone>` | Lookup TZ value [here][1] | `America/New_York` | False |
|
||||
|
||||
[1]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||
|
||||
#### User / Group Identifiers:
|
||||
When using data volumes (-v flags) permissions issues can arise between the host OS and the container. To avoid this
|
||||
issue you can specify the user PUID and group PGID. Ensure the data volume directory on the host is owned by the same
|
||||
user you specify.
|
||||
|
||||
In this instance `PUID=1001` and `PGID=1001`. To find yours use id user as below:
|
||||
|
||||
```bash
|
||||
$ id dockeruser
|
||||
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
|
||||
```
|
||||
|
||||
If you want to change the PUID or PGID after the image has been built, it will require rebuilding the image.
|
||||
92
Dockerfile
Normal file
92
Dockerfile
Normal file
@@ -0,0 +1,92 @@
|
||||
FROM ubuntu:22.04 AS sunshine-base
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
FROM sunshine-base as sunshine-build
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential=12.9* \
|
||||
cmake=3.22.1* \
|
||||
libavdevice-dev=7:4.4.* \
|
||||
libboost-filesystem-dev=1.74.0* \
|
||||
libboost-log-dev=1.74.0* \
|
||||
libboost-thread-dev=1.74.0* \
|
||||
libcap-dev=1:2.44* \
|
||||
libdrm-dev=2.4.110* \
|
||||
libevdev-dev=1.12.1* \
|
||||
libpulse-dev=1:15.99.1* \
|
||||
libopus-dev=1.3.1* \
|
||||
libssl-dev=3.0.2* \
|
||||
libwayland-dev=1.20.0* \
|
||||
libx11-dev=2:1.7.5* \
|
||||
libxcb-shm0-dev=1.14* \
|
||||
libxcb-xfixes0-dev=1.14* \
|
||||
libxcb1-dev=1.14* \
|
||||
libxfixes-dev=1:6.0.0* \
|
||||
libxrandr-dev=2:1.5.2* \
|
||||
libxtst-dev=2:1.2.3* \
|
||||
nvidia-cuda-dev=11.5.1* \
|
||||
nvidia-cuda-toolkit=11.5.1* \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copy repository
|
||||
WORKDIR /root/sunshine-build/
|
||||
COPY . .
|
||||
|
||||
# setup build directory
|
||||
WORKDIR /root/sunshine-build/build
|
||||
|
||||
# cmake and cpack
|
||||
RUN cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DSUNSHINE_ASSETS_DIR=share/sunshine \
|
||||
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||
-DSUNSHINE_ENABLE_WAYLAND=ON \
|
||||
-DSUNSHINE_ENABLE_X11=ON \
|
||||
-DSUNSHINE_ENABLE_DRM=ON \
|
||||
-DSUNSHINE_ENABLE_CUDA=ON \
|
||||
/root/sunshine-build \
|
||||
&& make -j "$(nproc)" \
|
||||
&& cpack -G DEB
|
||||
|
||||
FROM sunshine-base as sunshine
|
||||
|
||||
# copy deb from builder
|
||||
COPY --from=sunshine-build /root/sunshine-build/build/cpack_artifacts/Sunshine.deb /sunshine.deb
|
||||
|
||||
# install sunshine
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y --no-install-recommends /sunshine.deb \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# network setup
|
||||
EXPOSE 47984-47990/tcp
|
||||
EXPOSE 48010
|
||||
EXPOSE 47998-48000/udp
|
||||
|
||||
# setup user
|
||||
ARG PGID=1000
|
||||
ENV PGID=${PGID}
|
||||
ARG PUID=1000
|
||||
ENV PUID=${PUID}
|
||||
ENV TZ="UTC"
|
||||
ARG UNAME=lizard
|
||||
ENV UNAME=${UNAME}
|
||||
|
||||
ENV HOME=/home/$UNAME
|
||||
|
||||
RUN groupadd -f -g "${PGID}" "${UNAME}" && \
|
||||
useradd -lm -d ${HOME} -s /bin/bash -g "${PGID}" -G input -u "${PUID}" "${UNAME}" && \
|
||||
mkdir -p ${HOME}/.config/sunshine && \
|
||||
ln -s ${HOME}/.config/sunshine /config && \
|
||||
chown -R ${UNAME} ${HOME}
|
||||
|
||||
USER ${UNAME}
|
||||
WORKDIR ${HOME}
|
||||
|
||||
# entrypoint
|
||||
ENTRYPOINT ["/usr/bin/sunshine"]
|
||||
245
README.md
245
README.md
@@ -1,245 +0,0 @@
|
||||

|
||||
# Introduction
|
||||
Sunshine is a Gamestream host for Moonlight
|
||||
|
||||
[](https://ci.appveyor.com/project/loki-47-6F-64/sunshine/branch/master)
|
||||
[](https://github.com/Loki-47-6F-64/sunshine/releases)
|
||||
|
||||
- [Building](README.md#building)
|
||||
- [Credits](README.md#credits)
|
||||
|
||||
# Building
|
||||
- [Linux](README.md#linux)
|
||||
- [Windows](README.md#windows-10)
|
||||
|
||||
## Linux
|
||||
|
||||
If you do not wish to clutter your PC with development files, yet you want the very latest version...
|
||||
You can use these [build scripts](scripts/README.md)
|
||||
They make use of docker to handle building Sunshine automatically
|
||||
|
||||
### Requirements:
|
||||
|
||||
Ubuntu 20.04:
|
||||
Install the following:
|
||||
|
||||
#### Common
|
||||
```
|
||||
sudo apt install cmake gcc-10 g++-10 libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libevdev-dev
|
||||
```
|
||||
#### X11
|
||||
```
|
||||
sudo apt install libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev
|
||||
```
|
||||
|
||||
#### KMS
|
||||
This requires additional [setup](README.md#Setup).
|
||||
```
|
||||
sudo apt install libdrm-dev libcap-dev
|
||||
```
|
||||
|
||||
#### Wayland
|
||||
This is for wlroots based compositores, such as Sway
|
||||
```
|
||||
sudo apt install libwayland-dev
|
||||
```
|
||||
|
||||
#### Cuda + NvFBC
|
||||
This requires proprietary software
|
||||
On Ubuntu 20.04, the cuda compiler will fail since it's version is too old, it's recommended you compile the sources with the [build scripts](scripts/README.md)
|
||||
```
|
||||
sudo apt install nvidia-cuda-dev nvidia-cuda-toolkit
|
||||
```
|
||||
|
||||
#### Warning:
|
||||
You might require ffmpeg version >= 4.3. Check the troubleshooting section for more information.
|
||||
|
||||
### Compilation:
|
||||
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recurse-submodules`
|
||||
- `cd sunshine && mkdir build && cd build`
|
||||
- `cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ..`
|
||||
- `make -j ${nproc}`
|
||||
|
||||
### Setup:
|
||||
sunshine needs access to uinput to create mouse and gamepad events:
|
||||
|
||||
- Add user to group 'input':
|
||||
`usermod -a -G input $USER`
|
||||
- Create udev rules:
|
||||
- Run the following command:
|
||||
`nano /etc/udev/rules.d/85-sunshine-input.rules`
|
||||
- Input the following contents:
|
||||
`KERNEL=="uinput", GROUP="input", MODE="0660"`
|
||||
- Save the file and exit
|
||||
1. `CTRL+X` to start exit
|
||||
2. `Y` to save modifications
|
||||
- `assets/sunshine.conf` is an example configuration file. Modify it as you see fit, then use it by running:
|
||||
`sunshine path/to/sunshine.conf`
|
||||
- Configure autostart service
|
||||
`path/to/build/dir/sunshine.service` is used to start sunshine in the background. To use it, do the following:
|
||||
1. Copy it to the users systemd, `cp sunshine.service ~/.config/systemd/user/`
|
||||
2. Starting
|
||||
- Onetime:
|
||||
`systemctl --user start sunshine`
|
||||
- Always on boot:
|
||||
`systemctl --user enable sunshine`
|
||||
|
||||
- `assets/apps.json` is an [example](README.md#application-list) of a list of applications that are started just before running a stream
|
||||
|
||||
#### Additional Setup for KMS:
|
||||
Please note that `cap_sys_admin` may as well be root, except you don't need to be root to run it.
|
||||
It's necessary to allow Sunshine to use KMS
|
||||
- `sudo setcap cap_sys_admin+p sunshine`
|
||||
|
||||
### Trouleshooting:
|
||||
- If you get "Could not create Sunshine Gamepad: Permission Denied", ensure you are part of the group "input":
|
||||
- `groups $USER`
|
||||
|
||||
- If Sunshine sends audio from the microphone instead of the speaker, try the following steps:
|
||||
1. Check whether you're using Pulseaudio or Pipewire
|
||||
- Pulseaudio: Use `pacmd list-sources | grep "name:"`
|
||||
- Pipewire: Use `pactl info | grep Source`. In some causes you'd need to use the `sink` device. Try `pactl info | grep Sink`, if _Source_ doesn't work.
|
||||
2. Copy the name to the configuration option "audio_sink"
|
||||
3. Restart sunshine
|
||||
|
||||
- If you get "Error: Failed to create client: Daemon not running", ensure that your avahi-daemon is running:
|
||||
- `systemctl status avahi-daemon`
|
||||
|
||||
- If you use hardware acceleration on Linux using an Intel or an AMD GPU (with VAAPI), you will get tons of [graphical issues](https://github.com/loki-47-6F-64/sunshine/issues/228) if your ffmpeg version is < 4.3. If it is not available in your distribution's repositories, consider using a newer version of your distribution.
|
||||
- Ubuntu started to ship ffmpeg 4.3 starting with groovy (20.10). If you're using an older version, you could use [this PPA](https://launchpad.net/%7Esavoury1/+archive/ubuntu/ffmpeg4) instead of upgrading. **Using PPAs is dangerous and may break your system. Use it at your own risk.**
|
||||
|
||||
## Windows 10
|
||||
|
||||
### Requirements:
|
||||
|
||||
First you need to install [MSYS2](https://www.msys2.org), then startup "MSYS2 MinGW 64-bit" and install the following packages using `pacman -S`:
|
||||
|
||||
mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git mingw-w64-x86_64-make cmake make gcc
|
||||
|
||||
### Compilation:
|
||||
- `git clone https://github.com/loki-47-6F-64/sunshine.git --recursive`
|
||||
- `cd sunshine && mkdir build && cd build`
|
||||
- `cmake -G"Unix Makefiles" ..`
|
||||
- `mingw32-make`
|
||||
|
||||
### Setup:
|
||||
- **OPTIONAL** Gamepad support: Download and run 'ViGEmBus_Setup_1.16.116.exe' from [https://github.com/ViGEm/ViGEmBus/releases]
|
||||
|
||||
|
||||
|
||||
# Common
|
||||
|
||||
## Usage:
|
||||
- run "sunshine path/to/sunshine.conf"
|
||||
- If running for the first time, make sure to note the username and password Sunshine showed to you, since you **cannot get back later**!
|
||||
- In Moonlight: Add PC manually
|
||||
- When Moonlight request you insert the correct pin on sunshine:
|
||||
- Type in the URL bar of your browser: `https://xxx.xxx.xxx.xxx:47990` where `xxx.xxx.xxx.xxx` is the IP address of your computer
|
||||
- Ignore any warning given by your browser about "insecure website"
|
||||
- You should compile the next page with a new username and a password, needed to login into the next step
|
||||
- Press "Save" and log in using the credentials given above
|
||||
- Go to "PIN" in the Header
|
||||
- Type in your PIN and press Enter, you should get a Success Message
|
||||
- Click on one of the Applications listed
|
||||
- Have fun :)
|
||||
|
||||
## Shortcuts:
|
||||
|
||||
All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight
|
||||
- CTRL + ALT + SHIFT + N --> Hide/Unhide the cursor (This may be usefull for Remote Desktop Mode for Moonlight)
|
||||
- CTRL + ALT + SHIFT + F1/F13 --> Switch to different monitor for Streaming
|
||||
|
||||
## Credits:
|
||||
- [Simple-Web-Server](https://gitlab.com/eidheim/Simple-Web-Server)
|
||||
- [Moonlight](https://github.com/moonlight-stream)
|
||||
- [Looking-Glass](https://github.com/gnif/LookingGlass) (For showing me how to properly capture frames on Windows, saving me a lot of time :)
|
||||
- [Eretik](http://eretik.omegahg.com/) (For creating PolicyConfig.h, allowing me to change the default audio device on Windows programmatically)
|
||||
- [Twitter emoji](https://github.com/twitter/twemoji/blob/master/LICENSE-GRAPHICS) (Sunshine's icon is made of twemoji)
|
||||
|
||||
## Application List:
|
||||
**Note:** You can change the Application List in the "Apps" section of the User Interface `https://xxx.xxx.xxx.xxx:47990/`
|
||||
- You can use Environment variables in place of values
|
||||
- $(HOME) will be replaced by the value of $HOME
|
||||
- $$ will be replaced by $ --> $$(HOME) will be replaced by $(HOME)
|
||||
- env: Adds or overwrites Environment variables for the commands/applications run by Sunshine.
|
||||
- "Variable name":"Variable value"
|
||||
- apps: The list of applications
|
||||
- Example:
|
||||
```json
|
||||
{
|
||||
"name":"An App",
|
||||
"cmd":"command to open app",
|
||||
"prep-cmd":[
|
||||
{
|
||||
"do":"some-command",
|
||||
"undo":"undo-that-command"
|
||||
}
|
||||
],
|
||||
"detached":[
|
||||
"some-command",
|
||||
"another-command"
|
||||
]
|
||||
}
|
||||
```
|
||||
- name: Self explanatory
|
||||
- output <optional>: The file where the output of the command is stored
|
||||
- If it is not specified, the output is ignored
|
||||
- detached: A list of commands to be run and forgotten about
|
||||
- prep-cmd: A list of commands to be run before/after the application
|
||||
- If any of the prep-commands fail, starting the application is aborted
|
||||
- do: Run before the application
|
||||
- If it fails, all 'undo' commands of the previously succeeded 'do' commands are run
|
||||
- undo <optional>: Run after the application has terminated
|
||||
- This should not fail considering it is supposed to undo the 'do' commands.
|
||||
- If it fails, Sunshine is terminated
|
||||
- cmd <optional>: The main application
|
||||
- If not specified, a processs is started that sleeps indefinitely
|
||||
|
||||
1. When an application is started, if there is an application already running, it will be terminated.
|
||||
2. When the application has been shutdown, the stream shuts down as well.
|
||||
3. In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application, instead it simply starts a stream.
|
||||
|
||||
Linux
|
||||
```json
|
||||
{
|
||||
"env":{
|
||||
"DISPLAY":":0",
|
||||
"DRI_PRIME":"1",
|
||||
"XAUTHORITY":"$(HOME)/.Xauthority",
|
||||
"PATH":"$(PATH):$(HOME)/.local/bin"
|
||||
},
|
||||
"apps":[
|
||||
{
|
||||
"name":"Low Res Desktop",
|
||||
"prep-cmd":[
|
||||
{ "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Steam BigPicture",
|
||||
|
||||
"output":"steam.txt",
|
||||
"cmd":"steam -bigpicture",
|
||||
"prep-cmd":[]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Windows
|
||||
```json
|
||||
{
|
||||
"env":{
|
||||
"PATH":"$(PATH);C:\\Program Files (x86)\\Steam"
|
||||
},
|
||||
"apps":[
|
||||
{
|
||||
"name":"Steam BigPicture",
|
||||
|
||||
"output":"steam.txt",
|
||||
"prep-cmd":[
|
||||
{"do":"steam \"steam://open/bigpicture\""}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
71
README.rst
Normal file
71
README.rst
Normal file
@@ -0,0 +1,71 @@
|
||||
Overview
|
||||
========
|
||||
LizardByte has the full documentation hosted on `Read the Docs <https://sunshinestream.readthedocs.io/>`_.
|
||||
|
||||
About
|
||||
-----
|
||||
Sunshine is a Game stream host for Moonlight.
|
||||
Sunshine is a self hosted, low latency, cloud gaming solution with support for AMD, Intel, and Nvidia gpus.
|
||||
It is an open source implementation of NVIDIA's GameStream, as used by the NVIDIA Shield.
|
||||
Connect to Sunshine from any Moonlight client, available for nearly any device imaginable.
|
||||
|
||||
These are the advantages of Sunshine over GeForce Experience.
|
||||
|
||||
- FOSS (Free and Open Source Software)
|
||||
- Multi-platform
|
||||
|
||||
- Linux
|
||||
- macOS
|
||||
- Windows
|
||||
|
||||
- Pair over web ui
|
||||
- Supports AMD, Intel, and Nvidia GPUs for encoding
|
||||
- Supports software encoding
|
||||
- Supports streaming to multiple clients
|
||||
- Web UI for configuration
|
||||
|
||||
Integrations
|
||||
------------
|
||||
|
||||
.. image:: https://img.shields.io/github/workflow/status/lizardbyte/sunshine/CI/master?label=CI%20build&logo=github&style=for-the-badge
|
||||
:alt: GitHub Workflow Status (CI)
|
||||
:target: https://github.com/LizardByte/Sunshine/actions/workflows/CI.yml?query=branch%3Amaster
|
||||
|
||||
.. image:: https://img.shields.io/github/workflow/status/lizardbyte/sunshine/localize/nightly?label=localize%20build&logo=github&style=for-the-badge
|
||||
:alt: GitHub Workflow Status (localize)
|
||||
:target: https://github.com/LizardByte/Sunshine/actions/workflows/localize.yml?query=branch%3Anightly
|
||||
|
||||
.. image:: https://img.shields.io/readthedocs/sunshinestream?label=Docs&style=for-the-badge&logo=readthedocs
|
||||
:alt: Read the Docs
|
||||
:target: http://sunshinestream.readthedocs.io/
|
||||
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=localized&style=for-the-badge&query=%24.progress..data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json&logo=crowdin
|
||||
:alt: CrowdIn
|
||||
:target: https://crowdin.com/project/sunshinestream
|
||||
|
||||
Support
|
||||
---------
|
||||
|
||||
Our support methods are listed in our
|
||||
`LizardByte Docs <https://lizardbyte.readthedocs.io/en/latest/about/support.html>`_.
|
||||
|
||||
Downloads
|
||||
---------
|
||||
|
||||
.. image:: https://img.shields.io/github/downloads/lizardbyte/sunshine/total?style=for-the-badge&logo=github
|
||||
:alt: GitHub Releases
|
||||
:target: https://github.com/LizardByte/Sunshine/releases/latest
|
||||
|
||||
.. image:: https://img.shields.io/docker/pulls/lizardbyte/sunshine?style=for-the-badge&logo=docker
|
||||
:alt: Docker
|
||||
:target: https://hub.docker.com/r/lizardbyte/sunshine
|
||||
|
||||
Stats
|
||||
------
|
||||
.. image:: https://img.shields.io/github/stars/lizardbyte/sunshine?logo=github&style=for-the-badge
|
||||
:alt: GitHub stars
|
||||
:target: https://github.com/LizardByte/Sunshine
|
||||
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=AUR&style=for-the-badge&query=$.results.0.NumVotes&url=https%3A%2F%2Fapp.lizardbyte.dev%2Funo%2Faur%2Fsunshine.json&logo=archlinux
|
||||
:alt: AUR votes
|
||||
:target: https://aur.archlinux.org/packages/sunshine
|
||||
44
appveyor.yml
44
appveyor.yml
@@ -1,44 +0,0 @@
|
||||
services:
|
||||
- docker
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
|
||||
DOCKERFILE: Dockerfile-ubuntu_20_04
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
|
||||
DOCKERFILE: Dockerfile-ubuntu_21_04
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
|
||||
DOCKERFILE: Dockerfile-debian
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
BUILD_TYPE: Release
|
||||
|
||||
install:
|
||||
- cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make"
|
||||
|
||||
before_build:
|
||||
- cmd: git submodule update --init --recursive
|
||||
- cmd: mkdir build
|
||||
- cmd: cd build
|
||||
- sh: cd scripts
|
||||
- sh: ./build-container.sh -f $DOCKERFILE
|
||||
|
||||
build_script:
|
||||
- cmd: set OLDPATH=%PATH%
|
||||
- cmd: set PATH=C:\msys64\mingw64\bin
|
||||
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" ..
|
||||
- cmd: mingw32-make -j2
|
||||
- cmd: set PATH=%OLDPATH%
|
||||
- sh: ./build-sunshine.sh -pu
|
||||
|
||||
after_build:
|
||||
- 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: 7z a Sunshine-Windows.zip tools\sunshinesvc.exe
|
||||
- cmd: 7z a Sunshine-Windows.zip ..\tools\install-service.bat
|
||||
- cmd: 7z a Sunshine-Windows.zip ..\tools\uninstall-service.bat
|
||||
- cmd: appveyor PushArtifact Sunshine-Windows.zip
|
||||
- sh: appveyor PushArtifact sunshine-build/sunshine.deb
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"env":{
|
||||
"PATH":"$(PATH):$(HOME)/.local/bin"
|
||||
},
|
||||
"apps":[
|
||||
{
|
||||
"name":"Low Res Desktop",
|
||||
"prep-cmd":[
|
||||
{ "do":"xrandr --output HDMI-1 --mode 1920x1080", "undo":"xrandr --output HDMI-1 --mode 1920x1200" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name":"Steam BigPicture",
|
||||
|
||||
"output":"steam.txt",
|
||||
"detached":["setsid steam steam://open/bigpicture"],
|
||||
"image-path":"./assets/steam.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"env":{
|
||||
"PATH":"$(PATH);C:\\Program Files (x86)\\Steam"
|
||||
},
|
||||
"apps":[
|
||||
{
|
||||
"name":"Steam BigPicture",
|
||||
|
||||
"output":"steam.txt",
|
||||
"detached":["steam steam://open/bigpicture"],
|
||||
"image-path":"./assets/steam.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
# If no external IP address is given, Sunshine will attempt to automatically detect external ip-address
|
||||
# external_ip = 123.456.789.12
|
||||
|
||||
# Set the familly of ports used by Sunshine
|
||||
# port = 47989
|
||||
|
||||
# The private key must be 2048 bits
|
||||
# pkey = /dir/pkey.pem
|
||||
|
||||
# The certificate must be signed with a 2048 bit key
|
||||
# cert = /dir/cert.pem
|
||||
|
||||
# The name displayed by Moonlight
|
||||
# If not specified, the PC's hostname is used
|
||||
# sunshine_name = Sunshine
|
||||
|
||||
# The minimum log level printed to standard out
|
||||
#
|
||||
# none -> no logs are printed to standard out
|
||||
#
|
||||
# verbose = [0]
|
||||
# debug = [1]
|
||||
# info = [2]
|
||||
# warning = [3]
|
||||
# error = [4]
|
||||
# fatal = [5]
|
||||
# none = [6]
|
||||
#
|
||||
# min_log_level = info
|
||||
|
||||
# The origin of the remote endpoint address that is not denied for HTTP method /pin
|
||||
# Could be any of the following values:
|
||||
# pc|lan|wan
|
||||
# pc: Only localhost may access /pin
|
||||
# lan: Only those in LAN may access /pin
|
||||
# wan: Anyone may access /pin
|
||||
#
|
||||
# origin_pin_allowed = pc
|
||||
|
||||
# The origin of the remote endpoint address that is not denied for HTTPS Web UI
|
||||
# Could be any of the following values:
|
||||
# pc|lan|wan
|
||||
# pc: Only localhost may access the Web Manager
|
||||
# lan: Only those in LAN may access the Web Manager
|
||||
# wan: Anyone may access the Web Manager
|
||||
#
|
||||
# origin_web_ui_allowed = lan
|
||||
|
||||
# If UPnP is enabled, Sunshine will attempt to open ports for streaming over the internet
|
||||
# To enable it, uncomment the following line:
|
||||
# upnp = on
|
||||
|
||||
# The file where current state of Sunshine is stored
|
||||
# file_state = sunshine_state.json
|
||||
|
||||
# The file where user credentials for the UI are stored
|
||||
# By default, credentials are stored in `file_state`
|
||||
# credentials_file = sunshine_state.json
|
||||
|
||||
# The display modes advertised by Sunshine
|
||||
#
|
||||
# Some versions of Moonlight, such as Moonlight-nx (Switch),
|
||||
# rely on this list to ensure that the requested resolutions and fps
|
||||
# are supported.
|
||||
#
|
||||
# fps = [10, 30, 60, 90, 120]
|
||||
# resolutions = [
|
||||
# 352x240,
|
||||
# 480x360,
|
||||
# 858x480,
|
||||
# 1280x720,
|
||||
# 1920x1080,
|
||||
# 2560x1080,
|
||||
# 3440x1440,
|
||||
# 1920x1200,
|
||||
# 3860x2160,
|
||||
# 3840x1600,
|
||||
# ]
|
||||
|
||||
# Sometimes it may be usefull to map keybindings.
|
||||
# Wayland won't allow clients to capture the Win Key for example
|
||||
#
|
||||
# See https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
|
||||
#
|
||||
# Note:
|
||||
# keybindings needs to have a multiple of two elements
|
||||
# keybindings = [
|
||||
# 0x10, 0xA0,
|
||||
# 0x11, 0xA2,
|
||||
# 0x12, 0xA4,
|
||||
# 0x4A, 0x4B
|
||||
# ]
|
||||
|
||||
# It may be possible that you cannot send the Windows Key from Moonlight directly.
|
||||
# In those cases it may be useful to make Sunshine think the Right Alt key is the Windows key
|
||||
# key_rightalt_to_key_win = enabled
|
||||
|
||||
# How long to wait in milliseconds for data from moonlight before shutting down the stream
|
||||
# ping_timeout = 10000
|
||||
|
||||
# The file where configuration for the different applications that Sunshine can run during a stream
|
||||
# file_apps = apps.json
|
||||
|
||||
# Percentage of error correcting packets per data packet in each video frame
|
||||
# Higher values can correct for more network packet loss, but at the cost of increasing bandwidth usage
|
||||
# The default value of 20 is what GeForce Experience uses
|
||||
#
|
||||
# The value must be greater than 0 and lower than or equal to 255
|
||||
# fec_percentage = 20
|
||||
|
||||
# When multicasting, it could be usefull to have different configurations for each connected Client.
|
||||
# For example:
|
||||
# Clients connected through WAN and LAN have different bitrate contstraints.
|
||||
# Decoders may require different settings for color
|
||||
#
|
||||
# Unlike simply broadcasting to multiple Client, this will generate distinct video streams.
|
||||
# Note, CPU usage increases for each distinct video stream generated
|
||||
# channels = 1
|
||||
|
||||
# The back/select button on the controller
|
||||
# On the Shield, the home and powerbutton are not passed to Moonlight
|
||||
# If, after the timeout, the back button is still pressed down, Home/Guide button press is emulated.
|
||||
# If back_button_timeout < 0, then the Home/Guide button will not be emulated
|
||||
# back_button_timeout = 2000
|
||||
|
||||
# !! Windows only !!
|
||||
# Gamepads supported by Sunshine
|
||||
# Possible values:
|
||||
# x360 -- xbox 360 controller
|
||||
# ds4 -- dualshock controller (PS4)
|
||||
# gamepad = x360
|
||||
|
||||
# Control how fast keys will repeat themselves
|
||||
# The initial delay in milliseconds before repeating keys
|
||||
# key_repeat_delay = 500
|
||||
#
|
||||
# How often keys repeat every second
|
||||
# This configurable option supports decimals
|
||||
# key_repeat_frequency = 24.9
|
||||
|
||||
# The name of the audio sink used for Audio Loopback
|
||||
# If you do not specify this variable, pulseaudio will select the default monitor device.
|
||||
#
|
||||
# You can find the name of the audio sink using the following command:
|
||||
# !! Linux only !!
|
||||
# pacmd list-sinks | grep "name:" if running vanilla pulseaudio
|
||||
# pPipewire: Use `pactl info | grep Source`. In some causes you'd need to use the `sink` device. Try `pactl info | grep Sink`, if _Source_ doesn't work
|
||||
# audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo
|
||||
#
|
||||
# !! Windows only !!
|
||||
# tools\audio-info.exe
|
||||
# audio_sink = {0.0.0.00000000}.{FD47D9CC-4218-4135-9CE2-0C195C87405B}
|
||||
#
|
||||
# The virtual sink, is the audio device that's virtual (Like Steam Streaming Speakers), it allows Sunshine
|
||||
# to stream audio, while muting the speakers.
|
||||
# virtual_sink = {0.0.0.00000000}.{8edba70c-1125-467c-b89c-15da389bc1d4}
|
||||
|
||||
# !! Windows only !!
|
||||
# You can select the video card you want to stream:
|
||||
# The appropriate values can be found using the following command:
|
||||
# tools\dxgi-info.exe
|
||||
# adapter_name = Radeon RX 580 Series
|
||||
# output_name = \\.\DISPLAY1
|
||||
|
||||
# !! Linux only !!
|
||||
# Set the display number to stream.
|
||||
# You can find them by the following command:
|
||||
# xrandr --listmonitors
|
||||
# Example output: "0: +HDMI-1 1920/518x1200/324+0+0 HDMI-1"
|
||||
# ^ <-- You need this.
|
||||
# output_name = 0
|
||||
|
||||
###############################################
|
||||
# FFmpeg software encoding parameters
|
||||
# Honestly, I have no idea what the optimal values would be.
|
||||
# Play around with this :)
|
||||
|
||||
# Quantitization Parameter
|
||||
# Some devices don't support Constant Bit Rate. For those devices, QP is used instead
|
||||
# Higher value means more compression, but less quality
|
||||
# qp = 28
|
||||
|
||||
# Minimum number of threads used by ffmpeg to encode the video.
|
||||
# Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually
|
||||
# worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest
|
||||
# value that can reliably encode at your desired streaming settings on your hardware.
|
||||
# min_threads = 1
|
||||
|
||||
# Allows the client to request HEVC Main or HEVC Main10 video streams.
|
||||
# HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software encoding.
|
||||
# If set to 0 (default), Sunshine will specify support for HEVC based on encoder
|
||||
# If set to 1, Sunshine will not advertise support for HEVC
|
||||
# If set to 2, Sunshine will advertise support for HEVC Main profile
|
||||
# If set to 3, Sunshine will advertise support for HEVC Main and Main10 (HDR) profiles
|
||||
# hevc_mode = 2
|
||||
|
||||
# Force a specific encoder, otherwise Sunshine will use the first encoder that is available
|
||||
# supported encoders:
|
||||
# nvenc
|
||||
# amdvce # NOTE: alpha stage. The cursor is not yet displayed
|
||||
# software
|
||||
#
|
||||
# encoder = nvenc
|
||||
##################################### Software #####################################
|
||||
# See x264 --fullhelp for the different presets
|
||||
# sw_preset = superfast
|
||||
# sw_tune = zerolatency
|
||||
#
|
||||
|
||||
##################################### NVENC #####################################
|
||||
###### presets ###########
|
||||
# default
|
||||
# hp -- high performance
|
||||
# hq -- high quality
|
||||
# slow -- hq 2 passes
|
||||
# medium -- hq 1 pass
|
||||
# fast -- hp 1 pass
|
||||
# bd
|
||||
# ll -- low latency
|
||||
# llhq
|
||||
# llhp
|
||||
# lossless
|
||||
# losslesshp
|
||||
##########################
|
||||
# nv_preset = llhq
|
||||
#
|
||||
####### rate control #####
|
||||
# auto -- let ffmpeg decide rate control
|
||||
# constqp -- constant QP mode
|
||||
# vbr -- variable bitrate
|
||||
# cbr -- constant bitrate
|
||||
# cbr_hq -- cbr high quality
|
||||
# cbr_ld_hq -- cbr low delay high quality
|
||||
# vbr_hq -- vbr high quality
|
||||
##########################
|
||||
# nv_rc = auto
|
||||
|
||||
###### h264 entropy ######
|
||||
# auto -- let ffmpeg nvenc decide the entropy encoding
|
||||
# cabac
|
||||
# cavlc
|
||||
##########################
|
||||
# nv_coder = auto
|
||||
|
||||
##################################### AMD #####################################
|
||||
###### presets ###########
|
||||
# default
|
||||
# speed
|
||||
# balanced
|
||||
##########################
|
||||
# amd_quality = balanced
|
||||
#
|
||||
####### rate control #####
|
||||
# auto -- let ffmpeg decide rate control
|
||||
# constqp -- constant QP mode
|
||||
# vbr_latency -- Latency Constrained Variable Bitrate
|
||||
# vbr_peak -- Peak Contrained Variable Bitrate
|
||||
# cbr -- constant bitrate
|
||||
##########################
|
||||
# amd_rc = auto
|
||||
|
||||
###### h264 entropy ######
|
||||
# auto -- let ffmpeg nvenc decide the entropy encoding
|
||||
# cabac
|
||||
# cavlc
|
||||
##########################
|
||||
# amd_coder = auto
|
||||
|
||||
#################################### VAAPI ###################################
|
||||
####### adapter ##########
|
||||
# Unlike with `amdvce` and `nvenc`, it doesn't matter if video encoding is done
|
||||
# on a different GPU.
|
||||
# Run the following commands:
|
||||
# 1. ls /dev/dri/renderD*
|
||||
# to find all devices capable of VAAPI
|
||||
# 2. vainfo --display drm --device /dev/dri/renderD129 | grep -E "((VAProfileH264High|VAProfileHEVCMain|VAProfileHEVCMain10).*VAEntrypointEncSlice)|Driver version"
|
||||
# Lists the name and capabilities of the device.
|
||||
# To be supported by Sunshine, it needs to have at the very minimum:
|
||||
# VAProfileH264High : VAEntrypointEncSlice
|
||||
# adapter_name = /dev/dri/renderD128
|
||||
|
||||
##############################################
|
||||
# Some configurable parameters, are merely toggles for specific features
|
||||
# The first occurrence turns it on, the second occurence turns it off, the third occurence turns it on again, etc, etc
|
||||
# Here, you change the default state of any flag
|
||||
#
|
||||
# To set the initial state of flags -0 and -1 to on, set the following flags:
|
||||
# flags = 012
|
||||
#
|
||||
# See: sunshine --help for all options under the header: flags
|
||||
@@ -1,30 +0,0 @@
|
||||
<div id="content" class="container">
|
||||
<h1 class="my-4">Hello, Sunshine!</h1>
|
||||
<p>Sunshine is a Gamestream host for Moonlight</p>
|
||||
<!--Resources-->
|
||||
<div class="card p-2 my-4">
|
||||
<div class="card-body">
|
||||
<h2>Resources</h2>
|
||||
<br />
|
||||
<p>
|
||||
Resources for Sunshine!
|
||||
</p>
|
||||
<a class="btn btn-primary" href="https://sunshinestream.github.io" target="_blank">Official Website</a>
|
||||
<a class="btn btn-warning" href="https://github.com/SunshineStream/Sunshine/discussions" target="_blank"><i class="fab fa-fw fa-github"></i> Github Discussions</a>
|
||||
<a class="btn btn-warning" href="https://sunshinestream.github.io/discord" target="_blank"><i class="fas fa-fw fa-sun"></i><i class="fab fa-fw fa-discord"></i> Sunshine Discord</a>
|
||||
<a class="btn btn-warning" href="https://moonlight-stream.org/discord" target="_blank"><i class="fas fa-fw fa-moon"></i><i class="fab fa-fw fa-discord"></i> Moonlight Discord</a>
|
||||
</div>
|
||||
</div>
|
||||
<!--Legal-->
|
||||
<div class="card p-2 my-4">
|
||||
<div class="card-body">
|
||||
<h2>Legal</h2>
|
||||
<br />
|
||||
<p>
|
||||
By continuing to use this software you agree to the terms and conditions in the following documents.
|
||||
</p>
|
||||
<a class="btn btn-danger" href="https://github.com/SunshineStream/Sunshine/blob/master/LICENSE" target="_blank"><i class="fas fa-fw fa-file-alt"></i> License</a>
|
||||
<a class="btn btn-danger" href="https://github.com/SunshineStream/Sunshine/blob/master/NOTICE" target="_blank"><i class="fas fa-fw fa-exclamation"></i> Third Party Notice</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
22
crowdin.yml
Normal file
22
crowdin.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
"base_path": "."
|
||||
"base_url": "https://api.crowdin.com" # optional (for Crowdin Enterprise only)
|
||||
"preserve_hierarchy": false # flatten tree on crowdin
|
||||
"pull_request_labels": [
|
||||
"crowdin",
|
||||
"l10n"
|
||||
]
|
||||
|
||||
"files": [
|
||||
{
|
||||
"source": "/locale/*.po",
|
||||
"translation": "/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%",
|
||||
"languages_mapping": {
|
||||
"two_letters_code": {
|
||||
# map non-two letter codes here, left side is crowdin designation, right side is babel designation
|
||||
"en-GB": "en_GB",
|
||||
"en-US": "en_US"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
20
docs/Makefile
Normal file
20
docs/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = source
|
||||
BUILDDIR = build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
35
docs/make.bat
Normal file
35
docs/make.bat
Normal file
@@ -0,0 +1,35 @@
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set SOURCEDIR=source
|
||||
set BUILDDIR=build
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.https://www.sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
|
||||
:end
|
||||
popd
|
||||
4
docs/requirements.txt
Normal file
4
docs/requirements.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
furo==2022.9.29
|
||||
m2r2==0.3.3
|
||||
Sphinx==5.3.0
|
||||
sphinx-copybutton==0.5.0
|
||||
1125
docs/source/about/advanced_usage.rst
Normal file
1125
docs/source/about/advanced_usage.rst
Normal file
File diff suppressed because it is too large
Load Diff
3
docs/source/about/docker.rst
Normal file
3
docs/source/about/docker.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/DOCKER_README.md
|
||||
|
||||
.. mdinclude:: ../../../DOCKER_README.md
|
||||
231
docs/source/about/installation.rst
Normal file
231
docs/source/about/installation.rst
Normal file
@@ -0,0 +1,231 @@
|
||||
Installation
|
||||
============
|
||||
The recommended method for running Sunshine is to use the `binaries`_ bundled with the `latest release`_.
|
||||
|
||||
.. Attention:: Additional setup is required after installation. See
|
||||
:ref:`Setup <about/usage:setup>`.
|
||||
|
||||
Binaries
|
||||
--------
|
||||
Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows.
|
||||
Binaries can be found in the `latest release`_.
|
||||
|
||||
.. Tip:: Some third party packages also exist. See
|
||||
:ref:`Third Party Packages <about/third_party_packages:third party packages>`.
|
||||
|
||||
Docker
|
||||
------
|
||||
Docker images are available on `Dockerhub.io`_ and `ghcr.io`_.
|
||||
|
||||
See :ref:`Docker <about/docker:docker>` for additional information.
|
||||
|
||||
Linux
|
||||
-----
|
||||
First, follow the instructions for your preferred package type below.
|
||||
|
||||
Then start sunshine with the following command, unless a start command is listed in the specified package.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sunshine
|
||||
|
||||
AppImage
|
||||
^^^^^^^^
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:appimage?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
According to AppImageLint the supported distro matrix of the AppImage is below.
|
||||
|
||||
- [✖] Debian oldstable (buster)
|
||||
- [✔] Debian stable (bullseye)
|
||||
- [✔] Debian testing (bookworm)
|
||||
- [✔] Debian unstable (sid)
|
||||
- [✔] Ubuntu jammy
|
||||
- [✔] Ubuntu impish
|
||||
- [✔] Ubuntu focal
|
||||
- [✖] Ubuntu bionic
|
||||
- [✖] Ubuntu xenial
|
||||
- [✖] Ubuntu trusty
|
||||
- [✖] CentOS 7
|
||||
|
||||
#. Download ``sunshine-appimage.zip`` and extract the contents to your home directory.
|
||||
#. Open terminal and run the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./sunshine.AppImage --install
|
||||
|
||||
Start:
|
||||
.. code-block:: bash
|
||||
|
||||
./sunshine.AppImage --install && ./sunshine.AppImage
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
./sunshine.AppImage --remove
|
||||
|
||||
AUR Package
|
||||
^^^^^^^^^^^
|
||||
#. Open terminal and run the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git clone https://aur.archlinux.org/sunshine.git
|
||||
cd sunshine
|
||||
makepkg -fi
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
pacman -R sunshine
|
||||
|
||||
Debian Package
|
||||
^^^^^^^^^^^^^^
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:deb?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
#. Download ``sunshine.deb`` and run the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt install -f ./sunshine.deb
|
||||
|
||||
.. Tip:: You can double click the deb file to see details about the package and begin installation.
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt remove sunshine
|
||||
|
||||
Flatpak Package
|
||||
^^^^^^^^^^^^^^^
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:flatpak?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
#. Install `Flatpak <https://flatpak.org/setup/>`_ as required.
|
||||
#. Download ``sunshine.flatpak`` and run the following code.
|
||||
|
||||
System level (recommended)
|
||||
.. code-block:: bash
|
||||
|
||||
flatpak install --system sunshine.flatpak
|
||||
|
||||
User level
|
||||
.. code-block:: bash
|
||||
|
||||
flatpak install --user sunshine.flatpak
|
||||
|
||||
Start:
|
||||
X11 and NVFBC capture (X11 Only)
|
||||
.. code-block:: bash
|
||||
|
||||
flatpak run dev.lizardbyte.sunshine
|
||||
|
||||
KMS capture (Wayland & X11)
|
||||
.. code-block:: bash
|
||||
|
||||
sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.sunshine
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
flatpak uninstall --delete-data sunshine.flatpak
|
||||
|
||||
RPM Package
|
||||
^^^^^^^^^^^
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/pkg:rpm?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
#. Add `rpmfusion` repositories by running the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
|
||||
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
|
||||
#. Download ``sunshine.rpm`` and run the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf install ./sunshine.rpm
|
||||
|
||||
.. Tip:: You can double click the rpm file to see details about the package and begin installation.
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf remove sunshine
|
||||
|
||||
macOS
|
||||
-----
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:macos?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
pkg
|
||||
^^^
|
||||
.. Warning:: The `pkg` does not include runtime dependencies and should be considered experimental.
|
||||
|
||||
#. Download the ``sunshine.pkg`` file and install it as normal.
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
cd /etc/sunshine/assets
|
||||
uninstall_pkg.sh
|
||||
|
||||
Portfile
|
||||
^^^^^^^^
|
||||
#. Install `MacPorts <https://www.macports.org>`_
|
||||
#. Update the Macports sources.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo nano /opt/local/etc/macports/sources.conf
|
||||
|
||||
Add this line, replacing your username, below the line that starts with ``rsync``.
|
||||
``file:///Users/<username>/ports``
|
||||
|
||||
``Ctrl+x``, then ``Y`` to exit and save changes.
|
||||
|
||||
#. Download the ``Portfile`` to ``~/Downloads`` and run the following code.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mkdir -p ~/ports/multimedia/sunshine
|
||||
mv ~/Downloads/Portfile ~/ports/multimedia/sunshine/
|
||||
cd ~/ports
|
||||
portindex
|
||||
sudo port install sunshine
|
||||
|
||||
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
|
||||
|
||||
Uninstall:
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port uninstall sunshine
|
||||
|
||||
Windows
|
||||
-------
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:10?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
.. image:: https://img.shields.io/github/issues/lizardbyte/sunshine/os:windows:11?logo=github&style=for-the-badge
|
||||
:alt: GitHub issues by-label
|
||||
|
||||
Installer
|
||||
^^^^^^^^^
|
||||
#. Download and install ``sunshine-windows.exe``
|
||||
|
||||
To uninstall, find Sunshine in the list `here <ms-settings:installed-apps>`_ and select "Uninstall" from the overflow
|
||||
menu. Different versions of Windows may provide slightly different steps for uninstall.
|
||||
|
||||
Standalone
|
||||
^^^^^^^^^^
|
||||
#. Download and extract ``sunshine-windows.zip``
|
||||
|
||||
To uninstall, delete the extracted directory which contains the ``sunshine.exe`` file.
|
||||
|
||||
.. _latest release: https://github.com/LizardByte/Sunshine/releases/latest
|
||||
.. _Dockerhub.io: https://hub.docker.com/repository/docker/lizardbyte/sunshine
|
||||
.. _ghcr.io: https://github.com/orgs/LizardByte/packages?repo_name=sunshine
|
||||
1
docs/source/about/overview.rst
Normal file
1
docs/source/about/overview.rst
Normal file
@@ -0,0 +1 @@
|
||||
.. include:: ../../../README.rst
|
||||
57
docs/source/about/third_party_packages.rst
Normal file
57
docs/source/about/third_party_packages.rst
Normal file
@@ -0,0 +1,57 @@
|
||||
Third Party Packages
|
||||
====================
|
||||
|
||||
.. Danger:: These packages are not maintained by LizardByte. Use at your own risk.
|
||||
|
||||
Chocolatey
|
||||
----------
|
||||
|
||||
.. image:: https://img.shields.io/chocolatey/v/Sunshine?style=for-the-badge&logo=chocolatey
|
||||
:alt: Chocolatey Version
|
||||
:target: https://community.chocolatey.org/packages/sunshine
|
||||
|
||||
.. image:: https://img.shields.io/chocolatey/dt/sunshine?style=for-the-badge&logo=chocolatey
|
||||
:alt: Chocolatey
|
||||
|
||||
nixpkgs
|
||||
-------
|
||||
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=nixpkgs&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27nix_unstable%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=nixos
|
||||
:alt: nixpgs Version
|
||||
:target: https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/sunshine/default.nix
|
||||
|
||||
Scoop
|
||||
-----
|
||||
|
||||
.. image:: https://img.shields.io/scoop/v/sunshine?bucket=extras&style=for-the-badge
|
||||
:alt: Scoop Version (extras bucket)
|
||||
:target: https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine
|
||||
|
||||
Solus
|
||||
-----
|
||||
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Solus&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27solus%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=solus
|
||||
:alt: Solus Version
|
||||
:target: https://dev.getsol.us/source/sunshine
|
||||
|
||||
Winget
|
||||
------
|
||||
.. image:: https://img.shields.io/badge/dynamic/xml?color=orange&label=Winget&style=for-the-badge&prefix=v&query=%2F%2Ftr%5B%40id%3D%27winget%27%5D%2Ftd%5B3%5D%2Fspan%2Fa&url=https%3A%2F%2Frepology.org%2Fproject%2Fsunshine%2Fversions&logo=microsoft
|
||||
:alt: Winget Version
|
||||
:target: https://github.com/microsoft/winget-pkgs/tree/master/manifests/l/LizardByte/Sunshine
|
||||
|
||||
Legacy GitHub Repo
|
||||
------------------
|
||||
|
||||
.. Attention:: This repo is not maintained. Thank you to Loki for bringing this amazing project to life!
|
||||
|
||||
.. image:: https://img.shields.io/static/v1?label=repo&message=loki-47-6F-64/sunshine&color=blue&style=for-the-badge&logo=github
|
||||
:alt: GitHub Maintainer
|
||||
:target: https://github.com/loki-47-6F-64/sunshine/releases
|
||||
|
||||
.. image:: https://img.shields.io/github/last-commit/loki-47-6F-64/sunshine?style=for-the-badge&logo=github
|
||||
:alt: GitHub last commit
|
||||
|
||||
.. image:: https://img.shields.io/github/release-date/loki-47-6F-64/sunshine?style=for-the-badge&logo=github
|
||||
:alt: GitHub Release Date
|
||||
|
||||
.. image:: https://img.shields.io/github/downloads/loki-47-6F-64/sunshine/total?style=for-the-badge&logo=github
|
||||
:alt: GitHub Releases
|
||||
215
docs/source/about/usage.rst
Normal file
215
docs/source/about/usage.rst
Normal file
@@ -0,0 +1,215 @@
|
||||
Usage
|
||||
=====
|
||||
#. See the `setup`_ section for your specific OS.
|
||||
#. Run ``sunshine <directory of conf file>/sunshine.conf``.
|
||||
|
||||
.. Note:: You do not need to specify a config file. If no config file is entered the default location will be used.
|
||||
|
||||
.. Attention:: The configuration file specified will be created if it doesn't exist.
|
||||
|
||||
.. Tip:: If using the Linux AppImage, replace ``sunshine`` with ``./sunshine.AppImage``
|
||||
|
||||
#. Configure Sunshine in the web ui
|
||||
|
||||
The web ui is available on `https://localhost:47990 <https://localhost:47990>`_ by default. You may replace
|
||||
`localhost` with your internal ip address.
|
||||
|
||||
.. Attention:: Ignore any warning given by your browser about "insecure website".
|
||||
|
||||
.. Caution:: If running for the first time, make sure to note the username and password Sunshine showed to you,
|
||||
since you cannot get back later!
|
||||
|
||||
**Add games and applications.**
|
||||
This can be configured in the web ui.
|
||||
|
||||
.. Note:: Additionally, apps can be configured manually. `src_assets/<os>/config/apps.json` is an example of a
|
||||
list of applications that are started just before running a stream. This is the directory within the GitHub
|
||||
repo.
|
||||
|
||||
.. Attention:: Application list is not fully supported on macOS
|
||||
|
||||
#. In Moonlight, you may need to add the PC manually.
|
||||
#. When Moonlight request you insert the correct pin on sunshine:
|
||||
|
||||
- Login to the web ui
|
||||
- Go to "PIN" in the Navbar
|
||||
- Type in your PIN and press Enter, you should get a Success Message
|
||||
- In Moonlight, select one of the Applications listed
|
||||
|
||||
Network
|
||||
-------
|
||||
The Sunshine user interface will be available on port 47990 by default.
|
||||
|
||||
.. Warning:: Exposing ports to the internet can be dangerous. Do this at your own risk.
|
||||
|
||||
Arguments
|
||||
---------
|
||||
To get a list of available arguments run the following:
|
||||
.. code-block:: bash
|
||||
|
||||
sunshine --help
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
Linux
|
||||
^^^^^
|
||||
The `deb`, `rpm`, and `AppImage` packages handle these steps automatically. The flatpak does not, third party packages
|
||||
also may not.
|
||||
|
||||
Sunshine needs access to `uinput` to create mouse and gamepad events.
|
||||
|
||||
#. Add user to group `input`, if this is the first time installing.
|
||||
.. code-block:: bash
|
||||
|
||||
sudo usermod -a -G input $USER
|
||||
|
||||
#. Create `udev` rules.
|
||||
.. code-block::
|
||||
|
||||
echo 'KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"' | \
|
||||
sudo tee /etc/udev/rules.d/85-sunshine-input.rules
|
||||
|
||||
#. Optionally, configure autostart service
|
||||
|
||||
- filename: ``~/.config/systemd/user/sunshine.service``
|
||||
- contents:
|
||||
.. code-block::
|
||||
|
||||
[Unit]
|
||||
Description=Sunshine Gamestream Server for Moonlight
|
||||
|
||||
[Service]
|
||||
ExecStart=<see table>
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
.. table::
|
||||
:widths: auto
|
||||
|
||||
======== ============================================== ===============
|
||||
package ExecStart Auto Configured
|
||||
======== ============================================== ===============
|
||||
aur /usr/bin/sunshine ✔
|
||||
deb /usr/bin/sunshine ✔
|
||||
rpm /usr/bin/sunshine ✔
|
||||
AppImage ~/sunshine.AppImage ✔
|
||||
Flatpak flatpak run dev.lizardbyte.sunshine ✖
|
||||
======== ============================================== ===============
|
||||
|
||||
**Start once**
|
||||
.. code-block:: bash
|
||||
|
||||
systemctl --user start sunshine
|
||||
|
||||
**Start on boot**
|
||||
.. code-block:: bash
|
||||
|
||||
systemctl --user enable sunshine
|
||||
|
||||
#. Additional Setup for KMS
|
||||
.. Note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. It is necessary to
|
||||
allow Sunshine to use KMS.
|
||||
|
||||
**Enable**
|
||||
.. code-block:: bash
|
||||
|
||||
sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))
|
||||
|
||||
**Disable**
|
||||
.. code-block:: bash
|
||||
|
||||
sudo setcap -r $(readlink -f $(which sunshine))
|
||||
|
||||
#. Reboot
|
||||
.. code-block:: bash
|
||||
|
||||
sudo reboot now
|
||||
|
||||
macOS
|
||||
^^^^^
|
||||
Sunshine can only access microphones on macOS due to system limitations. To stream system audio use
|
||||
`Soundflower <https://github.com/mattingalls/Soundflower>`_ or
|
||||
`BlackHole <https://github.com/ExistentialAudio/BlackHole>`_ and
|
||||
select their sink as audio device in `sunshine.conf`.
|
||||
|
||||
.. Note:: Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key.
|
||||
|
||||
.. Caution:: Gamepads are not currently supported.
|
||||
|
||||
Configure autostart service
|
||||
**MacPorts**
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port load Sunshine
|
||||
|
||||
Windows
|
||||
^^^^^^^
|
||||
For gamepad support, install `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_
|
||||
|
||||
Shortcuts
|
||||
---------
|
||||
All shortcuts start with ``CTRL + ALT + SHIFT``, just like Moonlight
|
||||
|
||||
- ``CTRL + ALT + SHIFT + N`` - Hide/Unhide the cursor (This may be useful for Remote Desktop Mode for Moonlight)
|
||||
- ``CTRL + ALT + SHIFT + F1/F13`` - Switch to different monitor for Streaming
|
||||
|
||||
Application List
|
||||
----------------
|
||||
- Applications should be configured via the web UI.
|
||||
- A basic understanding of working directories and commands is recommended.
|
||||
- You can use Environment variables in place of values
|
||||
- ``$(HOME)`` will be replaced by the value of ``$HOME``
|
||||
- ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be become ``$(HOME)``
|
||||
- ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine
|
||||
- ``"Variable name":"Variable value"``
|
||||
- ``apps`` - The list of applications
|
||||
- Example application:
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"name":"An App",
|
||||
"cmd":"command to open app",
|
||||
"prep-cmd":[
|
||||
{
|
||||
"do":"some-command",
|
||||
"undo":"undo-that-command"
|
||||
}
|
||||
],
|
||||
"detached":[
|
||||
"some-command",
|
||||
"another-command"
|
||||
]
|
||||
}
|
||||
|
||||
- ``name`` - The name of the application/game
|
||||
- ``output`` - The file where the output of the command is stored
|
||||
- ``detached`` - A list of commands to be run and forgotten about
|
||||
- ``prep-cmd`` - A list of commands to be run before/after the application
|
||||
|
||||
- If any of the prep-commands fail, starting the application is aborted
|
||||
- ``do`` - Run before the application
|
||||
|
||||
- If it fails, all ``undo`` commands of the previously succeeded ``do`` commands are run
|
||||
|
||||
- ``undo`` - Run after the application has terminated
|
||||
|
||||
- This should not fail considering it is supposed to undo the ``do`` commands
|
||||
- If it fails, Sunshine is terminated
|
||||
|
||||
- ``cmd`` - The main application
|
||||
|
||||
- If not specified, a process is started that sleeps indefinitely
|
||||
|
||||
Considerations
|
||||
--------------
|
||||
- When an application is started, if there is an application already running, it will be terminated.
|
||||
- When the application has been shutdown, the stream shuts down as well.
|
||||
|
||||
- For example, if you attempt to run ``steam`` as a ``cmd`` instead of ``detached`` the stream will immediately fail.
|
||||
This is due to the method in which the steam process is executed. Other applications may behave similarly.
|
||||
|
||||
- In addition to the apps listed, one app "Desktop" is hardcoded into Sunshine. It does not start an application,
|
||||
instead it simply starts a stream.
|
||||
- For the Linux flatpak you must prepend commands with ``flatpak-spawn --host``.
|
||||
32
docs/source/building/build.rst
Normal file
32
docs/source/building/build.rst
Normal file
@@ -0,0 +1,32 @@
|
||||
Build
|
||||
=====
|
||||
Sunshine binaries are built using `CMake <https://cmake.org/>`_. Cross compilation is not
|
||||
supported. That means the binaries must be built on the target operating system and architecture.
|
||||
|
||||
Building Locally
|
||||
----------------
|
||||
|
||||
Clone
|
||||
^^^^^
|
||||
Ensure `git <https://git-scm.com/>`_ is installed and run the following:
|
||||
.. code-block:: bash
|
||||
|
||||
git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules
|
||||
cd sunshine && mkdir build && cd build
|
||||
|
||||
Compile
|
||||
^^^^^^^
|
||||
See the section specific to your OS.
|
||||
|
||||
- :ref:`Linux <building/linux:linux>`
|
||||
- :ref:`macOS <building/macos:macos>`
|
||||
- :ref:`Windows <building/windows:windows>`
|
||||
|
||||
Remote Build
|
||||
------------
|
||||
It may be beneficial to build remotely in some cases. This will enable easier building on different operating systems.
|
||||
|
||||
#. Fork the project
|
||||
#. Activate workflows
|
||||
#. Trigger the `CI` workflow manually
|
||||
#. Download the artifacts/binaries from the workflow run summary
|
||||
229
docs/source/building/linux.rst
Normal file
229
docs/source/building/linux.rst
Normal file
@@ -0,0 +1,229 @@
|
||||
Linux
|
||||
=====
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Debian Bullseye
|
||||
^^^^^^^^^^^^^^^
|
||||
End of Life: TBD
|
||||
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt update && sudo apt install \
|
||||
build-essential \
|
||||
cmake \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libboost-thread-dev \
|
||||
libcap-dev \ # KMS
|
||||
libdrm-dev \ # KMS
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \ # Wayland
|
||||
libx11-dev \ # X11
|
||||
libxcb-shm0-dev \ # X11
|
||||
libxcb-xfixes0-dev \ # X11
|
||||
libxcb1-dev \ # X11
|
||||
libxfixes-dev \ # X11
|
||||
libxrandr-dev \ # X11
|
||||
libxtst-dev \ # X11
|
||||
nvidia-cuda-dev \ # Cuda, NvFBC
|
||||
nvidia-cuda-toolkit \ # Cuda, NvFBC
|
||||
|
||||
Fedora 35
|
||||
^^^^^^^^^
|
||||
End of Life: TBD
|
||||
|
||||
Install Repositories
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf update && \
|
||||
sudo dnf group install "Development Tools" && \
|
||||
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo dnf install \
|
||||
boost-devel \
|
||||
boost-static.x86_64 \
|
||||
cmake \
|
||||
ffmpeg-devel \
|
||||
gcc-c++ \
|
||||
libevdev-devel \
|
||||
libX11-devel \ # X11
|
||||
libxcb-devel \ # X11
|
||||
libXcursor-devel \ # X11
|
||||
libXfixes-devel \ # X11
|
||||
libXinerama-devel \ # X11
|
||||
libXi-devel \ # X11
|
||||
libXrandr-devel \ # X11
|
||||
libXtst-devel \ # X11
|
||||
mesa-libGL-devel \
|
||||
openssl-devel \
|
||||
opus-devel \
|
||||
pulseaudio-libs-devel \
|
||||
rpm-build \ # if you want to build an RPM binary package
|
||||
|
||||
Ubuntu 18.04
|
||||
^^^^^^^^^^^^
|
||||
End of Life: April 2028
|
||||
|
||||
Install Repositories
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt update && sudo apt install \
|
||||
software-properties-common \
|
||||
&& add-apt-repository ppa:savoury1/graphics && \
|
||||
add-apt-repository ppa:savoury1/multimedia && \
|
||||
add-apt-repository ppa:savoury1/ffmpeg4 && \
|
||||
add-apt-repository ppa:savoury1/boost-defaults-1.71 && \
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test && \
|
||||
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt install \
|
||||
build-essential \
|
||||
cmake \
|
||||
gcc-10 \
|
||||
g++-10 \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem1.71-dev \
|
||||
libboost-log1.71-dev \
|
||||
libboost-regex1.71-dev \
|
||||
libboost-thread1.71-dev \
|
||||
libcap-dev \ # KMS
|
||||
libdrm-dev \ # KMS
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \ # Wayland
|
||||
libx11-dev \ # X11
|
||||
libxcb-shm0-dev \ # X11
|
||||
libxcb-xfixes0-dev \ # X11
|
||||
libxcb1-dev \ # X11
|
||||
libxfixes-dev \ # X11
|
||||
libxrandr-dev \ # X11
|
||||
libxtst-dev \ # X11
|
||||
wget \
|
||||
|
||||
Update gcc alias
|
||||
.. code-block:: bash
|
||||
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
|
||||
|
||||
Install CuDA
|
||||
.. code-block:: bash
|
||||
|
||||
wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O ./cuda.run && chmod a+x ./cuda.run
|
||||
./cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm ./cuda.run
|
||||
|
||||
Install CMake
|
||||
.. code-block:: bash
|
||||
|
||||
wget https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.sh
|
||||
mkdir /opt/cmake
|
||||
sh /cmake-3.22.2-linux-x86_64.sh --prefix=/opt/cmake --skip-license
|
||||
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
|
||||
cmake --version
|
||||
|
||||
Ubuntu 20.04
|
||||
^^^^^^^^^^^^
|
||||
End of Life: April 2030
|
||||
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt update && sudo apt install \
|
||||
build-essential \
|
||||
cmake \
|
||||
g++-10 \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libboost-thread-dev \
|
||||
libcap-dev \ # KMS
|
||||
libdrm-dev \ # KMS
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \ # Wayland
|
||||
libx11-dev \ # X11
|
||||
libxcb-shm0-dev \ # X11
|
||||
libxcb-xfixes0-dev \ # X11
|
||||
libxcb1-dev \ # X11
|
||||
libxfixes-dev \ # X11
|
||||
libxrandr-dev \ # X11
|
||||
libxtst-dev \ # X11
|
||||
wget \
|
||||
|
||||
Update gcc alias
|
||||
.. code-block:: bash
|
||||
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
|
||||
|
||||
Install CuDA
|
||||
.. code-block:: bash
|
||||
|
||||
wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O ./cuda.run && chmod a+x ./cuda.run
|
||||
./cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm ./cuda.run
|
||||
|
||||
Ubuntu 22.04
|
||||
^^^^^^^^^^^^
|
||||
End of Life: April 2027
|
||||
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt update && sudo apt install \
|
||||
build-essential \
|
||||
cmake \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libboost-thread-dev \
|
||||
libcap-dev \ # KMS
|
||||
libdrm-dev \ # KMS
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \ # Wayland
|
||||
libx11-dev \ # X11
|
||||
libxcb-shm0-dev \ # X11
|
||||
libxcb-xfixes0-dev \ # X11
|
||||
libxcb1-dev \ # X11
|
||||
libxfixes-dev \ # X11
|
||||
libxrandr-dev \ # X11
|
||||
libxtst-dev \ # X11
|
||||
nvidia-cuda-dev \ # Cuda, NvFBC
|
||||
nvidia-cuda-toolkit \ # Cuda, NvFBC
|
||||
|
||||
Build
|
||||
-----
|
||||
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
|
||||
|
||||
Debian based OSes
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10 ..
|
||||
|
||||
Red Hat based OSes
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
|
||||
|
||||
Finally
|
||||
.. code-block:: bash
|
||||
|
||||
make -j ${nproc}
|
||||
cpack -G DEB # optionally, create a deb package
|
||||
cpack -G RPM # optionally, create a rpm package
|
||||
40
docs/source/building/macos.rst
Normal file
40
docs/source/building/macos.rst
Normal file
@@ -0,0 +1,40 @@
|
||||
macOS
|
||||
=====
|
||||
|
||||
Requirements
|
||||
------------
|
||||
macOS Big Sur and Xcode 12.5+
|
||||
|
||||
Use either `MacPorts <https://www.macports.org>`_ or `Homebrew <https://brew.sh>`_
|
||||
|
||||
MacPorts
|
||||
""""""""
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
sudo port install cmake boost ffmpeg libopus
|
||||
|
||||
Homebrew
|
||||
""""""""
|
||||
Install Requirements
|
||||
.. code-block:: bash
|
||||
|
||||
brew install boost cmake ffmpeg opus
|
||||
# if there are issues with an SSL header that is not found:
|
||||
cd /usr/local/include
|
||||
ln -s ../opt/openssl/include/openssl .
|
||||
|
||||
Build
|
||||
-----
|
||||
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake ..
|
||||
make -j ${nproc}
|
||||
|
||||
cpack -G DragNDrop # optionally, create a macOS dmg package
|
||||
|
||||
If cmake fails complaining to find Boost, try to set the path explicitly.
|
||||
``cmake -DBOOST_ROOT=[boost path] ..``, e.g., ``cmake -DBOOST_ROOT=/opt/local/libexec/boost/1.76 ..``
|
||||
|
||||
27
docs/source/building/windows.rst
Normal file
27
docs/source/building/windows.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
Windows
|
||||
=======
|
||||
|
||||
Requirements
|
||||
------------
|
||||
First you need to install `MSYS2 <https://www.msys2.org>`_, then startup "MSYS2 MinGW 64-bit" and install the
|
||||
following packages using:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake \
|
||||
mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost \
|
||||
git mingw-w64-x86_64-make cmake make gcc
|
||||
|
||||
Build
|
||||
-----
|
||||
.. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cmake -G"Unix Makefiles" ..
|
||||
cmake -G"MinGW Makefiles" .. # alternatively
|
||||
|
||||
mingw32-make
|
||||
|
||||
cpack -G NSIS # optionally, create a windows installer
|
||||
cpack -G ZIP # optionally, create a windows standalone package
|
||||
85
docs/source/conf.py
Normal file
85
docs/source/conf.py
Normal file
@@ -0,0 +1,85 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# standard imports
|
||||
from datetime import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__)) # the directory of this file
|
||||
source_dir = os.path.dirname(script_dir) # the source folder directory
|
||||
root_dir = os.path.dirname(source_dir) # the root folder directory
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
project = 'Sunshine'
|
||||
copyright = f'{datetime.now ().year}, {project}'
|
||||
author = 'ReenigneArcher'
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
with open(os.path.join(root_dir, 'CMakeLists.txt'), 'r') as f:
|
||||
version = re.search(r"project\(Sunshine VERSION ((\d+)\.(\d+)\.(\d+))", str(f.read())).group(1)
|
||||
"""
|
||||
To use cmake method for obtaining version instead of regex,
|
||||
1. Within CMakeLists.txt add the following line without backticks:
|
||||
``configure_file(docs/source/conf.py.in "${CMAKE_CURRENT_SOURCE_DIR}/docs/source/conf.py" @ONLY)``
|
||||
2. Rename this file to ``conf.py.in``
|
||||
3. Uncomment the next line
|
||||
"""
|
||||
# version = '@PROJECT_VERSION@' # use this for cmake configure_file method
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'm2r2', # enable markdown files
|
||||
'sphinx.ext.autosectionlabel',
|
||||
'sphinx.ext.todo', # enable to-do sections
|
||||
'sphinx.ext.viewcode', # add links to view source code
|
||||
'sphinx_copybutton', # add a copy button to code blocks
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
# templates_path = ['_templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['toc.rst']
|
||||
|
||||
# Extensions to include.
|
||||
source_suffix = ['.rst', '.md']
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
# html_static_path = ['_static']
|
||||
|
||||
html_logo = os.path.join(root_dir, 'sunshine.png')
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'furo'
|
||||
|
||||
html_theme_options = {
|
||||
"top_of_page_button": "edit",
|
||||
"source_edit_link": "https://github.com/lizardbyte/sunshine/tree/nightly/docs/source/{filename}",
|
||||
}
|
||||
|
||||
# extension config options
|
||||
autosectionlabel_prefix_document = True # Make sure the target is unique
|
||||
todo_include_todos = True
|
||||
5
docs/source/contributing/contributing.rst
Normal file
5
docs/source/contributing/contributing.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
Contributing
|
||||
============
|
||||
|
||||
Read our contribution guide in our organization level
|
||||
`docs <https://lizardbyte.readthedocs.io/en/latest/developers/contributing.html>`_.
|
||||
81
docs/source/contributing/localization.rst
Normal file
81
docs/source/contributing/localization.rst
Normal file
@@ -0,0 +1,81 @@
|
||||
Localization
|
||||
============
|
||||
Sunshine is being localized into various languages. The default language is `en` (English) and is highlighted green.
|
||||
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=de&style=for-the-badge&query=%24.progress.0.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=green&label=en&style=for-the-badge&query=%24.progress.1.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-GB&style=for-the-badge&query=%24.progress.2.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=en-US&style=for-the-badge&query=%24.progress.3.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=es-ES&style=for-the-badge&query=%24.progress.4.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=fr&style=for-the-badge&query=%24.progress.5.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=it&style=for-the-badge&query=%24.progress.6.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
.. image:: https://img.shields.io/badge/dynamic/json?color=blue&label=ru&style=for-the-badge&query=%24.progress.7.data.translationProgress&url=https%3A%2F%2Fbadges.awesome-crowdin.com%2Fstats-15178612-503956.json
|
||||
|
||||
Graph
|
||||
.. image:: https://badges.awesome-crowdin.com/translation-15178612-503956.png
|
||||
|
||||
CrowdIn
|
||||
-------
|
||||
The translations occur on
|
||||
`CrowdIn <https://crowdin.com/project/sunshinestream>`_. Feel free to contribute to localization there.
|
||||
Only elements of the API are planned to be translated.
|
||||
|
||||
.. Attention:: The rest API has not yet been implemented.
|
||||
|
||||
**Translations Basics**
|
||||
- The brand names `LizardByte` and `Sunshine` should never be translated.
|
||||
- Other brand names should never be translated.
|
||||
Examples:
|
||||
|
||||
- AMD
|
||||
- Nvidia
|
||||
|
||||
**CrowdIn Integration**
|
||||
How does it work?
|
||||
|
||||
When a change is made to sunshine source code, a workflow generates new translation templates
|
||||
that get pushed to CrowdIn automatically.
|
||||
|
||||
When translations are updated on CrowdIn, a push gets made to the `l10n_nightly` branch and a PR is made against the
|
||||
`nightly` branch. Once PR is merged, all updated translations are part of the project and will be included in the
|
||||
next release.
|
||||
|
||||
Extraction
|
||||
----------
|
||||
There should be minimal cases where strings need to be extracted from source code; however it may be necessary in some
|
||||
situations. For example if a system tray icon is added it should be localized as it is user interfacing.
|
||||
|
||||
- Wrap the string to be extracted in a function as shown.
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <boost/locale.hpp>
|
||||
boost::locale::translate("Hello world!")
|
||||
|
||||
.. Tip:: More examples can be found in the documentation for
|
||||
`boost locale <https://www.boost.org/doc/libs/1_70_0/libs/locale/doc/html/messages_formatting.html>`_.
|
||||
|
||||
.. Warning:: This is for information only. Contributors should never include manually updated template files, or
|
||||
manually compiled language files in Pull Requests.
|
||||
|
||||
Strings are automatically extracted from the code to the `locale/sunshine.po` template file. The generated file is
|
||||
used by CrowdIn to generate language specific template files. The file is generated using the
|
||||
`.github/workflows/localize.yml` workflow and is run on any push event into the `nightly` branch. Jobs are only run if
|
||||
any of the following paths are modified.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
- 'src/**'
|
||||
|
||||
When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is
|
||||
required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally,
|
||||
`xgettext <https://www.gnu.org/software/gettext/>`_ must be installed.
|
||||
|
||||
**Extract, initialize, and update**
|
||||
.. code-block:: bash
|
||||
|
||||
python ./scripts/_locale.py --extract --init --update
|
||||
|
||||
**Compile**
|
||||
.. code-block:: bash
|
||||
|
||||
python ./scripts/_locale.py --compile
|
||||
40
docs/source/contributing/testing.rst
Normal file
40
docs/source/contributing/testing.rst
Normal file
@@ -0,0 +1,40 @@
|
||||
Testing
|
||||
=======
|
||||
|
||||
Clang Format
|
||||
------------
|
||||
Source code is tested against the `.clang-format` file for linting errors. The workflow file responsible for clang
|
||||
format testing is `.github/workflows/cpp-clang-format-lint.yml`.
|
||||
|
||||
Test clang-format locally.
|
||||
.. Todo:: This documentation needs to be improved.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
clang-format ...
|
||||
|
||||
Sphinx
|
||||
------
|
||||
Sunshine uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_ for documentation building. Sphinx, along with other
|
||||
required documentation depencies are included in the `./docs/requirements.txt` file. Python is required to build
|
||||
sphinx docs. Installation and setup of python will not be covered here.
|
||||
|
||||
The config file for Sphinx is `docs/source/conf.py`. This is already included in the repo and should not be modified.
|
||||
|
||||
Test with Sphinx
|
||||
.. code-block:: bash
|
||||
|
||||
cd docs
|
||||
make html
|
||||
|
||||
Alternatively
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd docs
|
||||
sphinx-build -b html source build
|
||||
|
||||
Unit Testing
|
||||
------------
|
||||
.. Todo:: Sunshine does not currently have any unit tests. If you would like to help us improve please get in contact
|
||||
with us, or make a PR with suggested changes.
|
||||
5
docs/source/index.rst
Normal file
5
docs/source/index.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/source/index.rst
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
.. include:: toc.rst
|
||||
36
docs/source/toc.rst
Normal file
36
docs/source/toc.rst
Normal file
@@ -0,0 +1,36 @@
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: About
|
||||
|
||||
about/overview
|
||||
about/installation
|
||||
about/docker
|
||||
about/third_party_packages
|
||||
about/usage
|
||||
about/advanced_usage
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Troubleshooting
|
||||
|
||||
troubleshooting/general
|
||||
troubleshooting/linux
|
||||
troubleshooting/macos
|
||||
troubleshooting/windows
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Build
|
||||
|
||||
building/build
|
||||
building/linux
|
||||
building/macos
|
||||
building/windows
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contributing
|
||||
|
||||
contributing/contributing
|
||||
contributing/localization
|
||||
contributing/testing
|
||||
17
docs/source/troubleshooting/general.rst
Normal file
17
docs/source/troubleshooting/general.rst
Normal file
@@ -0,0 +1,17 @@
|
||||
General
|
||||
=======
|
||||
If you forgot your credentials to the web UI, try this.
|
||||
.. code-block:: bash
|
||||
|
||||
sunshine -creds <new username> <new password>
|
||||
|
||||
Can't access the web UI?
|
||||
#. Check firefall rules.
|
||||
|
||||
NvFBC, NvENC, or general issues with Nvidia graphics card.
|
||||
- Consumer grade Nvidia cards are software limited to a specific number of encodes. See
|
||||
`Video Encode and Decode GPU Support Matrix <https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new>`_
|
||||
for more info.
|
||||
- You can usually bypass the restriction with a driver patch. See Keylase's
|
||||
`Linux <https://github.com/keylase/nvidia-patch>`_
|
||||
or `Windows <https://github.com/keylase/nvidia-patch/blob/master/win>`_ patches for more guidance.
|
||||
6
docs/source/troubleshooting/linux.rst
Normal file
6
docs/source/troubleshooting/linux.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
Linux
|
||||
=====
|
||||
If screencasting fails with KMS, you may need to run the following to force unprivileged screencasting.
|
||||
.. code-block:: bash
|
||||
|
||||
sudo setcap -r $(readlink -f $(which sunshine))
|
||||
10
docs/source/troubleshooting/macos.rst
Normal file
10
docs/source/troubleshooting/macos.rst
Normal file
@@ -0,0 +1,10 @@
|
||||
macOS
|
||||
=====
|
||||
If you get this error:
|
||||
`Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that
|
||||
org.freedesktop.dbus-session.plist is loaded!`
|
||||
|
||||
Try this.
|
||||
.. code-block:: bash
|
||||
|
||||
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist
|
||||
4
docs/source/troubleshooting/windows.rst
Normal file
4
docs/source/troubleshooting/windows.rst
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows
|
||||
=======
|
||||
No gamepad is detected.
|
||||
#. Verify that you've installed `ViGEmBus <https://github.com/ViGEm/ViGEmBus/releases/latest>`_.
|
||||
BIN
gamepad.png
BIN
gamepad.png
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
123
gen-deb.in
123
gen-deb.in
@@ -1,123 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ ! "@SUNSHINE_UNDEFINED_VARIABLE@" = "" ]; then
|
||||
echo "Please run gen-deb generated by cmake inside the build directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d package-deb ]; then
|
||||
echo "package-deb already exists: It will be replaced"
|
||||
rm -rf package-deb
|
||||
fi
|
||||
|
||||
export DEBIAN=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/DEBIAN
|
||||
export RULES=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/udev/rules.d
|
||||
export BIN=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/bin
|
||||
export SERVICE=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/lib/systemd/user
|
||||
export ASSETS=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/sunshine
|
||||
|
||||
mkdir -p $DEBIAN
|
||||
mkdir -p $RULES
|
||||
mkdir -p $BIN
|
||||
mkdir -p $ASSETS/shaders
|
||||
mkdir -p $SERVICE
|
||||
|
||||
if [ ! -f sunshine ]; then
|
||||
echo "Error: Can't find sunshine"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat << 'EOF' > $DEBIAN/conffiles
|
||||
/etc/sunshine/sunshine.conf
|
||||
/etc/sunshine/apps_linux.json
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $DEBIAN/control
|
||||
Package: sunshine
|
||||
Architecture: amd64
|
||||
Maintainer: @loki
|
||||
Priority: optional
|
||||
Version: 0.12.0
|
||||
Depends: libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2
|
||||
Description: Gamestream host for Moonlight
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $DEBIAN/preinst
|
||||
#Store backup for old config files to prevent it from being overwritten
|
||||
if [ -f /etc/sunshine/sunshine.conf ]; then
|
||||
cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old
|
||||
fi
|
||||
|
||||
if [ -f /etc/sunshine/apps_linux.json ]; then
|
||||
cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $DEBIAN/postinst
|
||||
#!/bin/sh
|
||||
|
||||
export GROUP_INPUT=input
|
||||
|
||||
if [ -f /etc/group ]; then
|
||||
if ! grep -q $GROUP_INPUT /etc/group; then
|
||||
echo "Creating group $GROUP_INPUT"
|
||||
|
||||
groupadd $GROUP_INPUT
|
||||
fi
|
||||
else
|
||||
echo "Warning: /etc/group not found"
|
||||
fi
|
||||
|
||||
if [ -f /etc/sunshine/sunshine.conf.old ]; then
|
||||
echo "Restoring old sunshine.conf"
|
||||
mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf
|
||||
fi
|
||||
|
||||
if [ -f /etc/sunshine/apps_linux.json.old ]; then
|
||||
echo "Restoring old apps_linux.json"
|
||||
mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json
|
||||
fi
|
||||
|
||||
# Update permissions on config files for Web Manager
|
||||
if [ -f /etc/sunshine/apps_linux.json ]; then
|
||||
echo "chmod 666 /etc/sunshine/apps_linux.json"
|
||||
chmod 666 /etc/sunshine/apps_linux.json
|
||||
fi
|
||||
|
||||
if [ -f /etc/sunshine/sunshine.conf ]; then
|
||||
echo "chmod 666 /etc/sunshine/sunshine.conf"
|
||||
chmod 666 /etc/sunshine/sunshine.conf
|
||||
fi
|
||||
|
||||
# Ensure Sunshine can grab images from KMS
|
||||
path_to_setcap=$(which setcap)
|
||||
if [ -x "$path_to_setcap" ] ; then
|
||||
echo "$path_to_setcap cap_sys_admin+p /usr/bin/sunshine"
|
||||
$path_to_setcap cap_sys_admin+p /usr/bin/sunshine
|
||||
fi
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $RULES/85-sunshine-rules.rules
|
||||
KERNEL=="uinput", GROUP="input", MODE="0660"
|
||||
EOF
|
||||
|
||||
cp sunshine $BIN/sunshine
|
||||
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/apps_linux.json $ASSETS/apps_linux.json
|
||||
cp @CMAKE_CURRENT_SOURCE_DIR@/assets/sunshine.conf $ASSETS/sunshine.conf
|
||||
cp @CMAKE_CURRENT_BINARY_DIR@/sunshine.service $SERVICE/sunshine.service
|
||||
cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/web $ASSETS/web
|
||||
cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/shaders/opengl $ASSETS/shaders/opengl
|
||||
|
||||
chmod 755 $DEBIAN/postinst
|
||||
chmod 755 $DEBIAN/preinst
|
||||
chmod 755 $BIN/sunshine
|
||||
chmod 644 $RULES/85-sunshine-rules.rules
|
||||
chmod 666 $ASSETS/apps_linux.json
|
||||
chmod 666 $ASSETS/sunshine.conf
|
||||
|
||||
cd package-deb
|
||||
if fakeroot dpkg-deb --build sunshine; then
|
||||
echo "generated debian package: @CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine.deb"
|
||||
fi
|
||||
cd ..
|
||||
|
||||
110
packaging/linux/AppImage/AppRun
Normal file
110
packaging/linux/AppImage/AppRun
Normal file
@@ -0,0 +1,110 @@
|
||||
#!/bin/bash
|
||||
|
||||
# custom AppRun for Sunshine AppImage
|
||||
|
||||
# path of the extracted AppRun
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
SUNSHINE_PATH=/usr/bin/sunshine
|
||||
SUNSHINE_BIN_HERE=$HERE/usr/bin/sunshine
|
||||
SUNSHINE_SHARE_HERE=$HERE/usr/share/sunshine
|
||||
|
||||
# Set APPDIR when running directly from the AppDir:
|
||||
if [ -z "$APPDIR" ]; then
|
||||
ARGV0="AppRun"
|
||||
fi
|
||||
|
||||
cd "$HERE" || exit 1
|
||||
|
||||
function help() {
|
||||
echo "
|
||||
------------------------------
|
||||
Sunshine AppImage package.
|
||||
------------------------------
|
||||
|
||||
sunshine.AppImage options
|
||||
------------------------
|
||||
|
||||
Usage: $ARGV0 --help, -h
|
||||
------ # This message
|
||||
|
||||
$ARGV0 --install, -i
|
||||
# Install input rules sunshine.service files. Restart required.
|
||||
|
||||
$ARGV0 --remove, -r
|
||||
# Remove input rules sunshine.service files.
|
||||
|
||||
$ARGV0 --appimage-help
|
||||
# Show available AppImage options
|
||||
|
||||
sunshine options
|
||||
----------------
|
||||
"
|
||||
# print sunshine binary help, replacing the sunshine command in usage statement
|
||||
"$SUNSHINE_BIN_HERE" --help | sed -e "s#$SUNSHINE_BIN_HERE#$ARGV0#g"
|
||||
}
|
||||
|
||||
function install() {
|
||||
# user input rules
|
||||
sudo usermod -a -G input $USER
|
||||
# shellcheck disable=SC2002
|
||||
cat "$SUNSHINE_SHARE_HERE/udev/rules.d/85-sunshine.rules" | sudo tee /etc/udev/85-sunshine.rules
|
||||
|
||||
# sunshine service
|
||||
mkdir -p ~/.config/systemd/user
|
||||
cp -r "$SUNSHINE_SHARE_HERE/systemd/user/" ~/.config/systemd/
|
||||
# patch service executable path
|
||||
sed -i -e "s#$SUNSHINE_PATH#$(readlink -f $ARGV0)#g" ~/.config/systemd/user/sunshine.service
|
||||
|
||||
# setcap
|
||||
sudo setcap cap_sys_admin+p "$(readlink -f "$SUNSHINE_BIN_HERE")"
|
||||
|
||||
while true
|
||||
do
|
||||
read -r -p "This installation requires a reboot. Do you want to reboot NOW? [y/n] " input
|
||||
|
||||
case $input in
|
||||
[yY][eE][sS]|[yY])
|
||||
echo "Yes"
|
||||
sudo reboot now
|
||||
;;
|
||||
[nN][oO]|[nN])
|
||||
echo "No"
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid input..."
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
function remove() {
|
||||
# remove input rules
|
||||
sudo rm -f /etc/udev/rules.d/85-sunshine.rules
|
||||
|
||||
# remove service
|
||||
sudo rm -f ~/.config/systemd/user/sunshine.service
|
||||
}
|
||||
|
||||
# process arguments
|
||||
if [ "x$1" == "xhelp" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ] ; then
|
||||
help
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ "x$1" == "xinstall" ] || [ "x$1" == "x--install" ] || [ "x$1" == "x-i" ] ; then
|
||||
install
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ "x$1" == "xremove" ] || [ "x$1" == "x--remove" ] || [ "x$1" == "x-r" ] ; then
|
||||
remove
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# create config directory if it doesn't exist
|
||||
# https://github.com/LizardByte/Sunshine/issues/324
|
||||
mkdir -p ~/.config/sunshine
|
||||
|
||||
# run sunshine
|
||||
"$SUNSHINE_BIN_HERE" $@
|
||||
54
packaging/linux/aur/PKGBUILD
Normal file
54
packaging/linux/aur/PKGBUILD
Normal file
@@ -0,0 +1,54 @@
|
||||
# Edit on github: https://github.com/LizardByte/Sunshine/tree/nightly/packaging/linux/aur/PKGBUILD
|
||||
# Reference: https://wiki.archlinux.org/title/PKGBUILD
|
||||
|
||||
pkgname=@SUNSHINE_AUR_PKG@
|
||||
pkgver=@PROJECT_VERSION@@SUNSHINE_SUB_VERSION@
|
||||
pkgrel=1
|
||||
pkgdesc="@PROJECT_DESCRIPTION@"
|
||||
arch=('x86_64' 'i686')
|
||||
url=@PROJECT_HOMEPAGE_URL@
|
||||
license=('GPL3')
|
||||
|
||||
depends=('avahi' 'boost-libs' 'ffmpeg4.4' 'libevdev' 'libpulse' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev')
|
||||
makedepends=('boost' 'cmake' 'git' 'make')
|
||||
optdepends=('cuda' 'libcap' 'libdrm')
|
||||
|
||||
provides=(@SUNSHINE_AUR_PROVIDES@)
|
||||
conflicts=(@SUNSHINE_AUR_CONFLICTS@)
|
||||
|
||||
source=("$pkgname::git+@GITHUB_CLONE_URL@#commit=@GITHUB_COMMIT@")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
prepare() {
|
||||
cd "$pkgname"
|
||||
git submodule update --recursive --init
|
||||
}
|
||||
|
||||
build() {
|
||||
export CFLAGS="${CFLAGS/-Werror=format-security/}"
|
||||
export CXXFLAGS="${CXXFLAGS/-Werror=format-security/}"
|
||||
|
||||
cmake \
|
||||
-S "$pkgname" \
|
||||
-B build \
|
||||
-Wno-dev \
|
||||
-D CMAKE_INSTALL_PREFIX=/usr \
|
||||
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
|
||||
-D SUNSHINE_ASSETS_DIR="share/sunshine" \
|
||||
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
|
||||
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||
-D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \
|
||||
-D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||
-D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \
|
||||
-D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||
-D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \
|
||||
-D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
|
||||
-D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so
|
||||
|
||||
make -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
make -C build install DESTDIR="$pkgdir"
|
||||
}
|
||||
210
packaging/linux/flatpak/dev.lizardbyte.sunshine.yml
Normal file
210
packaging/linux/flatpak/dev.lizardbyte.sunshine.yml
Normal file
@@ -0,0 +1,210 @@
|
||||
---
|
||||
app-id: dev.lizardbyte.sunshine
|
||||
runtime: org.freedesktop.Platform
|
||||
runtime-version: "21.08"
|
||||
sdk: org.freedesktop.Sdk
|
||||
command: sunshine
|
||||
separate-locales: false
|
||||
finish-args:
|
||||
- --device=all # access all devices
|
||||
- --env=PULSE_PROP_media.category=Manager # allow sunshine to manage audio sinks
|
||||
- --filesystem=home # need to save files in user's home directory
|
||||
- --share=ipc # required for X11 shared memory extension
|
||||
- --share=network # access network
|
||||
- --socket=pulseaudio # play sounds using pulseaudio
|
||||
- --socket=wayland # show windows using Wayland
|
||||
- --socket=x11 # show windows using X11
|
||||
- --system-talk-name=org.freedesktop.Avahi # talk to avahi on the system bus
|
||||
- --talk-name=org.freedesktop.Flatpak # talk to flatpak on the session bus
|
||||
|
||||
cleanup:
|
||||
- /include
|
||||
- /lib/cmake
|
||||
- /lib/pkgconfig
|
||||
- /lib/*.la
|
||||
- /lib/*.a
|
||||
- /share/man
|
||||
|
||||
modules:
|
||||
- name: boost
|
||||
disabled: false
|
||||
buildsystem: simple
|
||||
build-commands:
|
||||
- cd tools/build && bison -y -d -o src/engine/jamgram.cpp src/engine/jamgram.y
|
||||
- ./bootstrap.sh --prefix=$FLATPAK_DEST --with-libraries=system,thread,log || cat bootstrap.log
|
||||
- ./b2 install variant=release link=static,shared runtime-link=shared cxxflags="$CXXFLAGS" linkflags="$LDFLAGS"
|
||||
-j $FLATPAK_BUILDER_N_JOBS
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/main/b/boost1.74/boost1.74_1.74.0.orig.tar.xz
|
||||
sha256: 2467be4af625b5ae4b3c93fc7af196a09eba39c11a7338cd9e8b356fa44d2f45
|
||||
|
||||
- name: ffmpeg
|
||||
disabled: false
|
||||
config-opts:
|
||||
- --enable-gpl
|
||||
- --disable-static
|
||||
- --enable-shared
|
||||
- --disable-doc
|
||||
- --disable-programs
|
||||
- --disable-decoders
|
||||
- --disable-vdpau
|
||||
- --disable-audiotoolbox
|
||||
- --disable-videotoolbox
|
||||
- --disable-vulkan
|
||||
- --disable-sdl2
|
||||
- --disable-filters
|
||||
- --disable-avfilter
|
||||
- --disable-postproc
|
||||
- --disable-autodetect
|
||||
- --enable-nvenc
|
||||
- --enable-ffnvcodec
|
||||
- --enable-vaapi
|
||||
- --enable-libx264
|
||||
- --enable-libx265
|
||||
cleanup:
|
||||
- /share
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/ffmpeg/ffmpeg_5.1.1.orig.tar.xz
|
||||
sha256: 95bf3ff8c496511e71e958fb249e663c8c9c3de583c5bebc0f5a9745abbc0435
|
||||
modules:
|
||||
- name: x264
|
||||
config-opts:
|
||||
- --disable-cli
|
||||
- --enable-shared
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/x264_0.164.3095+gitbaee400.orig.tar.gz
|
||||
sha256: 8b237e94b08c196a1da22f2f25875f10be4cff3648df4eeff21e00da8f683fc2
|
||||
|
||||
- name: x265
|
||||
disabled: false
|
||||
buildsystem: cmake-ninja
|
||||
builddir: true
|
||||
subdir: source
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
- -DENABLE_CLI=OFF
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/universe/x/x265/x265_3.5.orig.tar.gz
|
||||
sha256: e70a3335cacacbba0b3a20ec6fecd6783932288ebc8163ad74bcc9606477cae8
|
||||
|
||||
- name: nv-codec-headers
|
||||
no-autogen: true
|
||||
make-install-args:
|
||||
- PREFIX=${FLATPAK_DEST}
|
||||
cleanup:
|
||||
- '*'
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/universe/n/nv-codec-headers/nv-codec-headers_11.1.5.1.orig.tar.gz
|
||||
sha256: d095fbd56aa93772471a323be0ebe65504a0f43f06c76a30b6d25da77b06ae9c
|
||||
|
||||
- name: avahi
|
||||
disabled: false
|
||||
cleanup:
|
||||
- /bin
|
||||
- /lib/avahi
|
||||
- /share
|
||||
config-opts:
|
||||
- --with-distro=none
|
||||
- --disable-gobject
|
||||
- --disable-introspection
|
||||
- --disable-qt3
|
||||
- --disable-qt4
|
||||
- --disable-qt5
|
||||
- --disable-gtk
|
||||
- --disable-core-docs
|
||||
- --disable-manpages
|
||||
- --disable-libdaemon
|
||||
- --disable-python
|
||||
- --disable-pygobject
|
||||
- --disable-mono
|
||||
- --disable-monodoc
|
||||
- --disable-autoipd
|
||||
- --disable-doxygen-doc
|
||||
- --disable-doxygen-dot
|
||||
- --disable-doxygen-xml
|
||||
- --disable-doxygen-html
|
||||
- --disable-manpages
|
||||
- --disable-xmltoman
|
||||
- --disable-libevent
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/main/a/avahi/avahi_0.8.orig.tar.gz
|
||||
sha256: 060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda
|
||||
|
||||
- name: libevdev
|
||||
disabled: false
|
||||
buildsystem: meson
|
||||
config-opts:
|
||||
- -Ddocumentation=disabled
|
||||
- -Dtests=disabled
|
||||
cleanup:
|
||||
- /bin
|
||||
sources:
|
||||
- type: archive
|
||||
url: http://archive.ubuntu.com/ubuntu/pool/main/libe/libevdev/libevdev_1.13.0+dfsg.orig.tar.xz
|
||||
sha256: a882e13ef1dd6bd227318080cabf60fe5af3c06471259d3acfc9dbfb202351a7
|
||||
|
||||
- name: cuda
|
||||
disabled: false
|
||||
buildsystem: simple
|
||||
only-arches:
|
||||
- x86_64
|
||||
- aarch64
|
||||
cleanup:
|
||||
- '*'
|
||||
build-commands:
|
||||
- chmod u+x ./cuda.run
|
||||
- ./cuda.run --silent --toolkit --toolkitpath=$FLATPAK_DEST/cuda --no-opengl-libs --no-man-page --no-drm
|
||||
--tmpdir=$FLATPAK_BUILDER_BUILDDIR
|
||||
- rm -r $FLATPAK_DEST/cuda/nsight-systems-2021.3.2
|
||||
- rm ./cuda.run
|
||||
sources:
|
||||
- type: file
|
||||
only-arches:
|
||||
- x86_64
|
||||
url: https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run
|
||||
sha256: bbd87ca0e913f837454a796367473513cddef555082e4d86ed9a38659cc81f0a
|
||||
dest-filename: cuda.run
|
||||
- type: file
|
||||
only-arches:
|
||||
- aarch64
|
||||
url: https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux_sbsa.run # yamllint disable-line rule:line-length
|
||||
sha256: f2c4a52e06329606c8dfb7c5ea3f4cb4c0b28f9d3fdffeeb734fcc98daf580d8
|
||||
dest-filename: cuda.run
|
||||
|
||||
- name: sunshine
|
||||
disabled: false
|
||||
buildsystem: cmake
|
||||
no-make-install: false
|
||||
builddir: true
|
||||
build-options:
|
||||
cxxflags: -I${C_INCLUDE_PATH}/libevdev-1.0
|
||||
config-opts:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/app
|
||||
- -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc
|
||||
- -DSUNSHINE_ASSETS_DIR=share/sunshine
|
||||
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
|
||||
- -DSUNSHINE_ENABLE_WAYLAND=ON
|
||||
- -DSUNSHINE_ENABLE_X11=ON
|
||||
- -DSUNSHINE_ENABLE_DRM=ON
|
||||
- -DSUNSHINE_ENABLE_CUDA=ON
|
||||
- -DSUNSHINE_CONFIGURE_FLATPAK=ON
|
||||
sources:
|
||||
- type: git
|
||||
url: '@GITHUB_CLONE_URL@'
|
||||
branch: '@GITHUB_BRANCH@'
|
||||
commit: '@GITHUB_COMMIT@'
|
||||
post-install:
|
||||
# use `sed` to update apps.json with prefixes required for flatpak
|
||||
# -r (regex)
|
||||
# -z (handle new lines) https://linuxhint.com/sed-replace-newline-with-space
|
||||
# `/gm` global and multiline
|
||||
- sed -r -z -i -e
|
||||
's/("((do)|(undo)|(cmd)|(detached))"\s*:\s*\[?\n*\s*")(.*")/\1flatpak-spawn --host \7/gm'
|
||||
/app/share/sunshine/apps.json
|
||||
@@ -1,12 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=sunshine
|
||||
Name=@PROJECT_NAME@
|
||||
Exec=sunshine
|
||||
Version=1.0
|
||||
Comment=Host for Moonlight Streaming Client
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Icon=sunshine
|
||||
Categories=Utility;
|
||||
Terminal=true
|
||||
X-AppImage-Name=sunshine
|
||||
X-AppImage-Version=0.12.0
|
||||
X-AppImage-Version=@PROJECT_VERSION@
|
||||
X-AppImage-Arch=x86_64
|
||||
59
packaging/macos/Portfile
Normal file
59
packaging/macos/Portfile
Normal file
@@ -0,0 +1,59 @@
|
||||
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
|
||||
|
||||
# initial PR into macports: https://github.com/macports/macports-ports/pull/15143
|
||||
|
||||
PortSystem 1.0
|
||||
PortGroup cmake 1.1
|
||||
PortGroup github 1.0
|
||||
PortGroup boost 1.0
|
||||
|
||||
name @PROJECT_NAME@
|
||||
version @PROJECT_VERSION@
|
||||
revision 0
|
||||
categories multimedia emulators games
|
||||
platforms darwin
|
||||
license GPL-3
|
||||
maintainers @LizardByte
|
||||
description @PROJECT_DESCRIPTION@
|
||||
|
||||
# long_description will not be split into multiple lines as it's configured by CMakeLists
|
||||
long_description @PROJECT_LONG_DESCRIPTION@
|
||||
homepage @PROJECT_HOMEPAGE_URL@
|
||||
master_sites https://github.com/lizardbyte/sunshine/releases
|
||||
|
||||
compiler.cxx_standard 2017
|
||||
fetch.type git
|
||||
|
||||
git.url @GITHUB_CLONE_URL@
|
||||
git.branch @GITHUB_COMMIT@
|
||||
|
||||
post-fetch {
|
||||
system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive"
|
||||
}
|
||||
|
||||
depends_lib port:avahi \
|
||||
port:ffmpeg \
|
||||
port:libopus
|
||||
|
||||
boost.version 1.80
|
||||
|
||||
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
||||
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
|
||||
|
||||
startupitem.create yes
|
||||
startupitem.executable "${prefix}/bin/{$name}"
|
||||
startupitem.location LaunchDaemons
|
||||
startupitem.name ${name}
|
||||
startupitem.netchange yes
|
||||
|
||||
platform darwin {
|
||||
if { ${os.major} < 20 } {
|
||||
# See: https://github.com/LizardByte/Sunshine/discussions/117#discussioncomment-2513494
|
||||
notes-append "Port is limited to software encoding, when used with macOS releases prior to Big Sur."
|
||||
}
|
||||
}
|
||||
|
||||
notes-append "Run @PROJECT_NAME@ by executing 'sunshine <path to user config>', e.g. 'sunshine ~/sunshine.conf' "
|
||||
notes-append "The config file will be created if it doesn't exist."
|
||||
notes-append "It is recommended to set a location for the apps file in the config."
|
||||
notes-append "See our documentation at 'https://docs.lizardbyte.dev/projects/sunshine/en/v@PROJECT_VERSION@/' for further info."
|
||||
@@ -1,39 +0,0 @@
|
||||
FROM debian:bullseye AS sunshine-debian
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TZ="Europe/London"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN echo deb http://deb.debian.org/debian/ bullseye main contrib non-free | tee /etc/apt/sources.list.d/non-free.list
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
libavdevice-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libcap-dev \
|
||||
libdrm-dev \
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \
|
||||
libx11-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxfixes-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
nvidia-cuda-dev \
|
||||
nvidia-cuda-toolkit \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,27 +0,0 @@
|
||||
FROM fedora:33 AS sunshine-fedora_33
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN dnf -y update && \
|
||||
dnf -y group install "Development Tools" && \
|
||||
dnf -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
|
||||
dnf -y install \
|
||||
boost-devel \
|
||||
boost-static.x86_64 \
|
||||
cmake \
|
||||
ffmpeg-devel \
|
||||
libevdev-devel \
|
||||
libxcb-devel \
|
||||
libX11-devel \
|
||||
libXfixes-devel \
|
||||
libXrandr-devel \
|
||||
libXtst-devel \
|
||||
openssl-devel \
|
||||
opus-devel \
|
||||
pulseaudio-libs-devel \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/yum
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,32 +0,0 @@
|
||||
FROM fedora:35 AS sunshine-fedora_35
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN dnf -y update && \
|
||||
dnf -y group install "Development Tools" && \
|
||||
dnf -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
|
||||
dnf -y install \
|
||||
boost-devel \
|
||||
boost-static.x86_64 \
|
||||
cmake \
|
||||
ffmpeg-devel \
|
||||
gcc-c++ \
|
||||
libevdev-devel \
|
||||
libxcb-devel \
|
||||
libX11-devel \
|
||||
libXcursor-devel \
|
||||
libXfixes-devel \
|
||||
libXinerama-devel \
|
||||
libXi-devel \
|
||||
libXrandr-devel \
|
||||
libXtst-devel \
|
||||
mesa-libGL-devel \
|
||||
openssl-devel \
|
||||
opus-devel \
|
||||
pulseaudio-libs-devel \
|
||||
&& dnf clean all \
|
||||
&& rm -rf /var/cache/yum
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,58 +0,0 @@
|
||||
FROM ubuntu:18.04 AS sunshine-ubuntu_18_04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TZ="Europe/London"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
software-properties-common \
|
||||
wget \
|
||||
&& wget -qO - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add - && \
|
||||
add-apt-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' && \
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test && \
|
||||
add-apt-repository ppa:savoury1/graphics && \
|
||||
add-apt-repository ppa:savoury1/multimedia && \
|
||||
add-apt-repository ppa:savoury1/ffmpeg4 && \
|
||||
apt-get update -y && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
ffmpeg \
|
||||
gcc-10 \
|
||||
git \
|
||||
g++-10 \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-thread-dev \
|
||||
libcap-dev \
|
||||
libdrm-dev \
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \
|
||||
libx11-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxfixes-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
|
||||
|
||||
RUN wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && chmod a+x /root/cuda.run
|
||||
RUN /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm /root/cuda.run
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,42 +0,0 @@
|
||||
FROM ubuntu:20.04 AS sunshine-ubuntu_20_04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TZ="Europe/London"
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
g++-10 \
|
||||
libavdevice-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libboost-thread-dev \
|
||||
libcap-dev \
|
||||
libdrm-dev \
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \
|
||||
libx11-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxfixes-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
wget \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10
|
||||
|
||||
RUN wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && chmod a+x /root/cuda.run
|
||||
RUN /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && rm /root/cuda.run
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,37 +0,0 @@
|
||||
FROM ubuntu:21.04 AS sunshine-ubuntu_21_04
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TZ="Europe/London"
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
libavdevice-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libcap-dev \
|
||||
libdrm-dev \
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \
|
||||
libx11-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxfixes-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
nvidia-cuda-dev \
|
||||
nvidia-cuda-toolkit \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,37 +0,0 @@
|
||||
FROM ubuntu:21.10 AS sunshine-ubuntu_21_10
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG TZ="Europe/London"
|
||||
|
||||
RUN apt-get update -y && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
libavdevice-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-filesystem-dev \
|
||||
libboost-log-dev \
|
||||
libcap-dev \
|
||||
libdrm-dev \
|
||||
libevdev-dev \
|
||||
libpulse-dev \
|
||||
libopus-dev \
|
||||
libssl-dev \
|
||||
libwayland-dev \
|
||||
libx11-dev \
|
||||
libxcb-shm0-dev \
|
||||
libxcb-xfixes0-dev \
|
||||
libxcb1-dev \
|
||||
libxfixes-dev \
|
||||
libxrandr-dev \
|
||||
libxtst-dev \
|
||||
nvidia-cuda-dev \
|
||||
nvidia-cuda-toolkit \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY build-private.sh /root/build.sh
|
||||
|
||||
|
||||
ENTRYPOINT ["/root/build.sh"]
|
||||
@@ -1,53 +0,0 @@
|
||||
# Introduction
|
||||
Sunshine is a Gamestream host for Moonlight
|
||||
|
||||
[](https://ci.appveyor.com/project/loki-47-6F-64/sunshine/branch/master)
|
||||
[](https://github.com/Loki-47-6F-64/sunshine/releases)
|
||||
|
||||
You may wish to simply build sunshine from source, without bloating your OS with development files.
|
||||
These scripts will create a docker images that have the necessary packages. As a result, removing the development files after you're done is a single command away.
|
||||
These scripts use docker under the hood, as such, they can only be used to compile the Linux version
|
||||
|
||||
|
||||
#### Requirements
|
||||
|
||||
```
|
||||
sudo apt install docker
|
||||
```
|
||||
|
||||
#### instructions
|
||||
|
||||
You'll require one of the following Dockerfiles:
|
||||
* Dockerfile-2004 --> Ubuntu 20.04
|
||||
* Dockerfile-2104 --> Ubuntu 21.04
|
||||
* Dockerfile-debian --> Debian Bullseye
|
||||
|
||||
Depending on your system, the build-* scripts may need root privilleges
|
||||
|
||||
First, the docker container needs to be created:
|
||||
```
|
||||
cd scripts
|
||||
./build-container.sh -f Dockerfile-<name>
|
||||
```
|
||||
|
||||
Then, the sources will be compiled and the debian package generated:
|
||||
```
|
||||
./build-sunshine.sh -p -s ..
|
||||
```
|
||||
You can run `build-sunshine -p -s ..` again as long as the docker container exists.
|
||||
|
||||
```
|
||||
git pull
|
||||
./build-sunshine.sh -p -s ..
|
||||
```
|
||||
|
||||
Optionally, the docker container can be removed after you're finished:
|
||||
```
|
||||
./build-container.sh -c delete
|
||||
```
|
||||
|
||||
Finally install the resulting package:
|
||||
```
|
||||
sudo apt install -f sunshine-build/sunshine.deb
|
||||
```
|
||||
|
||||
170
scripts/_locale.py
Normal file
170
scripts/_locale.py
Normal file
@@ -0,0 +1,170 @@
|
||||
"""
|
||||
..
|
||||
_locale.py
|
||||
|
||||
Functions related to building, initializing, updating, and compiling localization translations.
|
||||
|
||||
Borrowed from RetroArcher.
|
||||
"""
|
||||
# standard imports
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
project_name = 'Sunshine'
|
||||
project_owner = 'LizardByte'
|
||||
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
root_dir = os.path.dirname(script_dir)
|
||||
locale_dir = os.path.join(root_dir, 'locale')
|
||||
project_dir = os.path.join(root_dir, 'src')
|
||||
|
||||
year = datetime.datetime.now().year
|
||||
|
||||
# retroarcher target locales
|
||||
target_locales = [
|
||||
'de', # Deutsch
|
||||
'en', # English
|
||||
'en_GB', # English (United Kingdom)
|
||||
'en_US', # English (United States)
|
||||
'es', # español
|
||||
'fr', # français
|
||||
'it', # italiano
|
||||
'ru', # русский
|
||||
]
|
||||
|
||||
|
||||
def x_extract():
|
||||
"""Executes `xgettext extraction` in subprocess."""
|
||||
|
||||
pot_filepath = os.path.join(locale_dir, f'{project_name.lower()}.po')
|
||||
|
||||
commands = [
|
||||
'xgettext',
|
||||
'--keyword=translate:1,1t',
|
||||
'--keyword=translate:1c,2,2t',
|
||||
'--keyword=translate:1,2,3t',
|
||||
'--keyword=translate:1c,2,3,4t',
|
||||
'--keyword=gettext:1',
|
||||
'--keyword=pgettext:1c,2',
|
||||
'--keyword=ngettext:1,2',
|
||||
'--keyword=npgettext:1c,2,3',
|
||||
f'--default-domain={project_name.lower()}',
|
||||
f'--output={pot_filepath}',
|
||||
'--language=C++',
|
||||
'--boost',
|
||||
'--from-code=utf-8',
|
||||
'-F',
|
||||
f'--msgid-bugs-address=github.com/{project_owner.lower()}/{project_name.lower()}',
|
||||
f'--copyright-holder={project_owner}',
|
||||
f'--package-name={project_name}',
|
||||
'--package-version=v0'
|
||||
]
|
||||
|
||||
extensions = ['cpp', 'h', 'm', 'mm']
|
||||
|
||||
# find input files
|
||||
for root, dirs, files in os.walk(project_dir, topdown=True):
|
||||
for name in files:
|
||||
filename = os.path.join(root, name)
|
||||
extension = filename.rsplit('.', 1)[-1]
|
||||
if extension in extensions: # append input files
|
||||
commands.append(filename)
|
||||
|
||||
print(commands)
|
||||
subprocess.check_output(args=commands, cwd=root_dir)
|
||||
|
||||
try:
|
||||
# fix header
|
||||
body = ""
|
||||
with open(file=pot_filepath, mode='r') as file:
|
||||
for line in file.readlines():
|
||||
if line != '"Language: \\n"\n': # do not include this line
|
||||
if line == '# SOME DESCRIPTIVE TITLE.\n':
|
||||
body += f'# Translations template for {project_name}.\n'
|
||||
elif line.startswith('#') and 'YEAR' in line:
|
||||
body += line.replace('YEAR', str(year))
|
||||
elif line.startswith('#') and 'PACKAGE' in line:
|
||||
body += line.replace('PACKAGE', project_name)
|
||||
else:
|
||||
body += line
|
||||
|
||||
# rewrite pot file with updated header
|
||||
with open(file=pot_filepath, mode='w+') as file:
|
||||
file.write(body)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
def babel_init(locale_code: str):
|
||||
"""Executes `pybabel init` in subprocess.
|
||||
|
||||
:param locale_code: str - locale code
|
||||
"""
|
||||
commands = [
|
||||
'pybabel',
|
||||
'init',
|
||||
'-i', os.path.join(locale_dir, f'{project_name.lower()}.po'),
|
||||
'-d', locale_dir,
|
||||
'-D', project_name.lower(),
|
||||
'-l', locale_code
|
||||
]
|
||||
|
||||
print(commands)
|
||||
subprocess.check_output(args=commands, cwd=root_dir)
|
||||
|
||||
|
||||
def babel_update():
|
||||
"""Executes `pybabel update` in subprocess."""
|
||||
commands = [
|
||||
'pybabel',
|
||||
'update',
|
||||
'-i', os.path.join(locale_dir, f'{project_name.lower()}.po'),
|
||||
'-d', locale_dir,
|
||||
'-D', project_name.lower(),
|
||||
'--update-header-comment'
|
||||
]
|
||||
|
||||
print(commands)
|
||||
subprocess.check_output(args=commands, cwd=root_dir)
|
||||
|
||||
|
||||
def babel_compile():
|
||||
"""Executes `pybabel compile` in subprocess."""
|
||||
commands = [
|
||||
'pybabel',
|
||||
'compile',
|
||||
'-d', locale_dir,
|
||||
'-D', project_name.lower()
|
||||
]
|
||||
|
||||
print(commands)
|
||||
subprocess.check_output(args=commands, cwd=root_dir)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Set up and gather command line arguments
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Script helps update locale translations. Translations must be done manually.')
|
||||
|
||||
parser.add_argument('--extract', action='store_true', help='Extract messages from c++ files.')
|
||||
parser.add_argument('--init', action='store_true', help='Initialize any new locales specified in target locales.')
|
||||
parser.add_argument('--update', action='store_true', help='Update existing locales.')
|
||||
parser.add_argument('--compile', action='store_true', help='Compile translated locales.')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.extract:
|
||||
x_extract()
|
||||
|
||||
if args.init:
|
||||
for locale_id in target_locales:
|
||||
if not os.path.isdir(os.path.join(locale_dir, locale_id)):
|
||||
babel_init(locale_code=locale_id)
|
||||
|
||||
if args.update:
|
||||
babel_update()
|
||||
|
||||
if args.compile:
|
||||
babel_compile()
|
||||
@@ -1,179 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo " -c: command --> default [build]"
|
||||
echo " | delete --> Delete the container, Dockerfile isn't mandatory"
|
||||
echo " | build --> Build the container, Dockerfile is mandatory"
|
||||
echo " | compile --> Builds the container, then compiles it. Dockerfile is mandatory"
|
||||
echo ""
|
||||
echo " -s: path: The path to the source for compilation"
|
||||
echo " -n: name: Docker container name --> default [sunshine]"
|
||||
echo " --> all: Build/Compile/Delete all available docker containers"
|
||||
echo " -f: Dockerfile: The name of the docker file"
|
||||
}
|
||||
|
||||
# Attempt to turn relative paths into absolute paths
|
||||
absolute_path() {
|
||||
RELATIVE_PATH=$1
|
||||
if which realpath >/dev/null 2>/dev/null
|
||||
then
|
||||
RELATIVE_PATH=$(realpath $RELATIVE_PATH)
|
||||
else
|
||||
echo "Warning: realpath is not installed on your system, ensure [$1] is absolute"
|
||||
fi
|
||||
|
||||
RETURN=$RELATIVE_PATH
|
||||
}
|
||||
|
||||
CONTAINER_NAME=sunshine
|
||||
COMMAND=BUILD
|
||||
|
||||
build_container() {
|
||||
CONTAINER_NAME=$1
|
||||
DOCKER_FILE=$2
|
||||
|
||||
if [ ! -f "$DOCKER_FILE" ]
|
||||
then
|
||||
echo "Error: $DOCKER_FILE doesn't exist"
|
||||
exit 7
|
||||
fi
|
||||
|
||||
echo "docker build . -t $CONTAINER_NAME -f $DOCKER_FILE"
|
||||
docker build . -t "$CONTAINER_NAME" -f "$DOCKER_FILE"
|
||||
}
|
||||
|
||||
delete() {
|
||||
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
|
||||
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
|
||||
then
|
||||
shopt -s nullglob
|
||||
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
|
||||
do
|
||||
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
|
||||
|
||||
if docker inspect "$CURRENT_CONTAINER" > /dev/null 2> /dev/null
|
||||
then
|
||||
echo "docker rmi $CURRENT_CONTAINER"
|
||||
docker rmi "$CURRENT_CONTAINER"
|
||||
fi
|
||||
done
|
||||
shopt -u nullglob #revert nullglob back to it's normal default state
|
||||
else
|
||||
if docker inspect "$CONTAINER_NAME" > /dev/null 2> /dev/null
|
||||
then
|
||||
echo "docker rmi $CONTAINER_NAME"
|
||||
docker rmi $CONTAINER_NAME
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
|
||||
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
|
||||
then
|
||||
shopt -s nullglob
|
||||
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
|
||||
do
|
||||
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
|
||||
build_container "$CURRENT_CONTAINER" "$file"
|
||||
done
|
||||
shopt -u nullglob #revert nullglob back to it's normal default state
|
||||
else
|
||||
if [[ -z "$DOCKER_FILE" ]]
|
||||
then
|
||||
echo "Error: if container name isn't equal to 'all', you need to specify the Dockerfile"
|
||||
exit 6
|
||||
fi
|
||||
|
||||
build_container "$CONTAINER_NAME" "$DOCKER_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
abort() {
|
||||
echo "$1"
|
||||
exit 10
|
||||
}
|
||||
|
||||
compile() {
|
||||
CONTAINER_NAME_UPPER=$(echo "$CONTAINER_NAME" | tr '[:lower:]' '[:upper:]')
|
||||
if [ "$CONTAINER_NAME_UPPER" = "ALL" ]
|
||||
then
|
||||
shopt -s nullglob
|
||||
|
||||
# If any docker container doesn't exist, we cannot compile all of them
|
||||
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
|
||||
do
|
||||
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
|
||||
|
||||
# If container doesn't exist --> abort.
|
||||
docker inspect "$CURRENT_CONTAINER" > /dev/null 2> /dev/null || abort "Error: container image [$CURRENT_CONTAINER] doesn't exist"
|
||||
done
|
||||
|
||||
for file in $(find . -maxdepth 1 -iname "Dockerfile-*" -type f)
|
||||
do
|
||||
CURRENT_CONTAINER="sunshine-$(echo $file | cut -c 14-)"
|
||||
|
||||
echo "$PWD/build-sunshine.sh -p -n $CURRENT_CONTAINER $SUNSHINE_SOURCES"
|
||||
"$PWD/build-sunshine.sh" -p -n "$CURRENT_CONTAINER" $SUNSHINE_SOURCES
|
||||
done
|
||||
shopt -u nullglob #revert nullglob back to it's normal default state
|
||||
else
|
||||
# If container exists
|
||||
if docker inspect "$CONTAINER_NAME" > /dev/null 2> /dev/null
|
||||
then
|
||||
echo "$PWD/build-sunshine.sh -p -n $CONTAINER_NAME $SUNSHINE_SOURCES"
|
||||
"$PWD/build-sunshine.sh" -p -n "$CONTAINER_NAME" $SUNSHINE_SOURCES
|
||||
else
|
||||
echo "Error: container image [$CONTAINER_NAME] doesn't exist"
|
||||
exit 9
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts ":c:hn:f:s:" arg; do
|
||||
case ${arg} in
|
||||
s)
|
||||
SUNSHINE_SOURCES="-s $OPTARG"
|
||||
;;
|
||||
c)
|
||||
COMMAND=$(echo $OPTARG | tr '[:lower:]' '[:upper:]')
|
||||
;;
|
||||
n)
|
||||
echo "Container name: $OPTARG"
|
||||
CONTAINER_NAME="$OPTARG"
|
||||
;;
|
||||
f)
|
||||
echo "Using Dockerfile [$OPTARG]"
|
||||
DOCKER_FILE="$OPTARG"
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$0 set to $(echo $COMMAND | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
if [ "$COMMAND" = "BUILD" ]
|
||||
then
|
||||
echo "Start building..."
|
||||
delete
|
||||
build
|
||||
echo "Done."
|
||||
elif [ "$COMMAND" = "COMPILE" ]
|
||||
then
|
||||
echo "Start compiling..."
|
||||
compile
|
||||
echo "Done."
|
||||
elif [ "$COMMAND" = "DELETE" ]
|
||||
then
|
||||
echo "Start deleting..."
|
||||
delete
|
||||
echo "Done."
|
||||
else
|
||||
echo "Unknown command [$(echo $COMMAND | tr '[:upper:]' '[:lower:]')]"
|
||||
exit 4
|
||||
fi
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
|
||||
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
|
||||
SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}"
|
||||
SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-/etc/sunshine}"
|
||||
|
||||
|
||||
SUNSHINE_ROOT="${SUNSHINE_ROOT:-/root/sunshine}"
|
||||
SUNSHINE_TAG="${SUNSHINE_TAG:-master}"
|
||||
SUNSHINE_GIT_URL="${SUNSHINE_GIT_URL:-https://github.com/sunshinestream/sunshine.git}"
|
||||
|
||||
|
||||
SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON}
|
||||
SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON}
|
||||
SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON}
|
||||
SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON}
|
||||
|
||||
# For debugging, it would be usefull to have the sources on the host.
|
||||
if [[ ! -d "$SUNSHINE_ROOT" ]]
|
||||
then
|
||||
git clone --depth 1 --branch "$SUNSHINE_TAG" "$SUNSHINE_GIT_URL" --recurse-submodules "$SUNSHINE_ROOT"
|
||||
fi
|
||||
|
||||
if [[ ! -d /root/sunshine-build ]]
|
||||
then
|
||||
mkdir -p /root/sunshine-build
|
||||
fi
|
||||
cd /root/sunshine-build
|
||||
|
||||
cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "$SUNSHINE_ROOT"
|
||||
|
||||
make -j ${nproc}
|
||||
|
||||
./gen-deb
|
||||
@@ -1,115 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0"
|
||||
echo " -d: Generate a debug build"
|
||||
echo " -p: Generate a debian package"
|
||||
echo " -u: The input device is not a TTY"
|
||||
echo " -n name: Docker container name --> default [sunshine]"
|
||||
echo " -s path/to/sources/sunshine: Use local sources instead of a git repository"
|
||||
echo " -c path/to/cmake/binary/dir: Store cmake output on host OS"
|
||||
}
|
||||
|
||||
# Attempt to turn relative paths into absolute paths
|
||||
absolute_path() {
|
||||
RELATIVE_PATH=$1
|
||||
if which realpath >/dev/null 2>/dev/null
|
||||
then
|
||||
RELATIVE_PATH=$(realpath $RELATIVE_PATH)
|
||||
else
|
||||
echo "Warning: realpath is not installed on your system, ensure [$1] is absolute"
|
||||
fi
|
||||
|
||||
RETURN=$RELATIVE_PATH
|
||||
}
|
||||
|
||||
CMAKE_BUILD_TYPE="-e CMAKE_BUILD_TYPE=Release"
|
||||
SUNSHINE_PACKAGE_BUILD=OFF
|
||||
SUNSHINE_GIT_URL=https://github.com/sunshinestream/sunshine.git
|
||||
CONTAINER_NAME=sunshine
|
||||
|
||||
# Docker will fail if ctrl+c is passed through and the input is not a tty
|
||||
DOCKER_INTERACTIVE=-ti
|
||||
|
||||
while getopts ":dpuhc:s:n:" arg; do
|
||||
case ${arg} in
|
||||
u)
|
||||
echo "Input device is not a TTY"
|
||||
USERNAME="$USER"
|
||||
unset DOCKER_INTERACTIVE
|
||||
;;
|
||||
d)
|
||||
echo "Creating debug build"
|
||||
CMAKE_BUILD_TYPE="-e CMAKE_BUILD_TYPE=Debug"
|
||||
;;
|
||||
p)
|
||||
echo "Creating package build"
|
||||
SUNSHINE_PACKAGE_BUILD=ON
|
||||
SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=/etc/sunshine"
|
||||
SUNSHINE_EXECUTABLE_PATH="-e SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine"
|
||||
;;
|
||||
s)
|
||||
absolute_path "$OPTARG"
|
||||
OPTARG="$RETURN"
|
||||
echo "Using sources from $OPTARG"
|
||||
SUNSHINE_ROOT="-v $OPTARG:/root/sunshine"
|
||||
;;
|
||||
c)
|
||||
[ "$USERNAME" == "" ] && USERNAME=$(logname)
|
||||
|
||||
absolute_path "$OPTARG"
|
||||
OPTARG="$RETURN"
|
||||
|
||||
echo "Using $OPTARG as cmake binary dir"
|
||||
if [[ ! -d $OPTARG ]]
|
||||
then
|
||||
echo "cmake binary dir doesn't exist, a new one will be created."
|
||||
mkdir -p "$OPTARG"
|
||||
[ "$USERNAME" == "$USER"] || chown $USERNAME:$USERNAME "$OPTARG"
|
||||
fi
|
||||
|
||||
CMAKE_ROOT="-v $OPTARG:/root/sunshine-build"
|
||||
;;
|
||||
n)
|
||||
echo "Container name: $OPTARG"
|
||||
CONTAINER_NAME=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ "$USERNAME" = "" ] && USERNAME=$(logname)
|
||||
|
||||
BUILD_DIR="$PWD/$CONTAINER_NAME-build"
|
||||
[ "$SUNSHINE_ASSETS_DIR" = "" ] && SUNSHINE_ASSETS_DIR="-e SUNSHINE_ASSETS_DIR=$BUILD_DIR/assets"
|
||||
[ "$SUNSHINE_EXECUTABLE_PATH" = "" ] && SUNSHINE_EXECUTABLE_PATH="-e SUNSHINE_EXECUTABLE_PATH=$BUILD_DIR/sunshine"
|
||||
|
||||
echo "docker run $DOCKER_INTERACTIVE --privileged $SUNSHINE_ROOT $CMAKE_ROOT $SUNSHINE_ASSETS_DIR $SUNSHINE_EXECUTABLE_PATH $CMAKE_BUILD_TYPE --name $CONTAINER_NAME $CONTAINER_NAME"
|
||||
docker run $DOCKER_INTERACTIVE --privileged $SUNSHINE_ROOT $CMAKE_ROOT $SUNSHINE_ASSETS_DIR $SUNSHINE_EXECUTABLE_PATH $CMAKE_BUILD_TYPE --name $CONTAINER_NAME $CONTAINER_NAME
|
||||
|
||||
exit_code=$?
|
||||
|
||||
if [ $exit_code -eq 0 ]
|
||||
then
|
||||
mkdir -p $BUILD_DIR
|
||||
case $SUNSHINE_PACKAGE_BUILD in
|
||||
ON)
|
||||
echo "Downloading package to: $BUILD_DIR/$CONTAINER_NAME.deb"
|
||||
docker cp $CONTAINER_NAME:/root/sunshine-build/package-deb/sunshine.deb "$BUILD_DIR/$CONTAINER_NAME.deb"
|
||||
;;
|
||||
*)
|
||||
echo "Downloading binary and assets to: $BUILD_DIR"
|
||||
docker cp $CONTAINER_NAME:/root/sunshine/assets "$BUILD_DIR"
|
||||
docker cp $CONTAINER_NAME:/root/sunshine-build/sunshine "$BUILD_DIR"
|
||||
;;
|
||||
esac
|
||||
echo "chown --recursive $USERNAME:$USERNAME $BUILD_DIR"
|
||||
chown --recursive $USERNAME:$USERNAME "$BUILD_DIR"
|
||||
fi
|
||||
|
||||
echo "Removing docker container $CONTAINER_NAME"
|
||||
docker rm $CONTAINER_NAME
|
||||
1
scripts/requirements.txt
Normal file
1
scripts/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
Babel==2.10.3
|
||||
@@ -75,7 +75,7 @@ auto control_shared = safe::make_shared<audio_ctx_t>(start_audio_control, stop_a
|
||||
void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
||||
auto packets = mail::man->queue<packet_t>(mail::audio_packets);
|
||||
|
||||
//FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||
// FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||
|
||||
opus_t opus { opus_multistream_encoder_create(
|
||||
@@ -120,7 +120,7 @@ void encodeThread(sample_queue_t samples, config_t config, void *channel_data) {
|
||||
void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
auto shutdown_event = mail->event<bool>(mail::shutdown);
|
||||
|
||||
//FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||
// FIXME: Pick correct opus_stream_config_t based on config.channels
|
||||
auto stream = &stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])];
|
||||
|
||||
auto ref = control_shared.ref();
|
||||
@@ -135,9 +135,15 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string *sink =
|
||||
config::audio.sink.empty() ? &ref->sink.host : &config::audio.sink;
|
||||
if(ref->sink.null) {
|
||||
// Order of priority:
|
||||
// 1. Config
|
||||
// 2. Virtual if available
|
||||
// 3. Host
|
||||
std::string *sink = &ref->sink.host;
|
||||
if(!config::audio.sink.empty()) {
|
||||
sink = &config::audio.sink;
|
||||
}
|
||||
else if(ref->sink.null) {
|
||||
auto &null = *ref->sink.null;
|
||||
switch(stream->channelCount) {
|
||||
case 2:
|
||||
@@ -156,8 +162,14 @@ void capture(safe::mail_t mail, config_t config, void *channel_data) {
|
||||
if(!ref->sink_flag->exchange(true, std::memory_order_acquire)) {
|
||||
ref->restore_sink = !config.flags[config_t::HOST_AUDIO];
|
||||
|
||||
// If the sink is empty (Host has no sink!), definately switch to the virtual.
|
||||
if(ref->sink.host.empty()) {
|
||||
if(control->set_sink(*sink)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// If the client requests audio on the host, don't change the default sink
|
||||
if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*sink)) {
|
||||
else if(!config.flags[config_t::HOST_AUDIO] && control->set_sink(*sink)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -124,9 +124,9 @@ util::buffer_t<std::uint8_t> make_sps_h264(const AVCodecContext *ctx) {
|
||||
sps.seq_parameter_set_id = 0;
|
||||
sps.chroma_format_idc = 1;
|
||||
|
||||
sps.log2_max_frame_num_minus4 = 3; //4;
|
||||
sps.log2_max_frame_num_minus4 = 3; // 4;
|
||||
sps.pic_order_cnt_type = 0;
|
||||
sps.log2_max_pic_order_cnt_lsb_minus4 = 0; //4;
|
||||
sps.log2_max_pic_order_cnt_lsb_minus4 = 0; // 4;
|
||||
|
||||
sps.max_num_ref_frames = dpb_frame;
|
||||
|
||||
@@ -297,4 +297,4 @@ bool validate_sps(const AVPacket *packet, int codec_id) {
|
||||
|
||||
return ((CodedBitstreamH265Context *)ctx->priv_data)->active_sps->vui_parameters_present_flag;
|
||||
}
|
||||
} // namespace cbs
|
||||
} // namespace cbs
|
||||
@@ -31,4 +31,4 @@ h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
|
||||
bool validate_sps(const AVPacket *packet, int codec_id);
|
||||
} // namespace cbs
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include "config.h"
|
||||
#include "main.h"
|
||||
@@ -20,7 +21,7 @@ using namespace std::literals;
|
||||
#define PRIVATE_KEY_FILE CA_DIR "/cakey.pem"
|
||||
#define CERTIFICATE_FILE CA_DIR "/cacert.pem"
|
||||
|
||||
#define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/" APPS_JSON
|
||||
#define APPS_JSON_PATH platf::appdata().string() + "/apps.json"
|
||||
namespace config {
|
||||
|
||||
namespace nv {
|
||||
@@ -104,14 +105,14 @@ enum quality_e : int {
|
||||
enum class rc_hevc_e : int {
|
||||
constqp, /**< Constant QP mode */
|
||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||
cbr, /**< Constant bitrate mode */
|
||||
};
|
||||
|
||||
enum class rc_h264_e : int {
|
||||
constqp, /**< Constant QP mode */
|
||||
cbr, /**< Constant bitrate mode */
|
||||
vbr_peak, /**< Peak Contrained Variable Bitrate */
|
||||
vbr_peak, /**< Peak Constrained Variable Bitrate */
|
||||
vbr_latency, /**< Latency Constrained Variable Bitrate */
|
||||
};
|
||||
|
||||
@@ -162,6 +163,42 @@ int coder_from_view(const std::string_view &coder) {
|
||||
}
|
||||
} // namespace amd
|
||||
|
||||
namespace vt {
|
||||
|
||||
enum coder_e : int {
|
||||
_auto = 0,
|
||||
cabac,
|
||||
cavlc
|
||||
};
|
||||
|
||||
int coder_from_view(const std::string_view &coder) {
|
||||
if(coder == "auto"sv) return _auto;
|
||||
if(coder == "cabac"sv || coder == "ac"sv) return cabac;
|
||||
if(coder == "cavlc"sv || coder == "vlc"sv) return cavlc;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int allow_software_from_view(const std::string_view &software) {
|
||||
if(software == "allowed"sv || software == "forced") return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int force_software_from_view(const std::string_view &software) {
|
||||
if(software == "forced") return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rt_from_view(const std::string_view &rt) {
|
||||
if(rt == "disabled" || rt == "off" || rt == "0") return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
} // namespace vt
|
||||
|
||||
video_t video {
|
||||
28, // qp
|
||||
|
||||
@@ -184,9 +221,16 @@ video_t video {
|
||||
std::nullopt,
|
||||
-1 }, // amd
|
||||
|
||||
{}, // encoder
|
||||
{}, // adapter_name
|
||||
{}, // output_name
|
||||
{
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
-1 }, // vt
|
||||
|
||||
{}, // encoder
|
||||
{}, // adapter_name
|
||||
{}, // output_name
|
||||
true // dwmflush
|
||||
};
|
||||
|
||||
audio_t audio {};
|
||||
@@ -243,14 +287,14 @@ input_t input {
|
||||
};
|
||||
|
||||
sunshine_t sunshine {
|
||||
2, // min_log_level
|
||||
0, // flags
|
||||
{}, // User file
|
||||
{}, // Username
|
||||
{}, // Password
|
||||
{}, // Password Salt
|
||||
SUNSHINE_CONFIG_DIR "/sunshine.conf", // config file
|
||||
{}, // cmd args
|
||||
2, // min_log_level
|
||||
0, // flags
|
||||
{}, // User file
|
||||
{}, // Username
|
||||
{}, // Password
|
||||
{}, // Password Salt
|
||||
platf::appdata().string() + "/sunshine.conf", // config file
|
||||
{}, // cmd args
|
||||
47989,
|
||||
};
|
||||
|
||||
@@ -659,7 +703,7 @@ int apply_flags(const char *line) {
|
||||
|
||||
void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
||||
if(!fs::exists(stream.file_apps.c_str())) {
|
||||
fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps);
|
||||
fs::copy_file(SUNSHINE_ASSETS_DIR "/apps.json", stream.file_apps);
|
||||
}
|
||||
|
||||
for(auto &[name, val] : vars) {
|
||||
@@ -685,9 +729,15 @@ void apply_config(std::unordered_map<std::string, std::string> &&vars) {
|
||||
video.amd.rc_hevc = amd::rc_hevc_from_view(rc);
|
||||
}
|
||||
|
||||
int_f(vars, "vt_coder", video.vt.coder, vt::coder_from_view);
|
||||
int_f(vars, "vt_software", video.vt.allow_sw, vt::allow_software_from_view);
|
||||
int_f(vars, "vt_software", video.vt.require_sw, vt::force_software_from_view);
|
||||
int_f(vars, "vt_realtime", video.vt.realtime, vt::rt_from_view);
|
||||
|
||||
string_f(vars, "encoder", video.encoder);
|
||||
string_f(vars, "adapter_name", video.adapter_name);
|
||||
string_f(vars, "output_name", video.output_name);
|
||||
bool_f(vars, "dwmflush", video.dwmflush);
|
||||
|
||||
path_f(vars, "pkey", nvhttp.pkey);
|
||||
path_f(vars, "cert", nvhttp.cert);
|
||||
@@ -861,8 +911,14 @@ int parse(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
// create appdata folder if it does not exist
|
||||
if(!boost::filesystem::exists(platf::appdata().string())) {
|
||||
boost::filesystem::create_directory(platf::appdata().string());
|
||||
}
|
||||
|
||||
// create config file if it does not exist
|
||||
if(!fs::exists(sunshine.config_file)) {
|
||||
fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file);
|
||||
std::ofstream { sunshine.config_file }; // create empty config file
|
||||
}
|
||||
|
||||
auto vars = parse_config(read_file(sunshine.config_file.c_str()));
|
||||
@@ -34,9 +34,17 @@ struct video_t {
|
||||
int coder;
|
||||
} amd;
|
||||
|
||||
struct {
|
||||
int allow_sw;
|
||||
int require_sw;
|
||||
int realtime;
|
||||
int coder;
|
||||
} vt;
|
||||
|
||||
std::string encoder;
|
||||
std::string adapter_name;
|
||||
std::string output_name;
|
||||
bool dwmflush;
|
||||
};
|
||||
|
||||
struct audio_t {
|
||||
@@ -1,4 +1,3 @@
|
||||
//
|
||||
// Created by TheElixZammuto on 2021-05-09.
|
||||
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
|
||||
|
||||
@@ -92,9 +91,9 @@ bool authenticate(resp_https_t response, req_https_t request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//If credentials are shown, redirect the user to a /welcome page
|
||||
if(config::sunshine.username.empty()){
|
||||
send_redirect(response,request,"/welcome");
|
||||
// If credentials are shown, redirect the user to a /welcome page
|
||||
if(config::sunshine.username.empty()) {
|
||||
send_redirect(response, request, "/welcome");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -202,8 +201,8 @@ void getPasswordPage(resp_https_t response, req_https_t request) {
|
||||
|
||||
void getWelcomePage(resp_https_t response, req_https_t request) {
|
||||
print_req(request);
|
||||
if(!config::sunshine.username.empty()){
|
||||
send_redirect(response,request,"/");
|
||||
if(!config::sunshine.username.empty()) {
|
||||
send_redirect(response, request, "/");
|
||||
return;
|
||||
}
|
||||
std::string header = read_file(WEB_DIR "header-no-nav.html");
|
||||
@@ -314,7 +313,7 @@ void saveApp(resp_https_t response, req_https_t request) {
|
||||
|
||||
BOOST_LOG(fatal) << config::stream.file_apps;
|
||||
try {
|
||||
//TODO: Input Validation
|
||||
// TODO: Input Validation
|
||||
pt::read_json(ss, inputTree);
|
||||
pt::read_json(config::stream.file_apps, fileTree);
|
||||
|
||||
@@ -335,7 +334,7 @@ void saveApp(resp_https_t response, req_https_t request) {
|
||||
apps_node.push_back(std::make_pair("", inputTree));
|
||||
}
|
||||
else {
|
||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
pt::ptree newApps;
|
||||
int i = 0;
|
||||
for(const auto &kv : apps_node) {
|
||||
@@ -388,7 +387,7 @@ void deleteApp(resp_https_t response, req_https_t request) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//Unfortuantely Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
// Unfortunately Boost PT does not allow to directly edit the array, copy should do the trick
|
||||
pt::ptree newApps;
|
||||
int i = 0;
|
||||
for(const auto &kv : apps_node) {
|
||||
@@ -452,7 +451,7 @@ void saveConfig(resp_https_t response, req_https_t request) {
|
||||
});
|
||||
pt::ptree inputTree;
|
||||
try {
|
||||
//TODO: Input Validation
|
||||
// TODO: Input Validation
|
||||
pt::read_json(ss, inputTree);
|
||||
for(const auto &kv : inputTree) {
|
||||
std::string value = inputTree.get<std::string>(kv.first);
|
||||
@@ -488,7 +487,7 @@ void savePassword(resp_https_t response, req_https_t request) {
|
||||
});
|
||||
|
||||
try {
|
||||
//TODO: Input Validation
|
||||
// TODO: Input Validation
|
||||
pt::read_json(ss, inputTree);
|
||||
auto username = inputTree.count("currentUsername") > 0 ? inputTree.get<std::string>("currentUsername") : "";
|
||||
auto newUsername = inputTree.get<std::string>("newUsername");
|
||||
@@ -496,16 +495,18 @@ void savePassword(resp_https_t response, req_https_t request) {
|
||||
auto newPassword = inputTree.count("newPassword") > 0 ? inputTree.get<std::string>("newPassword") : "";
|
||||
auto confirmPassword = inputTree.count("confirmNewPassword") > 0 ? inputTree.get<std::string>("confirmNewPassword") : "";
|
||||
if(newUsername.length() == 0) newUsername = username;
|
||||
if(newUsername.length() == 0){
|
||||
if(newUsername.length() == 0) {
|
||||
outputTree.put("status", false);
|
||||
outputTree.put("error", "Invalid Username");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string();
|
||||
if(config::sunshine.username.empty() || (username == config::sunshine.username && hash == config::sunshine.password)) {
|
||||
if(newPassword.empty() || newPassword != confirmPassword) {
|
||||
outputTree.put("status", false);
|
||||
outputTree.put("error", "Password Mismatch");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
http::save_user_creds(config::sunshine.credentials_file, newUsername, newPassword);
|
||||
http::reload_user_creds(config::sunshine.credentials_file);
|
||||
outputTree.put("status", true);
|
||||
@@ -542,7 +543,7 @@ void savePin(resp_https_t response, req_https_t request) {
|
||||
});
|
||||
|
||||
try {
|
||||
//TODO: Input Validation
|
||||
// TODO: Input Validation
|
||||
pt::read_json(ss, inputTree);
|
||||
std::string pin = inputTree.get<std::string>("pin");
|
||||
outputTree.put("status", nvhttp::pin(pin));
|
||||
@@ -555,9 +556,9 @@ void savePin(resp_https_t response, req_https_t request) {
|
||||
}
|
||||
}
|
||||
|
||||
void unpairAll(resp_https_t response, req_https_t request){
|
||||
void unpairAll(resp_https_t response, req_https_t request) {
|
||||
if(!authenticate(response, request)) return;
|
||||
|
||||
|
||||
print_req(request);
|
||||
|
||||
pt::ptree outputTree;
|
||||
@@ -571,9 +572,9 @@ void unpairAll(resp_https_t response, req_https_t request){
|
||||
outputTree.put("status", true);
|
||||
}
|
||||
|
||||
void closeApp(resp_https_t response, req_https_t request){
|
||||
void closeApp(resp_https_t response, req_https_t request) {
|
||||
if(!authenticate(response, request)) return;
|
||||
|
||||
|
||||
print_req(request);
|
||||
|
||||
pt::ptree outputTree;
|
||||
@@ -597,35 +598,35 @@ void start() {
|
||||
ctx->use_certificate_chain_file(config::nvhttp.cert);
|
||||
ctx->use_private_key_file(config::nvhttp.pkey, boost::asio::ssl::context::pem);
|
||||
https_server_t server { ctx, 0 };
|
||||
server.default_resource = not_found;
|
||||
server.resource["^/$"]["GET"] = getIndexPage;
|
||||
server.resource["^/pin$"]["GET"] = getPinPage;
|
||||
server.resource["^/apps$"]["GET"] = getAppsPage;
|
||||
server.resource["^/clients$"]["GET"] = getClientsPage;
|
||||
server.resource["^/config$"]["GET"] = getConfigPage;
|
||||
server.resource["^/password$"]["GET"] = getPasswordPage;
|
||||
server.resource["^/welcome$"]["GET"] = getWelcomePage;
|
||||
server.resource["^/troubleshooting$"]["GET"] = getTroubleshootingPage;
|
||||
server.resource["^/api/pin"]["POST"] = savePin;
|
||||
server.resource["^/api/apps$"]["GET"] = getApps;
|
||||
server.resource["^/api/apps$"]["POST"] = saveApp;
|
||||
server.resource["^/api/config$"]["GET"] = getConfig;
|
||||
server.resource["^/api/config$"]["POST"] = saveConfig;
|
||||
server.resource["^/api/password$"]["POST"] = savePassword;
|
||||
server.resource["^/api/apps/([0-9]+)$"]["DELETE"] = deleteApp;
|
||||
server.resource["^/api/clients/unpair$"]["POST"] = unpairAll;
|
||||
server.resource["^/api/apps/close"]["POST"] = closeApp;
|
||||
server.resource["^/images/favicon.ico$"]["GET"] = getFaviconImage;
|
||||
server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage;
|
||||
server.resource["^/third_party/bootstrap.min.css$"]["GET"] = getBootstrapCss;
|
||||
server.resource["^/third_party/bootstrap.bundle.min.js$"]["GET"] = getBootstrapJs;
|
||||
server.resource["^/fontawesome/css/all.min.css$"]["GET"] = getFontAwesomeCss;
|
||||
server.resource["^/fontawesome/webfonts/fa-brands-400.ttf$"]["GET"] = getFontAwesomeBrands;
|
||||
server.resource["^/fontawesome/webfonts/fa-solid-900.ttf$"]["GET"] = getFontAwesomeSolid;
|
||||
server.resource["^/third_party/vue.js$"]["GET"] = getVueJs;
|
||||
server.config.reuse_address = true;
|
||||
server.config.address = "0.0.0.0"s;
|
||||
server.config.port = port_https;
|
||||
server.default_resource = not_found;
|
||||
server.resource["^/$"]["GET"] = getIndexPage;
|
||||
server.resource["^/pin$"]["GET"] = getPinPage;
|
||||
server.resource["^/apps$"]["GET"] = getAppsPage;
|
||||
server.resource["^/clients$"]["GET"] = getClientsPage;
|
||||
server.resource["^/config$"]["GET"] = getConfigPage;
|
||||
server.resource["^/password$"]["GET"] = getPasswordPage;
|
||||
server.resource["^/welcome$"]["GET"] = getWelcomePage;
|
||||
server.resource["^/troubleshooting$"]["GET"] = getTroubleshootingPage;
|
||||
server.resource["^/api/pin"]["POST"] = savePin;
|
||||
server.resource["^/api/apps$"]["GET"] = getApps;
|
||||
server.resource["^/api/apps$"]["POST"] = saveApp;
|
||||
server.resource["^/api/config$"]["GET"] = getConfig;
|
||||
server.resource["^/api/config$"]["POST"] = saveConfig;
|
||||
server.resource["^/api/password$"]["POST"] = savePassword;
|
||||
server.resource["^/api/apps/([0-9]+)$"]["DELETE"] = deleteApp;
|
||||
server.resource["^/api/clients/unpair$"]["POST"] = unpairAll;
|
||||
server.resource["^/api/apps/close"]["POST"] = closeApp;
|
||||
server.resource["^/images/favicon.ico$"]["GET"] = getFaviconImage;
|
||||
server.resource["^/images/logo-sunshine-45.png$"]["GET"] = getSunshineLogoImage;
|
||||
server.resource["^/third_party/bootstrap.min.css$"]["GET"] = getBootstrapCss;
|
||||
server.resource["^/third_party/bootstrap.bundle.min.js$"]["GET"] = getBootstrapJs;
|
||||
server.resource["^/fontawesome/css/all.min.css$"]["GET"] = getFontAwesomeCss;
|
||||
server.resource["^/fontawesome/webfonts/fa-brands-400.ttf$"]["GET"] = getFontAwesomeBrands;
|
||||
server.resource["^/fontawesome/webfonts/fa-solid-900.ttf$"]["GET"] = getFontAwesomeSolid;
|
||||
server.resource["^/third_party/vue.js$"]["GET"] = getVueJs;
|
||||
server.config.reuse_address = true;
|
||||
server.config.address = "0.0.0.0"s;
|
||||
server.config.port = port_https;
|
||||
|
||||
try {
|
||||
server.bind();
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/3/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_CONFIGHTTP_H
|
||||
#define SUNSHINE_CONFIGHTTP_H
|
||||
@@ -18,4 +16,4 @@ constexpr auto PORT_HTTPS = 1;
|
||||
void start();
|
||||
} // namespace confighttp
|
||||
|
||||
#endif //SUNSHINE_CONFIGHTTP_H
|
||||
#endif // SUNSHINE_CONFIGHTTP_H
|
||||
@@ -1,13 +1,11 @@
|
||||
//
|
||||
// Created by loki on 5/31/19.
|
||||
//
|
||||
|
||||
#include "crypto.h"
|
||||
#include <openssl/pem.h>
|
||||
|
||||
namespace crypto {
|
||||
using big_num_t = util::safe_ptr<BIGNUM, BN_free>;
|
||||
//using rsa_t = util::safe_ptr<RSA, RSA_free>;
|
||||
// using rsa_t = util::safe_ptr<RSA, RSA_free>;
|
||||
using asn1_string_t = util::safe_ptr<ASN1_STRING, ASN1_STRING_free>;
|
||||
|
||||
cert_chain_t::cert_chain_t() : _certs {}, _cert_ctx { X509_STORE_CTX_new() } {}
|
||||
@@ -22,7 +20,7 @@ static int openssl_verify_cb(int ok, X509_STORE_CTX *ctx) {
|
||||
int err_code = X509_STORE_CTX_get_error(ctx);
|
||||
|
||||
switch(err_code) {
|
||||
//FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
|
||||
// FIXME: Checking for X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY is a temporary workaround to get mmonlight-embedded to work on the raspberry pi
|
||||
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
||||
return 1;
|
||||
|
||||
@@ -274,7 +272,7 @@ int cbc_t::encrypt(const std::string_view &plaintext, std::uint8_t *cipher, aes_
|
||||
|
||||
int len;
|
||||
|
||||
int size = plaintext.size(); //round_to_pkcs7_padded(plaintext.size());
|
||||
int size = plaintext.size(); // round_to_pkcs7_padded(plaintext.size());
|
||||
|
||||
// Encrypt into the caller's buffer
|
||||
if(EVP_EncryptUpdate(encrypt_ctx.get(), cipher, &size, (const std::uint8_t *)plaintext.data(), plaintext.size()) != 1) {
|
||||
@@ -492,4 +490,4 @@ std::string rand_alphabet(std::size_t bytes, const std::string_view &alphabet) {
|
||||
return value;
|
||||
}
|
||||
|
||||
} // namespace crypto
|
||||
} // namespace crypto
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/1/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_CRYPTO_H
|
||||
#define SUNSHINE_CRYPTO_H
|
||||
@@ -44,7 +44,7 @@ int init() {
|
||||
|
||||
if(clean_slate) {
|
||||
unique_id = util::uuid_t::generate().string();
|
||||
auto dir = std::filesystem::temp_directory_path() / "Sushine"sv;
|
||||
auto dir = std::filesystem::temp_directory_path() / "Sunshine"sv;
|
||||
config::nvhttp.cert = (dir / ("cert-"s + unique_id)).string();
|
||||
config::nvhttp.pkey = (dir / ("pkey-"s + unique_id)).string();
|
||||
}
|
||||
@@ -56,7 +56,8 @@ int init() {
|
||||
}
|
||||
if(user_creds_exist(config::sunshine.credentials_file)) {
|
||||
if(reload_user_creds(config::sunshine.credentials_file)) return -1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
BOOST_LOG(info) << "Open the Web UI to set your new username and password and getting started";
|
||||
}
|
||||
return 0;
|
||||
@@ -179,4 +180,4 @@ int create_creds(const std::string &pkey, const std::string &cert) {
|
||||
|
||||
return 0;
|
||||
}
|
||||
} // namespace http
|
||||
} // namespace http
|
||||
@@ -16,4 +16,4 @@ extern std::string unique_id;
|
||||
extern net::net_e origin_pin_allowed;
|
||||
extern net::net_e origin_web_ui_allowed;
|
||||
|
||||
} // namespace http
|
||||
} // namespace http
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/20/19.
|
||||
//
|
||||
|
||||
// define uint32_t for <moonlight-common-c/src/Input.h>
|
||||
#include <cstdint>
|
||||
@@ -9,6 +7,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include <bitset>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "config.h"
|
||||
#include "input.h"
|
||||
@@ -88,7 +87,7 @@ struct gamepad_t {
|
||||
|
||||
// When emulating the HOME button, we may need to artificially release the back button.
|
||||
// Afterwards, the gamepad state on sunshine won't match the state on Moonlight.
|
||||
// To prevent Sunshine from sending erronious input data to the active application,
|
||||
// To prevent Sunshine from sending erroneous input data to the active application,
|
||||
// Sunshine forces the button to be in a specific state until the gamepad state matches that of
|
||||
// Moonlight once more.
|
||||
button_state_e back_button_state;
|
||||
@@ -315,11 +314,11 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_MOUSE_BUTTON_PACKET packet
|
||||
/*/
|
||||
* When Moonlight sends mouse input through absolute coordinates,
|
||||
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
|
||||
* As a result, Sunshine will left click on hyperlinks in the browser before right clicking
|
||||
* As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking
|
||||
*
|
||||
* This can be solved by delaying BUTTON_LEFT, however, any delay on input is undesirable during gaming
|
||||
* As a compromise, Sunshine will only put delays on BUTTON_LEFT when
|
||||
* absolute mouse coordinates have been send.
|
||||
* absolute mouse coordinates have been sent.
|
||||
*
|
||||
* Try to make sure BUTTON_RIGHT gets called before BUTTON_LEFT is released.
|
||||
*
|
||||
@@ -427,7 +426,7 @@ void passthrough(std::shared_ptr<input_t> &input, PNV_KEYBOARD_PACKET packet) {
|
||||
if(!pressed) {
|
||||
if(!release) {
|
||||
// A new key has been pressed down, we need to check for key combo's
|
||||
// If a keycombo has been pressed down, don't pass it through
|
||||
// If a key-combo has been pressed down, don't pass it through
|
||||
if(input->shortcutFlags == input_t::SHORTCUT && apply_shortcut(keyCode) > 0) {
|
||||
return;
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 6/20/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_INPUT_H
|
||||
#define SUNSHINE_INPUT_H
|
||||
@@ -32,4 +30,4 @@ struct touch_port_t : public platf::touch_port_t {
|
||||
};
|
||||
} // namespace input
|
||||
|
||||
#endif //SUNSHINE_INPUT_H
|
||||
#endif // SUNSHINE_INPUT_H
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 5/30/19.
|
||||
//
|
||||
|
||||
#include "process.h"
|
||||
|
||||
@@ -24,8 +22,8 @@
|
||||
#include "rtsp.h"
|
||||
#include "thread_pool.h"
|
||||
#include "upnp.h"
|
||||
#include "video.h"
|
||||
#include "version.h"
|
||||
#include "video.h"
|
||||
|
||||
#include "platform/common.h"
|
||||
extern "C" {
|
||||
@@ -57,24 +55,34 @@ struct NoDelete {
|
||||
|
||||
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", int)
|
||||
|
||||
/** Print the help to stdout.
|
||||
|
||||
This function prints output to stdout.
|
||||
*/
|
||||
void print_help(const char *name) {
|
||||
std::cout
|
||||
<< "Usage: "sv << name << " [options] [/path/to/configuration_file] [--cmd]"sv << std::endl
|
||||
<< " Any configurable option can be overwritten with: \"name=value\""sv << std::endl
|
||||
<< std::endl
|
||||
<< " Note: The configuration will be created if it doesn't exist."sv << std::endl
|
||||
<< std::endl
|
||||
<< " --help | print help"sv << std::endl
|
||||
<< " --creds username password | set user credentials for the Web manager" << std::endl
|
||||
<< " --version | print the version of sunshine" << std::endl
|
||||
<< " --creds username password | set user credentials for the Web manager"sv << std::endl
|
||||
<< " --version | print the version of sunshine"sv << std::endl
|
||||
<< std::endl
|
||||
<< " flags"sv << std::endl
|
||||
<< " -0 | Read PIN from stdin"sv << std::endl
|
||||
<< " -1 | Do not load previously saved state and do retain any state after shutdown"sv << std::endl
|
||||
<< " | Effectively starting as if for the first time without overwriting any pairings with your devices"sv << std::endl
|
||||
<< " -2 | Force replacement of headers in video stream" << std::endl
|
||||
<< " -p | Enable/Disable UPnP" << std::endl
|
||||
<< " -2 | Force replacement of headers in video stream"sv << std::endl
|
||||
<< " -p | Enable/Disable UPnP"sv << std::endl
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
/** Call the print_help function.
|
||||
|
||||
Calls the print_help function and then exits.
|
||||
*/
|
||||
namespace help {
|
||||
int entry(const char *name, int argc, char *argv[]) {
|
||||
print_help(name);
|
||||
@@ -82,6 +90,10 @@ int entry(const char *name, int argc, char *argv[]) {
|
||||
}
|
||||
} // namespace help
|
||||
|
||||
/** Print the version details to stdout.
|
||||
|
||||
This function prints the version details to stdout and then exits.
|
||||
*/
|
||||
namespace version {
|
||||
int entry(const char *name, int argc, char *argv[]) {
|
||||
std::cout << PROJECT_NAME << " version: v" << PROJECT_VER << std::endl;
|
||||
@@ -275,7 +287,7 @@ int main(int argc, char *argv[]) {
|
||||
upnp_unmap = upnp::start();
|
||||
});
|
||||
|
||||
//FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
|
||||
// FIXME: Temporary workaround: Simple-Web_server needs to be updated or replaced
|
||||
if(shutdown_event->peek()) {
|
||||
return 0;
|
||||
}
|
||||
@@ -326,4 +338,4 @@ int write_file(const char *path, const std::string_view &contents) {
|
||||
|
||||
std::uint16_t map_port(int port) {
|
||||
return (std::uint16_t)((int)config::sunshine.port + port);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/22/19.
|
||||
//
|
||||
|
||||
#ifndef SUNSHINE_MAIN_H
|
||||
#define SUNSHINE_MAIN_H
|
||||
@@ -54,4 +52,4 @@ MAIL(rumble);
|
||||
} // namespace mail
|
||||
|
||||
|
||||
#endif //SUNSHINE_MAIN_H
|
||||
#endif // SUNSHINE_MAIN_H
|
||||
@@ -1,6 +1,4 @@
|
||||
//
|
||||
// Created by loki on 12/27/19.
|
||||
//
|
||||
|
||||
#include "network.h"
|
||||
#include "utility.h"
|
||||
@@ -112,4 +110,4 @@ void free_host(ENetHost *host) {
|
||||
|
||||
enet_host_destroy(host);
|
||||
}
|
||||
} // namespace net
|
||||
} // namespace net
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user