forked from pinard/Pymacs
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall-pymacs.sh
executable file
·71 lines (63 loc) · 2.06 KB
/
install-pymacs.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
#!/bin/bash
# Install pymacs stuff that emacs needs (outside emacs), into the current
# virtual environment, if there is one.
if [[ -e "$VIRTUAL_ENV" ]]; then
echo "Installing (rope, ropemacs, and) pymacs into virtual environment $VIRTUAL_ENV"
SRC="$VIRTUAL_ENV/src"
USERFLAG=
SUDO=
else
SRC=src
USERFLAG=--user
SUDO=sudo
echo "Doing a user install of rope and ropemacs."
fi
# Find the install command
# We'll look for dnf (Red Hat/Fedora), apt-get (Debian/Ubuntu), and brew (MacOS)
CHECK_CMD=$(which dnf 2> /dev/null)
if [[ -x "${CHECK_CMD}" ]]; then
INSTALL_CMD="sudo ${CHECK_CMD} install -y"
fi
CHECK_CMD=$(which apt-get 2> /dev/null)
if [[ -x "${CHECK_CMD}" ]]; then
INSTALL_CMD="sudo ${CHECK_CMD} install -y"
fi
CHECK_CMD=$(which brew 2> /dev/null)
if [[ -x "${CHECK_CMD}" ]]; then
INSTALL_CMD="${CHECK_CMD} install"
fi
echo "Using ${INSTALL_CMD} to install."
if [[ `uname` == 'Linux' ]]; then
echo "Apparently on Raspbian, Ubuntu, and Debian, pyopenssl needs python-dev and libffi"
echo "in order to compile and install. It mostly seems to work without"
echo "them anyway, but if you want to sudo, here you go."
echo " "
echo "${INSTALL_CMD} python3-pip libssl-dev libffi-dev python-dev"
${INSTALL_CMD} python3-pip libssl-dev libffi-dev python-dev
sudo pip install -U setuptools
fi
if [[ -d ~/.emacs.d/lisp ]]; then
USER_LISP_DIR="$HOME/.emacs.d/lisp"
elif [[ -d ~/.emacs.d ]]; then
USER_LISP_DIR="$HOME/.emacs.d"
else
echo "Couldn't guess a good place to put pymacs.el."
echo "You should manually copy it from $HOME/pymacs.el to your emacs init directory."
USER_LISP_DIR="$HOME"
fi
python -m pip install $USERFLAG --upgrade pyopenssl
python -m pip install rope ropemacs $USERFLAG python
python -m pip install --editable "git+https://github.com/dgentry/Pymacs.git#egg=Pymacs"
pushd "$SRC"
cd pymacs/
make check
${SUDO} make install
echo " "
echo "Copying pymacs.el to $USER_LISP_DIR"
cp pymacs.el $USER_LISP_DIR
echo " "
popd
echo "Finished in:" $(pwd)
cd
echo "Final check:"
python -c 'import Pymacs'