-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
99 lines (74 loc) · 2.79 KB
/
build.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Load dll libraries directly from memory
# -*- coding: utf-8 -*-
###################################################
#........../\./\...___......|\.|..../...\.........#
#........./..|..\/\.|.|_|._.|.\|....|.c.|.........#
#......../....../--\|.|.|.|i|..|....\.../.........#
# Mathtin (c) #
###################################################
# Author: Daniel [Mathtin] Shiko #
# Copyright (c) 2019 <[email protected]> #
# This file is released under the MPL license. #
###################################################
MEMMOD_VER=1.1.0
PY2_32_MINGW=/mingw32/bin/python2
PY2_64_MINGW=/mingw64/bin/python2
PY3_32_MINGW=/mingw32/bin/python3
PY3_64_MINGW=/mingw64/bin/python3
PYDIR2_32_WIN=/c/Python27/
PYDIR2_64_WIN=/c/Python27amd64/
PYDIR3_32_WIN=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/Shared/Python36_86
PYDIR3_64_WIN=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/Shared/Python36_64
WD=$PWD
echo "[*] Cleaning directory"
git clean -xdf > /dev/null
if test $# -gt 0 && test $1 = "clean"; then
exit
fi
echo "[*] Making additionoal directories"
mkdir obj && mkdir dist && mkdir dist/x64 && mkdir dist/Win32 || exit
echo "[!] Building memmod $MEMMOD_VER"
echo "[*] Building unit tests"
cd tests
make > /dev/null || exit
cd ..
# Set library version
echo "[*] setup.py.in > setup.py"
sed -e "s/%MEMMOD_VER%/'$MEMMOD_VER'/g" setup.py.in > setup.py || exit
echo "[*] Building python2 lib for mingw32"
$PY2_32_MINGW setup.py bdist_wheel > /dev/null || exit
echo "[*] Building python3 lib for mingw32"
$PY3_32_MINGW setup.py bdist_wheel > /dev/null || exit
mv dist/memmod* dist/Win32 || exit
echo "[!] Wheels available in dist/Win32"
rm -rf build &> /dev/null
echo "[*] Building python2 lib for mingw64"
$PY2_64_MINGW setup.py bdist_wheel > /dev/null || exit
echo "[*] Building python3 lib for mingw64"
$PY3_64_MINGW setup.py bdist_wheel > /dev/null || exit
mv dist/memmod* dist/x64
echo "[!] Wheels available in dist/x64"
echo "[*] Building source dist package"
python setup.py sdist > /dev/null || exit
echo "[!] Source dist available in dist"
rm -rf build &> /dev/null
OLDPATH=$PATH
PATH=$PYDIR2_32_WIN:$PYDIR2_32_WIN/Scripts:$PATH
echo "[*] Building python2 lib for win32"
python.exe setup.py bdist_wheel &> /dev/null || exit
PATH=$OLDPATH
OLDPATH=$PATH
PATH=$PYDIR2_64_WIN:$PYDIR2_64_WIN/Scripts:$PATH
echo "[*] Building python2 lib for x64"
python.exe setup.py bdist_wheel &> /dev/null || exit
PATH=$OLDPATH
OLDPATH=$PATH
PATH=$PYDIR3_32_WIN:$PYDIR3_32_WIN/Scripts:$PATH
echo "[*] Building python3 lib for win32"
python.exe setup.py bdist_wheel &> /dev/null || exit
PATH=$OLDPATH
OLDPATH=$PATH
PATH=$PYDIR3_64_WIN:$PYDIR3_64_WIN/Scripts:$PATH
echo "[*] Building python3 lib for x64"
python.exe setup.py bdist_wheel &> /dev/null || exit
PATH=$OLDPATH