-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·40 lines (35 loc) · 879 Bytes
/
install.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
#!/usr/bin/env bash
if [ "$1" = "--reverse" ]
then
cd ftpplugin/python
rm -rf build
# rm -f ../python/*.so
echo "C extension uninstalled sucessfully!"
exit 0
fi
cd ftplugin/python
echo "Begin to compile C extension of Python3 ..."
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Running on Rosetta 2"
python3 setup.py build
else
echo "Running on native Intel"
python3 setup.py build
fi
elif [ "${arch_name}" = "arm64" ]; then
echo "Running on ARM"
/opt/homebrew/bin/python3.9 setup.py build
else
echo "Unknown architecture: ${arch_name}"
fi
if [ $? -eq 0 ]
then
cp build/lib*3.?/afpython*.so afpython.so
if [ $? -eq 0 ]
then
echo
echo C extension of Python3 installed sucessfully!
fi
fi