minio: set version variables with ldflags
Set version variables with ldflags rather than sed in a postPatch phase Also means that CGO_ENABLED and -tags=kqueue can be set in the same place Add changelog
This commit is contained in:
parent
02b121bf85
commit
acec233fcd
|
@ -30,25 +30,18 @@ buildGoModule rec {
|
||||||
|
|
||||||
subPackages = [ "." ];
|
subPackages = [ "." ];
|
||||||
|
|
||||||
postPatch = ''
|
preBuild = let t = "github.com/minio/minio/cmd"; in
|
||||||
sed -i "s/Version.*/Version = \"${versionToTimestamp version}\"/g" cmd/build-constants.go
|
''
|
||||||
sed -i "s/ReleaseTag.*/ReleaseTag = \"RELEASE.${version}\"/g" cmd/build-constants.go
|
export CGO_ENABLED=0
|
||||||
sed -i "s/CommitID.*/CommitID = \"${src.rev}\"/g" cmd/build-constants.go
|
buildFlagsArray+=("-tags" "kqueue" "-ldflags" "-s -w -X ${t}.Version=${versionToTimestamp version} -X ${t}.ReleaseTag=RELEASE.${version} -X ${t}.CommitID=${src.rev}")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postConfigure = ''
|
|
||||||
export CGO_ENABLED=0
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildFlagsArray = [
|
|
||||||
"-tags=kqueue"
|
|
||||||
];
|
|
||||||
|
|
||||||
passthru.tests.minio = nixosTests.minio;
|
passthru.tests.minio = nixosTests.minio;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://www.minio.io/";
|
homepage = "https://www.minio.io/";
|
||||||
description = "An S3-compatible object storage server";
|
description = "An S3-compatible object storage server";
|
||||||
|
changelog = "https://github.com/minio/minio/releases/tag/RELEASE.${version}";
|
||||||
maintainers = with maintainers; [ eelco bachp ];
|
maintainers = with maintainers; [ eelco bachp ];
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
license = licenses.agpl3Plus;
|
license = licenses.agpl3Plus;
|
||||||
|
|
Loading…
Reference in a new issue