From 23c0ff138486526bb47f8d91c31cb23e72287c58 Mon Sep 17 00:00:00 2001 From: Kris La Date: Wed, 15 Dec 2021 22:50:28 +0700 Subject: [PATCH 1/3] libspatialaudio: init at 0.3.0;vlc: fix headphones mode --- pkgs/applications/video/vlc/default.nix | 12 ++++++++--- .../libraries/libspatialaudio/default.nix | 21 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/libraries/libspatialaudio/default.nix diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix index ce9a72aebf9a..5ef62ff6b466 100644 --- a/pkgs/applications/video/vlc/default.nix +++ b/pkgs/applications/video/vlc/default.nix @@ -7,8 +7,8 @@ , mpeg2dec, systemd, gnutls, avahi, libcddb, libjack2, SDL, SDL_image , libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, libssh2, liboggz , libass, libva, libdvbpsi, libdc1394, libraw1394, libopus -, libvdpau, libsamplerate, live555, fluidsynth, wayland, wayland-protocols -, ncurses, srt +, libvdpau, libsamplerate, libspatialaudio, live555, fluidsynth +, wayland, wayland-protocols, ncurses, srt , onlyLibVLC ? false , withQt5 ? true, qtbase, qtsvg, qtx11extras, wrapQtAppsHook , jackSupport ? false @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { libkate libtiger libv4l samba libssh2 liboggz libass libdvbpsi libva xorg.xlibsWrapper xorg.libXv xorg.libXvMC xorg.libXpm xorg.xcbutilkeysyms libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate - fluidsynth wayland wayland-protocols ncurses srt + libspatialaudio fluidsynth wayland wayland-protocols ncurses srt ] ++ optional (!stdenv.hostPlatform.isAarch64 && !stdenv.hostPlatform.isAarch32) live555 ++ optionals withQt5 [ qtbase qtsvg qtx11extras ] ++ optionals skins2Support (with xorg; [ libXpm freetype libXext libXinerama ]) @@ -101,6 +101,12 @@ stdenv.mkDerivation rec { sed -i 's|^#define CONFIGURE_LINE.*$|#define CONFIGURE_LINE ""|g' config.h ''; + # Add missing SOFA files + # Given in EXTRA_DIST, but not in install-data target + postInstall = '' + cp -R share/hrtfs $out/share/vlc + ''; + meta = with lib; { description = "Cross-platform media player and streaming server"; homepage = "http://www.videolan.org/vlc/"; diff --git a/pkgs/development/libraries/libspatialaudio/default.nix b/pkgs/development/libraries/libspatialaudio/default.nix new file mode 100644 index 000000000000..9f3453d51308 --- /dev/null +++ b/pkgs/development/libraries/libspatialaudio/default.nix @@ -0,0 +1,21 @@ +{ lib, stdenv, fetchFromGitHub, cmake, libmysofa, zlib }: +stdenv.mkDerivation { + name = "libspatialaudio"; + src = fetchFromGitHub { + owner = "videolabs"; + repo = "libspatialaudio"; + rev = "0.3.0"; + hash = "sha256-sPnQPD41AceXM4uGqWXMYhuQv0TUkA6TZP8ChxUFIoI="; + }; + buildInputs = [ cmake libmysofa zlib ]; + configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out ."; + + meta = { + description = + "Ambisonic encoding / decoding and binauralization library in C++"; + homepage = "https://github.com/videolabs/libspatialaudio"; + license = lib.licenses.lgpl21Plus; + platforms = lib.platforms.linux; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 884890c46ac9..4848e0fab438 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18324,6 +18324,8 @@ with pkgs; libstrophe = callPackage ../development/libraries/libstrophe { }; + libspatialaudio = callPackage ../development/libraries/libspatialaudio { }; + libspatialindex = callPackage ../development/libraries/libspatialindex { }; libspatialite = callPackage ../development/libraries/libspatialite { }; From f48f6db38febf7f9225981e4b6dd94d3c58b0e5f Mon Sep 17 00:00:00 2001 From: Kris La Date: Fri, 17 Dec 2021 21:16:31 +0700 Subject: [PATCH 2/3] formatting;add maintainer;cmake is nativeBuildInput --- .../libraries/libspatialaudio/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libspatialaudio/default.nix b/pkgs/development/libraries/libspatialaudio/default.nix index 9f3453d51308..f3e5208431b4 100644 --- a/pkgs/development/libraries/libspatialaudio/default.nix +++ b/pkgs/development/libraries/libspatialaudio/default.nix @@ -1,14 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, cmake, libmysofa, zlib }: -stdenv.mkDerivation { - name = "libspatialaudio"; +{ lib, stdenv, cmake, fetchFromGitHub, libmysofa, zlib }: + +let version = "0.3.0"; +in stdenv.mkDerivation { + pname = "libspatialaudio"; + inherit version; + src = fetchFromGitHub { owner = "videolabs"; repo = "libspatialaudio"; - rev = "0.3.0"; + rev = version; hash = "sha256-sPnQPD41AceXM4uGqWXMYhuQv0TUkA6TZP8ChxUFIoI="; }; - buildInputs = [ cmake libmysofa zlib ]; - configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out ."; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ libmysofa zlib ]; meta = { description = @@ -16,6 +21,7 @@ stdenv.mkDerivation { homepage = "https://github.com/videolabs/libspatialaudio"; license = lib.licenses.lgpl21Plus; platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ krav ]; }; } From 8c0b67f6c11f501ba40e22b3bb200c6df7b8d199 Mon Sep 17 00:00:00 2001 From: Kris La Date: Mon, 20 Dec 2021 09:12:08 +0700 Subject: [PATCH 3/3] rec before let --- .../libraries/libspatialaudio/default.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libspatialaudio/default.nix b/pkgs/development/libraries/libspatialaudio/default.nix index f3e5208431b4..c8d29a87a03d 100644 --- a/pkgs/development/libraries/libspatialaudio/default.nix +++ b/pkgs/development/libraries/libspatialaudio/default.nix @@ -1,9 +1,8 @@ { lib, stdenv, cmake, fetchFromGitHub, libmysofa, zlib }: -let version = "0.3.0"; -in stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "libspatialaudio"; - inherit version; + version = "0.3.0"; src = fetchFromGitHub { owner = "videolabs"; @@ -15,13 +14,12 @@ in stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; buildInputs = [ libmysofa zlib ]; - meta = { + meta = with lib; { description = "Ambisonic encoding / decoding and binauralization library in C++"; homepage = "https://github.com/videolabs/libspatialaudio"; - license = lib.licenses.lgpl21Plus; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ krav ]; + license = licenses.lgpl21Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ krav ]; }; } -