forked from googlefonts/fontmake
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_pyz.sh
executable file
·52 lines (40 loc) · 1.29 KB
/
build_pyz.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
set -x
HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
PLATFORMS=(manylinux1_x86_64 macosx_10_6_intel win32 win_amd64)
PYTHON_VERSIONS=(3.6 3.7)
FONTMAKE_VERSION="$(python setup.py --version)"
FONTMAKE_WHEEL="${HERE}/dist/fontmake-${FONTMAKE_VERSION}-py3-none-any.whl"
REQUIREMENTS="${HERE}/requirements.txt"
LICENSE_FILE="${HERE}/LICENSE"
OUTPUT_DIR="${HERE}/shivs"
mkdir -p "${OUTPUT_DIR}"
pushd "${OUTPUT_DIR}"
for platform in ${PLATFORMS[*]}; do
for version in ${PYTHON_VERSIONS[*]}; do
v=${version//.}
abi="cp${v}m"
outdir="fontmake-${FONTMAKE_VERSION}-cp${v}-${abi}-${platform}"
mkdir -p "${outdir}"
if [[ $platform == win32 || $platform == win_amd64 ]]; then
ext=".pyz"
else
ext=""
fi
shiv -c fontmake \
-o "${outdir}/fontmake${ext}" \
-p "/usr/bin/env python${version}" \
--python-version ${v} \
--platform ${platform} \
--abi ${abi} \
--implementation cp \
--only-binary=:all: \
-r "${REQUIREMENTS}" \
"${FONTMAKE_WHEEL}"
cp "${HERE}/LICENSE" "${outdir}"
zip -r "${outdir}.zip" "${outdir}"
rm -rf "${outdir}"
done
done
popd