Skip to content

Commit bd11d7e

Browse files
v0.5.1: Homebrew tap support, Windows orphan mpv fix
- Add brew job to release workflow for automated Homebrew tap updates - Users can install via: brew tap nevermore23274/aethertune && brew install aethertune - Requires HOMEBREW_TAP_TOKEN secret for cross-repo push - Fix orphaned mpv.exe on Windows when terminal is closed via X button - Use Windows Job Objects to tie mpv lifecycle to AetherTune process - All new code behind #[cfg(windows)] to keep builds separate
1 parent a1e8f7f commit bd11d7e

3 files changed

Lines changed: 81 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,67 @@ jobs:
253253
dput ppa:patchgoblin/aethertune "aethertune_${VERSION}-ppa1~${SERIES}_source.changes"
254254
255255
cd "${STARTDIR}"
256-
done
256+
done
257+
258+
brew:
259+
name: Update Homebrew Tap
260+
needs: [build-linux, release]
261+
runs-on: ubuntu-latest
262+
continue-on-error: true
263+
264+
steps:
265+
- name: Update Homebrew formula
266+
env:
267+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
268+
run: |
269+
VERSION="${{ needs.build-linux.outputs.version }}"
270+
TAG="${{ needs.build-linux.outputs.tag }}"
271+
SHA256="${{ needs.build-linux.outputs.sha256 }}"
272+
273+
mkdir -p tap
274+
cd tap
275+
git clone https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/nevermore23274/homebrew-aethertune.git .
276+
mkdir -p Formula
277+
278+
cat > Formula/aethertune.rb <<'FORMULA'
279+
class Aethertune < Formula
280+
desc "Terminal-based internet radio player with real-time audio visualization, built in Rust"
281+
homepage "https://github.com/nevermore23274/AetherTune"
282+
url "RELEASE_URL"
283+
sha256 "RELEASE_SHA256"
284+
license "MIT"
285+
version "RELEASE_VERSION"
286+
287+
depends_on :linux
288+
289+
def install
290+
bin.install "AetherTune" => "aethertune"
291+
end
292+
293+
def caveats
294+
<<~EOS
295+
AetherTune requires mpv and PulseAudio/PipeWire for full functionality:
296+
297+
sudo apt install mpv pulseaudio-utils # Debian/Ubuntu
298+
sudo pacman -S mpv pipewire-pulse # Arch
299+
300+
Without parec, the visualizer falls back to simulated mode.
301+
EOS
302+
end
303+
304+
test do
305+
assert_match version.to_s, shell_output("#{bin}/aethertune --version 2>&1", 2)
306+
end
307+
end
308+
FORMULA
309+
310+
sed -i 's/^ //' Formula/aethertune.rb
311+
sed -i "s|RELEASE_URL|https://github.com/nevermore23274/AetherTune/releases/download/${TAG}/AetherTune-${TAG}-linux-x86_64.tar.gz|" Formula/aethertune.rb
312+
sed -i "s|RELEASE_SHA256|${SHA256}|" Formula/aethertune.rb
313+
sed -i "s|RELEASE_VERSION|${VERSION}|" Formula/aethertune.rb
314+
315+
git config user.name "sineyed"
316+
git config user.email "sineyed@users.noreply.github.com"
317+
git add Formula/aethertune.rb
318+
git diff --cached --quiet || git commit -m "Update to v${VERSION}"
319+
git push

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "AetherTune"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
edition = "2024"
55

66
[dependencies]

src/audio/player.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,20 +540,31 @@ fn shell_escape(s: &str) -> String {
540540
fn create_kill_on_close_job() -> Option<windows_sys::Win32::Foundation::HANDLE> {
541541
use windows_sys::Win32::System::JobObjects::*;
542542

543+
// Define locally to avoid needing extra windows-sys feature flags for IO_COUNTERS
544+
#[repr(C)]
545+
struct ExtendedLimitInfo {
546+
basic: JOBOBJECT_BASIC_LIMIT_INFORMATION,
547+
io_info: [u8; 48], // IO_COUNTERS padding
548+
process_memory_limit: usize,
549+
job_memory_limit: usize,
550+
peak_process_memory_used: usize,
551+
peak_job_memory_used: usize,
552+
}
553+
543554
unsafe {
544555
let job = CreateJobObjectW(std::ptr::null(), std::ptr::null());
545-
if job == 0 {
556+
if job.is_null() {
546557
return None;
547558
}
548559

549-
let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = std::mem::zeroed();
550-
info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
560+
let mut info: ExtendedLimitInfo = std::mem::zeroed();
561+
info.basic.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
551562

552563
let ok = SetInformationJobObject(
553564
job,
554565
JobObjectExtendedLimitInformation,
555566
&info as *const _ as *const _,
556-
std::mem::size_of::<JOBOBJECT_EXTENDED_LIMIT_INFORMATION>() as u32,
567+
std::mem::size_of::<ExtendedLimitInfo>() as u32,
557568
);
558569

559570
if ok == 0 {
@@ -574,6 +585,6 @@ fn assign_process_to_job(
574585
use windows_sys::Win32::System::JobObjects::AssignProcessToJobObject;
575586

576587
unsafe {
577-
AssignProcessToJobObject(job, process as isize);
588+
AssignProcessToJobObject(job, process as *mut std::ffi::c_void);
578589
}
579590
}

0 commit comments

Comments
 (0)