Merge pull request #133071 from qowoz/go-tags

This commit is contained in:
Sandro 2021-08-08 04:46:39 +02:00 committed by GitHub
commit 6d84ed4252
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 18 deletions

View file

@ -29,9 +29,7 @@ buildGoModule rec {
buildInputs = optional pamSupport pam;
buildFlags = [ "-tags" ];
buildFlagsArray =
tags =
( optional sqliteSupport "sqlite"
++ optional pamSupport "pam");

View file

@ -16,9 +16,7 @@ buildGoModule rec {
sha256 = "sha256-MKV5kor+Wm9cuIFFcjSNyCgVKtY+/B9sgBOXMMRvMPI=";
};
preBuild = ''
buildFlagsArray+=( "-tags" "${lib.optionalString (!enableUnfree) "oss nolimit"}" )
'';
tags = lib.optionals (!enableUnfree) [ "oss" "nolimit" ];
meta = with lib; {
maintainers = with maintainers; [ elohmeier vdemeester ];

View file

@ -47,21 +47,19 @@ buildGoModule rec {
ln -s ${webui} web/ui/static/react
'';
buildFlags = "-tags=builtinassets";
buildFlagsArray =
tags = [ "builtinassets" ];
ldflags =
let
t = "${goPackagePath}/vendor/github.com/prometheus/common/version";
in
[
''
-ldflags=
-X ${t}.Version=${version}
-X ${t}.Revision=unknown
-X ${t}.Branch=unknown
-X ${t}.BuildUser=nix@nixpkgs
-X ${t}.BuildDate=unknown
-X ${t}.GoVersion=${lib.getVersion go}
''
"-X ${t}.Version=${version}"
"-X ${t}.Revision=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.GoVersion=${lib.getVersion go}"
];
# only run this in the real build, not during the vendor build

View file

@ -18,7 +18,7 @@ buildGoPackage rec {
nativeBuildInputs = optional withSystemdSupport makeWrapper;
buildInputs = optional withSystemdSupport systemd;
buildFlags = optional (!withSystemdSupport) "-tags nosystemd";
tags = optional (!withSystemdSupport) "nosystemd";
goDeps = ./postfix-exporter-deps.nix;
extraSrcs = optionals withSystemdSupport [