2018-09-11 03:01:45 +01:00
|
|
|
{ stdenv
|
|
|
|
, runCommand
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pulseaudio
|
|
|
|
, pkgconfig
|
2018-10-17 14:55:05 +01:00
|
|
|
, ffmpeg_4
|
|
|
|
, patchelf
|
2018-11-04 14:14:16 +00:00
|
|
|
, fdk_aac
|
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}";
|
2019-02-06 17:52:50 +00:00
|
|
|
version = "unstable-2019-01-05";
|
2018-09-11 03:01:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2019-02-06 17:52:50 +00:00
|
|
|
rev = "4b0cde160c96f40d860fef267a6ded49ae045be0";
|
|
|
|
sha256 = "15jw5nf2dhqqdwzyh2x5kdkrq7f3qn140gw6gmspcai9kplhk24w";
|
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 = [
|
|
|
|
pulseaudio
|
2018-10-17 14:55:05 +01:00
|
|
|
ffmpeg_4
|
2018-11-04 14:14:16 +00:00
|
|
|
fdk_aac
|
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 \
|
2018-10-17 20:04:36 +01:00
|
|
|
--set-rpath "${lib.getLib ffmpeg_4}/lib:$out/lib/pulse-${pulseaudio.version}/modules:$orig_rpath" \
|
2018-10-17 14:55:05 +01:00
|
|
|
"$so"
|
|
|
|
done
|
2018-09-11 03:01:45 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://github.com/EHfive/pulseaudio-modules-bt;
|
2018-11-04 14:14:16 +00:00
|
|
|
description = "LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support for Linux PulseAudio";
|
2018-09-11 03:01:45 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ adisbladis ];
|
|
|
|
};
|
|
|
|
}
|