summaryrefslogtreecommitdiff
path: root/repo/protobuf/trim-rakefile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repo/protobuf/trim-rakefile.patch')
-rw-r--r--repo/protobuf/trim-rakefile.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/repo/protobuf/trim-rakefile.patch b/repo/protobuf/trim-rakefile.patch
new file mode 100644
index 0000000..ebc98d5
--- /dev/null
+++ b/repo/protobuf/trim-rakefile.patch
@@ -0,0 +1,74 @@
+--- a/ruby/Rakefile 2021-10-06 10:20:37.207462826 +0000
++++ b/ruby/Rakefile 2021-10-06 10:26:17.086024004 +0000
+@@ -1,6 +1,4 @@
+ require "rubygems"
+-require "rubygems/package_task"
+-require "rake/extensiontask" unless RUBY_PLATFORM == "java"
+ require "rake/testtask"
+
+ spec = Gem::Specification.load("google-protobuf.gemspec")
+@@ -66,64 +64,12 @@ unless ENV['IN_DOCKER'] == 'true'
+ end
+ end
+
+-if RUBY_PLATFORM == "java"
+- if `which mvn` == ''
+- raise ArgumentError, "maven needs to be installed"
+- end
+- task :clean do
+- system("mvn --batch-mode clean")
+- end
+-
+- task :compile do
+- system("mvn --batch-mode package")
+- end
+-else
+- Rake::ExtensionTask.new("protobuf_c", spec) do |ext|
+- unless RUBY_PLATFORM =~ /darwin/
+- # TODO: also set "no_native to true" for mac if possible. As is,
+- # "no_native" can only be set if the RUBY_PLATFORM doing
+- # cross-compilation is contained in the "ext.cross_platform" array.
+- ext.no_native = true
+- end
+- ext.ext_dir = "ext/google/protobuf_c"
+- ext.lib_dir = "lib/google"
+- ext.cross_compile = true
+- ext.cross_platform = [
+- 'x86-mingw32', 'x64-mingw32',
+- 'x86_64-linux', 'x86-linux',
+- 'universal-darwin'
+- ]
+- end
+-
+- task 'gem:windows' do
+- require 'rake_compiler_dock'
+- ['x86-mingw32', 'x64-mingw32', 'x86_64-linux', 'x86-linux'].each do |plat|
+- RakeCompilerDock.sh <<-"EOT", platform: plat
+- bundle && \
+- IN_DOCKER=true rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0:2.4.0:2.3.0
+- EOT
+- end
+- end
+-
+- if RUBY_PLATFORM =~ /darwin/
+- task 'gem:native' do
+- system "rake genproto"
+- system "rake cross native gem RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.1:2.4.0:2.3.0"
+- end
+- else
+- task 'gem:native' => [:genproto, 'gem:windows']
+- end
+-end
+-
+ task :genproto => genproto_output
+
+ task :clean do
+ sh "rm -f #{genproto_output.join(' ')}"
+ end
+
+-Gem::PackageTask.new(spec) do |pkg|
+-end
+-
+ Rake::TestTask.new(:test => [:build, :genproto]) do |t|
+ t.test_files = FileList["tests/*.rb"].exclude("tests/gc_test.rb", "tests/common_tests.rb")
+ end