forked from dashingsoft/pyarmor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-package.sh
executable file
·66 lines (56 loc) · 1.69 KB
/
build-package.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#! /bin/sh
#
# Build source and wheel distribute
#
PLATFORMS="win32 win_amd64 manylinux1_x86_64 macosx_10_11_x86_64 macosx_10_11_intel"
PYTHON=C:/Python34/python
test -x $PYTHON || PYTHON=/usr/local/bin/python3
test -x $PYTHON || PYTHON=python
echo "PYTHON is $PYTHON"
clear_build()
{
echo Remove build files: pyarmor.egg-info build src/__pycache__
rm -rf pyarmor.egg-info build src/__pycache__ src/*.pyc
}
clear_platform_files()
{
echo Remove platforms files
rm -rf src/platforms/windows
rm -rf src/platforms/linux
rm -rf src/platforms/darwin
rm -rf src/plugins
}
make_platform_files()
{
src=../pyarmor-core/platforms
dst=src/platforms
cp -a dist/platforms/* $dst
# mkdir -p ${dst} ${dst}/windows ${dst}/linux ${dst}/darwin
# cp -a ${src}/win32 ${dst}/windows/x86;
# cp -a ${src}/win_amd64 ${dst}/windows/x86_64;
# cp -a ${src}/linux_i386 ${dst}/linux/x86;
# cp -a ${src}/linux_x86_64 ${dst}/linux/x86_64;
# cp -a ${src}/macosx_x86_64 ${dst}/darwin/x86_64;
cp -a plugins ./src/
}
# Make platform files
make_platform_files
# Build source
$PYTHON setup.py sdist --formats=zip,bztar,gztar
clear_build
# Build universal wheel
$PYTHON setup.py bdist_wheel --python-tag=py3
clear_build
clear_platform_files
# Build binary wheel
# for plat in $PLATFORMS ; do
# name=$plat
# [[ "$plat" == "manylinux1_x86_64" ]] && name="linux_x86_64"
# [[ "$plat" == "macosx_10_11_intel" ]] && name="macosx_x86_64"
# [[ "$plat" == "macosx_10_11_x86_64" ]] && name="macosx_x86_64"
# cp src/platforms/$name/_pytransform.* src/
#
# $PYTHON setup.py bdist_wheel --python-tag=py2.py3 --plat-name=$plat
# clear_build
# rm -rf src/_pytransform.*
# done