1{ lib
2, stdenv
3, buildPecl
4, cargo
5, rustc
6, fetchFromGitHub
7, rustPlatform
8, curl
9, pcre2
10, libiconv
11, darwin
12}:
13
14buildPecl rec {
15 pname = "ddtrace";
16 version = "0.93.1";
17
18 src = fetchFromGitHub {
19 owner = "DataDog";
20 repo = "dd-trace-php";
21 rev = version;
22 fetchSubmodules = true;
23 hash = "sha256-eiqwcSDwxkuYEsseHdjBE3KFnTnD/7BMyz/DNVAKUIA=";
24 };
25
26 cargoDeps = rustPlatform.importCargoLock {
27 lockFile = ./Cargo.lock;
28 outputHashes = {
29 "datadog-profiling-5.0.0" = "sha256-/Z1vGpAHpU5EO80NXnzyAHN4s3iyA1jOquBS8MH1nOo=";
30 };
31 };
32
33 env.NIX_CFLAGS_COMPILE = "-O2";
34
35 nativeBuildInputs = [
36 cargo
37 rustc
38 ] ++ lib.optionals stdenv.isLinux [
39 rustPlatform.bindgenHook
40 rustPlatform.cargoSetupHook
41 ] ++ lib.optionals stdenv.isDarwin [
42 darwin.apple_sdk_11_0.rustPlatform.bindgenHook
43 darwin.apple_sdk_11_0.rustPlatform.cargoSetupHook
44 ];
45
46 buildInputs = [
47 curl
48 pcre2
49 ] ++ lib.optionals stdenv.isDarwin [
50 darwin.apple_sdk.frameworks.CoreFoundation
51 darwin.apple_sdk.frameworks.Security
52 libiconv
53 ];
54
55 meta = {
56 changelog = "https://github.com/DataDog/dd-trace-php/blob/${src.rev}/CHANGELOG.md";
57 description = "Datadog Tracing PHP Client";
58 homepage = "https://github.com/DataDog/dd-trace-php";
59 license = with lib.licenses; [ asl20 bsd3 ];
60 maintainers = lib.teams.php.members;
61 };
62}