2018-09-11 03:01:45 +01:00
|
|
|
{ stdenv
|
|
|
|
, runCommand
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libpulseaudio
|
|
|
|
, pulseaudio
|
|
|
|
, pkgconfig
|
2018-10-17 14:55:05 +01:00
|
|
|
, ffmpeg_4
|
|
|
|
, patchelf
|
2018-09-11 03:01:45 +01:00
|
|
|
, libtool
|
|
|
|
, cmake
|
|
|
|
, bluez
|
|
|
|
, dbus
|
|
|
|
, sbc
|
2018-10-17 14:55:05 +01:00
|
|
|
, lib
|
2018-09-11 03:01:45 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pulseSources = runCommand "pulseaudio-sources" {} ''
|
|
|
|
mkdir $out
|
|
|
|
tar -xf ${pulseaudio.src}
|
|
|
|
mv pulseaudio*/* $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "pulseaudio-modules-bt-${version}";
|
2018-10-17 14:55:05 +01:00
|
|
|
version = "unstable-2018-10-16";
|
2018-09-11 03:01:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2018-10-17 14:55:05 +01:00
|
|
|
rev = "552c2b48c0cc7dd44d0746b261f7c7d5559e8e30";
|
|
|
|
sha256 = "052jb1hjx1in7bafx4zpn78s7r6f2y7djriwi36dzqy9wmalmyjy";
|
2018-09-11 03:01:45 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2018-10-17 14:55:05 +01:00
|
|
|
patches = [
|
|
|
|
./fix-install-path.patch
|
|
|
|
];
|
|
|
|
|
2018-09-11 03:01:45 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
2018-10-17 14:55:05 +01:00
|
|
|
patchelf
|
2018-09-11 03:01:45 +01:00
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libpulseaudio
|
|
|
|
pulseaudio
|
2018-10-17 14:55:05 +01:00
|
|
|
ffmpeg_4
|
2018-09-11 03:01:45 +01:00
|
|
|
libtool
|
|
|
|
bluez
|
|
|
|
dbus
|
|
|
|
sbc
|
|
|
|
];
|
|
|
|
|
2018-10-17 14:55:05 +01:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream bundles pulseaudio as a submodule
|
2018-09-11 03:01:45 +01:00
|
|
|
rm -r pa
|
|
|
|
ln -s ${pulseSources} pa
|
2018-10-17 14:55:05 +01:00
|
|
|
|
|
|
|
# Pulseaudio version is detected with a -rebootstrapped suffix which build system assumptions
|
|
|
|
substituteInPlace config.h.in --replace PulseAudio_VERSION ${pulseaudio.version}
|
|
|
|
substituteInPlace CMakeLists.txt --replace '${"\${PulseAudio_VERSION}"}' ${pulseaudio.version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for so in $out/lib/pulse-${pulseaudio.version}/modules/*.so; do
|
|
|
|
orig_rpath=$(patchelf --print-rpath "$so")
|
|
|
|
patchelf \
|
|
|
|
--set-rpath "$orig_rpath:${lib.getLib ffmpeg_4}/lib:$out/lib/pulse-${pulseaudio.version}/modules" \
|
|
|
|
"$so"
|
|
|
|
done
|
2018-09-11 03:01:45 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/EHfive/pulseaudio-modules-bt;
|
|
|
|
description = "SBC, Sony LDAC codec (A2DP Audio) support for Pulseaudio";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ adisbladis ];
|
|
|
|
};
|
|
|
|
}
|