Sunshine/packaging/macos/Portfile
Cathy J. Fitzpatrick 3cc12dfbe7
macOS: New implementation of service publication (#2786)
The current implementation of service publication on macOS uses
`avahi-client`, but the majority of macOS machines do not have Avahi
installed because macOS provides a native alternative (`mDNSresponder`),
meaning that there is no reason to install Avahi.

The current implementation also attempts to load the Avahi client
libraries using `dlopen(3)`, which has a variety of restrictions on
macOS, such as only being willing to load from certain directories.
Depending on where the Avahi binaries are installed, they might not
be loadable through the current invocation of `dlopen(3)`.

Instead of using an Avahi client on macOS, it makes more sense to use
the native macOS API for publishing services via `mDNSresponder`. This
commit supplies such an implementation that uses the macOS native API.
It also has the advantage of being much simpler than the previous
implementation. Furthermore, this new implementation works on all
macOS machines, because it relies only on native APIs, rather than on
third-party software that is not commonly installed on macOS.
2024-07-07 15:19:51 +00:00

77 lines
2.9 KiB
Tcl

# -*- 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
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"
}
# https://guide.macports.org/chunked/reference.dependencies.html
depends_build-append port:doxygen \
port:graphviz \
port:npm9 \
port:pkgconfig \
port:python311 \
port:py311-pip
depends_lib port:curl \
port:libopus \
port:miniupnpc
configure.args -DBOOST_USE_STATIC=ON \
-DBUILD_WERROR=ON \
-DCMAKE_INSTALL_PREFIX=${prefix} \
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets
configure.env-append BRANCH=@GITHUB_BRANCH@
configure.env-append BUILD_VERSION=@BUILD_VERSION@
configure.env-append COMMIT=@GITHUB_COMMIT@
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."
test.run yes
test.dir ${build.dir}/tests
test.target ""
test.cmd ./test_sunshine
test.args --gtest_color=yes --gtest_filter=-*HIDTest.*:-*DeathTest.*