2022-01-09 14:17:36 -06:00
|
|
|
#!/bin/bash
|
2023-09-15 10:45:12 -05:00
|
|
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
2023-09-15 13:04:20 -05:00
|
|
|
if [ -f ".capnp_version" ]; then
|
|
|
|
CAPNPROTO_VERSION=$(cat ".capnp_version")
|
|
|
|
else
|
|
|
|
CAPNPROTO_VERSION=$(cat "$SCRIPTDIR/../../.capnp_version")
|
|
|
|
fi
|
2023-09-15 10:45:12 -05:00
|
|
|
|
2022-01-09 14:17:36 -06:00
|
|
|
mkdir /tmp/capnproto-install
|
2022-11-02 18:37:47 -05:00
|
|
|
pushd /tmp/capnproto-install
|
2023-09-15 10:45:12 -05:00
|
|
|
curl -O https://capnproto.org/capnproto-c++-${CAPNPROTO_VERSION}.tar.gz
|
|
|
|
tar zxf capnproto-c++-${CAPNPROTO_VERSION}.tar.gz
|
|
|
|
cd capnproto-c++-${CAPNPROTO_VERSION}
|
2022-11-02 18:37:47 -05:00
|
|
|
./configure --without-openssl
|
2023-02-20 16:56:53 -06:00
|
|
|
make -j$1 check
|
2022-11-02 18:37:47 -05:00
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
|
|
if command -v checkinstall &> /dev/null; then
|
|
|
|
sudo checkinstall -y
|
|
|
|
cp *.deb ~
|
|
|
|
else
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
sudo rm -rf /tmp/capnproto-install
|
|
|
|
else
|
|
|
|
if command -v checkinstall &> /dev/null; then
|
|
|
|
checkinstall -y
|
|
|
|
cp *.deb ~
|
|
|
|
else
|
|
|
|
make install
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
rm -rf /tmp/capnproto-install
|
|
|
|
fi
|