From e608d82444c99716c571575eb11a570cd9a87c5f Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Tue, 12 Jul 2022 01:51:23 +0200 Subject: [PATCH] Dependencies: add sockpp --- README.md | 7 ++++++- scripts/setup_project.sh | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83ea166..e598ed4 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ This project requires bash and a C++20 compiler. The project setup requires wget or curl, gzip, and tar. +Additional requirements for building dependencies: + +- sockpp: CMake + **For people using other shells than bash:** You need to at least have bash installed to use the scripts, but using it as your shell while working on this project also allows you to use the provided aliases. @@ -47,8 +51,9 @@ point to `bin/lib`. - `cd` to the project's base directory - `scripts/setup_project.sh` -This will download the following dependenceis: +This will download (and build if applicable) the following dependenceis: - [tiny-utf8](https://github.com/DuffsDevice/tiny-utf8) +- [sockpp](https://github.com/fpagliughi/sockpp) ### Building diff --git a/scripts/setup_project.sh b/scripts/setup_project.sh index 587d7cd..0241d0d 100755 --- a/scripts/setup_project.sh +++ b/scripts/setup_project.sh @@ -55,8 +55,10 @@ scripts/clean.sh echo "Cleaning dependencies..." scripts/clean_dependencies.sh +set -e # failures are not acceptable here mkdir -v dependencies/tmp download https://github.com/DuffsDevice/tiny-utf8/archive/refs/tags/v4.4.3.tar.gz dependencies/tmp/tiny-utf8.tar.gz 8e3f61651909c9f3105d3501932a96aa65733127fb6e7cf94cb1b0a2dff42c8f +download https://github.com/fpagliughi/sockpp/archive/refs/tags/v0.7.1.tar.gz dependencies/tmp/sockpp.tar.gz 2e023528bebbd2ac083fc91fbe6d5c4158c3336bedbcff48f594f3b28f53b940 #TODO: keep the files somewhere else as a cache and only download the ones # we don't have or that got corrupted #TODO: once we cache files properly, have clean_dependencies.sh prune @@ -68,4 +70,15 @@ gzip -d dependencies/tmp/tiny-utf8.tar.gz tar -xf dependencies/tmp/tiny-utf8.tar -C dependencies echo "done." +echo -n "Extracting sockpp... " +gzip -d dependencies/tmp/sockpp.tar.gz +tar -xf dependencies/tmp/sockpp.tar -C dependencies +echo "done." +echo -n "Building sockpp... " +pushd dependencies/sockpp-0.7.1/ >/dev/null 2>&1 +cmake -Bbuild . +cmake --build build +popd >/dev/null 2>&1 +echo "done." + rm -rv dependencies/tmp