Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / sy / symfony-cli / package.nix
blob47ae24c608229d1e5be8202ff4c1a1e7aeb631c1
1 { buildGoModule
2 , fetchFromGitHub
3 , lib
4 , nix-update-script
5 , testers
6 , symfony-cli
7 , nssTools
8 , makeBinaryWrapper
9 }:
11 buildGoModule rec {
12   pname = "symfony-cli";
13   version = "5.10.2";
14   vendorHash = "sha256-WSZM/9inaFLlZIAwH3E8hWyRQaOvY8BJ6ECpbkqJN6g=";
16   src = fetchFromGitHub {
17     owner = "symfony-cli";
18     repo = "symfony-cli";
19     rev = "v${version}";
20     hash = "sha256-/fJ9Ovk2gXCIvvieCXxnI8gDjwrhQHJoF3Ia47dSdgQ=";
21     leaveDotGit = true;
22     postFetch = ''
23       git --git-dir $out/.git log -1 --pretty=%cd --date=format:'%Y-%m-%dT%H:%M:%SZ' > $out/SOURCE_DATE
24       rm -rf $out/.git
25     '';
26   };
28   ldflags = [
29     "-s"
30     "-w"
31     "-X main.version=${version}"
32     "-X main.channel=stable"
33   ];
35   preBuild = ''
36     ldflags+=" -X main.buildDate=$(cat SOURCE_DATE)"
37   '';
39   buildInputs = [ makeBinaryWrapper ];
41   postInstall = ''
42     mkdir $out/libexec
43     mv $out/bin/symfony-cli $out/libexec/symfony
45     makeBinaryWrapper $out/libexec/symfony $out/bin/symfony \
46       --prefix PATH : ${lib.makeBinPath [ nssTools ]}
47   '';
49   # Tests requires network access
50   doCheck = false;
52   passthru = {
53     updateScript = nix-update-script { };
54     tests.version = testers.testVersion {
55       inherit version;
56       package = symfony-cli;
57       command = "symfony version --no-ansi";
58     };
59   };
61   meta = {
62     changelog = "https://github.com/symfony-cli/symfony-cli/releases/tag/v${version}";
63     description = "Symfony CLI";
64     homepage = "https://github.com/symfony-cli/symfony-cli";
65     license = lib.licenses.agpl3Plus;
66     mainProgram = "symfony";
67     maintainers = with lib.maintainers; [ drupol ];
68   };