From b9ec999bfae2a83848f4f43d46c2e688a012e696 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 | 7 ++++++- README.md | 28 ++++++++++++++++++++++++++++ build/bootstrap.build | 6 ++++++ build/root.build | 5 +++++ buildfile | 1 + include/buildfile | 1 + include/geo/buildfile | 11 +++++++++++ manifest | 17 +++++++++++++++++ 8 files changed, 75 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 ce379f0..17b5e37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,9 @@ -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/export.build # Compiled Object files *.slo diff --git a/README.md b/README.md index cd122d0..dc66790 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,34 @@ target("your_target") add_packages("geo-utils-cpp") ``` +### 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 +``` + ### find_package ```cmake diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 0000000..441d6c9 --- /dev/null +++ b/build/bootstrap.build @@ -0,0 +1,6 @@ +project = libgeo-utils + +using config +using test +using dist +using install diff --git a/build/root.build b/build/root.build new file mode 100644 index 0000000..e29cf15 --- /dev/null +++ b/build/root.build @@ -0,0 +1,5 @@ +cxx.std = latest + +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..702fc08 --- /dev/null +++ b/manifest @@ -0,0 +1,17 @@ +: 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 +src-url: https://github.com/gistrec/geo-utils-cpp +package-url: https://github.com/gistrec/geo-utils-cpp +email: gistrec@gmail.com +requires: c++17