mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 20:03:24 +00:00
grafana-agent: add Darwin support
This commit is contained in:
parent
d37a3efd4a
commit
209611b2e1
@ -1,4 +1,4 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub, systemd, nixosTests }:
|
||||
{ lib, stdenv, buildGoModule, fetchFromGitHub, systemd, nixosTests }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "grafana-agent";
|
||||
@ -38,7 +38,7 @@ buildGoModule rec {
|
||||
|
||||
# uses go-systemd, which uses libsystemd headers
|
||||
# https://github.com/coreos/go-systemd/issues/351
|
||||
NIX_CFLAGS_COMPILE = [ "-I${lib.getDev systemd}/include" ];
|
||||
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isLinux [ "-I${lib.getDev systemd}/include" ];
|
||||
|
||||
# tries to access /sys: https://github.com/grafana/agent/issues/333
|
||||
preBuild = ''
|
||||
@ -48,7 +48,7 @@ buildGoModule rec {
|
||||
# go-systemd uses libsystemd under the hood, which does dlopen(libsystemd) at
|
||||
# runtime.
|
||||
# Add to RUNPATH so it can be found.
|
||||
postFixup = ''
|
||||
postFixup = lib.optionalString stdenv.isLinux ''
|
||||
patchelf \
|
||||
--set-rpath "${lib.makeLibraryPath [ (lib.getLib systemd) ]}:$(patchelf --print-rpath $out/bin/agent)" \
|
||||
$out/bin/agent
|
||||
@ -61,6 +61,5 @@ buildGoModule rec {
|
||||
license = licenses.asl20;
|
||||
homepage = "https://grafana.com/products/cloud";
|
||||
maintainers = with maintainers; [ flokli ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user