Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 49b6ce8ce7ef
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 753656bbbc98
Choose a head ref
  • 6 commits
  • 10 files changed
  • 2 contributors

Commits on Nov 9, 2020

  1. pulseaudio-hsphfpd: init at 2020-11-02

    eadwu authored and gebner committed Nov 9, 2020
    Copy the full SHA
    3378435 View commit details
  2. treewide: generate pulseaudio pulseDir

    eadwu authored and gebner committed Nov 9, 2020
    Copy the full SHA
    0e4d0d9 View commit details

Commits on Nov 10, 2020

  1. hsphfpd: init at 2020-10-25

    eadwu authored and gebner committed Nov 10, 2020
    Copy the full SHA
    0f83b30 View commit details
  2. nixos/*: hsphfpd support

    eadwu authored and gebner committed Nov 10, 2020
    Copy the full SHA
    4d0ad27 View commit details
  3. Copy the full SHA
    7387dc5 View commit details

Commits on Nov 11, 2020

  1. Merge pull request #103225 from gebner/hsphfpd

    pulseaudio: add hsphfpd support
    gebner authored Nov 11, 2020
    Copy the full SHA
    753656b View commit details
2 changes: 1 addition & 1 deletion nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
@@ -263,7 +263,7 @@ in {
(drv: drv.override { pulseaudio = overriddenPackage; })
cfg.extraModules;
modulePaths = builtins.map
(drv: "${drv}/lib/pulse-${overriddenPackage.version}/modules")
(drv: "${drv}/${overriddenPackage.pulseDir}/modules")
# User-provided extra modules take precedence
(overriddenModules ++ [ overriddenPackage ]);
in lib.concatStringsSep ":" modulePaths;
32 changes: 28 additions & 4 deletions nixos/modules/services/hardware/bluetooth.nix
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@ in {
hardware.bluetooth = {
enable = mkEnableOption "support for Bluetooth";

hsphfpd.enable = mkEnableOption "support for hsphfpd[-prototype] implementation";

powerOnBoot = mkOption {
type = types.bool;
default = true;
@@ -72,15 +74,17 @@ in {
};
};

environment.systemPackages = [ bluez-bluetooth ];
environment.systemPackages = [ bluez-bluetooth ]
++ optionals cfg.hsphfpd.enable [ pkgs.hsphfpd ];

environment.etc."bluetooth/main.conf"= {
source = pkgs.writeText "main.conf"
(generators.toINI { } cfg.config + optionalString (cfg.extraConfig != null) cfg.extraConfig);
};

services.udev.packages = [ bluez-bluetooth ];
services.dbus.packages = [ bluez-bluetooth ];
services.dbus.packages = [ bluez-bluetooth ]
++ optionals cfg.hsphfpd.enable [ pkgs.hsphfpd ];
systemd.packages = [ bluez-bluetooth ];

systemd.services = {
@@ -90,11 +94,31 @@ in {
# restarting can leave people without a mouse/keyboard
unitConfig.X-RestartIfChanged = false;
};
};
}
// (optionalAttrs cfg.hsphfpd.enable {
hsphfpd = {
after = [ "bluetooth.service" ];
requires = [ "bluetooth.service" ];
wantedBy = [ "multi-user.target" ];

description = "A prototype implementation used for connecting HSP/HFP Bluetooth devices";
serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/hsphfpd.pl";
};
})
;

systemd.user.services = {
obex.aliases = [ "dbus-org.bluez.obex.service" ];
};
}
// (optionalAttrs cfg.hsphfpd.enable {
telephony_client = {
wantedBy = [ "default.target"];

description = "telephony_client for hsphfpd";
serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/telephony_client.pl";
};
})
;

};

12 changes: 8 additions & 4 deletions pkgs/applications/audio/pulseaudio-modules-bt/default.nix
Original file line number Diff line number Diff line change
@@ -18,8 +18,12 @@
let
pulseSources = runCommand "pulseaudio-sources" {} ''
mkdir $out
tar -xf ${pulseaudio.src}
mv pulseaudio*/* $out/
if [ -d ${pulseaudio.src} ]; then
ln -s ${pulseaudio.src}/* $out/
else
tar -xf ${pulseaudio.src}
mv pulseaudio*/* $out/
fi
'';

in stdenv.mkDerivation rec {
@@ -61,7 +65,7 @@ in stdenv.mkDerivation rec {
# 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}
substituteInPlace CMakeLists.txt --replace '${"\${PULSE_DIR}"}' ${pulseaudio.pulseDir}
# Fraunhofer recommends to enable afterburner but upstream has it set to false by default
substituteInPlace src/modules/bluetooth/a2dp/a2dp_aac.c \
@@ -72,7 +76,7 @@ in stdenv.mkDerivation rec {
for so in $out/lib/pulse-${pulseaudio.version}/modules/*.so; do
orig_rpath=$(patchelf --print-rpath "$so")
patchelf \
--set-rpath "${ldacbt}/lib:${lib.getLib ffmpeg}/lib:$out/lib/pulse-${pulseaudio.version}/modules:$orig_rpath" \
--set-rpath "${ldacbt}/lib:${lib.getLib ffmpeg}/lib:$out/${pulseaudio.pulseDir}/modules:$orig_rpath" \
"$so"
done
'';
Original file line number Diff line number Diff line change
@@ -8,4 +8,4 @@ index 8d20dbf..63fe7ba 100644
module-bluetooth-policy
- LIBRARY DESTINATION ${PulseAudio_modlibexecdir})
-
+ LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pulse-${PulseAudio_VERSION}/modules/)
+ LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${PULSE_DIR}/modules/)
100 changes: 100 additions & 0 deletions pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch
Original file line number Diff line number Diff line change
@@ -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,
)
13 changes: 13 additions & 0 deletions pkgs/servers/pulseaudio/correct-ldflags.patch
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions pkgs/servers/pulseaudio/default.nix
Original file line number Diff line number Diff line change
@@ -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/";
46 changes: 46 additions & 0 deletions pkgs/servers/pulseaudio/hsphfpd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ stdenv, fetchFromGitHub, makeWrapper, perlPackages }:

let
perlLibs = with perlPackages; [ NetDBus XMLTwig XMLParser ];
in
stdenv.mkDerivation {
pname = "hsphfpd";
version = "2020-10-25";

src = fetchFromGitHub {
owner = "pali";
repo = "hsphfpd-prototype";
rev = "601bf8f7bf2da97257aa6f786ec4cbb69b0ecbc8";
sha256 = "06hh0xmp143334x8dg5nmp5727g38q2m5kqsvlrfia6vw2hcq0v0";
};

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;
};
}
Loading