systems: add isCompatible handling

This commit is contained in:
Matthew Bauer
2019-02-21 22:17:51 -05:00
parent 266315c91d
commit f455a07f13
2 changed files with 63 additions and 2 deletions
+3 -2
View File
@@ -24,6 +24,8 @@ rec {
config = parse.tripleFromSystem final.parsed;
# Just a guess, based on `system`
platform = platforms.selectBySystem final.system;
# Determine whether we are compatible with the provided CPU
isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
# Derived meta-data
libc =
/**/ if final.isDarwin then "libSystem"
@@ -98,8 +100,7 @@ rec {
wine = (pkgs.winePackagesFor wine-name).minimal;
in
if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name &&
(final.parsed.cpu.name == pkgs.stdenv.hostPlatform.parsed.cpu.name ||
(final.isi686 && pkgs.stdenv.hostPlatform.isx86_64))
pkgs.stdenv.hostPlatform.isCompatible final
then pkgs.runtimeShell
else if final.isWindows
then "${wine}/bin/${wine-name}"