aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/servers/pulseaudio')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch100
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/correct-ldflags.patch13
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/default.nix4
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/hsphfpd.nix46
-rw-r--r--infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/pali.nix219
5 files changed, 382 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch
new file mode 100644
index 000000000000..dd4de7321e95
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch
@@ -0,0 +1,100 @@
+
+diff --git a/meson.build b/meson.build
+index 86af7243e..e2d48ab94 100644
+--- a/meson.build
++++ b/meson.build
+@@ -65,6 +65,11 @@ datadir = join_paths(prefix, get_option('datadir'))
+ localedir = join_paths(prefix, get_option('localedir'))
+ localstatedir = join_paths(prefix, get_option('localstatedir'))
+ sysconfdir = join_paths(prefix, get_option('sysconfdir'))
++if get_option('sysconfdir_install') != ''
++ sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'))
++else
++ sysconfdir_install = sysconfdir
++endif
+ privlibdir = join_paths(libdir, 'pulseaudio')
+
+ alsadatadir = get_option('alsadatadir')
+@@ -75,6 +80,11 @@ endif
+ pkgconfigdir = join_paths(libdir, 'pkgconfig')
+ pulselibexecdir = join_paths(libexecdir, 'pulse')
+ pulsesysconfdir = join_paths(sysconfdir, 'pulse')
++if get_option('sysconfdir_install') != ''
++ pulsesysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'), 'pulse')
++else
++ pulsesysconfdir_install = pulsesysconfdir
++endif
+
+ modlibexecdir = get_option('modlibexecdir')
+ if modlibexecdir == ''
+diff --git a/meson_options.txt b/meson_options.txt
+index 824f24e08..59a2b57ab 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -66,6 +66,9 @@ option('bashcompletiondir',
+ option('zshcompletiondir',
+ type : 'string',
+ description : 'Directory for zsh completion scripts ["no" disables]')
++option('sysconfdir_install',
++ type: 'string', value: '',
++ description: 'sysconfdir to use during installation')
+
+ # Optional features
+
+diff --git a/src/daemon/meson.build b/src/daemon/meson.build
+index 9c9f807e7..425cecb46 100644
+--- a/src/daemon/meson.build
++++ b/src/daemon/meson.build
+@@ -53,7 +53,7 @@ if x11_dep.found()
+ po_dir : po_dir,
+ type : 'desktop',
+ install : true,
+- install_dir : join_paths(sysconfdir, 'xdg', 'autostart'),
++ install_dir : join_paths(sysconfdir_install, 'xdg', 'autostart'),
+ )
+
+ desktop_utils = find_program('desktop-file-validate', required: false)
+@@ -85,7 +85,7 @@ custom_target('daemon.conf',
+ command : [m4, '@INPUT@'],
+ build_by_default : true,
+ install : true,
+- install_dir : pulsesysconfdir,
++ install_dir : pulsesysconfdir_install,
+ )
+
+ default_conf = configuration_data()
+@@ -111,7 +111,7 @@ custom_target('default.pa',
+ command : [m4, '@INPUT@'],
+ build_by_default : true,
+ install : true,
+- install_dir : pulsesysconfdir,
++ install_dir : pulsesysconfdir_install,
+ )
+
+ system_conf = configuration_data()
+@@ -132,12 +132,12 @@ custom_target('system.pa',
+ command : [m4, '@INPUT@'],
+ build_by_default : true,
+ install : true,
+- install_dir : pulsesysconfdir,
++ install_dir : pulsesysconfdir_install,
+ )
+
+ if dbus_dep.found()
+ install_data('pulseaudio-system.conf',
+- install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d')
++ install_dir : join_paths(sysconfdir_install, 'dbus-1', 'system.d')
+ )
+ endif
+
+diff --git a/src/pulse/meson.build b/src/pulse/meson.build
+index aaebff53e..05a29a0d0 100644
+--- a/src/pulse/meson.build
++++ b/src/pulse/meson.build
+@@ -130,5 +130,5 @@ client_conf_file = configure_file(
+ input : 'client.conf.in',
+ output : 'client.conf',
+ configuration : client_conf,
+- install_dir : pulsesysconfdir,
++ install_dir : pulsesysconfdir_install,
+ )
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/correct-ldflags.patch b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/correct-ldflags.patch
new file mode 100644
index 000000000000..174cb8b4f746
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/correct-ldflags.patch
@@ -0,0 +1,13 @@
+diff --git a/meson.build b/meson.build
+index 45df103f0..d57d13172 100644
+--- a/meson.build
++++ b/meson.build
+@@ -342,7 +342,7 @@ cdata.set('MESON_BUILD', 1)
+ # On ELF systems we don't want the libraries to be unloaded since we don't clean them up properly,
+ # so we request the nodelete flag to be enabled.
+ # On other systems, we don't really know how to do that, but it's welcome if somebody can tell.
+-nodelete_link_args = ['-Wl,-z,nodelete']
++nodelete_link_args = cc.get_supported_link_arguments(['-Wl,-z,nodelete'])
+
+ # Code coverage
+
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/default.nix b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/default.nix
index 513249cb7ad5..c9e2c3aa6e5e 100644
--- a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/default.nix
@@ -124,6 +124,10 @@ stdenv.mkDerivation rec {
--prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
'';
+ passthru = {
+ pulseDir = "lib/pulse-" + lib.versions.majorMinor version;
+ };
+
meta = {
description = "Sound server for POSIX and Win32 systems";
homepage = "http://www.pulseaudio.org/";
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/hsphfpd.nix b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/hsphfpd.nix
new file mode 100644
index 000000000000..dd2f5f07a2f0
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/hsphfpd.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchFromGitHub, makeWrapper, perlPackages }:
+
+let
+ perlLibs = with perlPackages; [ NetDBus XMLTwig XMLParser ];
+in
+stdenv.mkDerivation {
+ pname = "hsphfpd";
+ version = "2020-11-27";
+
+ src = fetchFromGitHub {
+ owner = "pali";
+ repo = "hsphfpd-prototype";
+ rev = "58ffbf8f1b457e46801039d572cd344472828714";
+ sha256 = "1hyg3cz6s58k6a7a3hcbs6wfk14cflnikd9psi7sirq6cn1z0ggb";
+ };
+
+ nativeBuildInputs = [ makeWrapper ];
+ buildInputs = [ perlPackages.perl ];
+ dontBuild = true;
+
+ installPhase = ''
+ runHook preInstall
+
+ mkdir -p $out/share/dbus-1/system.d
+ cp org.hsphfpd.conf $out/share/dbus-1/system.d
+
+ mkdir -p $out/bin
+ cp *.pl $out/bin
+
+ runHook postInstall
+ '';
+
+ postFixup = ''
+ for f in $out/bin/*.pl; do
+ wrapProgram "$f" --set PERL5LIB "${perlPackages.makePerlPath perlLibs}"
+ done
+ '';
+
+ meta = with stdenv.lib; {
+ description = "Bluetooth HSP/HFP daemon";
+ homepage = "https://github.com/pali/hsphfpd-prototype";
+ license = licenses.artistic1;
+ maintainers = with maintainers; [ gebner ];
+ platforms = platforms.linux;
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/pali.nix b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/pali.nix
new file mode 100644
index 000000000000..d5ae80b5e798
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/servers/pulseaudio/pali.nix
@@ -0,0 +1,219 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitLab
+, meson
+, ninja
+, pkgconfig
+, libsndfile
+, libtool
+, makeWrapper
+, perlPackages
+, xorg
+, libcap
+, alsaLib
+, glib
+, dconf
+, avahi
+, libjack2
+, libasyncns
+, lirc
+, dbus
+, sbc
+, bluez5
+, udev
+, openssl
+, fftwFloat
+, soxr
+, speexdsp
+, systemd
+, webrtc-audio-processing
+, gtk3
+, tdb
+, orc
+, check
+, gettext
+, gst_all_1
+, libopenaptx
+
+, x11Support ? true
+
+, # Whether to support the JACK sound system as a backend.
+ jackaudioSupport ? false
+
+, airtunesSupport ? true
+
+, bluetoothSupport ? true
+
+, remoteControlSupport ? true
+
+, zeroconfSupport ? true
+
+, # Whether to build only the library.
+ libOnly ? false
+
+# Building from Git source
+, fromGit ? true
+
+, CoreServices
+, AudioUnit
+, Cocoa
+}:
+
+stdenv.mkDerivation rec {
+ pname = "${if libOnly then "lib" else ""}pulseaudio-hsphfpd";
+ version = "13.99.2";
+
+ outputs = [ "out" "dev" ];
+
+ # https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/288
+ src = fetchFromGitLab {
+ domain = "gitlab.freedesktop.org";
+ owner = "pali";
+ repo = "pulseaudio";
+ rev = "5336b39e7e03cf50386e719e287a712b59730eb8";
+ sha256 = "0vc0i5rzkns3xw6y2q0c94p2qdi5k3mgjvhicgq1b0py2qxmji16";
+ };
+
+ patches = [
+ ./add-option-for-installation-sysconfdir.patch
+ ./correct-ldflags.patch
+ ];
+
+ # Says it should be v${version} but it's parsing logic is broken
+ preConfigure = lib.optionalString fromGit ''
+ sed -i "s@version : run_command.*@version: '${version}',@" meson.build
+ '';
+
+ nativeBuildInputs = [
+ gettext
+ makeWrapper
+ meson
+ ninja
+ pkgconfig
+ perlPackages.perl
+ perlPackages.XMLParser
+ ];
+
+ checkInputs = [
+ check
+ ];
+
+ propagatedBuildInputs = lib.optional stdenv.isLinux libcap;
+
+ buildInputs = [
+ libopenaptx
+ fftwFloat
+ libsndfile
+ libtool
+ orc
+ soxr
+ speexdsp
+ tdb
+ sbc
+ gst_all_1.gst-plugins-base
+ ] ++ lib.optionals bluetoothSupport [
+ bluez5
+ ] ++ lib.optionals stdenv.isLinux [
+ dbus
+ glib
+ gtk3
+ libasyncns
+ ] ++ lib.optionals stdenv.isDarwin [
+ AudioUnit
+ Cocoa
+ CoreServices
+ ] ++ lib.optionals (!libOnly) (
+ lib.optionals x11Support [
+ xorg.libXi
+ xorg.libXtst
+ xorg.xlibsWrapper
+ ] ++ lib.optionals stdenv.isLinux [
+ alsaLib
+ systemd
+ udev
+ ] ++ lib.optional airtunesSupport openssl
+ ++ lib.optional jackaudioSupport libjack2
+ ++ lib.optional remoteControlSupport lirc
+ ++ lib.optional zeroconfSupport avahi
+ ++ [ webrtc-audio-processing ]
+ );
+
+ mesonFlags = [
+ "--localstatedir=/var"
+ "--sysconfdir=/etc"
+ "-Daccess_group=audio"
+ "-Dbashcompletiondir=${placeholder "out"}/share/bash-completions/completions"
+ "-Dman=false" # TODO: needs xmltoman; also doesn't check for this
+ "-Dsysconfdir_install=${placeholder "out"}/etc"
+ "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
+ "-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
+ "-Dzshcompletiondir=${placeholder "out"}/share/zsh/site-functions"
+ ] ++ lib.optionals (!stdenv.isLinux) [
+ "-Dasyncns=disabled"
+ "-Ddbus=disabled"
+ "-Dglib=disabled"
+ "-Dgsettings=disabled"
+ "-Dgtk=disabled"
+ ] ++ lib.optionals (!stdenv.isLinux || libOnly) [
+ "-Dalsa=disabled"
+ "-Dsystemd=disabled"
+ "-Dudev=disabled"
+ ] ++ lib.optional libOnly "-Dwebrtc-aec=disabled"
+ ++ lib.optional (!x11Support) "-Dx11=disabled"
+ ++ lib.optional (!bluetoothSupport) "-Dbluez5=false"
+ ++ lib.optional (!airtunesSupport) "-Dopenssl=disabled"
+ ++ lib.optional (!jackaudioSupport) "-Djack=disabled"
+ ++ lib.optional (!remoteControlSupport) "-Dlirc=disabled"
+ ++ lib.optional (!zeroconfSupport) "-Davahi=disabled"
+ ++ lib.optional (!doCheck) "-Dtests=false";
+
+ # To create ~/.config/pulse
+ preCheck = ''
+ export HOME=$(mktemp -d)
+ '';
+
+ doCheck = true;
+
+ # not sure what the best practices are here -- can't seem to find a way
+ # for the compiler to bring in stdlib and stdio (etc.) properly
+ # the alternative is to copy the files from /usr/include to src, but there are
+ # probably a large number of files that would need to be copied (I stopped
+ # after the seventh)
+ NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I/usr/include";
+
+ NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreServices -framework Cocoa -framework AudioUnit";
+
+ postInstall = ''
+ moveToOutput lib/cmake "$dev"
+ rm -f $out/bin/qpaeq # this is packaged by the "qpaeq" package now, because of missing deps
+ '' + lib.optionalString libOnly ''
+ rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
+ '';
+
+ preFixup = lib.optionalString (stdenv.isLinux && !libOnly) ''
+ wrapProgram $out/libexec/pulse/gsettings-helper \
+ --prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${pname}-${version}" \
+ --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
+ '';
+
+ passthru = {
+ pulseDir = "lib/pulse-" + lib.versions.majorMinor version;
+ };
+
+ meta = with lib; {
+ description = "A featureful, general-purpose sound server";
+ homepage = "http://www.pulseaudio.org/";
+ license = licenses.lgpl2Plus;
+ maintainers = with maintainers; [ lovek323 ];
+ platforms = platforms.unix;
+ longDescription = ''
+ PulseAudio is a sound system for POSIX OSes, meaning that it is
+ a proxy for your sound applications. It allows you to do advanced
+ operations on your sound data as it passes between your application
+ and your hardware. Things like transferring the audio to a different machine,
+ changing the sample format or channel count and mixing several sounds into one
+ are easily achieved using a sound server.
+ '';
+ };
+}