Add MacOS build

This commit is contained in:
ReenigneArcher 2022-04-30 19:20:16 -04:00
parent 12bf5cffc5
commit 639af4f08a
4 changed files with 78 additions and 14 deletions

View File

@ -215,6 +215,60 @@ jobs:
last_version: ${{ needs.check_changelog.outputs.last_version }}
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:
name: Windows
runs-on: windows-2019
@ -265,8 +319,8 @@ jobs:
cpack -G ZIP
# move
mv Sunshine.exe ../artifacts/sunshine-windows-installer.exe
mv Sunshine.zip ../artifacts/sunshine-windows-standalone.zip
mv Sunshine.exe ../artifacts/sunshine-windows.exe
mv Sunshine.zip ../artifacts/sunshine-windows.zip
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}

View File

@ -127,8 +127,8 @@ if(WIN32)
elseif(APPLE)
add_compile_definitions(SUNSHINE_PLATFORM="macos")
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(/usr/local/lib)
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)
find_package(FFmpeg REQUIRED)
@ -531,9 +531,9 @@ if(APPLE) # TODO: test
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime)
# TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop
# set(CPACK_BUNDLE_NAME "Sunshine")
# set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist")
# set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist")
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns")
endif()
if(UNIX AND NOT APPLE)
install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}")

View File

@ -78,11 +78,15 @@ MacOS
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:macos?logo=github&style=for-the-badge
:alt: GitHub issues by-label
#. 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.
Disk Image File option:
#. Download and install ``sunshine.dmg``
Portfile option:
#. 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
-------
@ -92,7 +96,11 @@ Windows
.. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:windows:11?logo=github&style=for-the-badge
: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
.. _Dockerhub.io: https://hub.docker.com/repository/docker/sunshinestream/sunshine

View File

@ -14,14 +14,14 @@ MacPorts
Install Requirements
.. code-block:: bash
sudo port install cmake boost libopus ffmpeg
sudo port install cmake boost ffmpeg libopus
Homebrew
""""""""
Install Requirements
.. 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:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
@ -35,6 +35,8 @@ Build
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 ..``