diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/misc/apulse | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/misc/apulse')
-rw-r--r-- | nixpkgs/pkgs/misc/apulse/default.nix | 35 | ||||
-rw-r--r-- | nixpkgs/pkgs/misc/apulse/pressureaudio.nix | 82 |
2 files changed, 117 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/misc/apulse/default.nix b/nixpkgs/pkgs/misc/apulse/default.nix new file mode 100644 index 000000000000..58e50a50f0f9 --- /dev/null +++ b/nixpkgs/pkgs/misc/apulse/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchFromGitHub, alsaLib, cmake, pkgconfig, glib +, tracingSupport ? true, logToStderr ? true }: + +let oz = x: if x then "1" else "0"; in + +stdenv.mkDerivation rec { + name = "apulse-${version}"; + version = "0.1.11.1"; + + src = fetchFromGitHub { + owner = "i-rinat"; + repo = "apulse"; + rev = "602b3a02b4b459d4652a3a0a836fab6f892d4080"; + sha256 = "0yk9vgb4aws8xnkhdhgpxp5c0rri8yq61yxk85j99j8ax806i3r8"; + }; + + enableParallelBuilding = true; + + nativeBuildInputs = [ cmake pkgconfig ]; + + buildInputs = [ alsaLib glib ]; + + cmakeFlags = [ + "-DWITH_TRACE=${oz tracingSupport}" + "-DLOG_TO_STDERR=${oz logToStderr}" + ]; + + meta = with stdenv.lib; { + description = "PulseAudio emulation for ALSA"; + homepage = https://github.com/i-rinat/apulse; + license = licenses.mit; + platforms = platforms.linux; + maintainers = [ maintainers.jagajaga ]; + }; +} diff --git a/nixpkgs/pkgs/misc/apulse/pressureaudio.nix b/nixpkgs/pkgs/misc/apulse/pressureaudio.nix new file mode 100644 index 000000000000..142b72784578 --- /dev/null +++ b/nixpkgs/pkgs/misc/apulse/pressureaudio.nix @@ -0,0 +1,82 @@ +{ stdenv, apulse, libpulseaudio, pkgconfig, intltool, autoreconfHook }: + +stdenv.mkDerivation { + name = "libpressureaudio-${apulse.version}"; + + src = libpulseaudio.src; + + nativeBuildInputs = [ pkgconfig intltool autoreconfHook ]; + + configurePhase = ":"; + + buildPhase = ":"; + + 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 + Libs: -L$out/lib -lpulse + 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 + Libs: -L$out/lib -lpulse-simple + 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 + Libs: -L$out/lib -lpulse-mainloop-glib + Cflags: -I$out/include -D_REENTRANT + Requires: libpulse glib-2.0 + EOF + ''; + + meta = apulse.meta // { + description = "libpulse without any sound daemons over pure ALSA"; + longDescription = '' + apulse (${apulse.meta.homepage}) implements most of libpulse + 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 + that you still have to link against the original libpulse. + + pressureaudio (http://git.r-36.net/pressureaudio/) wraps apulse + with everything you need to replace libpulse completely. + + This derivation is a reimplementation of pressureaudio in pure + nix. + + You can simply override libpulse with this and most + packages would just work. + ''; + }; +} |