Merge pull request #311345 from drupol/symfony-cli/add-build-date

symfony-cli: add build date
This commit is contained in:
Pol Dellaiera 2024-05-14 09:23:24 +02:00 committed by GitHub
commit 75674be7fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,12 @@ buildGoModule rec {
owner = "symfony-cli";
repo = "symfony-cli";
rev = "v${version}";
hash = "sha256-IanaxFhD0nAabr9w6ARCVie+sYW9bvgHoahsuHQYeqE=";
hash = "sha256-UmGyIZk5s5A8ModafWMZqeJHdZ4fa+hAHi62pdlfJ8I=";
leaveDotGit = true;
postFetch = ''
git --git-dir $out/.git log -1 --pretty=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ' > $out/SOURCE_DATE
rm -rf $out/.git
'';
};
ldflags = [
@ -27,6 +32,10 @@ buildGoModule rec {
"-X main.channel=stable"
];
preBuild = ''
ldflags+=" -X main.buildDate=$(cat SOURCE_DATE)"
'';
buildInputs = [ makeBinaryWrapper ];
postInstall = ''