Merge pull request #133071 from qowoz/go-tags
This commit is contained in:
commit
6d84ed4252
|
@ -29,9 +29,7 @@ buildGoModule rec {
|
||||||
|
|
||||||
buildInputs = optional pamSupport pam;
|
buildInputs = optional pamSupport pam;
|
||||||
|
|
||||||
buildFlags = [ "-tags" ];
|
tags =
|
||||||
|
|
||||||
buildFlagsArray =
|
|
||||||
( optional sqliteSupport "sqlite"
|
( optional sqliteSupport "sqlite"
|
||||||
++ optional pamSupport "pam");
|
++ optional pamSupport "pam");
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,7 @@ buildGoModule rec {
|
||||||
sha256 = "sha256-MKV5kor+Wm9cuIFFcjSNyCgVKtY+/B9sgBOXMMRvMPI=";
|
sha256 = "sha256-MKV5kor+Wm9cuIFFcjSNyCgVKtY+/B9sgBOXMMRvMPI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
preBuild = ''
|
tags = lib.optionals (!enableUnfree) [ "oss" "nolimit" ];
|
||||||
buildFlagsArray+=( "-tags" "${lib.optionalString (!enableUnfree) "oss nolimit"}" )
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
maintainers = with maintainers; [ elohmeier vdemeester ];
|
maintainers = with maintainers; [ elohmeier vdemeester ];
|
||||||
|
|
|
@ -47,21 +47,19 @@ buildGoModule rec {
|
||||||
ln -s ${webui} web/ui/static/react
|
ln -s ${webui} web/ui/static/react
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildFlags = "-tags=builtinassets";
|
tags = [ "builtinassets" ];
|
||||||
buildFlagsArray =
|
|
||||||
|
ldflags =
|
||||||
let
|
let
|
||||||
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
|
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
''
|
"-X ${t}.Version=${version}"
|
||||||
-ldflags=
|
"-X ${t}.Revision=unknown"
|
||||||
-X ${t}.Version=${version}
|
"-X ${t}.Branch=unknown"
|
||||||
-X ${t}.Revision=unknown
|
"-X ${t}.BuildUser=nix@nixpkgs"
|
||||||
-X ${t}.Branch=unknown
|
"-X ${t}.BuildDate=unknown"
|
||||||
-X ${t}.BuildUser=nix@nixpkgs
|
"-X ${t}.GoVersion=${lib.getVersion go}"
|
||||||
-X ${t}.BuildDate=unknown
|
|
||||||
-X ${t}.GoVersion=${lib.getVersion go}
|
|
||||||
''
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# only run this in the real build, not during the vendor build
|
# only run this in the real build, not during the vendor build
|
||||||
|
|
|
@ -18,7 +18,7 @@ buildGoPackage rec {
|
||||||
|
|
||||||
nativeBuildInputs = optional withSystemdSupport makeWrapper;
|
nativeBuildInputs = optional withSystemdSupport makeWrapper;
|
||||||
buildInputs = optional withSystemdSupport systemd;
|
buildInputs = optional withSystemdSupport systemd;
|
||||||
buildFlags = optional (!withSystemdSupport) "-tags nosystemd";
|
tags = optional (!withSystemdSupport) "nosystemd";
|
||||||
|
|
||||||
goDeps = ./postfix-exporter-deps.nix;
|
goDeps = ./postfix-exporter-deps.nix;
|
||||||
extraSrcs = optionals withSystemdSupport [
|
extraSrcs = optionals withSystemdSupport [
|
||||||
|
|
Loading…
Reference in a new issue