2018-09-11 04:01:45 +02:00
|
|
|
{ stdenv
|
|
|
|
, runCommand
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pulseaudio
|
|
|
|
, pkgconfig
|
2018-10-17 15:55:05 +02:00
|
|
|
, ffmpeg_4
|
|
|
|
, patchelf
|
2018-11-04 15:14:16 +01:00
|
|
|
, fdk_aac
|
2018-09-11 04:01:45 +02:00
|
|
|
, libtool
|
2019-04-15 04:32:56 +02:00
|
|
|
, ldacbt
|
2018-09-11 04:01:45 +02:00
|
|
|
, cmake
|
|
|
|
, bluez
|
|
|
|
, dbus
|
|
|
|
, sbc
|
2018-10-17 15:55:05 +02:00
|
|
|
, lib
|
2018-09-11 04:01:45 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pulseSources = runCommand "pulseaudio-sources" {} ''
|
|
|
|
mkdir $out
|
|
|
|
tar -xf ${pulseaudio.src}
|
|
|
|
mv pulseaudio*/* $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "pulseaudio-modules-bt";
|
2019-08-09 12:24:23 +02:00
|
|
|
version = "1.3";
|
2018-09-11 04:01:45 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2019-04-15 04:32:56 +02:00
|
|
|
rev = "v${version}";
|
2019-08-09 12:24:23 +02:00
|
|
|
sha256 = "00xmidcw4fvpbmg0nsm2gk5zw26fpyjbc0pjk6mzr570zbnyqqbn";
|
2018-09-11 04:01:45 +02:00
|
|
|
};
|
|
|
|
|
2018-10-17 15:55:05 +02:00
|
|
|
patches = [
|
|
|
|
./fix-install-path.patch
|
2019-06-27 15:50:38 +02:00
|
|
|
./fix-aac-defaults.patch
|
2018-10-17 15:55:05 +02:00
|
|
|
];
|
|
|
|
|
2018-09-11 04:01:45 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
2018-10-17 15:55:05 +02:00
|
|
|
patchelf
|
2018-09-11 04:01:45 +02:00
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pulseaudio
|
2018-10-17 15:55:05 +02:00
|
|
|
ffmpeg_4
|
2018-11-04 15:14:16 +01:00
|
|
|
fdk_aac
|
2018-09-11 04:01:45 +02:00
|
|
|
libtool
|
2019-04-15 04:32:56 +02:00
|
|
|
ldacbt
|
2018-09-11 04:01:45 +02:00
|
|
|
bluez
|
|
|
|
dbus
|
|
|
|
sbc
|
|
|
|
];
|
|
|
|
|
2018-10-17 15:55:05 +02:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream bundles pulseaudio as a submodule
|
2018-09-11 04:01:45 +02:00
|
|
|
rm -r pa
|
|
|
|
ln -s ${pulseSources} pa
|
2018-10-17 15:55:05 +02: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 04:32:56 +02:00
|
|
|
--set-rpath "${ldacbt}/lib:${lib.getLib ffmpeg_4}/lib:$out/lib/pulse-${pulseaudio.version}/modules:$orig_rpath" \
|
2018-10-17 15:55:05 +02:00
|
|
|
"$so"
|
|
|
|
done
|
2018-09-11 04:01:45 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/EHfive/pulseaudio-modules-bt";
|
2018-11-04 15:14:16 +01:00
|
|
|
description = "LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support for Linux PulseAudio";
|
2018-09-11 04:01:45 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ adisbladis ];
|
|
|
|
};
|
|
|
|
}
|