Add MacOS build
This commit is contained in:
58
.github/workflows/CI.yml
vendored
58
.github/workflows/CI.yml
vendored
@@ -215,6 +215,60 @@ jobs:
|
|||||||
last_version: ${{ needs.check_changelog.outputs.last_version }}
|
last_version: ${{ needs.check_changelog.outputs.last_version }}
|
||||||
release_body: ${{ needs.check_changelog.outputs.release_body }}
|
release_body: ${{ needs.check_changelog.outputs.release_body }}
|
||||||
|
|
||||||
|
build_mac:
|
||||||
|
name: MacOS
|
||||||
|
runs-on: macos-11
|
||||||
|
needs: check_changelog
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Setup Dependencies MacOS
|
||||||
|
run: |
|
||||||
|
# install dependencies using homebrew
|
||||||
|
brew install boost cmake ffmpeg opus
|
||||||
|
|
||||||
|
# fix openssl header not found
|
||||||
|
cd /usr/local/include
|
||||||
|
ln -s ../opt/openssl/include/openssl .
|
||||||
|
|
||||||
|
- name: Build MacOS
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets ..
|
||||||
|
make -j ${nproc}
|
||||||
|
|
||||||
|
- name: Package MacOS
|
||||||
|
run: |
|
||||||
|
mkdir -p artifacts
|
||||||
|
cd build
|
||||||
|
|
||||||
|
# package
|
||||||
|
cpack -G DragNDrop
|
||||||
|
|
||||||
|
# move
|
||||||
|
mv Sunshine.dmg ../artifacts/sunshine.dmg
|
||||||
|
|
||||||
|
- name: Upload Artifacts
|
||||||
|
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: sunshine-macos
|
||||||
|
path: artifacts/
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
|
uses: SunshineStream/actions/create_release@master
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
next_version: ${{ needs.check_changelog.outputs.next_version }}
|
||||||
|
last_version: ${{ needs.check_changelog.outputs.last_version }}
|
||||||
|
release_body: ${{ needs.check_changelog.outputs.release_body }}
|
||||||
|
|
||||||
build_win:
|
build_win:
|
||||||
name: Windows
|
name: Windows
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
@@ -265,8 +319,8 @@ jobs:
|
|||||||
cpack -G ZIP
|
cpack -G ZIP
|
||||||
|
|
||||||
# move
|
# move
|
||||||
mv Sunshine.exe ../artifacts/sunshine-windows-installer.exe
|
mv Sunshine.exe ../artifacts/sunshine-windows.exe
|
||||||
mv Sunshine.zip ../artifacts/sunshine-windows-standalone.zip
|
mv Sunshine.zip ../artifacts/sunshine-windows.zip
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ if(WIN32)
|
|||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
add_compile_definitions(SUNSHINE_PLATFORM="macos")
|
add_compile_definitions(SUNSHINE_PLATFORM="macos")
|
||||||
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_mac.json")
|
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_mac.json")
|
||||||
link_directories(/opt/homebrew/lib/) # Default brew lib location
|
|
||||||
link_directories(/opt/local/lib)
|
link_directories(/opt/local/lib)
|
||||||
|
link_directories(/usr/local/lib)
|
||||||
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
|
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
|
||||||
|
|
||||||
find_package(FFmpeg REQUIRED)
|
find_package(FFmpeg REQUIRED)
|
||||||
@@ -531,9 +531,9 @@ if(APPLE) # TODO: test
|
|||||||
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)
|
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)
|
||||||
|
|
||||||
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
|
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
|
||||||
# set(CPACK_BUNDLE_NAME "Sunshine")
|
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
# set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist")
|
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist")
|
||||||
# set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
|
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
|
||||||
endif()
|
endif()
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
||||||
|
|||||||
@@ -78,11 +78,15 @@ MacOS
|
|||||||
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:macos?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:macos?logo=github&style=for-the-badge
|
||||||
:alt: GitHub issues by-label
|
:alt: GitHub issues by-label
|
||||||
|
|
||||||
#. Install `MacPorts <https://www.macports.org>`_
|
Disk Image File option:
|
||||||
#. Download the `Portfile <https://github.com/SunshineStream/Sunshine/blob/master/Portfile>`_ from this repository to
|
#. Download and install ``sunshine.dmg``
|
||||||
``/tmp``
|
|
||||||
#. In a terminal run ``cd /tmp && sudo port install``
|
Portfile option:
|
||||||
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
|
#. Install `MacPorts <https://www.macports.org>`_
|
||||||
|
#. Download the `Portfile <https://github.com/SunshineStream/Sunshine/blob/master/Portfile>`_ from this repository
|
||||||
|
to ``/tmp``
|
||||||
|
#. In a terminal run ``cd /tmp && sudo port install``
|
||||||
|
#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone.
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
-------
|
-------
|
||||||
@@ -92,7 +96,11 @@ Windows
|
|||||||
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:windows:11?logo=github&style=for-the-badge
|
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:windows:11?logo=github&style=for-the-badge
|
||||||
:alt: GitHub issues by-label
|
:alt: GitHub issues by-label
|
||||||
|
|
||||||
#. Download and extract ``sunshine-windows.zip``
|
Installed option:
|
||||||
|
#. Download and install ``sunshine-windows.exe``
|
||||||
|
|
||||||
|
Standalone option:
|
||||||
|
#. Download and extract ``sunshine-windows.zip``
|
||||||
|
|
||||||
.. _latest release: https://github.com/SunshineStream/Sunshine/releases/latest
|
.. _latest release: https://github.com/SunshineStream/Sunshine/releases/latest
|
||||||
.. _Dockerhub.io: https://hub.docker.com/repository/docker/sunshinestream/sunshine
|
.. _Dockerhub.io: https://hub.docker.com/repository/docker/sunshinestream/sunshine
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ MacPorts
|
|||||||
Install Requirements
|
Install Requirements
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
sudo port install cmake boost libopus ffmpeg
|
sudo port install cmake boost ffmpeg libopus
|
||||||
|
|
||||||
Homebrew
|
Homebrew
|
||||||
""""""""
|
""""""""
|
||||||
Install Requirements
|
Install Requirements
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
brew install boost cmake ffmpeg libopusenc
|
brew install boost cmake ffmpeg opus
|
||||||
# if there are issues with an SSL header that is not found:
|
# if there are issues with an SSL header that is not found:
|
||||||
cd /usr/local/include
|
cd /usr/local/include
|
||||||
ln -s ../opt/openssl/include/openssl .
|
ln -s ../opt/openssl/include/openssl .
|
||||||
@@ -35,6 +35,8 @@ Build
|
|||||||
cmake ..
|
cmake ..
|
||||||
make -j ${nproc}
|
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.
|
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 ..``
|
``cmake -DBOOST_ROOT=[boost path] ..``, e.g., ``cmake -DBOOST_ROOT=/opt/local/libexec/boost/1.76 ..``
|
||||||
|
|||||||
Reference in New Issue
Block a user