www/gitlab: use gitlab own grpc packages

This commit is contained in:
Matthias Fechner
2025-06-18 17:35:47 +02:00
parent 06d71e04ae
commit f097255a9b
22 changed files with 185 additions and 11 deletions
+2
View File
@@ -7430,6 +7430,7 @@
SUBDIR += rubygem-google-protobuf
SUBDIR += rubygem-google-protobuf3
SUBDIR += rubygem-googleapis-common-protos
SUBDIR += rubygem-googleapis-common-protos-gitlab
SUBDIR += rubygem-googleapis-common-protos-types
SUBDIR += rubygem-graf
SUBDIR += rubygem-grape
@@ -7447,6 +7448,7 @@
SUBDIR += rubygem-graphql-client
SUBDIR += rubygem-graphql-docs
SUBDIR += rubygem-grpc-google-iam-v1
SUBDIR += rubygem-grpc-google-iam-v1-gitlab
SUBDIR += rubygem-guess_html_encoding
SUBDIR += rubygem-gyoku
SUBDIR += rubygem-hamster
+3 -2
View File
@@ -1,5 +1,6 @@
PORTNAME= gapic-common
PORTVERSION= 0.23.0
PORTREVISION= 1
CATEGORIES= devel rubygems
MASTER_SITES= RG
PKGNAMESUFFIX= -gitlab
@@ -14,10 +15,10 @@ LICENSE= APACHE20
RUN_DEPENDS= rubygem-faraday-gitlab>=1.9<3:www/rubygem-faraday-gitlab \
rubygem-faraday-retry-gitlab>=1.0<3:www/rubygem-faraday-retry-gitlab \
rubygem-google-protobuf>=3.25<5.0:devel/rubygem-google-protobuf \
rubygem-googleapis-common-protos>=1.6<2:devel/rubygem-googleapis-common-protos \
rubygem-googleapis-common-protos-gitlab>=1.6<2:devel/rubygem-googleapis-common-protos-gitlab \
rubygem-googleapis-common-protos-types>=1.15<2:devel/rubygem-googleapis-common-protos-types \
rubygem-googleauth-gitlab>=1.11<2:security/rubygem-googleauth-gitlab \
rubygem-grpc>=1.65<2:net/rubygem-grpc
rubygem-grpc-gitlab>=1.65<2:net/rubygem-grpc-gitlab
USES= gem
+2 -2
View File
@@ -1,6 +1,6 @@
PORTNAME= gitlab-labkit
PORTVERSION= 0.37.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= devel rubygems
MASTER_SITES= RG
@@ -13,7 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= rubygem-actionpack-gitlab>=5<8.1:www/rubygem-actionpack-gitlab \
rubygem-activesupport-gitlab>=5<8.1:devel/rubygem-activesupport-gitlab \
rubygem-grpc>=1.62:net/rubygem-grpc \
rubygem-grpc-gitlab>=1.62:net/rubygem-grpc-gitlab \
rubygem-jaeger-client>=1.1.0<1.2:devel/rubygem-jaeger-client \
rubygem-opentracing>=0.4<1:devel/rubygem-opentracing \
rubygem-pg_query>=5.1.0<7:databases/rubygem-pg_query \
@@ -0,0 +1,22 @@
PORTNAME= googleapis-common-protos
PORTVERSION= 1.8.0
CATEGORIES= devel rubygems
MASTER_SITES= RG
PKGNAMESUFFIX= -gitlab
MAINTAINER= mfechner@FreeBSD.org
COMMENT= Common gRPC and protocol buffer classes used in Google APIs
WWW= https://github.com/googleapis/common-protos-ruby/tree/main/googleapis-common-protos \
https://github.com/googleapis/common-protos-ruby
LICENSE= APACHE20
RUN_DEPENDS= rubygem-google-protobuf>=3.18<5.0:devel/rubygem-google-protobuf \
rubygem-googleapis-common-protos-types>=1.20<2:devel/rubygem-googleapis-common-protos-types \
rubygem-grpc-gitlab>=1.41<2:net/rubygem-grpc-gitlab
USES= gem
NO_ARCH= yes
.include <bsd.port.mk>
@@ -0,0 +1,3 @@
TIMESTAMP = 1747547446
SHA256 (rubygem/googleapis-common-protos-1.8.0.gem) = bfe89cb75d1a8f13e4591d262a20333e145481d803adb74dd13ac0517decdffe
SIZE (rubygem/googleapis-common-protos-1.8.0.gem) = 6656
@@ -0,0 +1,2 @@
googleapis-common-protos provides common gRPC and protocol buffer classes used
in Google APIs.
@@ -0,0 +1,22 @@
PORTNAME= grpc-google-iam-v1
PORTVERSION= 1.11.0
CATEGORIES= devel rubygems
MASTER_SITES= RG
PKGNAMESUFFIX= -gitlab
MAINTAINER= mfechner@FreeBSD.org
COMMENT= Common protos and gRPC services for Google IAM
WWW= https://github.com/googleapis/common-protos-ruby/tree/main/grpc-google-iam-v1 \
https://github.com/googleapis/common-protos-ruby
LICENSE= APACHE20
RUN_DEPENDS= rubygem-google-protobuf>=3.18<5.0:devel/rubygem-google-protobuf \
rubygem-googleapis-common-protos-gitlab>=1.7.0<2:devel/rubygem-googleapis-common-protos-gitlab \
rubygem-grpc-gitlab>=1.41<2:net/rubygem-grpc-gitlab
USES= gem
NO_ARCH= yes
.include <bsd.port.mk>
@@ -0,0 +1,3 @@
TIMESTAMP = 1747547450
SHA256 (rubygem/grpc-google-iam-v1-1.11.0.gem) = 8f0aa8a8503b3e001cb1561f31e43aa0445752fb675334afa1afac7f023f368c
SIZE (rubygem/grpc-google-iam-v1-1.11.0.gem) = 14336
@@ -0,0 +1,11 @@
--- grpc-google-iam-v1.gemspec.orig 2025-05-18 07:33:39 UTC
+++ grpc-google-iam-v1.gemspec
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.specification_version = 4
- s.add_runtime_dependency(%q<googleapis-common-protos>.freeze, ["~> 1.7.0".freeze])
+ s.add_runtime_dependency(%q<googleapis-common-protos>.freeze, ["~> 1.7".freeze])
s.add_runtime_dependency(%q<google-protobuf>.freeze, [">= 3.18".freeze, "< 5.a".freeze])
s.add_runtime_dependency(%q<grpc>.freeze, ["~> 1.41".freeze])
end
@@ -0,0 +1 @@
Google IAM gRPC client library
+1
View File
@@ -1365,6 +1365,7 @@
SUBDIR += rubygem-google-cloud-trace-v1
SUBDIR += rubygem-google-cloud-trace-v2
SUBDIR += rubygem-grpc
SUBDIR += rubygem-grpc-gitlab
SUBDIR += rubygem-grpc-tools
SUBDIR += rubygem-grpc_reflection
SUBDIR += rubygem-hangouts-chat
+1 -1
View File
@@ -9,7 +9,7 @@ WWW= https://gitlab.com/gitlab-org/gitaly
LICENSE= MIT
RUN_DEPENDS= rubygem-grpc>=1.0<2.0:net/rubygem-grpc
RUN_DEPENDS= rubygem-grpc-gitlab>=1.0<2.0:net/rubygem-grpc-gitlab
USES= cpe gem
+1 -1
View File
@@ -10,7 +10,7 @@ WWW= https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent
LICENSE= MIT
RUN_DEPENDS= rubygem-grpc>=1.0<2.0:net/rubygem-grpc
RUN_DEPENDS= rubygem-grpc-gitlab>=1.0<2.0:net/rubygem-grpc-gitlab
USES= gem
+29
View File
@@ -0,0 +1,29 @@
PORTNAME= grpc
PORTVERSION= 1.72.0
CATEGORIES= net rubygems
MASTER_SITES= RG
PKGNAMESUFFIX= -gitlab
MAINTAINER= mfechner@FreeBSD.org
COMMENT= Ruby implementation of gRPC
WWW= https://github.com/grpc/grpc/tree/master/src/ruby
LICENSE= BSD3CLAUSE
LIB_DEPENDS= libgrpc.so:devel/grpc
RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss \
rubygem-google-protobuf>=3.25<5.0:devel/rubygem-google-protobuf \
rubygem-googleapis-common-protos-types>=1.0<2:devel/rubygem-googleapis-common-protos-types
USES= cpe gem gmake pkgconfig
MAKE_JOBS_UNSAFE= yes
post-patch:
@${RM} ${WRKSRC}/Makefile ${WRKSRC}/.yardopts
@${RM} -r ${WRKSRC}/etc ${WRKSRC}/include ${WRKSRC}/third_party ${WRKSRC}/src/boringssl ${WRKSRC}/src/core
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/src/ruby/lib/grpc.rb
@${REINPLACE_CMD} -Ee '/s\.files = /s;, "(Makefile|etc|include|third_party|src/boringssl|src/core)[^"]*"\.freeze;;g' ${WRKSRC}/${GEMSPEC}
@${REINPLACE_CMD} -e '/s\.files = /s|"\.yardopts"\.freeze, ||' ${WRKSRC}/${GEMSPEC}
.include <bsd.port.mk>
+3
View File
@@ -0,0 +1,3 @@
TIMESTAMP = 1750238898
SHA256 (rubygem/grpc-1.72.0.gem) = 56fa0da2f4f96471f59430a9ef08a612cc77649e8fa118c83ae7d0bb619bea09
SIZE (rubygem/grpc-1.72.0.gem) = 6834176
@@ -0,0 +1,60 @@
--- src/ruby/ext/grpc/extconf.rb.orig 2024-05-18 09:15:48 UTC
+++ src/ruby/ext/grpc/extconf.rb
@@ -96,9 +96,9 @@ end
end
# Don't embed on TruffleRuby (constant-time crypto is unsafe with Sulong, slow build times)
-ENV['EMBED_OPENSSL'] = (RUBY_ENGINE != 'truffleruby').to_s
+ENV['EMBED_OPENSSL'] = 'false'
# Don't embed on TruffleRuby (the system zlib is already linked for the zlib C extension, slow build times)
-ENV['EMBED_ZLIB'] = (RUBY_ENGINE != 'truffleruby').to_s
+ENV['EMBED_ZLIB'] = 'false'
ENV['ARCH_FLAGS'] = RbConfig::CONFIG['ARCH_FLAG']
if apple_toolchain && !cross_compiling
@@ -122,30 +122,10 @@ strip_tool += ' -x' if apple_toolchain
strip_tool = RbConfig::CONFIG['STRIP']
strip_tool += ' -x' if apple_toolchain
-unless windows
- puts 'Building internal gRPC into ' + grpc_lib_dir
- nproc = 4
- nproc = Etc.nprocessors if Etc.respond_to? :nprocessors
- nproc_override = ENV['GRPC_RUBY_BUILD_PROCS']
- unless nproc_override.nil? or nproc_override.size == 0
- nproc = nproc_override
- puts "Overriding make parallelism to #{nproc}"
- end
- make = bsd ? 'gmake' : 'make'
- cmd = "#{make} -j#{nproc} -C #{grpc_root} #{grpc_lib_dir}/libgrpc.a CONFIG=#{grpc_config} Q="
- puts "Building grpc native library: #{cmd}"
- system(cmd)
- exit 1 unless $? == 0
-end
-
# C-core built, generate Makefile for ruby extension
$LDFLAGS = maybe_remove_strip_all_linker_flag($LDFLAGS)
$DLDFLAGS = maybe_remove_strip_all_linker_flag($DLDFLAGS)
-$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
-$CFLAGS << ' -I' + File.join(grpc_root, 'include')
-$CFLAGS << ' -g'
-
def have_ruby_abi_version()
return true if RUBY_ENGINE == 'truffleruby'
# ruby_abi_version is only available in development versions: https://github.com/ruby/ruby/pull/6231
@@ -174,13 +154,12 @@ ext_export_file = File.join(grpc_root, 'src', 'ruby',
end
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', ext_export_filename())
-$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux
if apple_toolchain
$LDFLAGS << ' -weak_framework CoreFoundation'
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"'
end
-$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
+$LDFLAGS << ' -lgrpc' unless windows
if grpc_config == 'gcov'
$CFLAGS << ' -O0 -fprofile-arcs -ftest-coverage'
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'
@@ -0,0 +1,11 @@
--- src/ruby/lib/grpc.rb.orig 2020-09-23 17:48:57 UTC
+++ src/ruby/lib/grpc.rb
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-ssl_roots_path = File.expand_path('../../../../etc/roots.pem', __FILE__)
+ssl_roots_path = '%%LOCALBASE%%/etc/ssl/cert.pem'
require_relative 'grpc/errors'
require_relative 'grpc/structs'
+1
View File
@@ -0,0 +1 @@
A Ruby implementation of gRPC.
+2 -1
View File
@@ -1,5 +1,6 @@
PORTNAME= spamcheck
PORTVERSION= 1.3.3
PORTREVISION= 1
CATEGORIES= net rubygems
MASTER_SITES= RG
@@ -9,7 +10,7 @@ WWW= https://rubygems.org/gems/spamcheck
LICENSE= MIT
RUN_DEPENDS= rubygem-grpc>=1.63<2.0:net/rubygem-grpc
RUN_DEPENDS= rubygem-grpc-gitlab>=1.63<2.0:net/rubygem-grpc-gitlab
USES= gem
@@ -1,5 +1,6 @@
PORTNAME= gitlab-secret_detection
PORTVERSION= 0.31.0
PORTREVISION= 1
CATEGORIES= security rubygems
MASTER_SITES= RG
@@ -10,7 +11,7 @@ WWW= https://gitlab.com/gitlab-org/security-products/secret-detection/secret-de
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= rubygem-grpc>=1.63.0<2:net/rubygem-grpc \
RUN_DEPENDS= rubygem-grpc-gitlab>=1.63.0<2:net/rubygem-grpc-gitlab \
rubygem-grpc_reflection>=0.1<1:net/rubygem-grpc_reflection \
rubygem-parallel>=1<2:sysutils/rubygem-parallel \
rubygem-re2>=2.7<3:devel/rubygem-re2 \
@@ -1,6 +1,6 @@
PORTNAME= google-cloud-artifact_registry-v1
PORTVERSION= 0.11.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= textproc rubygems
MASTER_SITES= RG
@@ -15,7 +15,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
RUN_DEPENDS= rubygem-gapic-common-gitlab>=0.20.0<2:devel/rubygem-gapic-common-gitlab \
rubygem-google-cloud-errors>=1.0<2:net/rubygem-google-cloud-errors \
rubygem-google-cloud-location-gitlab>=0.4<2:net/rubygem-google-cloud-location-gitlab \
rubygem-grpc-google-iam-v1>=1.1<2:devel/rubygem-grpc-google-iam-v1
rubygem-grpc-google-iam-v1-gitlab>=1.1<2:devel/rubygem-grpc-google-iam-v1-gitlab
USES= gem
+1 -1
View File
@@ -273,7 +273,7 @@ MY_DEPENDS= gitaly>=${GITLAB_VERSION}:devel/gitaly \
rubygem-spamcheck>=1.3.3<1.4:net/rubygem-spamcheck \
rubygem-gitaly>=17.8.4:net/rubygem-gitaly \
rubygem-gitlab-kas-grpc>=${GITLAB_KAS_GRPC_VERSION}:net/rubygem-gitlab-kas-grpc \
rubygem-grpc>=1.63.0<2:net/rubygem-grpc \
rubygem-grpc-gitlab>=1.63.0<2:net/rubygem-grpc-gitlab \
rubygem-google-protobuf3>=3.25.6<4:devel/rubygem-google-protobuf3 \
rubygem-toml-rb>=2.2.0<3:www/rubygem-toml-rb \
rubygem-flipper-gitlab>=0.28.0<0.29:devel/rubygem-flipper-gitlab \