Mercurial > hgrepos > FreeBSD > ports > net-mgmt > prometheus-client-c
changeset 8:e38a6e16e756
MERGE: the move libprom
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 19 Mar 2025 08:47:36 +0100 |
| parents | aae160bdb31e (current diff) 19458de35e56 (diff) |
| children | b3adf5848e4c |
| files | |
| diffstat | 6 files changed, 93 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/Makefile Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,28 @@ +PORTNAME= prometheus-client-c-libprom +DISTVERSION= 0.1.3 +CATEGORIES= net-mgmt + +MAINTAINER= freebsd-dev@dom66.de +COMMENT= This is libprom -- the C-client library for Prometheus +WWW= https://github.com/digitalocean/prometheus-client-c + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= cmake:noninja compiler:c11 + +USE_GITHUB= yes +GH_ACCOUNT= digitalocean +GH_PROJECT= prometheus-client-c +GH_TAGNAME= v${DISTVERSION} + +# Currently compilation errors on incompatible types with clang +USE_LDCONFIG= yes + +CMAKE_SOURCE_PATH= ${WRKSRC}/prom + +do-install: + (cd ${CMAKE_SOURCE_PATH}/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include) + ${INSTALL_LIB} ${BUILD_WRKSRC}/libprom.so ${STAGEDIR}${PREFIX}/lib/libprom.so + +.include <bsd.port.mk>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/distinfo Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,3 @@ +TIMESTAMP = 1742306323 +SHA256 (digitalocean-prometheus-client-c-0.1.3-v0.1.3_GH0.tar.gz) = 3a82e302a5bdbbd5f699cf21bee97217c0386b5076d878cab724d5f672ef5092 +SIZE (digitalocean-prometheus-client-c-0.1.3-v0.1.3_GH0.tar.gz) = 1038300
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/files/patch-prom_src_prom__metric__sample.c Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,26 @@ +--- prom/src/prom_metric_sample.c.orig 2020-12-08 07:38:13 UTC ++++ prom/src/prom_metric_sample.c +@@ -63,9 +63,9 @@ int prom_metric_sample_add(prom_metric_sample_t *self, + if (r_value < 0) { + return 1; + } +- _Atomic double old = atomic_load(&self->r_value); ++ double old = atomic_load(&self->r_value); + for (;;) { +- _Atomic double new = ATOMIC_VAR_INIT(old + r_value); ++ double new = old + r_value; + if (atomic_compare_exchange_weak(&self->r_value, &old, new)) { + return 0; + } +@@ -78,9 +78,9 @@ int prom_metric_sample_sub(prom_metric_sample_t *self, + PROM_LOG(PROM_METRIC_INCORRECT_TYPE); + return 1; + } +- _Atomic double old = atomic_load(&self->r_value); ++ double old = atomic_load(&self->r_value); + for (;;) { +- _Atomic double new = ATOMIC_VAR_INIT(old - r_value); ++ double new = old - r_value; + if (atomic_compare_exchange_weak(&self->r_value, &old, new)) { + return 0; + }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/files/patch-prom_src_prom__metric__sample__t.h Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,11 @@ +--- prom/src/prom_metric_sample_t.h.orig 2020-12-08 07:38:13 UTC ++++ prom/src/prom_metric_sample_t.h +@@ -23,7 +23,7 @@ struct prom_metric_sample { + struct prom_metric_sample { + prom_metric_type_t type; /**< type is the metric type for the sample */ + char *l_value; /**< l_value is the full metric name and label set represeted as a string */ +- _Atomic double r_value; /**< r_value is the value of the metric sample */ ++ _Atomic(double) r_value; /**< r_value is the value of the metric sample */ + }; + + #endif // PROM_METRIC_SAMPLE_T_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/pkg-descr Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,11 @@ +This is libprom -- the C-client library for Prometheus from +https://github.com/digitalocean/prometheus-client-c. + +This project provides this shared library for instrumenting software via +Prometheus. + + libprom: Provides the core API. Resources such as counters, gauges, + histograms, and collector registries can be found + here. This library has no dependencies on third-party + libraries; however, it does rely on pthreads native to + POSIX systems.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/prometheus-client-c-libprom/pkg-plist Wed Mar 19 08:47:36 2025 +0100 @@ -0,0 +1,14 @@ +include/prom_collector.h +include/prom_alloc.h +include/prom_metric_sample_histogram.h +include/prom_gauge.h +include/prom_map.h +include/prom_collector_registry.h +include/prom_histogram_buckets.h +include/prom_histogram.h +include/prom_counter.h +include/prom.h +include/prom_linked_list.h +include/prom_metric_sample.h +include/prom_metric.h +lib/libprom.so
