make wheel selection more sophisticated for m1 macs (#489)

* make wheel selection more sophisticated for m1 macs

* remove unneeded parentheses

Co-authored-by: Austin Platt <austinplatt@Austins-MacBook-Air.local>
This commit is contained in:
austin-searchpilot 2022-01-06 23:19:14 +00:00 committed by GitHub
parent d3e600bf94
commit 5a8fb13cb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,7 +84,13 @@ let
)
else
(x: x.platform == "any")
else (x: hasInfix "macosx" x.platform || x.platform == "any");
else
if stdenv.isDarwin
then
if stdenv.targetPlatform.isAarch64
then (x: x.platform == "any" || (hasInfix "macosx" x.platform && lib.lists.any (e: hasSuffix e x.platform) [ "arm64" "aarch64" ]))
else (x: x.platform == "any" || (hasInfix "macosx" x.platform && hasSuffix "x86_64" x.platform))
else (x: x.platform == "any");
filterWheel = x:
let
f = toWheelAttrs x.file;
@ -93,7 +99,7 @@ let
filtered = builtins.filter filterWheel filesWithoutSources;
choose = files:
let
osxMatches = [ "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
osxMatches = [ "12_0" "11_0" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "any" ];
chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x);
chooseOSX = x: lib.take 1 (findBestMatches osxMatches x);