diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 236d1602..44e75515 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 02a11376..944bff64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 3900561a..6634a714 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -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 `_ -#. Download the `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 `_ + #. Download the `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 diff --git a/docs/source/building/macos.rst b/docs/source/building/macos.rst index 97a58a23..51ae6b15 100644 --- a/docs/source/building/macos.rst +++ b/docs/source/building/macos.rst @@ -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 ..``