manifest-tool: add static binary support

This commit is contained in:
Thibault Gagnaux 2023-01-23 09:22:25 +01:00
parent e3374aff8a
commit 2c5768fe8f
No known key found for this signature in database
GPG key ID: 44BD0764ACAE8E25

View file

@ -33,6 +33,11 @@ buildGoModule rec {
ldflags="-X main.gitCommit=$(cat .git-revision)"
'';
CGO_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
GO_EXTLINK_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
ldflags = lib.optionals stdenv.hostPlatform.isStatic [ "-w" "-extldflags" "-static" ];
tags = lib.optionals stdenv.hostPlatform.isStatic [ "netgo" ];
passthru.tests.version = testers.testVersion {
package = manifest-tool;
};