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}";
|
2018-11-04 14:14:16 +00:00
|
|
|
version = "unstable-2018-11-01";
|
2018-09-11 03:01:45 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "EHfive";
|
|
|
|
repo = "pulseaudio-modules-bt";
|
2018-11-04 14:14:16 +00:00
|
|
|
rev = "a2f62fcaa702bb883c07d074ebca8d7135520ab8";
|
|
|
|
sha256 = "1fhg7q9064zikhy0xxldn4fvh49pc47mgikcbd9yhsk66gcn6zj3";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|