mpg123: Modernize and fix for cross

Do not even think about configureFlags unless in cross, to avoid hash
breaking when not in cross.
This commit is contained in:
John Ericson 2017-06-04 19:24:50 -04:00 committed by John Ericson
parent 502902f1c6
commit 7c754b1e3b

View file

@ -1,4 +1,7 @@
{stdenv, fetchurl, alsaLib }:
{ stdenv
, fetchurl, alsaLib
, buildPlatform, hostPlatform
}:
stdenv.mkDerivation rec {
name = "mpg123-1.23.8";
@ -10,10 +13,8 @@ stdenv.mkDerivation rec {
buildInputs = stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
crossAttrs = {
configureFlags = if stdenv.cross ? mpg123 then
"--with-cpu=${stdenv.cross.mpg123.cpu}" else "";
};
${if buildPlatform != hostPlatform then "configureFlags" else null} =
stdenv.lib.optional (hostPlatform ? mpg123) "--with-cpu=${hostPlatform.mpg123.cpu}";
meta = {
description = "Fast console MPEG Audio Player and decoder library";