forked from mirrors/nixpkgs
manifest-tool: fix static build and update 2.0.6 -> 2.1.5 (#279451)
* manifest-tool: 2.0.6 -> 2.1.5 * manifest-tool: fix static build * manifest-tool: remove import from derivation --------- Co-authored-by: R. Ryantm <ryantm-bot@ryantm.com>
This commit is contained in:
parent
8c56a751cb
commit
afa089e86d
|
@ -9,15 +9,14 @@
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
pname = "manifest-tool";
|
pname = "manifest-tool";
|
||||||
version = "2.0.6";
|
version = "2.1.5";
|
||||||
gitCommit = "2ed9312726765567a84f2acc44a0c8a6e50f4b7a";
|
|
||||||
modRoot = "v2";
|
modRoot = "v2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "estesp";
|
owner = "estesp";
|
||||||
repo = "manifest-tool";
|
repo = "manifest-tool";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-oopk++IdNF6msxOszT0fKxQABgWKbaQZ2aNH9chqWU0=";
|
hash = "sha256-TCR8A35oETAZszrZFtNZulzCsh9UwGueTyHyYe+JQeI=";
|
||||||
leaveDotGit = true;
|
leaveDotGit = true;
|
||||||
postFetch = ''
|
postFetch = ''
|
||||||
git -C $out rev-parse HEAD > $out/.git-revision
|
git -C $out rev-parse HEAD > $out/.git-revision
|
||||||
|
@ -29,14 +28,26 @@ buildGoModule rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ git ];
|
nativeBuildInputs = [ git ];
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
"-s"
|
||||||
|
"-w"
|
||||||
|
"-X main.version=${version}"
|
||||||
|
] ++ lib.optionals stdenv.hostPlatform.isStatic [
|
||||||
|
"-linkmode=external"
|
||||||
|
"-extldflags"
|
||||||
|
"-static"
|
||||||
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
ldflags="-X main.gitCommit=$(cat .git-revision)"
|
export ldflags+=" -X main.gitCommit=$(cat .git-revision)"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
CGO_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
|
tags = lib.optionals stdenv.hostPlatform.isStatic [
|
||||||
GO_EXTLINK_ENABLED = if stdenv.hostPlatform.isStatic then "0" else "1";
|
"cgo"
|
||||||
ldflags = lib.optionals stdenv.hostPlatform.isStatic [ "-w" "-extldflags" "-static" ];
|
"netgo"
|
||||||
tags = lib.optionals stdenv.hostPlatform.isStatic [ "netgo" ];
|
"osusergo"
|
||||||
|
"static_build"
|
||||||
|
];
|
||||||
|
|
||||||
passthru.tests.version = testers.testVersion {
|
passthru.tests.version = testers.testVersion {
|
||||||
package = manifest-tool;
|
package = manifest-tool;
|
||||||
|
|
Loading…
Reference in a new issue