mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
Merge pull request #133071 from qowoz/go-tags
This commit is contained in:
commit
6d84ed4252
4 changed files with 12 additions and 18 deletions
|
@ -29,9 +29,7 @@ buildGoModule rec {
|
|||
|
||||
buildInputs = optional pamSupport pam;
|
||||
|
||||
buildFlags = [ "-tags" ];
|
||||
|
||||
buildFlagsArray =
|
||||
tags =
|
||||
( optional sqliteSupport "sqlite"
|
||||
++ optional pamSupport "pam");
|
||||
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 [
|
||||
|
|
Loading…
Reference in a new issue