Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

PulseAudio 3.0 #18838

Closed
wants to merge 9 commits into from
87 changes: 87 additions & 0 deletions Library/Formula/pulseaudio.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
require 'formula'

class Pulseaudio < Formula
homepage 'http://pulseaudio.org'
url 'http://freedesktop.org/software/pulseaudio/releases/pulseaudio-3.0.tar.gz'
sha1 '875ee8c39bb8413007004ffd31f6b35d6508a194'

head 'git://anongit.freedesktop.org/pulseaudio/pulseaudio'

option "with-dbus", "Enable dbus"

# Dependencies from http://www.freedesktop.org/wiki/Software/PulseAudio/Ports/OSX
if build.head?
depends_on :autoconf
depends_on :automake
depends_on :libtool
end

depends_on 'pkg-config' => :build
depends_on 'intltool' => :build
depends_on 'libsndfile'
depends_on 'speex'
depends_on 'gdbm'
depends_on 'liboil'
depends_on 'json-c'
depends_on 'dbus' if build.include? 'with-dbus'

def install
args = ["--prefix=#{prefix}",
"--disable-jack",
"--disable-hal",
"--disable-bluez",
"--disable-avahi",
"--with-udev-rules-dir=#{lib}/udev/rules.d",
"--with-mac-sysroot=#{MacOS.sdk_path}",
"--with-mac-version-min=#{MacOS.version}"]

args << '--disable-dbus' unless build.include? 'with-dbus'
args << "--disable-nls" if build.head? and not Formula.factory('libtool').installed?

if build.head? then
# It uses `git describe` to set the version string.
system "ln -s #{cached_download}/.git"
# For `git describe`, we need the full history and tags.
# If we already unhallowed earlier, this fails but we can ignore that.
system "git fetch --unshallow || true"
system "git fetch --tags"
system "git describe" # just test
system "./autogen.sh", *args
else
system "./configure", *args
end

# remove sconv_neon.c, mix_neon.c because it wont compile (it's ARM Neon related) and is not needed.
# see <https://bugs.freedesktop.org/show_bug.cgi?id=62986>.
system "echo > src/pulsecore/sconv_neon.c"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you reported this issue to the developers?

system "echo > src/pulsecore/mix_neon.c"
# fix shm_open mode. see <https://bugs.freedesktop.org/show_bug.cgi?id=62988>.
inreplace "src/pulsecore/shm.c", "& 0444", "& 0777"
# use rewritten semaphore-osx.c. see <https://bugs.freedesktop.org/show_bug.cgi?id=63014>.
system "curl https://gist.github.com/albertz/5291528/raw/semaphore-osx.c > src/pulsecore/semaphore-osx.c"

system "make"
system "make install"
end

def caveats; <<-EOS.undent
Edit `/usr/local/etc/pulse/default.pa` and remove the "module-detect" parts.
You might want to add these:

# Detect the CoreAudio soundcard.
load-module module-coreaudio-detect
# Listen on TCP port 4713.
# Note that this allows anonymous access from any network!
load-module module-native-protocol-tcp auth-anonymous=1

In `/usr/local/etc/pulse/daemon.conf`, you might want to set:

# Disable autoexit on idle.
exit-idle-time = -1
EOS
end

def test
system "#{bin}/pulseaudio"
end
end