Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / roadrunner / default.nix
blob531dfb9b7ee5e7f3dbf156dcdb987c2b61ba157e
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 }:
7 buildGoModule rec {
8   pname = "roadrunner";
9   version = "2024.1.2";
11   src = fetchFromGitHub {
12     repo = "roadrunner";
13     owner = "roadrunner-server";
14     rev = "refs/tags/v${version}";
15     hash = "sha256-qaG7krLu6D08izPwRwqzSpnGVQjTgNwoSky3jmSwOdM=";
16   };
18   nativeBuildInputs = [
19     installShellFiles
20   ];
22   # Flags as provided by the build automation of the project:
23   # https://github.com/roadrunner-server/roadrunner/blob/fe572d0eceae8fd05225fbd99ba50a9eb10c4393/.github/workflows/release.yml#L89
24   ldflags = [
25     "-s"
26     "-X=github.com/roadrunner-server/roadrunner/v2023/internal/meta.version=${version}"
27     "-X=github.com/roadrunner-server/roadrunner/v2023/internal/meta.buildTime=1970-01-01T00:00:00Z"
28   ];
30   postInstall = ''
31     installShellCompletion --cmd rr \
32       --bash <($out/bin/rr completion bash) \
33       --zsh <($out/bin/rr zsh) \
34       --fish <($out/bin/rr fish)
35   '';
37   postPatch = ''
38     substituteInPlace internal/rpc/client_test.go \
39       --replace "127.0.0.1:55555" "127.0.0.1:55554"
41     substituteInPlace internal/rpc/test/config_rpc_ok.yaml \
42       --replace "127.0.0.1:55555" "127.0.0.1:55554"
44     substituteInPlace internal/rpc/test/config_rpc_conn_err.yaml \
45       --replace "127.0.0.1:0" "127.0.0.1:55554"
46   '';
48   vendorHash = "sha256-vwOvp8hckamdN0qKnvaL2pm30nCMelQ8+LjqcPZR/ZQ=";
50   meta = {
51     changelog = "https://github.com/roadrunner-server/roadrunner/blob/v${version}/CHANGELOG.md";
52     description = "High-performance PHP application server, process manager written in Go and powered with plugins";
53     homepage = "https://roadrunner.dev";
54     license = lib.licenses.mit;
55     mainProgram = "rr";
56     maintainers = with lib.maintainers; [ shyim ];
57   };