-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
57 lines (49 loc) · 1.25 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
#!/bin/bash
. configure.sh
echo ""
echo "BUILD LIBS"
d=./build/install
make
make install prefix=$d
# echo ""
# echo "DEPLOY GFORTRAN LIBS"
# for lib in ${LIBS[@]}; do
# if [ -f $ROOT$lib$EXT ]; then
# cp -v $ROOT$lib$EXT $d/lib/
# else
# echo -n $lib$EXT" -> "
# echo "Not found."
# fi
# done
echo ""
echo "DEPLOY LIBS TO PYTHON"
cp -vf $d/bin/* py/$PY_SRC/
cp -vf $d/include/$NAME*.h py/$PY_SRC/
cp -vf $d/lib/* py/$PY_SRC/
# if [[ $PLATFORM == "darwin" ]]; then
# echo ""
# echo "CHECK RPATHS FOR DARWIN"
# # in case od shared libs: change rpaths for dependencies
# for lib in ${LIBS[@]}; do
# install_name_tool -change /usr/local/opt/gcc@10/lib/gcc/10/$lib$EXT @loader_path/$lib$EXT $d/lib/$LIBNAME$EXT
# install_name_tool -change /usr/local/opt/gcc@10/lib/gcc/10/$lib$EXT @loader_path/$lib$EXT py/$PY_SRC/$LIBNAME$EXT
# done
# otool -L $d/lib/$LIBNAME$EXT
# fi
echo ""
echo "ZIP LIBS"
cd $d/
zip -r $NAME-$PLATFORM-$ARCH-$VERSION.zip .
cd ../../
mv $d/$NAME-$PLATFORM-$ARCH-$VERSION.zip ./build/
echo ""
echo "BUILD PYTHON WRAPPER"
make -C py
cd ./py
if [[ $PLATFORM == "linux" ]]; then
cp ./wheelhouse/*.whl ./dist/
fi
cd ./dist
zip $PYNAME-$PLATFORM-$ARCH-$VERSION.zip *.*
cd ..
cd ..