diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-01-10 07:13:44 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-01-12 14:07:16 +0000 |
commit | e2698550456abba83c6dcd5d5e5a9990a0b96f8a (patch) | |
tree | 79a56f0df3fa55e470d84b4dff6059fbf487ec18 /nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix | |
parent | 1cdc42df888dc98c347e03bd942ed9825a55bcb3 (diff) | |
parent | 84d74ae9c9cbed73274b8e4e00be14688ffc93fe (diff) | |
download | nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.gz nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.bz2 nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.lz nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.xz nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.zst nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.zip |
Merge commit '84d74ae9c9cbed73274b8e4e00be14688ffc93fe'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix new file mode 100644 index 000000000000..57f4ef5956f6 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix @@ -0,0 +1,71 @@ +{ stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, libmicrohttpd +}: +let + build = + { pname + , subdir + , buildInputs ? [ ] + , description + }: + stdenv.mkDerivation rec { + inherit pname; + version = "0.1.1"; + + src = fetchFromGitHub { + owner = "digitalocean"; + repo = "prometheus-client-c"; + rev = "v${version}"; + sha256 = "0g69s24xwrv5974acshrhnp6i8rpby8c6bhz15m3d8kpgjw3cm8f"; + }; + + nativeBuildInputs = [ cmake ]; + inherit buildInputs; + + # These patches will be in 0.1.2 + patches = [ + # Required so CMAKE_INSTALL_PREFIX is honored, otherwise it + # installs headers in /usr/include (absolute) + ( + fetchpatch { + url = "https://github.com/digitalocean/prometheus-client-c/commit/5fcedeb506b7d47dd7bab35797f2c3f23db6fe10.patch"; + sha256 = "10hzg8v5jcgxz224kdq0nha9vs78wz098b0ys7gig2iwgrg018fy"; + } + ) + ( + fetchpatch { + url = "https://github.com/digitalocean/prometheus-client-c/commit/0c15e7e45ad0c3726593591fdd7d8f2fde845fe3.patch"; + sha256 = "06899v1xz3lpsdxww4p3q7pv8nrymnibncdc472056znr5fidlp0"; + } + ) + ]; + + preConfigure = '' + cd ${subdir} + ''; + + meta = { + homepage = "https://github.com/digitalocean/prometheus-client-c/"; + inherit description; + platforms = stdenv.lib.platforms.unix; + license = stdenv.lib.licenses.asl20; + maintainers = [ stdenv.lib.maintainers.cfsmp3 ]; + }; + }; +in +rec { + libprom = build { + pname = "libprom"; + subdir = "prom"; + description = "A Prometheus Client in C"; + }; + libpromhttp = build { + pname = "libpromhttp"; + subdir = "promhttp"; + buildInputs = [ libmicrohttpd libprom ]; + description = "A Prometheus HTTP Endpoint in C"; + }; +} |