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
|
2019-04-15 03:32:56 +01:00
|
|
|
, ldacbt
|
2018-09-11 03:01:45 +01:00
|
|
|
, 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-04-15 03:32:56 +01:00
|
|
|
version = "1.1.99";
|
2018-09-11 03:01:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2019-04-15 03:32:56 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0x670xbd62r3fs9a8pa5p4ppvxn6m64hvlrqa702gvikcvyrmwcg";
|
2018-09-11 03:01:45 +01:00
|
|
|
};
|
|
|
|
|
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
|
2019-04-15 03:32:56 +01:00
|
|
|
ldacbt
|
2018-09-11 03:01:45 +01:00
|
|
|
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 \
|
2019-04-15 03:32:56 +01:00
|
|
|
--set-rpath "${ldacbt}/lib:${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 ];
|
|
|
|
};
|
|
|
|
}
|