14 stdenv.mkDerivation rec {
18 src = fetchFromGitHub {
19 owner = "digitalocean";
20 repo = "prometheus-client-c";
22 sha256 = "0g69s24xwrv5974acshrhnp6i8rpby8c6bhz15m3d8kpgjw3cm8f";
25 nativeBuildInputs = [ cmake ];
28 # These patches will be in 0.1.2
30 # Required so CMAKE_INSTALL_PREFIX is honored, otherwise it
31 # installs headers in /usr/include (absolute)
34 url = "https://github.com/digitalocean/prometheus-client-c/commit/5fcedeb506b7d47dd7bab35797f2c3f23db6fe10.patch";
35 sha256 = "10hzg8v5jcgxz224kdq0nha9vs78wz098b0ys7gig2iwgrg018fy";
40 url = "https://github.com/digitalocean/prometheus-client-c/commit/0c15e7e45ad0c3726593591fdd7d8f2fde845fe3.patch";
41 sha256 = "06899v1xz3lpsdxww4p3q7pv8nrymnibncdc472056znr5fidlp0";
46 # Workaround build failure on -fno-common toolchains like upstream
47 # gcc-10. Otherwise build fails as:
48 # ld: CMakeFiles/prom.dir/src/prom_process_stat.c.o:(.bss+0x0): multiple definition of
49 # `prom_process_start_time_seconds'; CMakeFiles/prom.dir/src/prom_collector.c.o:(.bss+0x0): first defined here
50 # Should be fixed in 1.2.0 and later: https://github.com/digitalocean/prometheus-client-c/pull/25
51 env.NIX_CFLAGS_COMPILE = "-fcommon";
58 homepage = "https://github.com/digitalocean/prometheus-client-c/";
60 platforms = lib.platforms.unix;
61 license = lib.licenses.asl20;
62 maintainers = [ lib.maintainers.cfsmp3 ];
70 description = "Prometheus Client in C";
73 pname = "libpromhttp";
75 buildInputs = [ libmicrohttpd libprom ];
76 description = "Prometheus HTTP Endpoint in C";