Debian Codegraph @

contrib/build-one-linux-wheel.sh

raw
1 #!/bin/bash
2 # build a single linux wheel within a prepared imaged based on manylinux images
3 #
4 #
5 #
6 set -eu
7
8 if [ $# -lt 2 ]; then
9 echo "usage $0 PYTHONTAG DEST_DIR [FLAVOR]" >&2
10 echo "" >&2
11 echo 'PYTHONTAG should be of the form "cp310-cp310"' >&2
12 exit 64
13 fi
14 py_tag=$1
15 destination_directory=$2
16 flavor=${3:-c}
17
18
19 flavor_arg=""
20 if [[ "${flavor}" == "c" ]]; then
21 :
22 elif [[ "$flavor" == "rust" ]]; then
23 flavor_arg="--config-setting=--global-option=--rust"
24 else
25 echo "unknown flavor: \"$flavor\""
26 exit 96
27 fi
28
29
30 tmp_wheel_dir=./tmp-wheelhouse
31
32 if [ -e $tmp_wheel_dir ]; then
33 rm -rf $tmp_wheel_dir
34 fi
35 /opt/python/$py_tag/bin/python -m build --outdir $tmp_wheel_dir $flavor_arg
36 # adjust it to make it universal
37 auditwheel repair $tmp_wheel_dir/*.whl -w $destination_directory