Commit ebeac616 authored by Isuru Fernando's avatar Isuru Fernando
Browse files

fuse wheels to create universal2

parent ea11e29c
...@@ -271,9 +271,6 @@ function bdist_wheel_cmd { ...@@ -271,9 +271,6 @@ function bdist_wheel_cmd {
} }
function run_command_universal2 { function run_command_universal2 {
if [[ "${PLAT:-}" == "arm64" ]]; then
export PLAT_BACKUP="arm64"
fi
if [[ "${PLAT:-}" == "universal2" ]]; then if [[ "${PLAT:-}" == "universal2" ]]; then
export PLAT_BACKUP="universal2" export PLAT_BACKUP="universal2"
( (
...@@ -289,6 +286,7 @@ function run_command_universal2 { ...@@ -289,6 +286,7 @@ function run_command_universal2 {
rm -rf *-stamp rm -rf *-stamp
fi fi
if [[ "${PLAT:-}" == "universal2" || "${PLAT:-}" == "arm64" ]]; then if [[ "${PLAT:-}" == "universal2" || "${PLAT:-}" == "arm64" ]]; then
(
export PLAT="arm64" export PLAT="arm64"
export BUILD_PREFIX=/opt/arm64-builds export BUILD_PREFIX=/opt/arm64-builds
sudo mkdir -p $BUILD_PREFIX sudo mkdir -p $BUILD_PREFIX
...@@ -304,7 +302,26 @@ function run_command_universal2 { ...@@ -304,7 +302,26 @@ function run_command_universal2 {
export LDFLAGS+=" -arch arm64 -L$BUILD_PREFIX/lib -Wl,-rpath,$BUILD_PREFIX/lib ${FC_ARM64_LDFLAGS:-}" export LDFLAGS+=" -arch arm64 -L$BUILD_PREFIX/lib -Wl,-rpath,$BUILD_PREFIX/lib ${FC_ARM64_LDFLAGS:-}"
export host_alias="aarch64-apple-darwin20.0.0" export host_alias="aarch64-apple-darwin20.0.0"
$@ $@
export PLAT="$PLAT_BACKUP" )
local wheelhouse=$(abspath ${WHEEL_SDIR:-wheelhouse})
mkdir -p wheelhouse2
if [[ "${PLAT:-}" == "universal2" ]]; then
for whl in $wheelhouse/*.whl; do
if [[ "$whl" == *macosx_10_9_x86_64.whl ]]; then
whl_base=$(echo $whl | rev | cut -c 23- | rev)
echo $whl_base
if [[ -f "${whl_base}macosx_11_0_arm64.whl" ]]; then
delocate-fuse $whl "${whl_base}macosx_11_0_arm64.whl" -w wheelhouse2
mv wheelhouse2/$(basename $whl) $wheelhouse/$(basename ${whl_base})macosx_10_9_universal2.whl
# Since we want one wheel thats installable for testing we are deleting the 10_9_x86_64 wheel.
# We are not deleting arm64 wheel because the size is lower and homebrew/conda-forge python
# will use them by default
rm $whl
fi
fi
done
fi
else else
$@ $@
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment