From c1997a3e657b73a7f3ead9fbc6787c18412f5875 Mon Sep 17 00:00:00 2001 From: Aleksandr Kovalko Date: Wed, 13 May 2026 11:19:48 +0200 Subject: [PATCH] Add build2 packaging; document libgeo-utils vs geo-utils-cpp Publish on cppget under the build2 `libfoo` convention as `libgeo-utils`. The CMake / vcpkg / Conan / xrepo name stays `geo-utils-cpp`. The header layout, namespace, and `#include ` API are unchanged. Adds manifest, root and per-directory buildfiles, and the build/{bootstrap,root}.build scaffolding for a binless lib target; updates README to explain the dual naming; tweaks .gitignore so CMake artifacts under build/ stay ignored while the new build2 metadata files are tracked. Closes #18 --- .gitignore | 6 +++++- README.md | 28 ++++++++++++++++++++++++++++ build/bootstrap.build | 5 +++++ build/root.build | 5 +++++ buildfile | 1 + include/buildfile | 1 + include/geo/buildfile | 11 +++++++++++ manifest | 15 +++++++++++++++ 8 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 build/bootstrap.build create mode 100644 build/root.build create mode 100644 buildfile create mode 100644 include/buildfile create mode 100644 include/geo/buildfile create mode 100644 manifest diff --git a/.gitignore b/.gitignore index 7adb8bb..307dff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ -build/ +# Ignore CMake/build2 out-of-tree build artifacts under build/, but keep +# the tracked build2 metadata files (build/bootstrap.build, build/root.build). +build/* +!build/bootstrap.build +!build/root.build build-*/ # Compiled Object files diff --git a/README.md b/README.md index d73e6f6..264c2a7 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,34 @@ conan install --requires=geo-utils-cpp/1.0.1 --build=missing Conan Center support is pending [conan-io/conan-center-index#30152](https://github.com/conan-io/conan-center-index/pull/30152) +### build2 / bpkg / cppget + +> **Package name note:** in the build2 ecosystem (cppget.org) this library +> follows the build2 `libfoo` convention and is published as **`libgeo-utils`**. +> Everywhere else — GitHub project, CMake, vcpkg, Conan, xrepo — it is named +> **`geo-utils-cpp`**. Both names refer to the same library, same headers, same +> `#include ` API. + +Add the dependency to your package's `manifest`: + +``` +depends: libgeo-utils ^1.0.1 +``` + +And in the consuming `buildfile`: + +``` +import libs = libgeo-utils%lib{geo-utils} + +exe{hello}: cxx{hello} $libs +``` + +To install it into a build2 configuration directly: + +```sh +bpkg build libgeo-utils +``` + ### Manual Copy the `include/` directory into your project and add it to your include path. diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 0000000..629a193 --- /dev/null +++ b/build/bootstrap.build @@ -0,0 +1,5 @@ +project = libgeo-utils + +using config +using dist +using install diff --git a/build/root.build b/build/root.build new file mode 100644 index 0000000..17ee783 --- /dev/null +++ b/build/root.build @@ -0,0 +1,5 @@ +cxx.std = 17 + +using cxx + +hxx{*}: extension = hpp diff --git a/buildfile b/buildfile new file mode 100644 index 0000000..6143bca --- /dev/null +++ b/buildfile @@ -0,0 +1 @@ +./: include/ doc{README.md LICENSE NOTICE CHANGELOG.md} manifest diff --git a/include/buildfile b/include/buildfile new file mode 100644 index 0000000..c2ccdd8 --- /dev/null +++ b/include/buildfile @@ -0,0 +1 @@ +./: geo/ diff --git a/include/geo/buildfile b/include/geo/buildfile new file mode 100644 index 0000000..7322ef1 --- /dev/null +++ b/include/geo/buildfile @@ -0,0 +1,11 @@ +lib{geo-utils}: hxx{**} + +# Public include path: consumers do `#include `. +lib{geo-utils}: cxx.export.poptions = "-I$out_root/include" "-I$src_root/include" + +# Install headers under /include/geo/, preserving the detail/ subdir. +hxx{*}: +{ + install = include/geo/ + install.subdirs = true +} diff --git a/manifest b/manifest new file mode 100644 index 0000000..2cfeb7e --- /dev/null +++ b/manifest @@ -0,0 +1,15 @@ +: 1 +name: libgeo-utils +version: 1.0.1 +project: geo-utils-cpp +language: c++ +summary: Header-only C++17 geographic geometry utilities +license: Apache-2.0 +topics: geography, geometry, spherical, distance, header-only +description-file: README.md +description-type: text/markdown +changes-file: CHANGELOG.md +changes-type: text/markdown +url: https://github.com/gistrec/geo-utils-cpp +email: gistrec@gmail.com +requires: c++17