nixpkgs/pkgs/applications/misc/audio/soxr/default.nix
Anders Kaseorg 3cd8ce3bce treewide: Fix unsafe concatenation of $LD_LIBRARY_PATH
Naive concatenation of $LD_LIBRARY_PATH can result in an empty
colon-delimited segment; this tells glibc to load libraries from the
current directory, which is definitely wrong, and may be a security
vulnerability if the current directory is untrusted.  (See #67234, for
example.)  Fix this throughout the tree.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-01-15 09:47:03 +01:00

28 lines
775 B
Nix

{ stdenv, fetchurl, cmake }:
stdenv.mkDerivation rec {
name = "soxr-0.1.3";
src = fetchurl {
url = "mirror://sourceforge/soxr/${name}-Source.tar.xz";
sha256 = "12aql6svkplxq5fjycar18863hcq84c5kx8g6f4rj0lcvigw24di";
};
outputs = [ "out" "doc" ]; # headers are just two and very small
preConfigure = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}"`pwd`/build/src
'' else ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}"`pwd`/build/src
'';
nativeBuildInputs = [ cmake ];
meta = {
description = "An audio resampling library";
homepage = http://soxr.sourceforge.net;
license = stdenv.lib.licenses.lgpl21Plus;
platforms = stdenv.lib.platforms.unix;
};
}