Subject: [PATCH rust-team v2 015/117] gnu: Add rust-opentelemetry-proto-0.4.

From: Herman Rimm <[email-masked]>
Date: Sun, 28 Apr 2024 20:54:41 +0200

* gnu/packages/crates-io.scm (rust-opentelemetry-proto-0.4): Add
variable.
(define-module): Use (gnu packages protobuf) module.

Change-Id: I36ecba2dde7f01d592aa2d1481e63e17b92deae0
---
 gnu/packages/crates-io.scm | 40 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 9f4eacad2f..cf23951055 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -49128,6 +49128,46 @@ (define-public rust-opentelemetry-jaeger-0.20
 @code{OpenTelemetry}.")
     (license license:asl2.0)))
 
+(define-public rust-opentelemetry-proto-0.4
+  (package
+    (name "rust-opentelemetry-proto")
+    (version "0.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "opentelemetry-proto" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1qblsq0hkksdw3k60bc8yi5xwlynmqwibggz3lyyl4n8bk75bqd2"))))
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs
+       (("rust-grpcio" ,rust-grpcio-0.12)
+        ("rust-opentelemetry" ,rust-opentelemetry-0.21)
+        ("rust-opentelemetry-sdk" ,rust-opentelemetry-sdk-0.21)
+        ("rust-prost" ,rust-prost-0.11)
+        ("rust-serde" ,rust-serde-1)
+        ("rust-tonic" ,rust-tonic-0.9))
+       #:cargo-development-inputs
+       (("rust-grpcio-compiler" ,rust-grpcio-compiler-0.12)
+        ("rust-prost-build" ,rust-prost-build-0.11)
+        ("rust-tempfile" ,rust-tempfile-3)
+        ("rust-tonic-build" ,rust-tonic-build-0.9))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'set-protoc-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((protobuf (assoc-ref inputs "protobuf"))
+                    (protoc (string-append protobuf "/bin/protoc")))
+               (setenv "PROTOC" protoc)))))))
+    (native-inputs (list protobuf))
+    (home-page (string-append "https://github.com/open-telemetry/opentele"
+                              "metry-rust/tree/main/opentelemetry-proto"))
+    (synopsis "Protobuf generated files and transformations")
+    (description "This package provides Protobuf generated files and
+transformations.")
+    (license license:asl2.0)))
+
 (define-public rust-opentelemetry-sdk-0.21
   (package
     (name "rust-opentelemetry-sdk")
-- 
2.41.0