|
| 1 | +# MacPorts packaging |
| 2 | + |
| 3 | +This directory holds the canonical [MacPorts](https://www.macports.org) |
| 4 | +[Portfile](Portfile) for LiveAudioServer. The published port lives in |
| 5 | +[`macports/macports-ports`](https://github.com/macports/macports-ports) at |
| 6 | +`audio/liveaudioserver/Portfile`; the copy here is the source of truth that |
| 7 | +gets mirrored upstream at release time. |
| 8 | + |
| 9 | +## Toolchain assumption |
| 10 | + |
| 11 | +The build invokes `swift build`, which relies on Xcode or the Command Line |
| 12 | +Tools being installed on the user's machine. The Swift toolchain itself is |
| 13 | +not a MacPorts dependency, matching how other Swift CLI ports (e.g. |
| 14 | +`swiftlint`, `swiftformat`) ship today. |
| 15 | + |
| 16 | +## Cutting a new release |
| 17 | + |
| 18 | +1. Tag the upstream release on GitHub: |
| 19 | + ```bash |
| 20 | + git tag v0.2.0 && git push --tags |
| 21 | + ``` |
| 22 | +2. Bump the version in [Portfile](Portfile) (`github.setup` line — the third |
| 23 | + field). |
| 24 | +3. Recompute the distfile checksums against the new tarball. Easiest path is |
| 25 | + to let MacPorts do it: |
| 26 | + ```bash |
| 27 | + sudo /opt/local/bin/port clean liveaudioserver |
| 28 | + sudo /opt/local/bin/port -v checksum liveaudioserver |
| 29 | + ``` |
| 30 | + Or hash the tarball directly: |
| 31 | + ```bash |
| 32 | + url="https://github.com/dsward2/LiveAudioServer/archive/refs/tags/v0.2.0.tar.gz" |
| 33 | + curl -sLo /tmp/las.tgz "$url" |
| 34 | + echo "size: $(wc -c < /tmp/las.tgz | tr -d ' ')" |
| 35 | + echo "sha256: $(shasum -a 256 /tmp/las.tgz | awk '{print $1}')" |
| 36 | + echo "rmd160: $(openssl dgst -rmd160 /tmp/las.tgz | awk '{print $NF}')" |
| 37 | + ``` |
| 38 | +4. Paste the three values into [Portfile](Portfile) replacing the previous |
| 39 | + release's checksums. |
| 40 | +5. Verify the port still builds end-to-end: |
| 41 | + ```bash |
| 42 | + sudo /opt/local/bin/port -v install liveaudioserver |
| 43 | + /opt/local/bin/liveaudioserver --version |
| 44 | + sudo /opt/local/bin/port lint --nitpick liveaudioserver |
| 45 | + ``` |
| 46 | + |
| 47 | +## Local-test setup (one-time) |
| 48 | + |
| 49 | +To make `port` recognize this Portfile by name, register a local ports tree |
| 50 | +with MacPorts. The setup is described in detail in the project root README; |
| 51 | +the short version: |
| 52 | + |
| 53 | +```bash |
| 54 | +mkdir -p ~/macports-local/audio/liveaudioserver |
| 55 | +ln -sf "$PWD/Portfile" ~/macports-local/audio/liveaudioserver/Portfile |
| 56 | + |
| 57 | +# Add `file:///Users/<you>/macports-local` above the rsync line in |
| 58 | +# /opt/local/etc/macports/sources.conf, then: |
| 59 | +cd ~/macports-local && /opt/local/bin/portindex |
| 60 | +``` |
| 61 | + |
| 62 | +The symlink means edits in this directory flow into the local ports tree |
| 63 | +automatically — no re-copy needed when iterating. |
| 64 | + |
| 65 | +## Submitting / updating the upstream port |
| 66 | + |
| 67 | +The upstream copy at `macports/macports-ports` is a plain file, not a |
| 68 | +symlink. After updating [Portfile](Portfile) here: |
| 69 | + |
| 70 | +```bash |
| 71 | +cd ~/macports-ports # your fork of macports/macports-ports |
| 72 | +git checkout -b liveaudioserver-0.2.0 |
| 73 | +cp /path/to/LiveAudioServer/MacPorts/Portfile \ |
| 74 | + audio/liveaudioserver/Portfile |
| 75 | +git add audio/liveaudioserver/Portfile |
| 76 | +git commit -m "liveaudioserver: update to 0.2.0" |
| 77 | +git push origin liveaudioserver-0.2.0 |
| 78 | +gh pr create --repo macports/macports-ports \ |
| 79 | + --base master \ |
| 80 | + --title "liveaudioserver: update to 0.2.0" |
| 81 | +``` |
| 82 | + |
| 83 | +The macports-ports CI will re-run `port lint` and a sandboxed build on the PR. |
0 commit comments