From 9ab6aae3cdedc9fa9dbe558d01aea31227e87d8e Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Mon, 22 Mar 2021 16:35:58 +0100 Subject: Update rubygem-protobuf.spec --- ...s_add-message-from-json_64bit-int-as-json.patch | 20 ++++++++++++++ rubygem-protobuf.spec | 31 ++++++++-------------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/rubygem-protobuf-3.10.3-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch b/rubygem-protobuf-3.10.3-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch index bd0e11b..c995020 100644 --- a/rubygem-protobuf-3.10.3-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch +++ b/rubygem-protobuf-3.10.3-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch @@ -550,3 +550,23 @@ index 70b338b..a5573e2 100644 } message ResourceSleepRequest { +--- a/spec/encoding/extreme_values_spec.rb 2021-03-16 09:59:12.864960277 +0100 ++++ b/spec/encoding/extreme_values_spec.rb 2021-03-12 18:22:09.951286951 +0100 +@@ -4,7 +4,7 @@ + RSpec.describe ::Protobuf do + it "correctly encodes extreme values" do + message = Protobuf_unittest::TestExtremeDefaultValues.new( +- :escaped_bytes => "\0\001\a\b\f\n\r\t\v\\\'\"\xfe", ++ :escaped_bytes => "\0\001\a\b\f\n\r\t\v\\\'\"\xfe".force_encoding(Encoding::ASCII_8BIT), + :large_uint32 => 4294967295, + :large_uint64 => 18446744073709551615, + :small_int32 => -2147483647, +@@ -27,7 +27,7 @@ + :really_small_int32 => -2147483648, + :really_small_int64 => -9223372036854775808, + :string_with_zero => "hello", +- :bytes_with_zero => "world", ++ :bytes_with_zero => "world".force_encoding(Encoding::ASCII_8BIT), + :string_piece_with_zero => "abc", + :cord_with_zero => "123", + ) diff --git a/rubygem-protobuf.spec b/rubygem-protobuf.spec index eb25643..2acdfc5 100644 --- a/rubygem-protobuf.spec +++ b/rubygem-protobuf.spec @@ -3,20 +3,16 @@ Name: rubygem-%{gem_name} Version: 3.10.3 -Release: 1.11%{?dist} +Release: 1.12%{?dist} Summary: Google Protocol Buffers serialization and RPC implementation for Ruby License: MIT URL: https://github.com/localshred/protobuf Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem -# We need PRs #410 #411 #415 to satisfy requirements of rubygem-cucumber-messages. -# git clone https://github.com/ruby-protobuf/protobuf.git && cd protobuf -# git fetch origin pull/410/head:pr-410 && git fetch origin pull/411/head:pr-411 && git fetch origin pull/415/head:pr-415 -# git checkout v3.10.3 && git rebase pr-410 && git rebase pr-411 && git rebase pr-415 -# git diff v3.10.3 -U > rubygem-protobuf-3.10.3-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch +# We need the following PRs for compatibility with rubygem-cucumber-messages. +# https://github.com/ruby-protobuf/protobuf/pull/410 +# https://github.com/ruby-protobuf/protobuf/pull/411 +# https://github.com/ruby-protobuf/protobuf/pull/415 Patch0: %{name}-%{version}-generate-camel-cased-keys_add-message-from-json_64bit-int-as-json.patch -# For some reason git thinks that spec/encoding/extreme_values_spec.rb is a binary file -# even though it should have appeared in previous diff creation, we need extra patch for that. -Patch1: %{name}-%{version}-spec-extreme-values-force-ascii-utf8-encoding.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby @@ -26,7 +22,7 @@ BuildRequires: rubygem(activesupport) BuildRequires: rubygem(timecop) BuildRequires: rubygem(thor) BuildRequires: rubygem(thread_safe) -# rubygem-ffi-rzmq is currently not in fedora. +# rubygem-ffi-rzmq is not a runtime dependency. # BuildRequires: rubygem(ffi-rzmq) BuildArch: noarch @@ -46,7 +42,6 @@ Documentation for %{name}. %setup -q -n %{gem_name}-%{version} %patch0 -p1 -%patch1 -p1 %build gem build ../%{gem_name}-%{version}.gemspec @@ -73,14 +68,10 @@ sed -i -e '/require .pry./ s/^/#/g' \ -e '/^Bundler\./ s/^/#/g' \ spec/spec_helper.rb -# rubygem-ffi-rzmq is not in fedora -# Removing the require does not seem to affect this test anyway -# as long as we require the correct file instead. +# Bypass require, as we don't have ffi-rzmq. +# The second test fails without internet access. sed -i -e "s/require .protobuf\/zmq./require 'protobuf\/rpc\/connectors\/ping'/g" \ - spec/lib/protobuf/rpc/connectors/ping_spec.rb - -# This test fails only without access to internet. -sed -i -e '/context .when a select timeout is fired./,/^ end$/ s/^/#/' \ + -e '/context .when a select timeout is fired./,/^ end$/ s/^/#/' \ spec/lib/protobuf/rpc/connectors/ping_spec.rb # There is not currently a ffi-rzmq gem in Fedora, @@ -89,11 +80,11 @@ for file in spec/lib/protobuf/rpc/servers/zmq/server_spec.rb \ spec/lib/protobuf/rpc/servers/zmq/util_spec.rb \ spec/functional/zmq_server_spec.rb \ spec/lib/protobuf/rpc/connectors/zmq_spec.rb ; do - mv $file{,.disabled} done # Another ffi-zmq test that needs disabling. -sed -i -e "/context ..*zmq.*. do/,/^ end$/ s/^/#/g" spec/lib/protobuf/cli_spec.rb +sed -i -e "/context ..*zmq.*. do/,/^ end$/ s/^/#/g" \ + spec/lib/protobuf/cli_spec.rb rspec spec popd -- cgit