git: 2d01032b0f96 - main - textproc/elasticsearch94: Use LOCALBASE in path to protoc

From: Vladimir Druzenko <vvd_at_FreeBSD.org>
Date: Mon, 09 Nov 2026 19:13:24 UTC
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2d01032b0f962cc01e1cc841795bf378ea8e782d

commit 2d01032b0f962cc01e1cc841795bf378ea8e782d
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2026-11-09 19:03:43 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-11-09 19:12:59 +0000

    textproc/elasticsearch94: Use LOCALBASE in path to protoc
    
    PR:             290954
    Approved by:    elastic (implicit, inactive)
    Sponsored by:   UNIS Labs
---
 textproc/elasticsearch94/Makefile                                 | 3 +++
 .../files/patch-x-pack_plugin_otel-data_build.gradle              | 8 ++++++--
 .../files/patch-x-pack_plugin_prometheus_build.gradle             | 8 ++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/textproc/elasticsearch94/Makefile b/textproc/elasticsearch94/Makefile
index 04e508f48b9d..3baa405bad62 100644
--- a/textproc/elasticsearch94/Makefile
+++ b/textproc/elasticsearch94/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	elasticsearch
 DISTVERSIONPREFIX=	v
 DISTVERSION=	9.4.9
+PORTREVISION=	1
 CATEGORIES=	textproc java devel
 PKGNAMESUFFIX=	${DISTVERSION:R:S|.||}
 
@@ -137,6 +138,8 @@ post-patch:
 			 -e 's|%%PREFIX%%|${PREFIX}|' \
 			 -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
 		${WRKSRC}/libs/native/libraries/build.gradle \
+		${WRKSRC}/x-pack/plugin/otel-data/build.gradle \
+		${WRKSRC}/x-pack/plugin/prometheus/build.gradle \
 		${WRKSRC}/qa/packaging/src/test/java/org/elasticsearch/packaging/util/Cleanup.java
 
 do-configure:
diff --git a/textproc/elasticsearch94/files/patch-x-pack_plugin_otel-data_build.gradle b/textproc/elasticsearch94/files/patch-x-pack_plugin_otel-data_build.gradle
index f583ba629d4d..c1746bc947d3 100644
--- a/textproc/elasticsearch94/files/patch-x-pack_plugin_otel-data_build.gradle
+++ b/textproc/elasticsearch94/files/patch-x-pack_plugin_otel-data_build.gradle
@@ -1,6 +1,6 @@
 --- x-pack/plugin/otel-data/build.gradle.orig	2026-10-28 20:24:18 UTC
 +++ x-pack/plugin/otel-data/build.gradle
-@@ -100,8 +100,13 @@ protobuf {
+@@ -100,8 +100,17 @@ protobuf {
  
  protobuf {
    protoc {
@@ -8,7 +8,11 @@
 -    artifact = "com.google.protobuf:protoc:${protobufVersion}"
 +    if (System.getProperty("os.name", "").startsWith("FreeBSD")) {
 +      // Requires devel/protobuf to be installed
-+      path = '/usr/local/bin/protoc'
++      if (Boolean.parseBoolean(System.getProperty("freebsd.build.fromPorts", "false"))) {
++        path = '%%LOCALBASE%%/bin/protoc'
++      } else {
++        path = '/usr/local/bin/protoc'
++      }
 +    } else {
 +      // The artifact spec for the Protobuf Compiler
 +      artifact = "com.google.protobuf:protoc:${protobufVersion}"
diff --git a/textproc/elasticsearch94/files/patch-x-pack_plugin_prometheus_build.gradle b/textproc/elasticsearch94/files/patch-x-pack_plugin_prometheus_build.gradle
index 87cc2211e688..70cfd8363640 100644
--- a/textproc/elasticsearch94/files/patch-x-pack_plugin_prometheus_build.gradle
+++ b/textproc/elasticsearch94/files/patch-x-pack_plugin_prometheus_build.gradle
@@ -1,13 +1,17 @@
 --- x-pack/plugin/prometheus/build.gradle.orig	2026-10-28 20:24:18 UTC
 +++ x-pack/plugin/prometheus/build.gradle
-@@ -53,7 +53,13 @@ protobuf {
+@@ -53,7 +53,17 @@ protobuf {
  
  protobuf {
    protoc {
 -    artifact = "com.google.protobuf:protoc:${protobufVersion}"
 +    if (System.getProperty("os.name", "").startsWith("FreeBSD")) {
 +      // Requires devel/protobuf to be installed
-+      path = '/usr/local/bin/protoc'
++      if (Boolean.parseBoolean(System.getProperty("freebsd.build.fromPorts", "false"))) {
++        path = '%%LOCALBASE%%/bin/protoc'
++      } else {
++        path = '/usr/local/bin/protoc'
++      }
 +    } else {
 +      // The artifact spec for the Protobuf Compiler
 +      artifact = "com.google.protobuf:protoc:${protobufVersion}"