nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9buildGoModule rec {
10 pname = "roadrunner";
11 version = "2025.1.6";
12
13 src = fetchFromGitHub {
14 repo = "roadrunner";
15 owner = "roadrunner-server";
16 tag = "v${version}";
17 hash = "sha256-qoPQxJbZ1BH9Gy06qmp9LGWF6YPJL0gRZX3+S5ej6XY=";
18 };
19
20 nativeBuildInputs = [
21 installShellFiles
22 ];
23
24 # Flags as provided by the build automation of the project:
25 # https://github.com/roadrunner-server/roadrunner/blob/fe572d0eceae8fd05225fbd99ba50a9eb10c4393/.github/workflows/release.yml#L89
26 ldflags = [
27 "-s"
28 "-X=github.com/roadrunner-server/roadrunner/v2023/internal/meta.version=${version}"
29 "-X=github.com/roadrunner-server/roadrunner/v2023/internal/meta.buildTime=1970-01-01T00:00:00Z"
30 ];
31
32 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
33 installShellCompletion --cmd rr \
34 --bash <($out/bin/rr completion bash) \
35 --zsh <($out/bin/rr completion zsh) \
36 --fish <($out/bin/rr completion fish)
37 '';
38
39 postPatch = ''
40 substituteInPlace internal/rpc/client_test.go \
41 --replace "127.0.0.1:55555" "127.0.0.1:55554"
42
43 substituteInPlace internal/rpc/test/config_rpc_ok.yaml \
44 --replace "127.0.0.1:55555" "127.0.0.1:55554"
45
46 substituteInPlace internal/rpc/test/config_rpc_conn_err.yaml \
47 --replace "127.0.0.1:0" "127.0.0.1:55554"
48 '';
49
50 __darwinAllowLocalNetworking = true;
51
52 vendorHash = "sha256-LSeQACVgBywJqHfRE2q6HxL1ADKZtrJP83U3Zd1oIDw=";
53
54 meta = {
55 changelog = "https://github.com/roadrunner-server/roadrunner/blob/v${version}/CHANGELOG.md";
56 description = "High-performance PHP application server, process manager written in Go and powered with plugins";
57 homepage = "https://roadrunner.dev";
58 license = lib.licenses.mit;
59 mainProgram = "rr";
60 maintainers = [ ];
61 };
62}