From aecc8aa7b827fba14b414558202093466e3ca8d2 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 13 May 2024 14:07:42 +0200 Subject: [PATCH] symfony-cli: add build date Inspired from pkgs/applications/graphics/pdfcpu/default.nix --- pkgs/by-name/sy/symfony-cli/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/sy/symfony-cli/package.nix b/pkgs/by-name/sy/symfony-cli/package.nix index 794bd2f0ea9b..20a30fd5d249 100644 --- a/pkgs/by-name/sy/symfony-cli/package.nix +++ b/pkgs/by-name/sy/symfony-cli/package.nix @@ -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 = ''