Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding BlueZ to [PulseAudio] #3033

Merged
merged 27 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 109 additions & 27 deletions P/PulseAudio/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@
using BinaryBuilder, Pkg

name = "PulseAudio"
version = v"14.2.0"
version = v"15.0.0"

short_version = "$(version.major).$(version.minor)"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://freedesktop.org/software/pulseaudio/releases/pulseaudio-14.2.tar.gz", "902dd1928801bb5dc7b121754aa4110ce55768b5dff94a700e7bd58d3f597970")
ArchiveSource("https://freedesktop.org/software/pulseaudio/releases/pulseaudio-$short_version.tar.gz", "a570b592351586541daf27b5e4b82555d6ac46bb6920eb847bcf5818e92f4c1e"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
apk add gettext
apk add glib
apk add orc-compiler
apk add perl-xml-parser
apk add bash-completion
apk update
apk add bash-completion doxygen gettext glib orc-compiler perl-xml-parser
# make sure meson can find everything
sed -i -e "s~c_args = .*~c_args = ['-I${includedir}', '-L${libdir}']~" ${MESON_TARGET_TOOLCHAIN}
# I guess pulseaudio doesn't set install_rpath correctly?
find pulseaudio-* -type f | xargs sed -i "s~install_rpath : privlibdir~install_rpath : '\$ORIGIN/pulseaudio'~"
# For some reason, librt fails to get linked correctly, so add a flag
sed -i -e "s~c_link_args = .*~c_link_args = ['-lrt']~" ${MESON_TARGET_TOOLCHAIN}
cd pulseaudio-*
# Disable ffast-math; I repented
sed -i -e "s/link_args : \['-ffast-math'],//" src/daemon/meson.build
# pulseaudio seems to check for iconv_open but use libiconv_open?
sed -i -e "s/cc.has_function('iconv_open')/cc.has_function('libiconv_open')/" meson.build
# Force meson to use some libraries
if [[ "${target}" == powerpc64le-* ]]; then sed -i -e "s~'sys/capability.h',~~" meson.build; fi
# make rpath work with cross compilation
atomic_patch -p2 $WORKSPACE/srcdir/patches/rpath.patch
# disable fastmath
atomic_patch -p2 $WORKSPACE/srcdir/patches/fastmath.patch
# sys/capability.h doesn't seem to be workig on PowerPC
if [[ "${target}" == powerpc64le-* ]]; then
atomic_patch -p2 $WORKSPACE/srcdir/patches/capabilities.patch
fi
mkdir build
cd build
# I can't figure out how to build tdb, see https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/887
# BlueZ is in progress, see https://github.com/JuliaPackaging/Yggdrasil/pull/2582
meson .. -Ddatabase="gdbm" -Dbluez5="false" --cross-file=${MESON_TARGET_TOOLCHAIN}
# optional dependencies I can't build but might be useful
# Avahi Jack LIRC tdb WebRTC
meson .. -Ddatabase="gdbm" --cross-file=${MESON_TARGET_TOOLCHAIN}
ninja
ninja install
"""
Expand All @@ -46,38 +46,120 @@ platforms = filter!(Sys.islinux, supported_platforms())

# The products that we will ensure are always built
products = [
LibraryProduct("libpulse-simple", :libpulse_simple),
ExecutableProduct("pulseaudio", :pulseaudio),
LibraryProduct("module-native-protocol-tcp", :module_native_protocol_tcp, "lib/pulse-$short_version/modules"),
LibraryProduct("module-combine", :module_combine, "lib/pulse-$short_version/modules"),
LibraryProduct("module-native-protocol-fd", :module_native_protocol_fd, "lib/pulse-$short_version/modules"),
LibraryProduct("module-oss", :module_oss, "lib/pulse-$short_version/modules"),
LibraryProduct("module-card-restore", :module_card_restore, "lib/pulse-$short_version/modules"),
LibraryProduct("module-cli-protocol-unix", :module_cli_protocol_unix, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulse-mainloop-glib", :libpulse_mainloop_glib),
LibraryProduct("module-rescue-streams", :module_rescue_streams, "lib/pulse-$short_version/modules"),
LibraryProduct("module-filter-heuristics", :module_filter_heuristics, "lib/pulse-$short_version/modules"),
LibraryProduct("module-simple-protocol-tcp", :module_simple_protocol_tcp, "lib/pulse-$short_version/modules"),
LibraryProduct("module-raop-sink", :module_raop_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulsecommon-$short_version", :libpulsecommon, "lib/pulseaudio"),
ExecutableProduct("pasuspender", :pasuspender),
LibraryProduct("libprotocol-cli", :libprotocol_cli, "lib/pulse-$short_version/modules"),
LibraryProduct("module-mmkbd-evdev", :module_mmkbd_evdev, "lib/pulse-$short_version/modules"),
LibraryProduct("module-position-event-sounds", :module_position_event_sounds, "lib/pulse-$short_version/modules"),
LibraryProduct("module-virtual-sink", :module_virtual_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulsecore-$short_version", :libpulsecore, "lib/pulseaudio"),
LibraryProduct("module-pipe-source", :module_pipe_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-null-sink", :module_null_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-loopback", :module_loopback, "lib/pulse-$short_version/modules"),
LibraryProduct("liboss-util", :liboss_util, "lib/pulse-$short_version/modules"),
LibraryProduct("module-bluez5-device", :module_bluez5_device, "lib/pulse-$short_version/modules"),
LibraryProduct("module-sine-source", :module_sine_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-always-sink", :module_always_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulsedsp", :libpulsedsp, "lib/pulseaudio"),
LibraryProduct("module-device-restore", :module_device_restore, "lib/pulse-$short_version/modules"),
LibraryProduct("module-equalizer-sink", :module_equalizer_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("libcli", :libcli, "lib/pulse-$short_version/modules"),
LibraryProduct("module-console-kit", :module_console_kit, "lib/pulse-$short_version/modules"),
LibraryProduct("module-role-cork", :module_role_cork, "lib/pulse-$short_version/modules"),
LibraryProduct("module-role-ducking", :module_role_ducking, "lib/pulse-$short_version/modules"),
LibraryProduct("module-tunnel-sink", :module_tunnel_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-udev-detect", :module_udev_detect, "lib/pulse-$short_version/modules"),
LibraryProduct("module-detect", :module_detect, "lib/pulse-$short_version/modules"),
LibraryProduct("module-tunnel-source", :module_tunnel_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-stream-restore", :module_stream_restore, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulse-simple", :libpulse_simple),
LibraryProduct("module-augment-properties", :module_augment_properties, "lib/pulse-$short_version/modules"),
LibraryProduct("module-rtp-send", :module_rtp_send, "lib/pulse-$short_version/modules"),
LibraryProduct("module-remap-source", :module_remap_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-sine", :module_sine, "lib/pulse-$short_version/modules"),
LibraryProduct("module-combine-sink", :module_combine_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-intended-roles", :module_intended_roles, "lib/pulse-$short_version/modules"),
LibraryProduct("module-null-source", :module_null_source, "lib/pulse-$short_version/modules"),
ExecutableProduct("pacmd", :pacmd),
ExecutableProduct("pactl", :pactl),
ExecutableProduct("pulseaudio", :pulseaudio),
LibraryProduct("libbluez5-util", :libbluez5_util, "lib/pulse-$short_version/modules"),
LibraryProduct("librtp", :librtp, "lib/pulse-$short_version/modules"),
LibraryProduct("module-bluetooth-discover", :module_bluetooth_discover, "lib/pulse-$short_version/modules"),
LibraryProduct("module-bluetooth-policy", :module_bluetooth_policy, "lib/pulse-$short_version/modules"),
LibraryProduct("module-echo-cancel", :module_echo_cancel, "lib/pulse-$short_version/modules"),
LibraryProduct("module-virtual-source", :module_virtual_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-switch-on-connect", :module_switch_on_connect, "lib/pulse-$short_version/modules"),
LibraryProduct("libprotocol-simple", :libprotocol_simple, "lib/pulse-$short_version/modules"),
LibraryProduct("module-alsa-card", :module_alsa_card, "lib/pulse-$short_version/modules"),
LibraryProduct("module-tunnel-sink-new", :module_tunnel_sink_new, "lib/pulse-$short_version/modules"),
LibraryProduct("module-allow-passthrough", :module_allow_passthrough, "lib/pulse-$short_version/modules"),
LibraryProduct("module-http-protocol-unix", :module_http_protocol_unix, "lib/pulse-$short_version/modules"),
LibraryProduct("module-filter-apply", :module_filter_apply, "lib/pulse-$short_version/modules"),
LibraryProduct("libalsa-util", :libalsa_util, "lib/pulse-$short_version/modules"),
LibraryProduct("module-cli-protocol-tcp", :module_cli_protocol_tcp, "lib/pulse-$short_version/modules"),
LibraryProduct("module-simple-protocol-unix", :module_simple_protocol_unix, "lib/pulse-$short_version/modules"),
LibraryProduct("module-pipe-sink", :module_pipe_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-bluez5-discover", :module_bluez5_discover, "lib/pulse-$short_version/modules"),
LibraryProduct("module-native-protocol-unix", :module_native_protocol_unix, "lib/pulse-$short_version/modules"),
LibraryProduct("module-rtp-recv", :module_rtp_recv, "lib/pulse-$short_version/modules"),
LibraryProduct("module-alsa-sink", :module_alsa_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-default-device-restore", :module_default_device_restore, "lib/pulse-$short_version/modules"),
LibraryProduct("module-virtual-surround-sink", :module_virtual_surround_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-suspend-on-idle", :module_suspend_on_idle, "lib/pulse-$short_version/modules"),
LibraryProduct("module-rygel-media-server", :module_rygel_media_server, "lib/pulse-$short_version/modules"),
LibraryProduct("module-always-source", :module_always_source, "lib/pulse-$short_version/modules"),
LibraryProduct("libpulse", :libpulse),
LibraryProduct("libpulse-mainloop-glib", :libpulse_mainloop_glib),
ExecutableProduct("pacat", :pacat)
LibraryProduct("libraop", :libraop, "lib/pulse-$short_version/modules"),
LibraryProduct("module-dbus-protocol", :module_dbus_protocol, "lib/pulse-$short_version/modules"),
ExecutableProduct("pacat", :pacat),
LibraryProduct("module-match", :module_match, "lib/pulse-$short_version/modules"),
LibraryProduct("module-alsa-source", :module_alsa_source, "lib/pulse-$short_version/modules"),
LibraryProduct("module-hal-detect", :module_hal_detect, "lib/pulse-$short_version/modules"),
LibraryProduct("module-tunnel-source-new", :module_tunnel_source_new, "lib/pulse-$short_version/modules"),
LibraryProduct("module-volume-restore", :module_volume_restore, "lib/pulse-$short_version/modules"),
LibraryProduct("libprotocol-http", :libprotocol_http, "lib/pulse-$short_version/modules"),
ExecutableProduct("pactl", :pactl),
LibraryProduct("module-switch-on-port-available", :module_switch_on_port_available, "lib/pulse-$short_version/modules"),
LibraryProduct("module-ladspa-sink", :module_ladspa_sink, "lib/pulse-$short_version/modules"),
LibraryProduct("module-cli", :module_cli, "lib/pulse-$short_version/modules"),
LibraryProduct("module-device-manager", :module_device_manager, "lib/pulse-$short_version/modules"),
LibraryProduct("module-http-protocol-tcp", :module_http_protocol_tcp, "lib/pulse-$short_version/modules"),
LibraryProduct("libprotocol-native", :libprotocol_native, "lib/pulse-$short_version/modules"),
LibraryProduct("module-remap-sink", :module_remap_sink, "lib/pulse-$short_version/modules")
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="alsa_jll", uuid="45378030-f8ea-5b20-a7c7-1a9d95efb90e"))
Dependency(PackageSpec(name="BlueZ_jll", uuid="471b5b61-da80-5748-8755-67d5084d21f2"))
Dependency(PackageSpec(name="Check_jll", uuid="491db154-c145-5abe-9c32-446728d60cce"))
Dependency(PackageSpec(name="Dbus_jll", uuid="ee1fde0b-3d02-5ea6-8484-8dfef6360eab"))
Dependency(PackageSpec(name="eudev_jll", uuid="35ca27e7-8b34-5b7f-bca9-bdc33f59eb06"))
Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a"))
Dependency(PackageSpec(name="Gdbm_jll", uuid="54ca2031-c8dd-5cab-9ed4-295edde1660f"))
# TOOD: verify Gettext is actually needed at runtime
Dependency(PackageSpec(name="Gettext_jll", uuid="78b55507-aeef-58d4-861c-77aaff3498b1"), v"0.20.1"; compat="=0.20.1")
Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"), v"2.59.0"; compat="2.59.0")
Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"); compat="2.68.1")
Dependency(PackageSpec(name="GStreamer_jll", uuid="aaaaf01e-2457-52c6-9fe8-886f7267d736"))
Dependency(PackageSpec(name="libsndfile_jll", uuid="5bf562c0-5a39-5b4f-b979-f64ac885830c"))
Dependency(PackageSpec(name="libasyncns_jll", uuid="ed080073-db63-57db-a029-74e11ae80737"))
Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed"))
Dependency(PackageSpec(name="Libiconv_jll", uuid="94ce4f54-9a6c-5748-9c1c-f9c7231a4531"))
Dependency(PackageSpec(name="Libtool_jll", uuid="a76c16ae-fb8f-5ff0-8826-da3b7a640f0b"))
Dependency(PackageSpec(name="OpenSSL_jll", uuid="458c3c95-2e84-50aa-8efc-19380b2a3a95"))
Dependency(PackageSpec(name="ORC_jll", uuid="fb41591b-4dee-5dae-bf56-d83afd04fbc0"))
Dependency(PackageSpec(name="SBC_jll", uuid="da37f231-8920-5702-a09a-bdd970cb6ddc"))
Dependency(PackageSpec(name="SoXResampler_jll", uuid="fbe68eb6-6641-54c6-99e3-f7c7c4d73a57"))
Dependency(PackageSpec(name="SpeexDSP_jll", uuid="f2f9631b-9a4e-5b48-9975-88f638ec36a7"))

]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down
13 changes: 13 additions & 0 deletions P/PulseAudio/bundled/patches/capabilities.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git before/pulseaudio-15.0/meson.build after/pulseaudio-15.0/meson.build
index d7e468c..a45aeaf 100644
--- before/pulseaudio-15.0/meson.build
+++ after/pulseaudio-15.0/meson.build
@@ -235,7 +235,7 @@ check_headers = [
'sched.h',
'stdint.h',
'sys/atomic.h',
- 'sys/capability.h',
+
'sys/conf.h',
'sys/dl.h',
'sys/eventfd.h',
13 changes: 13 additions & 0 deletions P/PulseAudio/bundled/patches/fastmath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git before/pulseaudio-15.0/src/daemon/meson.build after/pulseaudio-15.0/src/daemon/meson.build
index 262e193..7bb207c 100644
--- before/pulseaudio-15.0/src/daemon/meson.build
+++ after/pulseaudio-15.0/src/daemon/meson.build
@@ -29,7 +29,7 @@ executable('pulseaudio',
install: true,
install_rpath : privlibdir,
include_directories : [configinc, topinc],
- link_args : ['-ffast-math'],
+
link_with : [libpulsecore, libpulsecommon, libpulse],
dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep],
c_args : pa_c_args,
Loading