Skip to content

Commit

Permalink
treewide: Get rid of *Platform.arch
Browse files Browse the repository at this point in the history
Use `parsed.cpu.name` or `platform.gcc.arch` instead.
  • Loading branch information
Ericson2314 committed May 10, 2018
1 parent a31984e commit a02be2b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
12 changes: 1 addition & 11 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,31 @@ rec {

sheevaplug = rec {
config = "armv5tel-unknown-linux-gnueabi";
arch = "armv5tel";
float = "soft";
platform = platforms.sheevaplug;
};

raspberryPi = rec {
config = "armv6l-unknown-linux-gnueabihf";
arch = "armv6l";
float = "hard";
fpu = "vfp";
platform = platforms.raspberrypi;
};

armv7l-hf-multiplatform = rec {
config = "arm-unknown-linux-gnueabihf";
arch = "armv7-a";
config = "armv7a-unknown-linux-gnueabihf";
float = "hard";
fpu = "vfpv3-d16";
platform = platforms.armv7l-hf-multiplatform;
};

aarch64-multiplatform = rec {
config = "aarch64-unknown-linux-gnu";
arch = "aarch64";
platform = platforms.aarch64-multiplatform;
};

aarch64-android-prebuilt = rec {
config = "aarch64-unknown-linux-android";
arch = "aarch64";
platform = platforms.aarch64-multiplatform;
useAndroidPrebuilt = true;
};
Expand All @@ -51,15 +46,13 @@ rec {
};

pogoplug4 = rec {
arch = "armv5tel";
config = "armv5tel-unknown-linux-gnueabi";
float = "soft";
platform = platforms.pogoplug4;
};

ben-nanonote = rec {
config = "mipsel-unknown-linux-uclibc";
arch = "mips";
float = "soft";
platform = {
name = "ben_nanonote";
Expand All @@ -73,7 +66,6 @@ rec {

fuloongminipc = rec {
config = "mipsel-unknown-linux-gnu";
arch = "mips";
float = "hard";
platform = platforms.fuloong2f_n32;
};
Expand Down Expand Up @@ -122,7 +114,6 @@ rec {
# 32 bit mingw-w64
mingw32 = {
config = "i686-pc-mingw32";
arch = "x86"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
};
Expand All @@ -131,7 +122,6 @@ rec {
mingwW64 = {
# That's the triplet they use in the mingw-w64 docs.
config = "x86_64-pc-mingw32";
arch = "x86_64"; # Irrelevant
libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
platform = {};
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/video/omxplayer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=linux"
"--arch=${hostPlatform.arch}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/ffmpeg-full/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ stdenv.mkDerivation rec {
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=${hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.arch}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/ffmpeg/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ stdenv.mkDerivation rec {
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=${hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.arch}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/libraries/fontconfig/2.10.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ stdenv.mkDerivation rec {
];

# We should find a better way to access the arch reliably.
crossArch = hostPlatform.arch or null;
crossArch = if stdenv.hostPlatform != stdenv.buildPlatform
then hostPlatform.parsed.cpu.name
else null;

preConfigure = ''
if test -n "$crossConfig"; then
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/libraries/fontconfig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ stdenv.mkDerivation rec {
];

# We should find a better way to access the arch reliably.
crossArch = hostPlatform.arch or null;
crossArch = if stdenv.hostPlatform != stdenv.buildPlatform
then hostPlatform.parsed.cpu.name
else null;

preConfigure = ''
if test -n "$crossConfig"; then
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libav/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ let
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=linux"
"--arch=${hostPlatform.arch}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

Expand Down

0 comments on commit a02be2b

Please sign in to comment.