Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 91 lines 2.5 kB view raw
1{ 2 stdenv, 3 apulse, 4 libpulseaudio, 5 pkg-config, 6 intltool, 7}: 8 9stdenv.mkDerivation { 10 pname = "libpressureaudio"; 11 version = apulse.version; 12 13 src = libpulseaudio.src; 14 15 nativeBuildInputs = [ 16 pkg-config 17 intltool 18 ]; 19 20 dontConfigure = true; 21 dontBuild = true; 22 23 installPhase = '' 24 echo "Copying libraries from apulse." 25 mkdir -p $out/lib 26 ls ${apulse}/lib/apulse $out/lib 27 cp -a ${apulse}/lib/apulse/* $out/lib/ 28 29 echo "Copying headers from pulseaudio." 30 mkdir -p $out/include/pulse 31 cp -a src/pulse/*.h $out/include/pulse 32 33 echo "Generating custom pkgconfig definitions." 34 mkdir -p $out/lib/pkgconfig 35 for a in libpulse.pc libpulse-simple.pc libpulse-mainloop-glib.pc ; do 36 cat > $out/lib/pkgconfig/$a << EOF 37 prefix=$out 38 libdir=$out/lib 39 includedir=$out/include 40 41 EOF 42 done 43 44 cat >> $out/lib/pkgconfig/libpulse.pc << EOF 45 Name: libpulse 46 Description: PulseAudio Client Interface 47 Version: ${libpulseaudio.version}-rebootstrapped 48 Libs: -L$out/lib -lpulse 49 Cflags: -I$out/include -D_REENTRANT 50 EOF 51 52 cat >> $out/lib/pkgconfig/libpulse-simple.pc << EOF 53 Name: libpulse-simple 54 Description: PulseAudio Simplified Synchronous Client Interface 55 Version: ${libpulseaudio.version}-rebootstrapped 56 Libs: -L$out/lib -lpulse-simple 57 Cflags: -I$out/include -D_REENTRANT 58 Requires: libpulse 59 EOF 60 61 cat >> $out/lib/pkgconfig/libpulse-mainloop-glib.pc << EOF 62 Name: libpulse-mainloop-glib 63 Description: PulseAudio GLib 2.0 Main Loop Wrapper 64 Version: ${libpulseaudio.version}-rebootstrapped 65 Libs: -L$out/lib -lpulse-mainloop-glib 66 Cflags: -I$out/include -D_REENTRANT 67 Requires: libpulse glib-2.0 68 EOF 69 ''; 70 71 meta = apulse.meta // { 72 description = "Libpulse without any sound daemons over pure ALSA"; 73 longDescription = '' 74 apulse (${apulse.meta.homepage}) implements most of libpulse 75 API over pure ALSA in 5% LOC of the original PulseAudio. 76 77 But apulse is made to be used as a wrapper that substitutes its 78 replacement libs into LD_LIBRARY_PATH. The problem with that is 79 that you still have to link against the original libpulse. 80 81 pressureaudio (http://git.r-36.net/pressureaudio/) wraps apulse 82 with everything you need to replace libpulse completely. 83 84 This derivation is a reimplementation of pressureaudio in pure 85 nix. 86 87 You can simply override libpulse with this and most 88 packages would just work. 89 ''; 90 }; 91}