2022-05-09 13:13:21 +02:00
|
|
|
{ stdenv, apulse, libpulseaudio, pkg-config, intltool }:
|
2018-02-16 23:57:00 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2021-07-17 23:40:43 +02:00
|
|
|
pname = "libpressureaudio";
|
|
|
|
version = apulse.version;
|
2018-02-16 23:57:00 +01:00
|
|
|
|
|
|
|
src = libpulseaudio.src;
|
|
|
|
|
2022-05-09 13:13:21 +02:00
|
|
|
nativeBuildInputs = [ pkg-config intltool ];
|
2018-02-16 23:57:00 +01:00
|
|
|
|
2019-06-19 17:36:06 +02:00
|
|
|
dontConfigure = true;
|
2021-07-18 23:42:48 +02:00
|
|
|
dontBuild = true;
|
2018-02-16 23:57:00 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
echo "Copying libraries from apulse."
|
|
|
|
mkdir -p $out/lib
|
|
|
|
ls ${apulse}/lib/apulse $out/lib
|
|
|
|
cp -a ${apulse}/lib/apulse/* $out/lib/
|
|
|
|
|
|
|
|
echo "Copying headers from pulseaudio."
|
|
|
|
mkdir -p $out/include/pulse
|
|
|
|
cp -a src/pulse/*.h $out/include/pulse
|
|
|
|
|
|
|
|
echo "Generating custom pkgconfig definitions."
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
for a in libpulse.pc libpulse-simple.pc libpulse-mainloop-glib.pc ; do
|
|
|
|
cat > $out/lib/pkgconfig/$a << EOF
|
|
|
|
prefix=$out
|
|
|
|
libdir=$out/lib
|
|
|
|
includedir=$out/include
|
|
|
|
|
|
|
|
EOF
|
|
|
|
done
|
|
|
|
|
|
|
|
cat >> $out/lib/pkgconfig/libpulse.pc << EOF
|
|
|
|
Name: libpulse
|
|
|
|
Description: PulseAudio Client Interface
|
|
|
|
Version: ${libpulseaudio.version}-rebootstrapped
|
2019-06-19 17:36:06 +02:00
|
|
|
Libs: -L$out/lib -lpulse
|
2018-02-16 23:57:00 +01:00
|
|
|
Cflags: -I$out/include -D_REENTRANT
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >> $out/lib/pkgconfig/libpulse-simple.pc << EOF
|
|
|
|
Name: libpulse-simple
|
|
|
|
Description: PulseAudio Simplified Synchronous Client Interface
|
|
|
|
Version: ${libpulseaudio.version}-rebootstrapped
|
2019-06-19 17:36:06 +02:00
|
|
|
Libs: -L$out/lib -lpulse-simple
|
2018-02-16 23:57:00 +01:00
|
|
|
Cflags: -I$out/include -D_REENTRANT
|
|
|
|
Requires: libpulse
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat >> $out/lib/pkgconfig/libpulse-mainloop-glib.pc << EOF
|
|
|
|
Name: libpulse-mainloop-glib
|
|
|
|
Description: PulseAudio GLib 2.0 Main Loop Wrapper
|
|
|
|
Version: ${libpulseaudio.version}-rebootstrapped
|
2019-06-19 17:36:06 +02:00
|
|
|
Libs: -L$out/lib -lpulse-mainloop-glib
|
2018-02-16 23:57:00 +01:00
|
|
|
Cflags: -I$out/include -D_REENTRANT
|
|
|
|
Requires: libpulse glib-2.0
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = apulse.meta // {
|
2018-02-22 23:09:07 +01:00
|
|
|
description = "libpulse without any sound daemons over pure ALSA";
|
2018-02-16 23:57:00 +01:00
|
|
|
longDescription = ''
|
2018-02-22 23:09:07 +01:00
|
|
|
apulse (${apulse.meta.homepage}) implements most of libpulse
|
2018-02-16 23:57:00 +01:00
|
|
|
API over pure ALSA in 5% LOC of the original PulseAudio.
|
|
|
|
|
|
|
|
But apulse is made to be used as a wrapper that substitutes its
|
|
|
|
replacement libs into LD_LIBRARY_PATH. The problem with that is
|
2018-02-22 23:09:07 +01:00
|
|
|
that you still have to link against the original libpulse.
|
2018-02-16 23:57:00 +01:00
|
|
|
|
|
|
|
pressureaudio (http://git.r-36.net/pressureaudio/) wraps apulse
|
2018-02-22 23:09:07 +01:00
|
|
|
with everything you need to replace libpulse completely.
|
2018-02-16 23:57:00 +01:00
|
|
|
|
|
|
|
This derivation is a reimplementation of pressureaudio in pure
|
|
|
|
nix.
|
|
|
|
|
2018-02-22 23:09:07 +01:00
|
|
|
You can simply override libpulse with this and most
|
2018-02-16 23:57:00 +01:00
|
|
|
packages would just work.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|