File: build-one-linux-wheel.sh

package info (click to toggle)
mercurial 7.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,824 kB
  • sloc: python: 206,444; ansic: 56,415; tcl: 3,715; sh: 1,797; lisp: 1,483; cpp: 864; makefile: 752; javascript: 649; xml: 36
file content (37 lines) | stat: -rwxr-xr-x 800 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# build a single linux wheel within a prepared imaged based on manylinux images
#
#
#
set -eu

if [ $# -lt 2 ]; then
    echo "usage $0 PYTHONTAG DEST_DIR [FLAVOR]" >&2
    echo "" >&2
    echo 'PYTHONTAG should be of the form "cp310-cp310"' >&2
    exit 64
fi
py_tag=$1
destination_directory=$2
flavor=${3:-c}


flavor_arg=""
if [[ "${flavor}" == "c" ]]; then
    :
elif [[ "$flavor" == "rust" ]]; then
    flavor_arg="--config-setting=--global-option=--rust"
else
    echo "unknown flavor: \"$flavor\""
    exit 96
fi


tmp_wheel_dir=./tmp-wheelhouse

if [ -e $tmp_wheel_dir ]; then
    rm -rf $tmp_wheel_dir
fi
/opt/python/$py_tag/bin/python -m build --outdir $tmp_wheel_dir $flavor_arg
# adjust it to make it universal
auditwheel repair $tmp_wheel_dir/*.whl -w $destination_directory