about summary refs log tree commit diff
path: root/pkgs/applications/audio/mpg123/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/mpg123/default.nix')
-rw-r--r--pkgs/applications/audio/mpg123/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix
index 9004a46115ee..2909dd70ce9a 100644
--- a/pkgs/applications/audio/mpg123/default.nix
+++ b/pkgs/applications/audio/mpg123/default.nix
@@ -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";