# -*- 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

PortSystem              1.0
PortGroup               github 1.0
PortGroup               xcode 1.0

github.setup            deweller switchaudio-osx 1.2.2
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
revision                2
categories              audio sysutils
maintainers             {i0ntempest @i0ntempest} openmaintainer
license                 MIT

description             A command-line utility to switch the audio source on Mac OS X.
long_description        {*}${description}

checksums               rmd160  62d8e1d8ff51671e9473d6866dce672f604cc200 \
                        sha256  09d6e9167ed55df08f778b97d2cd925793927cbfea778d70caa8e5d939c66ba1 \
                        size    22138

# https://github.com/deweller/switchaudio-osx/pull/67
patchfiles-append       0001-audio_switch.h-fix-for-pre-10.8.patch

xcode.project           AudioSwitcher.xcodeproj
xcode.configuration     Release
xcode.build.settings    SYMROOT=build
xcode.target            SwitchAudioSource

destroot {
    copy ${worksrcpath}/build/Release/SwitchAudioSource ${destroot}${prefix}/bin
    ln -s SwitchAudioSource ${destroot}${prefix}/bin/switch-audio-source
}

test.run                yes
test.cmd                ${worksrcpath}/build/Release/SwitchAudioSource
test.target
test.args               -a
