2022-02-24 20:09:00 +00:00
|
|
|
# -*- 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
|
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
# initial PR into macports: https://github.com/macports/macports-ports/pull/15143
|
|
|
|
|
2022-06-11 03:20:24 +00:00
|
|
|
PortSystem 1.0
|
|
|
|
PortGroup cmake 1.1
|
|
|
|
PortGroup github 1.0
|
|
|
|
PortGroup boost 1.0
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-11 03:20:24 +00:00
|
|
|
name @PROJECT_NAME@
|
|
|
|
version @PROJECT_VERSION@
|
2022-06-21 02:53:40 +00:00
|
|
|
revision 0
|
2022-06-11 03:20:24 +00:00
|
|
|
categories multimedia emulators games
|
|
|
|
platforms darwin
|
|
|
|
license GPL-3
|
2022-06-21 02:53:40 +00:00
|
|
|
maintainers @SunshineStream
|
2022-06-11 03:20:24 +00:00
|
|
|
description @PROJECT_DESCRIPTION@
|
2022-06-21 02:53:40 +00:00
|
|
|
|
|
|
|
# long_description will not be split into multiple lines as it's configured by CMakeLists
|
|
|
|
long_description @PROJECT_LONG_DESCRIPTION@
|
2022-06-11 03:20:24 +00:00
|
|
|
homepage @PROJECT_HOMEPAGE_URL@
|
2022-06-21 02:53:40 +00:00
|
|
|
master_sites https://github.com/sunshinestream/sunshine/releases
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
compiler.cxx_standard 2017
|
2022-06-11 03:20:24 +00:00
|
|
|
fetch.type git
|
2022-06-21 02:53:40 +00:00
|
|
|
|
|
|
|
git.url @GITHUB_CLONE_URL@
|
|
|
|
git.branch @GITHUB_COMMIT@
|
|
|
|
|
2022-02-24 20:09:00 +00:00
|
|
|
post-fetch {
|
|
|
|
system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive"
|
|
|
|
}
|
|
|
|
|
2022-06-11 03:20:24 +00:00
|
|
|
depends_lib port:avahi \
|
|
|
|
port:ffmpeg \
|
|
|
|
port:libopus
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-11 03:20:24 +00:00
|
|
|
boost.version 1.76
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
configure.args -DCMAKE_INSTALL_PREFIX=${prefix} \
|
|
|
|
-DSUNSHINE_ASSETS_DIR=etc/sunshine/assets \
|
|
|
|
-DSUNSHINE_CONFIG_DIR=etc/sunshine/config
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-11 03:20:24 +00:00
|
|
|
startupitem.create yes
|
|
|
|
startupitem.executable "${prefix}/bin/{$name}"
|
|
|
|
startupitem.location LaunchDaemons
|
|
|
|
startupitem.name ${name}
|
|
|
|
startupitem.netchange yes
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-16 20:18:59 +00:00
|
|
|
platform darwin {
|
|
|
|
if { ${os.major} < 20 } {
|
|
|
|
# See: https://github.com/SunshineStream/Sunshine/discussions/117#discussioncomment-2513494
|
|
|
|
notes-append "Port is limited to software encoding, when used with macOS releases prior to Big Sur."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
# destroot not required as cmake install directive handles moving files
|
2022-06-11 03:20:24 +00:00
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
# Rename files in `destroot`
|
|
|
|
post-destroot {
|
|
|
|
file rename ${destroot}${prefix}/etc/${name}/config/sunshine.conf ${destroot}${prefix}/etc/${name}/config/sunshine.conf.sample
|
|
|
|
file rename ${destroot}${prefix}/etc/${name}/config/apps.json ${destroot}${prefix}/etc/${name}/config/apps.json.sample
|
|
|
|
}
|
2022-02-24 20:09:00 +00:00
|
|
|
|
2022-06-21 02:53:40 +00:00
|
|
|
# Don't overwrite existing preference files
|
|
|
|
post-activate {
|
|
|
|
if {![file exists ${prefix}/etc/${name}/config/sunshine.conf]} {
|
|
|
|
file copy ${destroot}${prefix}/etc/${name}/config/sunshine.conf.sample \
|
|
|
|
${prefix}/etc/${name}/config/sunshine.conf
|
|
|
|
}
|
|
|
|
if {![file exists ${prefix}/etc/${name}/config/apps.json]} {
|
|
|
|
file copy ${destroot}${prefix}/etc/${name}/config/apps.json.sample \
|
|
|
|
${prefix}/etc/${name}/config/apps.json
|
|
|
|
}
|
2022-02-24 20:09:00 +00:00
|
|
|
}
|