2018-09-11 05:01:45 +03:00
|
|
|
{ stdenv
|
|
|
|
, runCommand
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pulseaudio
|
|
|
|
, pkgconfig
|
2020-06-13 05:31:01 +03:00
|
|
|
, ffmpeg
|
2018-10-17 16:55:05 +03:00
|
|
|
, patchelf
|
2018-11-04 17:14:16 +03:00
|
|
|
, fdk_aac
|
2018-09-11 05:01:45 +03:00
|
|
|
, libtool
|
2019-04-15 05:32:56 +03:00
|
|
|
, ldacbt
|
2018-09-11 05:01:45 +03:00
|
|
|
, cmake
|
|
|
|
, bluez
|
|
|
|
, dbus
|
|
|
|
, sbc
|
2018-10-17 16:55:05 +03:00
|
|
|
, lib
|
2018-09-11 05:01:45 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pulseSources = runCommand "pulseaudio-sources" {} ''
|
|
|
|
mkdir $out
|
|
|
|
tar -xf ${pulseaudio.src}
|
|
|
|
mv pulseaudio*/* $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "pulseaudio-modules-bt";
|
2020-06-06 23:46:39 +03:00
|
|
|
version = "1.4";
|
2018-09-11 05:01:45 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2019-04-15 05:32:56 +03:00
|
|
|
rev = "v${version}";
|
2020-06-06 23:46:39 +03:00
|
|
|
sha256 = "0bzg6x405j39axnkvc6n6vkl1hv1frk94y1i9sl170081bk23asd";
|
2018-09-11 05:01:45 +03:00
|
|
|
};
|
|
|
|
|
2018-10-17 16:55:05 +03:00
|
|
|
patches = [
|
|
|
|
./fix-install-path.patch
|
|
|
|
];
|
|
|
|
|
2018-09-11 05:01:45 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
2018-10-17 16:55:05 +03:00
|
|
|
patchelf
|
2018-09-11 05:01:45 +03:00
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pulseaudio
|
2020-06-13 05:31:01 +03:00
|
|
|
ffmpeg
|
2018-11-04 17:14:16 +03:00
|
|
|
fdk_aac
|
2018-09-11 05:01:45 +03:00
|
|
|
libtool
|
2019-04-15 05:32:56 +03:00
|
|
|
ldacbt
|
2018-09-11 05:01:45 +03:00
|
|
|
bluez
|
|
|
|
dbus
|
|
|
|
sbc
|
|
|
|
];
|
|
|
|
|
2018-10-17 16:55:05 +03:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream bundles pulseaudio as a submodule
|
2018-09-11 05:01:45 +03:00
|
|
|
rm -r pa
|
|
|
|
ln -s ${pulseSources} pa
|
2018-10-17 16:55:05 +03:00
|
|
|
|
|
|
|
# Pulseaudio version is detected with a -rebootstrapped suffix which build system assumptions
|
|
|
|
substituteInPlace config.h.in --replace PulseAudio_VERSION ${pulseaudio.version}
|
2020-10-26 04:18:26 +03:00
|
|
|
substituteInPlace CMakeLists.txt --replace '${"\${PULSE_DIR}"}' ${pulseaudio.pulseDir}
|
2020-06-06 23:46:39 +03:00
|
|
|
|
|
|
|
# Fraunhofer recommends to enable afterburner but upstream has it set to false by default
|
|
|
|
substituteInPlace src/modules/bluetooth/a2dp/a2dp_aac.c \
|
|
|
|
--replace "info->aac_afterburner = false;" "info->aac_afterburner = true;"
|
2018-10-17 16:55:05 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for so in $out/lib/pulse-${pulseaudio.version}/modules/*.so; do
|
|
|
|
orig_rpath=$(patchelf --print-rpath "$so")
|
|
|
|
patchelf \
|
2020-10-26 04:18:26 +03:00
|
|
|
--set-rpath "${ldacbt}/lib:${lib.getLib ffmpeg}/lib:$out/${pulseaudio.pulseDir}/modules:$orig_rpath" \
|
2018-10-17 16:55:05 +03:00
|
|
|
"$so"
|
|
|
|
done
|
2018-09-11 05:01:45 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://github.com/EHfive/pulseaudio-modules-bt";
|
2018-11-04 17:14:16 +03:00
|
|
|
description = "LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support for Linux PulseAudio";
|
2018-09-11 05:01:45 +03:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ adisbladis ];
|
|
|
|
};
|
|
|
|
}
|