mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
54 lines
1.4 KiB
Nix
54 lines
1.4 KiB
Nix
{ lib, stdenv
|
|
, fetchurl
|
|
, makeWrapper
|
|
, alsa-lib
|
|
, AudioUnit
|
|
, AudioToolbox
|
|
, perl
|
|
, withConplay ? !stdenv.hostPlatform.isWindows
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mpg123";
|
|
version = "1.26.5";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
|
|
sha256 = "sha256-UCqX4Nk1vn432YczgCHY8wG641wohPKoPVnEtSRm7wY=";
|
|
};
|
|
|
|
outputs = [ "out" ] ++ lib.optionals withConplay [ "conplay" ];
|
|
|
|
nativeBuildInputs = lib.optionals withConplay [ makeWrapper ];
|
|
|
|
buildInputs = lib.optionals withConplay [ perl ]
|
|
++ lib.optionals (stdenv.hostPlatform.isLinux) [ alsa-lib ]
|
|
++ lib.optionals (stdenv.hostPlatform.isDarwin) [ AudioUnit AudioToolbox ];
|
|
|
|
configureFlags = lib.optional
|
|
(stdenv.hostPlatform ? mpg123)
|
|
"--with-cpu=${stdenv.hostPlatform.mpg123.cpu}";
|
|
|
|
postInstall = lib.optionalString withConplay ''
|
|
mkdir -p $conplay/bin
|
|
mv scripts/conplay $conplay/bin/
|
|
'';
|
|
|
|
preFixup = lib.optionalString withConplay ''
|
|
patchShebangs $conplay/bin/conplay
|
|
'';
|
|
|
|
postFixup = lib.optionalString withConplay ''
|
|
wrapProgram $conplay/bin/conplay \
|
|
--prefix PATH : $out/bin
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Fast console MPEG Audio Player and decoder library";
|
|
homepage = "https://mpg123.org";
|
|
license = licenses.lgpl21Only;
|
|
maintainers = with maintainers; [ ftrvxmtrx ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|