about summary refs log tree commit diff
path: root/pkgs/servers/roadrunner
diff options
context:
space:
mode:
authorSoner Sayakci <s.sayakci@shopware.com>2023-04-19 23:36:45 +0200
committerSoner Sayakci <s.sayakci@shopware.com>2023-08-16 09:46:45 +0200
commit2375c0f072de5d31eab5e78600d590b391091cc2 (patch)
tree5aa97d3a32474fb5c7fa0fe0876d2fed6ef48c9a /pkgs/servers/roadrunner
parent4ed9856be002a730234a1a1ed9dcd9dd10cbdb40 (diff)
roadrunner: init at 2023.2.2
Diffstat (limited to 'pkgs/servers/roadrunner')
-rw-r--r--pkgs/servers/roadrunner/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/servers/roadrunner/default.nix b/pkgs/servers/roadrunner/default.nix
new file mode 100644
index 0000000000000..b6885bc9ee9f6
--- /dev/null
+++ b/pkgs/servers/roadrunner/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+}:
+
+buildGoModule rec {
+  pname = "roadrunner";
+  version = "2023.2.2";
+  src = fetchFromGitHub {
+    repo = "roadrunner";
+    owner = "roadrunner-server";
+    rev = "v${version}";
+    hash = "sha256-tkJ7MDFHWps6bCppFJXMFYQl7+i8OhuDVrk1n78rrUc";
+  };
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  # Flags as provided by the build automation of the project:
+  # https://github.com/roadrunner-server/roadrunner/blob/fe572d0eceae8fd05225fbd99ba50a9eb10c4393/.github/workflows/release.yml#L89
+  ldflags = [
+    "-s"
+    "-X github.com/roadrunner-server/roadrunner/v2023/internal/meta.version=${version}"
+    "-X github.com/roadrunner-server/roadrunner/v2023/internal/meta.buildTime=1970-01-01T00:00:00Z"
+  ];
+
+  postInstall = ''
+    installShellCompletion --cmd rr \
+      --bash <($out/bin/rr completion bash) \
+      --zsh <($out/bin/rr zsh) \
+      --fish <($out/bin/rr fish)
+  '';
+
+  postPatch = ''
+    substituteInPlace internal/rpc/client_test.go \
+      --replace "127.0.0.1:55555" "127.0.0.1:55554"
+
+    substituteInPlace internal/rpc/test/config_rpc_ok.yaml \
+      --replace "127.0.0.1:55555" "127.0.0.1:55554"
+
+    substituteInPlace internal/rpc/test/config_rpc_conn_err.yaml \
+      --replace "127.0.0.1:0" "127.0.0.1:55554"
+  '';
+
+  vendorHash = "sha256-pRZaJ1PBtshhna71V86IJ0VKs0u9wCFG27mghcE/8xY";
+
+  meta = {
+    changelog = "https://github.com/roadrunner-server/roadrunner/blob/v${version}/CHANGELOG.md";
+    description = "High-performance PHP application server, process manager written in Go and powered with plugins";
+    homepage = "https://roadrunner.dev";
+    license = lib.licenses.mit;
+    mainProgram = "rr";
+    maintainers = with lib.maintainers; [ shyim ];
+  };
+}