Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
multibuild
Commits
a42c4421
Commit
a42c4421
authored
Jan 14, 2021
by
Isuru Fernando
Browse files
support arm64 and universal2 wheels
parent
94f249a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
6 deletions
+43
-6
common_utils.sh
common_utils.sh
+35
-4
osx_utils.sh
osx_utils.sh
+8
-2
No files found.
common_utils.sh
View file @
a42c4421
...
@@ -270,22 +270,49 @@ function bdist_wheel_cmd {
...
@@ -270,22 +270,49 @@ function bdist_wheel_cmd {
cp dist/*.whl
$abs_wheelhouse
cp dist/*.whl
$abs_wheelhouse
}
}
function run_command_universal2 {
if [[ "
${
PLAT
:-}
" == "
arm64
" ]]; then
export _PYTHON_HOST_PLATFORM="
macosx-11.0-arm64
"
fi
if [[ "
${
PLAT
:-}
" == "
universal2
" ]]; then
export _PYTHON_HOST_PLATFORM="
macosx-10.9-x86_64
"
export CFLAGS+="
-arch
x86_64
"
export CXXFLAGS+="
-arch
x86_64
"
export ARCHFLAGS+="
-arch
x86_64
"
$@
export _PYTHON_HOST_PLATFORM="
macosx-11.0-arm64
"
export BUILD_PREFIX=/usr/local-arm64
mkdir -p /usr/local-arm64
export CFLAGS+="
-arch
arm64
"
export CXXFLAGS+="
-arch
arm64
"
export ARCHFLAGS+="
-arch
arm64
"
export LDFLAGS+="
-arch
arm64
-L
$BUILD_PREFIX
/lib
-Wl
,-rpath,
$BUILD_PREFIX
/lib
${
FC_ARM64_LDFLAGS
:-}
"
export FCFLAGS+="
-arch
arm64
"
export FC=
$FC_ARM64
export host_alias="
aarch64-apple-darwin20.0.0
"
$@
else
$@
fi
}
function build_pip_wheel {
function build_pip_wheel {
# Standard wheel building command with pip wheel
# Standard wheel building command with pip wheel
build_wheel_cmd "
pip_wheel_cmd
"
$@
run_command_universal2
build_wheel_cmd "
pip_wheel_cmd
"
$@
}
}
function build_bdist_wheel {
function build_bdist_wheel {
# Wheel building with bdist_wheel. See bdist_wheel_cmd
# Wheel building with bdist_wheel. See bdist_wheel_cmd
build_wheel_cmd "
bdist_wheel_cmd
"
$@
run_command_universal2
build_wheel_cmd "
bdist_wheel_cmd
"
$@
}
}
function build_wheel {
function build_wheel {
# Set default building method to pip
# Set default building method to pip
build_pip_wheel
$@
run_command_universal2
build_pip_wheel
$@
}
}
function build_index_wheel {
function build_index_wheel
_cmd
{
# Builds wheel from some index, usually pypi
# Builds wheel from some index, usually pypi
#
#
# Parameters:
# Parameters:
...
@@ -316,6 +343,10 @@ function build_index_wheel {
...
@@ -316,6 +343,10 @@ function build_index_wheel {
repair_wheelhouse
$wheelhouse
repair_wheelhouse
$wheelhouse
}
}
function build_index_wheel {
run_command_universal2 build_index_wheel_cmd
$@
}
function pip_opts {
function pip_opts {
[ -n "
$MANYLINUX_URL
" ] && echo "
--find-links
$MANYLINUX_URL
"
[ -n "
$MANYLINUX_URL
" ] && echo "
--find-links
$MANYLINUX_URL
"
}
}
...
...
osx_utils.sh
View file @
a42c4421
...
@@ -103,7 +103,9 @@ function macpython_sdk_list_for_version {
...
@@ -103,7 +103,9 @@ function macpython_sdk_list_for_version {
local
_major
=
${
_ver
%%.*
}
local
_major
=
${
_ver
%%.*
}
local
_return
local
_return
if
[
"
$_major
"
-eq
"2"
]
;
then
if
[
"
${
PLAT
:-}
"
==
"arm64"
]
||
[
"
${
PLAT
:-}
"
==
"universal2"
]
;
then
_return
=
"11.0"
elif
[
"
$_major
"
-eq
"2"
]
;
then
[
$(
lex_ver
$_ver
)
-lt
$(
lex_ver 2.7.18
)
]
&&
_return
=
"10.6"
[
$(
lex_ver
$_ver
)
-lt
$(
lex_ver 2.7.18
)
]
&&
_return
=
"10.6"
[
$(
lex_ver
$_ver
)
-ge
$(
lex_ver 2.7.15
)
]
&&
_return
=
"
$_return
10.9"
[
$(
lex_ver
$_ver
)
-ge
$(
lex_ver 2.7.15
)
]
&&
_return
=
"
$_return
10.9"
elif
[
"
$_major
"
-eq
"3"
]
;
then
elif
[
"
$_major
"
-eq
"3"
]
;
then
...
@@ -155,7 +157,11 @@ function pyinst_fname_for_version {
...
@@ -155,7 +157,11 @@ function pyinst_fname_for_version {
local
py_version
=
$1
local
py_version
=
$1
local
py_osx_ver
=
${
2
:-
$(
macpython_sdk_for_version
$py_version
)
}
local
py_osx_ver
=
${
2
:-
$(
macpython_sdk_for_version
$py_version
)
}
local
inst_ext
=
$(
pyinst_ext_for_version
$py_version
)
local
inst_ext
=
$(
pyinst_ext_for_version
$py_version
)
echo
"python-
${
py_version
}
-macosx
${
py_osx_ver
}
.
${
inst_ext
}
"
if
[
"
${
PLAT
:-}
"
==
"arm64"
]
||
[
"
${
PLAT
:-}
"
==
"universal2"
]
;
then
echo
"python-
${
py_version
}
-macos
${
py_osx_ver
}
.
${
inst_ext
}
"
else
echo
"python-
${
py_version
}
-macosx
${
py_osx_ver
}
.
${
inst_ext
}
"
fi
}
}
function
get_macpython_arch
{
function
get_macpython_arch
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment