tested on archlinux
# setup a special virtenv for python, e.g. here:
sudo mkdir /var/opt/virtenv/libavg
virtualenv -p /usr/bin/python2 /var/opt/virtenv/libavg --system-site-packages
# hopefully your virtualenv version is later than this https://github.com/pypa/virtualenv/pull/798
# otherwise if your /usr/bin/python is python 3 you have to coppy over python2-config manually
. /var/opt/virtenv/libavg/bin/activate
# configure
./bootstrap
PYTHON=/usr/bin/python2 ./configure --prefix=/var/opt/virtenv/libavg18
# build
make -j4 # or as many cores as you wanna spare
make install # no sudo needed because of virtualenv :D