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
5f761026
Commit
5f761026
authored
Feb 26, 2019
by
Rob Buckley
Browse files
introspect build python to get arch for wheelhouse repair tags
parent
bec7515f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
osx_utils.sh
osx_utils.sh
+24
-4
tests/test_osx_utils.sh
tests/test_osx_utils.sh
+10
-2
No files found.
osx_utils.sh
View file @
5f761026
...
@@ -133,6 +133,27 @@ function pyinst_fname_for_version {
...
@@ -133,6 +133,27 @@ function pyinst_fname_for_version {
echo
"python-
${
py_version
}
-macosx
${
py_osx_ver
}
.
${
inst_ext
}
"
echo
"python-
${
py_version
}
-macosx
${
py_osx_ver
}
.
${
inst_ext
}
"
}
}
function
get_macpython_arch
{
# get arch (e.g. intel or x86_64) from the disutils platform tag
distutils_plat
=
${
1
:-
$(
get_distutils_platform
)
}
if
[[
$distutils_plat
=
~ macosx-
(
10
\.
[
0-9]+
)
-
(
.
*
)
]]
;
then
echo
${
BASH_REMATCH
[2]
}
else
echo
"Error parsing distutils platform '
$distutils_plat
'"
exit
1
fi
}
function
get_macpython_osx_ver
{
# get minimum macOS version (e.g. 10.9) from the disutils platform tag
distutils_plat
=
${
1
:-
$(
get_distutils_platform
)
}
if
[[
$distutils_plat
=
~ macosx-
(
10
\.
[
0-9]+
)
-
(
.
*
)
]]
;
then
echo
${
BASH_REMATCH
[1]
}
else
echo
"Error parsing distutils platform '
$distutils_plat
'"
exit
1
fi
}
function
mac_cpython_arch_for_osx_ver
{
function
mac_cpython_arch_for_osx_ver
{
# echo arch (intel or x86_64) for cpython python.org builds targetted for
# echo arch (intel or x86_64) for cpython python.org builds targetted for
...
@@ -339,7 +360,6 @@ function install_delocate {
...
@@ -339,7 +360,6 @@ function install_delocate {
function
repair_wheelhouse
{
function
repair_wheelhouse
{
local
wheelhouse
=
$1
local
wheelhouse
=
$1
install_delocate
install_delocate
delocate-wheel
$wheelhouse
/
*
.whl
# copies library dependencies into wheel
delocate-wheel
$wheelhouse
/
*
.whl
# copies library dependencies into wheel
# Add platform tags to label wheels as compatible with OSX 10.9 and
# Add platform tags to label wheels as compatible with OSX 10.9 and
...
@@ -349,13 +369,13 @@ function repair_wheelhouse {
...
@@ -349,13 +369,13 @@ function repair_wheelhouse {
# try to install have older pip, add platform tags to specify compatibility
# try to install have older pip, add platform tags to specify compatibility
# with later OSX. Not necessary for OSX released well after pip 6.0. See:
# with later OSX. Not necessary for OSX released well after pip 6.0. See:
# https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel
# https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel
local
MAC_ARCH
=
$(
mac_arch_for_pyosx_version
$MB_PYTHON_OSX_VER
)
local
MAC_ARCH
=
$(
get_macpython_arch
)
if
[[
"
$MAC_ARCH
"
==
"x86_
x
64"
]]
;
then
if
[[
"
$MAC_ARCH
"
==
"x86_64"
]]
;
then
delocate-addplat
--rm-orig
-p
macosx_10_10_x86_64
$wheelhouse
/
*
.whl
delocate-addplat
--rm-orig
-p
macosx_10_10_x86_64
$wheelhouse
/
*
.whl
elif
[[
"
$MAC_ARCH
"
==
"intel"
]]
;
then
elif
[[
"
$MAC_ARCH
"
==
"intel"
]]
;
then
delocate-addplat
--rm-orig
-x
10_9
-x
10_10
$wheelhouse
/
*
.whl
delocate-addplat
--rm-orig
-x
10_9
-x
10_10
$wheelhouse
/
*
.whl
else
else
echo
"
invali
d ARCH
=
'
$MAC_ARCH
'"
echo
"
Unexpecte
d ARCH
=
'
$MAC_ARCH
'
, supported values are 'x86_64' and 'intel'
"
exit
1
exit
1
fi
fi
}
}
...
...
tests/test_osx_utils.sh
View file @
5f761026
...
@@ -22,8 +22,16 @@
...
@@ -22,8 +22,16 @@
# Test utilities for getting Python version versions
# Test utilities for getting Python version versions
[
"
$(
get_py_digit
)
"
==
"
${
cpython_version
:0:1
}
"
]
||
ingest
[
"
$(
get_py_digit
)
"
==
"
${
cpython_version
:0:1
}
"
]
||
ingest
[
"
$(
get_py_mm
)
"
==
"
${
cpython_version
:0:3
}
"
]
||
ingest
[
"
$(
get_py_mm
)
"
==
"
${
cpython_version
:0:3
}
"
]
||
ingest
[
"
$(
get_py_mm_nodot
)
"
==
$(
echo
"
${
cpython_version
:0:3
}
"
|
tr
-d
.
)
]
||
\
[
"
$(
get_py_mm_nodot
)
"
==
$(
echo
"
${
cpython_version
:0:3
}
"
|
tr
-d
.
)
]
||
ingest
ingest
# test lookup of arch from cpython macos target build
[
"
$(
mac_cpython_arch_for_osx_ver 10.6
)
"
==
"intel"
]
||
ingest
[
"
$(
mac_cpython_arch_for_osx_ver 10.9
)
"
==
"x86_64"
]
||
ingest
[
"
$(
get_macpython_arch macosx-10.6-intel
)
"
==
"intel"
]
||
ingest
[
"
$(
get_macpython_arch macosx-10.6-x86_64
)
"
==
"x86_64"
]
||
ingest
[
"
$(
get_macpython_osx_ver macosx-10.6-intel
)
"
==
"10.6"
]
||
ingest
# Test pkg-config install
# Test pkg-config install
install_pkg_config
install_pkg_config
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