|
| 1 | +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | +# vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
| 3 | +# |
| 4 | +# LiveAudioServer — https://github.com/dsward2/LiveAudioServer |
| 5 | +# |
| 6 | +# Submission notes (for macports.org): |
| 7 | +# * Place this file at audio/liveaudioserver/Portfile in the macports-ports |
| 8 | +# tree. |
| 9 | +# * After tagging a release on GitHub (e.g. `git tag v0.1.0 && git push --tags`), |
| 10 | +# replace the rmd160/sha256/size placeholders below with the actual values |
| 11 | +# reported by `port checksum liveaudioserver`. |
| 12 | +# * The build invokes `swift build`, which relies on Xcode or the Command Line |
| 13 | +# Tools being installed on the user's machine. The Swift toolchain itself is |
| 14 | +# not a MacPorts dependency, matching how other Swift CLI ports |
| 15 | +# (e.g. swiftlint, swiftformat) ship today. |
| 16 | + |
| 17 | +PortSystem 1.0 |
| 18 | +PortGroup github 1.0 |
| 19 | + |
| 20 | +github.setup dsward2 LiveAudioServer 0.1.0 v |
| 21 | +github.tarball_from archive |
| 22 | + |
| 23 | +name liveaudioserver |
| 24 | +categories audio net |
| 25 | +license Apache-2 |
| 26 | +maintainers {github.com:dsward2 @dsward2} \ |
| 27 | + openmaintainer |
| 28 | + |
| 29 | +description Live audio streaming server (MP3 + AAC + HLS) for macOS |
| 30 | + |
| 31 | +long_description \ |
| 32 | + LiveAudioServer is a zero-UI macOS command-line tool that reads live \ |
| 33 | + 16-bit PCM audio from stdin or a UDP/TCP socket and streams it \ |
| 34 | + simultaneously as MP3 and AAC/M4A (with optional HLS) over HTTP. No \ |
| 35 | + intermediate files, no third-party server, no container process. |
| 36 | + |
| 37 | +homepage https://github.com/dsward2/LiveAudioServer |
| 38 | + |
| 39 | +checksums rmd160 0000000000000000000000000000000000000000 \ |
| 40 | + sha256 0000000000000000000000000000000000000000000000000000000000000000 \ |
| 41 | + size 0 |
| 42 | + |
| 43 | +# macOS 13 Ventura or later (matches the SwiftPM Package.swift `.macOS(.v13)` |
| 44 | +# platform requirement and the AudioToolbox / Network.framework APIs in use). |
| 45 | +platforms {darwin >= 22} |
| 46 | + |
| 47 | +# Build-time tools and runtime libraries from MacPorts. |
| 48 | +depends_build port:pkgconfig |
| 49 | +depends_lib port:lame |
| 50 | + |
| 51 | +# SwiftPM is not autoconf-based. |
| 52 | +use_configure no |
| 53 | + |
| 54 | +# `swift build` writes to ~/Library/Caches/org.swift.swiftpm by default; the |
| 55 | +# --disable-sandbox flag avoids tripping SwiftPM's own sandbox when running |
| 56 | +# under MacPorts' build environment. |
| 57 | +build.cmd swift |
| 58 | +build.target build |
| 59 | +build.args --configuration release \ |
| 60 | + --disable-sandbox \ |
| 61 | + -Xlinker -L${prefix}/lib \ |
| 62 | + -Xcc -I${prefix}/include |
| 63 | + |
| 64 | +# Make sure libmp3lame from MacPorts is discoverable via pkg-config when |
| 65 | +# SwiftPM invokes pkg-config to resolve the CLame system-library target. |
| 66 | +build.env PKG_CONFIG_PATH=${prefix}/lib/pkgconfig |
| 67 | + |
| 68 | +# Install the single SwiftPM-produced binary under ${prefix}/bin, and tuck the |
| 69 | +# LICENSE + README under ${prefix}/share/doc/${name} for users who want them. |
| 70 | +destroot { |
| 71 | + xinstall -m 0755 \ |
| 72 | + ${worksrcpath}/.build/release/LiveAudioServer \ |
| 73 | + ${destroot}${prefix}/bin/liveaudioserver |
| 74 | + |
| 75 | + xinstall -d ${destroot}${prefix}/share/doc/${name} |
| 76 | + xinstall -m 0644 ${worksrcpath}/LICENSE \ |
| 77 | + ${destroot}${prefix}/share/doc/${name}/LICENSE |
| 78 | + xinstall -m 0644 ${worksrcpath}/README.md \ |
| 79 | + ${destroot}${prefix}/share/doc/${name}/README.md |
| 80 | +} |
| 81 | + |
| 82 | +# Smoke test: `--version` is self-contained — no ports opened, no audio I/O. |
| 83 | +test.run yes |
| 84 | +test.cmd ${worksrcpath}/.build/release/LiveAudioServer |
| 85 | +test.target |
| 86 | +test.args --version |
0 commit comments