feat: let Nimble dependents build liblogosdelivery (#4137)

* feat: let Nimble dependents build liblogosdelivery

Nimble installs only a package's namesake directory, so a dependent got
logos_delivery/ alone: enough to compile Nim against this package, not
enough to build the C library, whose entry point and headers live in
library/. installDirs ships that, and migrations/, which the postgres
driver reaches by relative import.

The build recipe moves into library/build_lib.nims so it ships too, and a
dependent builds the library the same way we do instead of copying a flag
list. buildLibrary now delegates to it.

The move is behaviour-preserving: buildLibrary's `params` was never
referenced by either exec string, so the chronicles and warning flags the
platform tasks pass have always been discarded, and they still are.
Making them honest would move shipped artifacts from INFO to TRACE
logging, which is a separate decision.

cBindingsDir is derived from the library directory rather than the cwd,
so the generated header lands beside the liblogosdelivery.h that includes
it wherever the package is checked out.

Needed by status-go, which consumes logos-delivery through Nimble
(status-im/status-app#19907, logos-messaging/pm#380).

* feat: let Nimble dependents build liblogosdelivery

Nimble installs only a package's namesake directory, so a dependent
received logos_delivery/ alone: enough to compile Nim against this
package, not enough to build the C library, whose entry point and headers
live in library/. tools/ is needed too, because logos_delivery imports
tools/confutils.

The single host-platform task saves every consumer dispatching on the OS
itself; the per-platform tasks stay for callers that want a specific one.
This commit is contained in:
Igor Sirotin
2026-08-23 16:30:19 +01:00
committed by GitHub
parent 69fbffa3a0
commit 4a45d22e9e
+12 -1
View File
@@ -8,7 +8,10 @@ version = "0.38.1"
author = "Status Research & Development GmbH"
description = "Logos-delivery, Private P2P Messaging for Resource-Restricted Devices"
license = "MIT or Apache License 2.0"
skipDirs = @["tests", "examples", "tools", "apps", "simulations", "metrics"]
skipDirs = @["tests", "examples", "apps", "simulations", "metrics"]
# Nimble installs only the namesake directory; dependents need these too.
installDirs = @["library", "migrations", "tools"]
const RequiredNimVersion = "2.2.4"
## This is the nim compiler version that we are working on. Other versions may behave differently.
@@ -509,6 +512,14 @@ let chroniclesParams =
## Liblogosdelivery build tasks
task liblogosdelivery, "Build liblogosdelivery for the host platform":
when defined(windows):
buildLibDynamicWindows("liblogosdelivery", "library")
elif defined(macosx):
buildLibDynamicMac("liblogosdelivery", "library")
else:
buildLibDynamicLinux("liblogosdelivery", "library")
task liblogosdeliveryDynamicWindows, "Generate bindings":
buildLibDynamicWindows("liblogosdelivery", "library")