From bafe712020b76421bf06c1320405b95e39b246a2 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 28 Aug 2025 16:19:54 +0200 Subject: [PATCH] docs: add Linux (WSL/Ubuntu) quick start and build/test instructions --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index 1ec9dc6..9e8fd33 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,60 @@ cmake -S example -B example/build -DCMAKE_BUILD_TYPE=Release cmake --build example/build --config Release ``` +### Linux (WSL/Ubuntu) – Quick start + +Prerequisites (Ubuntu/Debian): + +```bash +sudo apt-get update -y && sudo apt-get install -y \ + build-essential cmake git pkg-config libcurl4-openssl-dev \ + curl zip unzip tar ninja-build ca-certificates +``` + +Bootstrap vcpkg (once): + +```bash +git clone https://github.com/microsoft/vcpkg.git "$HOME/vcpkg" +"$HOME/vcpkg/bootstrap-vcpkg.sh" -disableMetrics +``` + +Build (library, tests, example): + +```bash +export VCPKG_ROOT="$HOME/vcpkg" +cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" +cmake --build build --config Release +``` + +Or simply use the helper script: + +```bash +bash ./build.sh +``` + +Run the example: + +```bash +./build/example/example +``` + +Run tests: + +```bash +ctest --test-dir build --output-on-failure +``` + +Artifacts: + +- Library: `build/libprivatebinapi.so` +- Example binary: `build/example/example` + +Notes: + +- vcpkg dependencies (`cryptopp`, `nlohmann-json`) are installed automatically during CMake configure when the toolchain file is provided. +- On Linux the example links directly against the in-tree target `privatebinapi`. On Windows it additionally copies the DLL next to the example executable after build. +- PrivateBin delete operation is performed via HTTP POST (per API), not HTTP DELETE. + ### Windows (PowerShell) – Build via build_thinkpad.bat For systems with Visual Studio 2022 Build Tools (C++ workload) and vcpkg in the user profile, there is a robust build script: