summary refs log tree commit diff
path: root/pkgs/applications/misc/audio
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/applications/misc/audio
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/applications/misc/audio')
-rw-r--r--pkgs/applications/misc/audio/sox/0001-musl-rewind-pipe-workaround.patch24
-rw-r--r--pkgs/applications/misc/audio/sox/default.nix14
-rw-r--r--pkgs/applications/misc/audio/soxr/arm64-check.patch79
-rw-r--r--pkgs/applications/misc/audio/soxr/default.nix11
-rw-r--r--pkgs/applications/misc/audio/wavesurfer/default.nix9
-rw-r--r--pkgs/applications/misc/audio/wavrsocvt/default.nix6
6 files changed, 128 insertions, 15 deletions
diff --git a/pkgs/applications/misc/audio/sox/0001-musl-rewind-pipe-workaround.patch b/pkgs/applications/misc/audio/sox/0001-musl-rewind-pipe-workaround.patch
new file mode 100644
index 00000000000..6aacbcc65bc
--- /dev/null
+++ b/pkgs/applications/misc/audio/sox/0001-musl-rewind-pipe-workaround.patch
@@ -0,0 +1,24 @@
+From e7446c9bcb47674c9d0ee3b5bab129e9b86eb1c9 Mon Sep 17 00:00:00 2001
+From: Walter Franzini <walter.franzini@gmail.com>
+Date: Fri, 7 Jun 2019 17:57:11 +0200
+Subject: [PATCH] musl does not support rewind pipe, make it build anyway
+
+---
+ src/formats.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/formats.c b/src/formats.c
+index f3efe764..477bf451 100644
+--- a/src/formats.c
++++ b/src/formats.c
+@@ -424,7 +424,6 @@ static void UNUSED rewind_pipe(FILE * fp)
+   /* To fix this #error, either simply remove the #error line and live without
+    * file-type detection with pipes, or add support for your compiler in the
+    * lines above.  Test with cat monkey.wav | ./sox --info - */
+-  #error FIX NEEDED HERE
+   #define NO_REWIND_PIPE
+   (void)fp;
+ #endif
+-- 
+2.19.2
+
diff --git a/pkgs/applications/misc/audio/sox/default.nix b/pkgs/applications/misc/audio/sox/default.nix
index 32ea821b22d..9baf2d4d2f2 100644
--- a/pkgs/applications/misc/audio/sox/default.nix
+++ b/pkgs/applications/misc/audio/sox/default.nix
@@ -1,5 +1,5 @@
-{ config, lib, stdenv, fetchurl, pkgconfig, CoreAudio
-, enableAlsa ? true, alsaLib ? null
+{ config, lib, stdenv, fetchurl, pkg-config, CoreAudio
+, enableAlsa ? true, alsa-lib ? null
 , enableLibao ? true, libao ? null
 , enableLame ? config.sox.enableLame or false, lame ? null
 , enableLibmad ? true, libmad ? null
@@ -8,12 +8,13 @@
 , enableFLAC ? true, flac ? null
 , enablePNG ? true, libpng ? null
 , enableLibsndfile ? true, libsndfile ? null
+, enableWavpack ? true, wavpack ? null
 # amrnb and amrwb are unfree, disabled by default
 , enableAMR ? false, amrnb ? null, amrwb ? null
 , enableLibpulseaudio ? true, libpulseaudio ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   name = "sox-14.4.2";
@@ -24,10 +25,12 @@ stdenv.mkDerivation rec {
   };
 
   # configure.ac uses pkg-config only to locate libopusfile
-  nativeBuildInputs = optional enableOpusfile pkgconfig;
+  nativeBuildInputs = optional enableOpusfile pkg-config;
+
+  patches = [ ./0001-musl-rewind-pipe-workaround.patch ];
 
   buildInputs =
-    optional (enableAlsa && stdenv.isLinux) alsaLib ++
+    optional (enableAlsa && stdenv.isLinux) alsa-lib ++
     optional enableLibao libao ++
     optional enableLame lame ++
     optional enableLibmad libmad ++
@@ -36,6 +39,7 @@ stdenv.mkDerivation rec {
     optional enableFLAC flac ++
     optional enablePNG libpng ++
     optional enableLibsndfile libsndfile ++
+    optional enableWavpack wavpack ++
     optionals enableAMR [ amrnb amrwb ] ++
     optional enableLibpulseaudio libpulseaudio ++
     optional (stdenv.isDarwin) CoreAudio;
diff --git a/pkgs/applications/misc/audio/soxr/arm64-check.patch b/pkgs/applications/misc/audio/soxr/arm64-check.patch
new file mode 100644
index 00000000000..ac16a214c3a
--- /dev/null
+++ b/pkgs/applications/misc/audio/soxr/arm64-check.patch
@@ -0,0 +1,79 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Misty De Meo <mistydemeo@gmail.com>
+Date: Tue, 15 Sep 2020 16:57:26 -0700
+Subject: [PATCH] Check for __arm64__, not just __arm__
+
+On at least one 64-bit ARM processor I've tested (Apple Silicon on macOS),
+__arm__ isn't defined but __arm64__ is. As a result, some of the
+ARM-specific macros are missing and calls to them fail.
+---
+ src/cr-core.c    | 2 +-
+ src/dev32s.h     | 2 +-
+ src/pffft-wrap.c | 2 +-
+ src/pffft.c      | 4 ++--
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/cr-core.c b/src/cr-core.c
+index 159a5d9..fe5ea8a 100644
+--- a/src/cr-core.c
++++ b/src/cr-core.c
+@@ -80,7 +80,7 @@ static void cubic_stage_fn(stage_t * p, fifo_t * output_fifo)
+   #define DEFINED_X86 0
+ #endif
+ 
+-#if defined __arm__
++#if defined(__arm__) || defined(__arm64__)
+   #define DEFINED_ARM 1
+ #else
+   #define DEFINED_ARM 0
+diff --git a/src/dev32s.h b/src/dev32s.h
+index 7edae86..a14d7ad 100644
+--- a/src/dev32s.h
++++ b/src/dev32s.h
+@@ -31,7 +31,7 @@ SIMD_INLINE(void) vStorSum(float * a, v4_t b) {
+   v4_t t = vAdd(_mm_movehl_ps(b, b), b);
+   _mm_store_ss(a, vAdd(t, _mm_shuffle_ps(t,t,1)));}
+ 
+-#elif defined __arm__
++#elif defined(__arm__) || defined(__arm64__)
+ 
+ #include <arm_neon.h>
+ 
+diff --git a/src/pffft-wrap.c b/src/pffft-wrap.c
+index c920f06..1641fc4 100644
+--- a/src/pffft-wrap.c
++++ b/src/pffft-wrap.c
+@@ -40,7 +40,7 @@ static void pffft_zconvolve(PFFFT_Setup *s, const float *a, const float *b, floa
+ 
+   float ar, ai, br, bi;
+ 
+-#ifdef __arm__
++#if defined(__arm__) || defined(__arm64__)
+   __builtin_prefetch(va);
+   __builtin_prefetch(vb);
+   __builtin_prefetch(va+2);
+diff --git a/src/pffft.c b/src/pffft.c
+index 46c841e..8c775a9 100644
+--- a/src/pffft.c
++++ b/src/pffft.c
+@@ -157,7 +157,7 @@ typedef __m128 v4sf;
+ /*
+   ARM NEON support macros
+ */
+-#elif !defined(PFFFT_SIMD_DISABLE) && defined(__arm__)
++#elif !defined(PFFFT_SIMD_DISABLE) && (defined(__arm__) || defined(__arm64__))
+ #  include <arm_neon.h>
+ typedef float32x4_t v4sf;
+ #  define SIMD_SZ 4
+@@ -1732,7 +1732,7 @@ void pffft_zconvolve_accumulate(PFFFT_Setup *s, const float *a, const float *b,
+   const v4sf * RESTRICT vb = (const v4sf*)b;
+   v4sf * RESTRICT vab = (v4sf*)ab;
+ 
+-#ifdef __arm__
++#if defined(__arm__) || defined(__arm64__)
+   __builtin_prefetch(va);
+   __builtin_prefetch(vb);
+   __builtin_prefetch(vab);
+-- 
+2.30.1
+
diff --git a/pkgs/applications/misc/audio/soxr/default.nix b/pkgs/applications/misc/audio/soxr/default.nix
index 59c7154fa7d..8460b4856dc 100644
--- a/pkgs/applications/misc/audio/soxr/default.nix
+++ b/pkgs/applications/misc/audio/soxr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   name = "soxr-0.1.3";
@@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "12aql6svkplxq5fjycar18863hcq84c5kx8g6f4rj0lcvigw24di";
   };
 
+  patches = [
+    # Remove once https://sourceforge.net/p/soxr/code/merge-requests/5/ is merged.
+    ./arm64-check.patch
+  ];
+
   outputs = [ "out" "doc" ]; # headers are just two and very small
 
   preConfigure = if stdenv.isDarwin then ''
@@ -21,7 +26,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An audio resampling library";
     homepage = "http://soxr.sourceforge.net";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/misc/audio/wavesurfer/default.nix b/pkgs/applications/misc/audio/wavesurfer/default.nix
index 45746a963b2..b7e738cfc12 100644
--- a/pkgs/applications/misc/audio/wavesurfer/default.nix
+++ b/pkgs/applications/misc/audio/wavesurfer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, snack, tcl, tk, makeWrapper }:
+{ lib, stdenv, fetchurl, snack, tcl, tk, makeWrapper }:
 
 stdenv.mkDerivation {
   name = "wavesurfer-1.8.5";
@@ -8,7 +8,8 @@ stdenv.mkDerivation {
     sha256 = "1yx9s1j47cq0v40cwq2gn7bdizpw46l95ba4zl9z4gg31mfvm807";
   };
 
-  buildInputs = [ snack tcl tk makeWrapper ];
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ snack tcl tk ];
 
   installPhase = ''
     mkdir -p $out/{bin,nix-support,share/wavesurfer/}
@@ -17,12 +18,12 @@ stdenv.mkDerivation {
     ln -s $out/{nix-support,bin}/wavesurfer.tcl
     wrapProgram "$out/nix-support/wavesurfer.tcl"  \
                  --set TCLLIBPATH "${snack}/lib" \
-                 --prefix PATH : "${stdenv.lib.makeBinPath [ tcl tk ]}"
+                 --prefix PATH : "${lib.makeBinPath [ tcl tk ]}"
   '';
 
   meta = {
     description = "Tool for recording, playing, editing, viewing and labeling of audio";
     homepage = "http://www.speech.kth.se/wavesurfer/";
-    license = stdenv.lib.licenses.bsd0;
+    license = lib.licenses.bsd0;
   };
 }
diff --git a/pkgs/applications/misc/audio/wavrsocvt/default.nix b/pkgs/applications/misc/audio/wavrsocvt/default.nix
index ebb04a30ab8..3b32f0d7f30 100644
--- a/pkgs/applications/misc/audio/wavrsocvt/default.nix
+++ b/pkgs/applications/misc/audio/wavrsocvt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "wavrsocvt-1.0.2.0";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   phases = [ "unpackPhase" "installPhase" ];
 
   unpackPhase = ''
-    tar -zxf $src 
+    tar -zxf $src
     '';
 
   installPhase = ''
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     cp wavrsocvt $out/bin
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Convert .wav files into sound files for Lego NXT brick";
     longDescription = ''
     wavrsocvt is a command-line utility which can be used from a