Mercurial > hg
annotate contrib/build-one-linux-wheel.sh @ 52314:33d8cb64e9da default tip
rust: fix darwin build
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Mon, 18 Nov 2024 15:42:09 +0100 |
parents | 4d825ad10840 |
children |
rev | line source |
---|---|
52243
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
1 #!/bin/bash |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
2 # build a single linux wheel within a prepared imaged based on manylinux images |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
3 # |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
4 # |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
5 # |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
6 set -eu |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
7 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
8 # enforce that the translation are built |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
9 export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
10 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
11 if [ $# -lt 2 ]; then |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
12 echo "usage $0 PYTHONTAG DEST_DIR" >&2 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
13 echo "" >&2 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
14 echo 'PYTHONTAG should be of the form "cp310-cp310"' >&2 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
15 exit 64 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
16 fi |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
17 py_tag=$1 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
18 destination_directory=$2 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
19 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
20 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
21 tmp_wheel_dir=./tmp-wheelhouse |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
22 |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
23 if [ -e $tmp_wheel_dir ]; then |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
24 rm -rf $tmp_wheel_dir |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
25 fi |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
26 /opt/python/$py_tag/bin/python setup.py bdist_wheel --dist-dir $tmp_wheel_dir |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
27 # adjust it to make it universal |
4d825ad10840
wheels: factor the core of Linux wheel building into a script
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff
changeset
|
28 auditwheel repair $tmp_wheel_dir/*.whl -w $destination_directory |