diff options
Diffstat (limited to 'dev-ruby')
47 files changed, 968 insertions, 2 deletions
diff --git a/dev-ruby/async-container/Manifest b/dev-ruby/async-container/Manifest new file mode 100644 index 000000000000..aaa698db3399 --- /dev/null +++ b/dev-ruby/async-container/Manifest @@ -0,0 +1 @@ +DIST async-container-0.16.12.tar.gz 22626 BLAKE2B 8e850ebededcc0110a8ddf79c23287d816973fee1c32b7e7b76a7158995ffca5476d8701b3b4499aa3c0fd023ee9f253e4d07bc9ad0562a32d529678d0569701 SHA512 d71bdd1dc22a7ebecd4fed7e17b28c9ae1c875e111db4fb9cddda3508113e3cb7fc72b820c447cac27f047606d20f62180b203e58164da18dc47cff385262441 diff --git a/dev-ruby/async-container/async-container-0.16.12.ebuild b/dev-ruby/async-container/async-container-0.16.12.ebuild new file mode 100644 index 000000000000..bacc76a095b5 --- /dev/null +++ b/dev-ruby/async-container/async-container-0.16.12.ebuild @@ -0,0 +1,39 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="Abstract container-based parallelism using threads and processes" +HOMEPAGE="https://github.com/socketry/async-container" +SRC_URI="https://github.com/socketry/async-container/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend "dev-ruby/async + dev-ruby/async-io" + +ruby_add_bdepend "test? ( + dev-ruby/bundler + >=dev-ruby/async-rspec-1.1:1 +)" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + + # spec/async/container/notify/pipe_spec.rb directly executes "bundler" command, + # so we can't just wipe out gems.rb as usual. also must remove covered from gemspec + # for this reason. + sed -i -E 's/gem ".+"//g' "gems.rb" || die + sed -i -E 's/spec.add_development_dependency "covered"//g' "${RUBY_FAKEGEM_GEMSPEC}" || die + + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/async-container/metadata.xml b/dev-ruby/async-container/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/async-container/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/async-io/Manifest b/dev-ruby/async-io/Manifest new file mode 100644 index 000000000000..0ad8291ad7ec --- /dev/null +++ b/dev-ruby/async-io/Manifest @@ -0,0 +1 @@ +DIST async-io-1.34.0.tar.gz 34147 BLAKE2B 85cb79423bcbcc45e7c3f703d5ce7866522e66c55f866a0545369b65eda9c8a4b5637eaeeb7e17a5a8ee7256c6a991871dbb96244e4647fa19f8f027fad37961 SHA512 d35389ebfb748ea1c44f4a7ea7707511e32d40e98ae3fd7e8a5b22fdbb5f8f5a00933ec48346e2ed44c679ee6121a6fdf980c8ee6a1da609fb7571abb703aa02 diff --git a/dev-ruby/async-io/async-io-1.34.0.ebuild b/dev-ruby/async-io/async-io-1.34.0.ebuild new file mode 100644 index 000000000000..75b432695d8b --- /dev/null +++ b/dev-ruby/async-io/async-io-1.34.0.ebuild @@ -0,0 +1,32 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRA_DOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="Provides support for asynchonous TCP, UDP, UNIX and SSL sockets" +HOMEPAGE="https://github.com/socketry/async-io" +SRC_URI="https://github.com/socketry/async-io/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend "dev-ruby/async" + +ruby_add_bdepend "test? ( + >=dev-ruby/async-container-0.15:0 + >=dev-ruby/async-rspec-1.10:1 + dev-ruby/rack-test +)" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/async-io/metadata.xml b/dev-ruby/async-io/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/async-io/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/async-rspec/Manifest b/dev-ruby/async-rspec/Manifest new file mode 100644 index 000000000000..39be7d5270a5 --- /dev/null +++ b/dev-ruby/async-rspec/Manifest @@ -0,0 +1 @@ +DIST async-rspec-1.16.1.tar.gz 7775 BLAKE2B a1ff314fbe3e42b9b25e1c891bf1a336644fa5183b6f504b06e0747c127e712a66a0fbb2f18695bd7cba91ec8a4e8af887a25fe3e9887f86fb5f17873e26f51f SHA512 5c2bc5cf5ff4ca25cad67e251b5e078ac9f6f2d0f5d50f67584d4a043040c4e9e9e51d3a9e2727f08de3eba39d46be66461e691af8b86e173d8b70b589161a29 diff --git a/dev-ruby/async-rspec/async-rspec-1.16.1.ebuild b/dev-ruby/async-rspec/async-rspec-1.16.1.ebuild new file mode 100644 index 000000000000..c920dff8061b --- /dev/null +++ b/dev-ruby/async-rspec/async-rspec-1.16.1.ebuild @@ -0,0 +1,34 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="Helpers for writing specs against the async gem" +HOMEPAGE="https://github.com/socketry/async-rspec" +SRC_URI="https://github.com/socketry/async-rspec/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend ">=dev-ruby/rspec-3.0:3 + >=dev-ruby/rspec-files-1.0:1 + >=dev-ruby/rspec-memory-1.0:1 +" + +ruby_add_bdepend "test? ( + dev-ruby/async + dev-ruby/async-io +)" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/async-rspec/metadata.xml b/dev-ruby/async-rspec/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/async-rspec/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/async/Manifest b/dev-ruby/async/Manifest new file mode 100644 index 000000000000..2d7531f0b811 --- /dev/null +++ b/dev-ruby/async/Manifest @@ -0,0 +1,2 @@ +DIST async-1.30.3.tar.gz 92599 BLAKE2B 69db66676adf2dd0f77142bffc55b1e90a6983c53c7fac444f72b9365f6907e4d2ec45579ea267f3a8f31fc45af63c3517908c353749b288d1873e2cf720f96b SHA512 337a51ca8fd0e6685528e2eca9b584344ba583f7254f2600110ee62da6e4ccabeb471e7d94f36ab6f8d0eb3eada9e23335a262a50c8d035f67708fce0a590e5e +DIST async-2.1.0.tar.gz 75110 BLAKE2B 6226cd64f62d42a57d46f1c31287e403af5c645343a2de899a090f986e2b669dc96f1019629cf32ed46809fbfcbb5716375ef4560358676759dcad0e17d02849 SHA512 85f02004f7851757425f6e30c364ad9cb52ac4ad4559fa3a4a9b933fc5df1f10f6975233df6057da479dc28b5188d9e6d0b70e215a4a99b7864938260571089c diff --git a/dev-ruby/async/async-1.30.3.ebuild b/dev-ruby/async/async-1.30.3.ebuild new file mode 100644 index 000000000000..f4164212833c --- /dev/null +++ b/dev-ruby/async/async-1.30.3.ebuild @@ -0,0 +1,40 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="A concurrency framework for Ruby" +HOMEPAGE="https://github.com/socketry/async" +SRC_URI="https://github.com/socketry/async/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend ">=dev-ruby/console-1.10:1 + >=dev-ruby/nio4r-2.3:2 + >=dev-ruby/timers-4.1:4" + +ruby_add_bdepend "test? ( + >=dev-ruby/async-rspec-1.1:1 + dev-ruby/benchmark-ips +)" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + + # network tests + rm -f "spec/async/scheduler_spec.rb" "spec/async/scheduler/address_spec.rb" "spec/async/scheduler/io_spec.rb" || die + + # broken on ruby 3.x + rm -f "spec/async/condition_spec.rb" "spec/async/notification_spec.rb" || die + + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/async/async-2.1.0.ebuild b/dev-ruby/async/async-2.1.0.ebuild new file mode 100644 index 000000000000..07e5ba91db6c --- /dev/null +++ b/dev-ruby/async/async-2.1.0.ebuild @@ -0,0 +1,40 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="readme.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="A concurrency framework for Ruby" +HOMEPAGE="https://github.com/socketry/async" +SRC_URI="https://github.com/socketry/async/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend ">=dev-ruby/console-1.10:1 + >=dev-ruby/io-event-1.0.0:1/1.0 + >=dev-ruby/timers-4.1:4" + +ruby_add_bdepend "test? ( + >=dev-ruby/async-rspec-1.1:1 + dev-ruby/benchmark-ips +)" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + + # network tests + rm -f \ + "spec/net/http_spec.rb" \ + "spec/async/scheduler/address_spec.rb" \ + "spec/async/scheduler/io_spec.rb" || die + + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/async/metadata.xml b/dev-ruby/async/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/async/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/console/Manifest b/dev-ruby/console/Manifest new file mode 100644 index 000000000000..694623a35a8b --- /dev/null +++ b/dev-ruby/console/Manifest @@ -0,0 +1 @@ +DIST console-1.15.3.tar.gz 23089 BLAKE2B 8387b0dc8ee84df3ce930ef79fcfec9e9b947b946770535beeb16fe58496c30134862b6a3fb48a842b321ab2ec493b1e4f9ec3462bdce04aa35066672ee55699 SHA512 c1d7fc987f3f6df3506c85c64d3c93b3eae6b5eca64ac7de2cf7cc0cb5572c102ebd6909d993d9d683081063ff8b7f2de46fefa255491adc47b88f13ff24ea67 diff --git a/dev-ruby/console/console-1.15.3.ebuild b/dev-ruby/console/console-1.15.3.ebuild new file mode 100644 index 000000000000..f6370717fffc --- /dev/null +++ b/dev-ruby/console/console-1.15.3.ebuild @@ -0,0 +1,28 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="Beautiful logging for Ruby" +HOMEPAGE="https://github.com/socketry/console" +SRC_URI="https://github.com/socketry/console/archive/fc6ecb94bc02b8b75003fc31f0a8b3e1e43cafcf.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" +RUBY_S="${PN}-fc6ecb94bc02b8b75003fc31f0a8b3e1e43cafcf" + +ruby_add_rdepend "dev-ruby/fiber-local" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + rm -f "gems.rb" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/console/metadata.xml b/dev-ruby/console/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/console/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/ffi-compiler/ffi-compiler-1.0.1-r2.ebuild b/dev-ruby/ffi-compiler/ffi-compiler-1.0.1-r2.ebuild new file mode 100644 index 000000000000..6a6262edb1ff --- /dev/null +++ b/dev-ruby/ffi-compiler/ffi-compiler-1.0.1-r2.ebuild @@ -0,0 +1,22 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +USE_RUBY="ruby26 ruby27 ruby30 ruby31" + +RUBY_FAKEGEM_EXTRADOC="README.md" + +RUBY_FAKEGEM_RECIPE_TEST="none" + +inherit ruby-fakegem + +DESCRIPTION="Ruby FFI Rakefile generator" +HOMEPAGE="https://github.com/ffi/ffi/wiki" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~sparc ~x86" +IUSE="" +# PATCHES=( "${FILESDIR}/respect-cflags.patch" ) + +ruby_add_rdepend "dev-ruby/rake >=dev-ruby/ffi-1.0.0" diff --git a/dev-ruby/ffi-compiler/files/respect-cflags.patch b/dev-ruby/ffi-compiler/files/respect-cflags.patch new file mode 100644 index 000000000000..3fe68f8211cb --- /dev/null +++ b/dev-ruby/ffi-compiler/files/respect-cflags.patch @@ -0,0 +1,17 @@ +diff --git a/lib/ffi-compiler/compile_task.rb b/lib/ffi-compiler/compile_task.rb +index 363c247..637fd3d 100644 +--- a/lib/ffi-compiler/compile_task.rb ++++ b/lib/ffi-compiler/compile_task.rb +@@ -26,9 +26,9 @@ module FFI + @libraries = [] + @headers = [] + @functions = [] +- @cflags = DEFAULT_CFLAGS.dup +- @cxxflags = DEFAULT_CFLAGS.dup +- @ldflags = DEFAULT_LDFLAGS.dup ++ @cflags = ENV['CFLAGS']&.split || DEFAULT_CFLAGS.dup ++ @cxxflags = ENV['CXXFLAGS']&.split || DEFAULT_CFLAGS.dup ++ @ldflags = ENV['LDFLAGS']&.split || DEFAULT_LDFLAGS.dup + @libs = [] + @platform = Platform.system + @exports = [] diff --git a/dev-ruby/ffi/ffi-1.15.5-r1.ebuild b/dev-ruby/ffi/ffi-1.15.5-r1.ebuild new file mode 100644 index 000000000000..82b8c9596f94 --- /dev/null +++ b/dev-ruby/ffi/ffi-1.15.5-r1.ebuild @@ -0,0 +1,71 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" + +RUBY_FAKEGEM_RECIPE_TEST="rspec3" + +RUBY_FAKEGEM_DOCDIR="doc" +RUBY_FAKEGEM_EXTRADOC="README.md" + +RUBY_FAKEGEM_GEMSPEC="ffi.gemspec" + +RUBY_FAKEGEM_EXTENSIONS=(ext/ffi_c/extconf.rb) + +inherit ruby-fakegem toolchain-funcs + +DESCRIPTION="Ruby extension for programmatically loading dynamic libraries" +HOMEPAGE="https://github.com/ffi/ffi/wiki" + +SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${PN}-git-${PV}.tgz" + +IUSE="" +LICENSE="BSD" +SLOT="0" +KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +PATCHES=( + "${FILESDIR}/backport-pr-962.patch" + "${FILESDIR}/pr-957-sparc.patch" # submitted upstream as https://github.com/ffi/ffi/pull/957 +) + +RDEPEND+=" dev-libs/libffi:=" +DEPEND+=" dev-libs/libffi:=" + +ruby_add_bdepend "dev-ruby/rake" + +all_ruby_prepare() { + sed -i -e '/tasks/ s:^:#:' \ + -e '/Gem::Tasks/,/end/ s:^:#:' Rakefile || die + + sed -e '/require/c\require "./lib/ffi/version"' \ + -e 's/git ls-files -z/find * -print0/' \ + -e '/^ lfs/,/^ end/ s:^:#:' \ + -i ${RUBY_FAKEGEM_GEMSPEC} || die + + # Fix Makefile for tests + sed -i -e '/CCACHE :=/ s:^:#:' \ + -e 's/-O2//' \ + -e 's/^CFLAGS =/CFLAGS +=/' spec/ffi/fixtures/GNUmakefile || die + + # Remove bundled version of libffi. + rm -rf ext/ffi_c/libffi || die +} + +each_ruby_compile() { + each_fakegem_compile + + ${RUBY} -S rake -f gen/Rakefile || die "types.conf generation failed" +} + +each_ruby_test() { + CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ${RUBY} -S rspec spec || die +} + +all_ruby_install() { + all_fakegem_install + + docinto examples + dodoc samples/* +} diff --git a/dev-ruby/ffi/files/backport-pr-962.patch b/dev-ruby/ffi/files/backport-pr-962.patch new file mode 100644 index 000000000000..708c52025bd5 --- /dev/null +++ b/dev-ruby/ffi/files/backport-pr-962.patch @@ -0,0 +1,48 @@ +From edc54894f77d00c4ca34593c8b4c94f656f5807e Mon Sep 17 00:00:00 2001 +From: Frederick Cheung <frederick.cheung@gmail.com> +Date: Fri, 17 Jun 2022 18:57:28 +0100 +Subject: [PATCH] Fix Pointer#initialize using NUM2LL instead of NUM2ULL + +If the high bit of the address was set this would raise RangeError +(bignum too big to convert into long long). This is not uncommon on +platforms that use the high bits of pointers for purposes such as +pointer authentication + +This also now matches Pointer#address which uses ULL2NUM. +--- + ext/ffi_c/Pointer.c | 2 +- + spec/ffi/pointer_spec.rb | 8 ++++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/ext/ffi_c/Pointer.c b/ext/ffi_c/Pointer.c +index 153fff101..79886811f 100644 +--- a/ext/ffi_c/Pointer.c ++++ b/ext/ffi_c/Pointer.c +@@ -112,7 +112,7 @@ ptr_initialize(int argc, VALUE* argv, VALUE self) + switch (TYPE(rbAddress)) { + case T_FIXNUM: + case T_BIGNUM: +- p->memory.address = (void*) (uintptr_t) NUM2LL(rbAddress); ++ p->memory.address = (void*) (uintptr_t) NUM2ULL(rbAddress); + p->memory.size = LONG_MAX; + if (p->memory.address == NULL) { + p->memory.flags = 0; +diff --git a/spec/ffi/pointer_spec.rb b/spec/ffi/pointer_spec.rb +index b216a161d..7a2ac1565 100644 +--- a/spec/ffi/pointer_spec.rb ++++ b/spec/ffi/pointer_spec.rb +@@ -237,6 +237,14 @@ def to_ptr + expect(FFI::Pointer.new(0).slice(0, 10).size_limit?).to be true + end + end ++ ++ describe "#initialise" do ++ it 'can use adresses with high bit set' do ++ max_address = 2**FFI::Platform::ADDRESS_SIZE - 1 ++ pointer = FFI::Pointer.new(:uint8, max_address) ++ expect(pointer.address).to eq(max_address) ++ end ++ end + end + + describe "AutoPointer" do diff --git a/dev-ruby/ffi/files/pr-957-sparc.patch b/dev-ruby/ffi/files/pr-957-sparc.patch new file mode 100644 index 000000000000..b68b5e06a7d4 --- /dev/null +++ b/dev-ruby/ffi/files/pr-957-sparc.patch @@ -0,0 +1,42 @@ +From 241b10322283743b79c9489993bfb964b5167f7f Mon Sep 17 00:00:00 2001 +From: matoro <matoro@users.noreply.github.com> +Date: Wed, 25 May 2022 14:23:55 -0400 +Subject: [PATCH 1/2] Rename sparc64-linux -> sparcv9-linux + +In https://github.com/ffi/ffi/pull/575, 64-bit sparc was changed to also +use sparcv9 as the platform name, but the types.conf directory was never +renamed. This breaks only on Ruby 3.0 and later due to the fileutils +change to use keyword arguments in +https://github.com/ruby/fileutils/commit/482de6d397742526d1111576e2791f9b7051e3c0 +--- + lib/ffi/platform/{sparc64-linux => sparcv9-linux}/types.conf | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) + rename lib/ffi/platform/{sparc64-linux => sparcv9-linux}/types.conf (100%) + +diff --git a/lib/ffi/platform/sparc64-linux/types.conf b/lib/ffi/platform/sparcv9-linux/types.conf +similarity index 100% +rename from lib/ffi/platform/sparc64-linux/types.conf +rename to lib/ffi/platform/sparcv9-linux/types.conf + +From 76dc5c7d69a445268f47f5b6a9185e644bcd68e8 Mon Sep 17 00:00:00 2001 +From: matoro <matoro@users.noreply.github.com> +Date: Mon, 13 Jun 2022 22:56:26 -0400 +Subject: [PATCH 2/2] Also normalize sparc64 -> sparcv9 in test fixture + +--- + spec/ffi/fixtures/compile.rb | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/spec/ffi/fixtures/compile.rb b/spec/ffi/fixtures/compile.rb +index f2e831a63..58ee5611d 100644 +--- a/spec/ffi/fixtures/compile.rb ++++ b/spec/ffi/fixtures/compile.rb +@@ -22,6 +22,8 @@ module TestLibrary + "powerpc64" + when /ppc|powerpc/ + "powerpc" ++ when /sparcv9|sparc64/ ++ "sparcv9" + when /^arm/ + if RbConfig::CONFIG['host_os'] =~ /darwin/ + "aarch64" diff --git a/dev-ruby/fiber-local/Manifest b/dev-ruby/fiber-local/Manifest new file mode 100644 index 000000000000..52c6faa57383 --- /dev/null +++ b/dev-ruby/fiber-local/Manifest @@ -0,0 +1 @@ +DIST fiber-local-1.0.0.tar.gz 3780 BLAKE2B 5360ebdc2f3958863742e5ca1e1cdefe76e4487bad2257a1bd34a8a6769b1191e1a8f0ba8c7dfe1481f73fdd8b9ee1a014b11e5527273dbb0ee6d8a94edae2ae SHA512 5f77213c3760bb7c23a6912f138e46aa54d8508c11d02dadde5ddbc4ab03976abccb37ad2b1b43b118eddfb7a5e8ca4ee647a7fea1bac5ee4d7b39e8dc8f8424 diff --git a/dev-ruby/fiber-local/fiber-local-1.0.0.ebuild b/dev-ruby/fiber-local/fiber-local-1.0.0.ebuild new file mode 100644 index 000000000000..ad2959e09769 --- /dev/null +++ b/dev-ruby/fiber-local/fiber-local-1.0.0.ebuild @@ -0,0 +1,25 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="Provides a class-level mixin to make fiber local state easy" +HOMEPAGE="https://github.com/socketry/fiber-local" +SRC_URI="https://github.com/socketry/fiber-local/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + rm -f "gems.rb" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/fiber-local/metadata.xml b/dev-ruby/fiber-local/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/fiber-local/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/http/Manifest b/dev-ruby/http/Manifest index 41b2ecc8d0a2..881c00e264fb 100644 --- a/dev-ruby/http/Manifest +++ b/dev-ruby/http/Manifest @@ -1 +1,2 @@ DIST http-4.4.1.gem 75776 BLAKE2B ab34a6a567842d52f9b7cbe3fc3fb8e4757f5cf1303deacdf2f2130a44e82fde64f0db561c3f8fc28100faea277a9c4a9352f95e6cb1359730b34e83a7b36d72 SHA512 6e43a8ae379d7c8a807a9a03c87bfb5ad1719f9838e26ac7a695220ee2bc50344accc2db268d30da175328fd5468b87ec8532d17ce42a5b74d6c2c4c281d1bc9 +DIST http-5.1.0.gem 81920 BLAKE2B cc80149b89eabd5c6b468ffe28b33e17845bd996fa3bf8b9c38c517fe79994412b376b3bac365e8debbeb272cf4333aebd398d1955a358faa27ba9f124671443 SHA512 b99da5318da54e7b64abd48df0b68cde9a02e1ae92b51fc43302e3dea28ba9672e2b7a25e31c342235835e16b2e1b98c94b6d4efa7916a0aa99258fc8290260f diff --git a/dev-ruby/http/http-5.1.0.ebuild b/dev-ruby/http/http-5.1.0.ebuild new file mode 100644 index 000000000000..d05205e7563f --- /dev/null +++ b/dev-ruby/http/http-5.1.0.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +USE_RUBY="ruby26 ruby27 ruby30 ruby31" + +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="CHANGES.md README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="An easy-to-use client library for making requests from Ruby" +HOMEPAGE="https://github.com/tarcieri/http" + +LICENSE="MIT" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend "=dev-ruby/addressable-2* + >=dev-ruby/addressable-2.8 + =dev-ruby/http-cookie-1* + >=dev-ruby/http-form_data-2.2:2 + >=dev-ruby/llhttp-ffi-0.4.0:0/0.4" + +ruby_add_bdepend " + test? ( + =dev-ruby/certificate_authority-1* + dev-ruby/rspec-its + )" + +all_ruby_prepare() { + # Avoid specs that require network access + sed -i -e '/.persistent/,/^ end/ s:^:#:' \ + spec/lib/http_spec.rb || die + sed -i -e '/with non-ASCII URLs/,/^ end/ s:^:#:' \ + spec/lib/http/client_spec.rb || die + + # Avoid spec that may fail with a running web server + sed -i -e '/unifies socket errors into HTTP::ConnectionError/,/^ end/ s:^:#:' spec/lib/http_spec.rb || die + + # Fix spec for production release + sed -i -e '/User-Agent:/ s/.dev//' spec/lib/http/features/logging_spec.rb || die + + # Avoid specs also failing upstream due to some certificate issue + sed -i -e '/context "ssl"/,/^ end/ s:^:#:' spec/lib/http_spec.rb || die + sed -i -e '/describe "working with SSL"/,/^ end/ s:^:#:' spec/lib/http/client_spec.rb || die + + # Disable coverage + sed -i -e 's/require_relative ".\/support\/simplecov"//g' "spec/spec_helper.rb" || die + + # Submitted upstream as https://github.com/httprb/http/pull/719 + sed -i -e '4i require "cgi"' "spec/lib/http/client_spec.rb" || die +} + +each_ruby_test() { + # disables dev-ruby/fuubar dep + CI=1 each_fakegem_test +} diff --git a/dev-ruby/io-event/Manifest b/dev-ruby/io-event/Manifest new file mode 100644 index 000000000000..082d5fee6a19 --- /dev/null +++ b/dev-ruby/io-event/Manifest @@ -0,0 +1 @@ +DIST io-event-1.0.9.tar.gz 31984 BLAKE2B 543c460cde5ac269607e4d7ec54962879141d40d9592433a55d53e89b2a43bce4f161c1e4b21322a9b3fe60d5ab77e35692a19f899b9210d06fbcf185bca83de SHA512 d2b5903e68425bb23a7a9b861e76b2d125b9cf53f81ca0120ded010559ca26f3af002b5da28092245e00e8d9b81e94bdda72b2ea607cfae27a1e48e3f1a39130 diff --git a/dev-ruby/io-event/io-event-1.0.9.ebuild b/dev-ruby/io-event/io-event-1.0.9.ebuild new file mode 100644 index 000000000000..d0b6cc652fb7 --- /dev/null +++ b/dev-ruby/io-event/io-event-1.0.9.ebuild @@ -0,0 +1,31 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby30 ruby31" +RUBY_FAKEGEM_EXTENSIONS="ext/extconf.rb" +RUBY_FAKEGEM_RECIPE_TEST="" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="An event loop" +HOMEPAGE="https://github.com/socketry/io-event" +SRC_URI="https://github.com/socketry/io-event/archive/68cffe24077a53201acbb383e8e132b192e1fa83.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" +RUBY_S="${PN}-68cffe24077a53201acbb383e8e132b192e1fa83" + +ruby_add_bdepend "test? ( >=dev-ruby/sus-0.6:0 )" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die +} + +each_ruby_test() { + "${RUBY}" -S sus-parallel || die +} diff --git a/dev-ruby/io-event/metadata.xml b/dev-ruby/io-event/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/io-event/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/llhttp-ffi/Manifest b/dev-ruby/llhttp-ffi/Manifest new file mode 100644 index 000000000000..edd8ef0da00a --- /dev/null +++ b/dev-ruby/llhttp-ffi/Manifest @@ -0,0 +1 @@ +DIST llhttp-0.4.0.tar.gz 98406 BLAKE2B 9f7358d988ed00558a36ae80e3c7d38cabb41a2233f32f4e3e6e9ed49a205f85ed84cb76cb07984f3b73b0a67eade4844ed5f4ee98b2453fa5c25d36fcb0082c SHA512 56a491763500b1619492173a83a227e3228847f4b85b8dadab1a9de34d65d5c662615c18d6cc6d5e11226df83381fd7f79f67e12f89f0e437ada8f9fd083ec26 diff --git a/dev-ruby/llhttp-ffi/llhttp-ffi-0.4.0.ebuild b/dev-ruby/llhttp-ffi/llhttp-ffi-0.4.0.ebuild new file mode 100644 index 000000000000..b22be2e05156 --- /dev/null +++ b/dev-ruby/llhttp-ffi/llhttp-ffi-0.4.0.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" + +inherit ruby-fakegem + +DESCRIPTION="Ruby FFI bindings for llhttp" +HOMEPAGE="https://github.com/metabahn/llhttp" +MY_PV="2021-09-09" +SRC_URI="https://github.com/metabahn/llhttp/archive/refs/tags/${MY_PV}.tar.gz -> llhttp-${PV}.tar.gz" + +LICENSE="MPL-2.0" +SLOT="$(ver_cut 1)/$(ver_cut 1-2)" +KEYWORDS="~amd64 ~sparc" +IUSE="" +RUBY_S="llhttp-${MY_PV}/ffi" + +ruby_add_rdepend "=dev-ruby/ffi-compiler-1*" + +ruby_add_bdepend "test? ( dev-ruby/async-io )" + +all_ruby_prepare() { + sed -i -e 's/gem "rake-compiler"//g' "Gemfile" || die +} + +each_ruby_compile() { + cd ext && "${RUBY}" -S rake || die + local FFI_PLATFORM_NAME="$(${RUBY} --disable=did_you_mean -e "require 'ffi' ; p \"#{FFI::Platform::ARCH}-#{FFI::Platform::OS}\"" | tr -d "\"")" + install -D "${FFI_PLATFORM_NAME}/libllhttp-ext.so" "../lib/${FFI_PLATFORM_NAME}/libllhttp-ext.so" || die +} + +each_ruby_install() { + each_fakegem_install + ruby_fakegem_extensions_installed +} diff --git a/dev-ruby/llhttp-ffi/metadata.xml b/dev-ruby/llhttp-ffi/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/llhttp-ffi/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/rack-test/files/backport-b1084c1-issue-323.patch b/dev-ruby/rack-test/files/backport-b1084c1-issue-323.patch new file mode 100644 index 000000000000..84b3b2307aeb --- /dev/null +++ b/dev-ruby/rack-test/files/backport-b1084c1-issue-323.patch @@ -0,0 +1,29 @@ +https://github.com/rack/rack-test/issues/323 + +From b1084c1f7b04f6bdaad73c9d1ffc1b279af55e78 Mon Sep 17 00:00:00 2001 +From: Jeremy Evans <code@jeremyevans.net> +Date: Wed, 28 Sep 2022 18:33:43 -0700 +Subject: [PATCH] Make the UploadedFile GC finalizer test more reliable on + CRuby + +--- + spec/rack/test/uploaded_file_spec.rb | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/spec/rack/test/uploaded_file_spec.rb b/spec/rack/test/uploaded_file_spec.rb +index 2cb56ac..67bfbc5 100644 +--- a/spec/rack/test/uploaded_file_spec.rb ++++ b/spec/rack/test/uploaded_file_spec.rb +@@ -69,8 +69,10 @@ def file_path + System.gc + end + else +- c.new(file_path) +- GC.start ++ 50.times do |_i| ++ c.new(file_path) ++ GC.start ++ end + end + + # Due to CRuby's conservative garbage collection, you can never guarantee diff --git a/dev-ruby/rack-test/rack-test-1.1.0-r1.ebuild b/dev-ruby/rack-test/rack-test-1.1.0-r1.ebuild index 0c5ce5f3d97a..4197fc6b4827 100644 --- a/dev-ruby/rack-test/rack-test-1.1.0-r1.ebuild +++ b/dev-ruby/rack-test/rack-test-1.1.0-r1.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby26 ruby27 ruby30" +USE_RUBY="ruby26 ruby27 ruby30 ruby31" RUBY_FAKEGEM_RECIPE_TEST="rspec3" diff --git a/dev-ruby/rack-test/rack-test-2.0.2.ebuild b/dev-ruby/rack-test/rack-test-2.0.2.ebuild index 15c959648795..1791e958884f 100644 --- a/dev-ruby/rack-test/rack-test-2.0.2.ebuild +++ b/dev-ruby/rack-test/rack-test-2.0.2.ebuild @@ -19,6 +19,8 @@ SLOT="$(ver_cut 1)" KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" IUSE="" +PATCHES=( "${FILESDIR}/backport-b1084c1-issue-323.patch" ) # https://github.com/rack/rack-test/issues/323 + ruby_add_rdepend ">=dev-ruby/rack-1.3:*" ruby_add_bdepend " test? ( dev-ruby/minitest:5 dev-ruby/minitest-global_expectations )" diff --git a/dev-ruby/rspec-files/Manifest b/dev-ruby/rspec-files/Manifest new file mode 100644 index 000000000000..7c1bfd853e3d --- /dev/null +++ b/dev-ruby/rspec-files/Manifest @@ -0,0 +1 @@ +DIST rspec-files-1.1.2.tar.gz 4546 BLAKE2B fc3c3cc2acbac23e36ec6f85f6f58c8243f9ca769a16cfbdab6a4660dd9a22ba40fe1108b319206e9a6b5aaa4094ec372205ca33d00d2030476f1050448ef21d SHA512 af64435572b61ae4eaaed922160b8db5dca8a64987a3c24f2d15d1ec92abd2655d0e408ff2c7b4aeae29189ef1047901adc7c9e2af8a21f65dfafc974a4661ec diff --git a/dev-ruby/rspec-files/metadata.xml b/dev-ruby/rspec-files/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/rspec-files/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/rspec-files/rspec-files-1.1.2.ebuild b/dev-ruby/rspec-files/rspec-files-1.1.2.ebuild new file mode 100644 index 000000000000..b1009e5db552 --- /dev/null +++ b/dev-ruby/rspec-files/rspec-files-1.1.2.ebuild @@ -0,0 +1,26 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="RSpec helpers for buffering and detecting file descriptor leaks" +HOMEPAGE="https://github.com/socketry/rspec-files" +SRC_URI="https://github.com/socketry/rspec-files/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend "dev-ruby/rspec:3" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/rspec-memory/Manifest b/dev-ruby/rspec-memory/Manifest new file mode 100644 index 000000000000..ade882afc076 --- /dev/null +++ b/dev-ruby/rspec-memory/Manifest @@ -0,0 +1 @@ +DIST rspec-memory-1.0.3.tar.gz 5248 BLAKE2B cf2cb55a6c3d155a739f1cbe3f307016d9446f9edde8554b6336602b86d95a369b152a413426082061c68d2e4015c68d31a34d7d80706ba09986fb8c8952d670 SHA512 1077bd6cb73ada029fc42f820e42792b58f8e06feeda711725d6f2a7a2af9151f72330d3e5a9d0fa7493eeb42f65ddf02a93fac00f5e24f2596f7df0da9439a3 diff --git a/dev-ruby/rspec-memory/metadata.xml b/dev-ruby/rspec-memory/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/rspec-memory/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/rspec-memory/rspec-memory-1.0.3.ebuild b/dev-ruby/rspec-memory/rspec-memory-1.0.3.ebuild new file mode 100644 index 000000000000..0c30ccc070b1 --- /dev/null +++ b/dev-ruby/rspec-memory/rspec-memory-1.0.3.ebuild @@ -0,0 +1,26 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby26 ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="rspec3" +RUBY_FAKEGEM_EXTRADOC="README.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="RSpec helpers for checking memory allocations" +HOMEPAGE="https://github.com/socketry/rspec-memory" +SRC_URI="https://github.com/socketry/rspec-memory/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64 ~sparc" +IUSE="" + +ruby_add_rdepend "dev-ruby/rspec:3" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + sed -i -E 's/require '"'"'covered\/rspec'"'"'//g' "spec/spec_helper.rb" || die +} diff --git a/dev-ruby/sinatra/files/backport-pr-1519.patch b/dev-ruby/sinatra/files/backport-pr-1519.patch new file mode 100644 index 000000000000..cc344621c3b6 --- /dev/null +++ b/dev-ruby/sinatra/files/backport-pr-1519.patch @@ -0,0 +1,122 @@ +https://github.com/sinatra/sinatra/pull/1519 + +From 6d34a2a1bee48961c25e1b53edac874a31c42060 Mon Sep 17 00:00:00 2001 +From: Jordan Owens <jkowens@gmail.com> +Date: Thu, 31 Jan 2019 22:32:45 -0500 +Subject: [PATCH] Internal Sinatra errors now extend Sinatra::Error + +By extending Sinatra::Error, an error class can set the http status +code on the response to a value other than 500. This commit fixes +issues #1204 and #1518 where an error raised by a third party library +that responded to http_status could set the status on the response. +Any error outside of Sinatra errors will now always return a 500 status. + +This fixes an issue where an exception could leak sensitive data in +the message to the browser. Errors that have http_status code 400 or +404 use the message as the body of the response. This is why it is +imperative that these errors extend Sinatra::Error so that this is +an explicit decision. +--- + lib/sinatra/base.rb | 22 ++++++++++++++-------- + test/mapped_error_test.rb | 6 +++--- + test/result_test.rb | 15 +++++++++++++++ + 3 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb +index 6dbb3ae57..4dfc9a8ae 100644 +--- a/lib/sinatra/base.rb ++++ b/lib/sinatra/base.rb +@@ -255,11 +255,14 @@ def call(env) + end + end + +- class BadRequest < TypeError #:nodoc: ++ class Error < StandardError #:nodoc: ++ end ++ ++ class BadRequest < Error #:nodoc: + def http_status; 400 end + end + +- class NotFound < NameError #:nodoc: ++ class NotFound < Error #:nodoc: + def http_status; 404 end + end + +@@ -1149,14 +1152,17 @@ def handle_exception!(boom) + end + @env['sinatra.error'] = boom + +- if boom.respond_to? :http_status and boom.http_status.between? 400, 599 +- status(boom.http_status) +- elsif settings.use_code? and boom.respond_to? :code and boom.code.between? 400, 599 +- status(boom.code) +- else +- status(500) ++ http_status = if boom.kind_of? Sinatra::Error ++ if boom.respond_to? :http_status ++ boom.http_status ++ elsif settings.use_code? && boom.respond_to?(:code) ++ boom.code ++ end + end + ++ http_status = 500 unless http_status && http_status.between?(400, 599) ++ status(http_status) ++ + if server_error? + dump_errors! boom if settings.dump_errors? + raise boom if settings.show_exceptions? and settings.show_exceptions != :after_handler +diff --git a/test/mapped_error_test.rb b/test/mapped_error_test.rb +index cb158a268..562e509dc 100644 +--- a/test/mapped_error_test.rb ++++ b/test/mapped_error_test.rb +@@ -6,15 +6,15 @@ class FooError < RuntimeError + class FooNotFound < Sinatra::NotFound + end + +-class FooSpecialError < RuntimeError ++class FooSpecialError < Sinatra::Error + def http_status; 501 end + end + +-class FooStatusOutOfRangeError < RuntimeError ++class FooStatusOutOfRangeError < Sinatra::Error + def code; 4000 end + end + +-class FooWithCode < RuntimeError ++class FooWithCode < Sinatra::Error + def code; 419 end + end + +diff --git a/test/result_test.rb b/test/result_test.rb +index cbb781319..67d163fc4 100644 +--- a/test/result_test.rb ++++ b/test/result_test.rb +@@ -1,5 +1,9 @@ + require File.expand_path('../helper', __FILE__) + ++class ThirdPartyError < RuntimeError ++ def http_status; 400 end ++end ++ + class ResultTest < Minitest::Test + it "sets response.body when result is a String" do + mock_app { get('/') { 'Hello World' } } +@@ -73,4 +77,15 @@ def res.each ; yield call ; end + assert_equal 205, status + assert_equal '', body + end ++ ++ it "sets status to 500 when raised error is not Sinatra::Error" do ++ mock_app do ++ set :raise_errors, false ++ get('/') { raise ThirdPartyError } ++ end ++ ++ get '/' ++ assert_equal 500, status ++ assert_equal '<h1>Internal Server Error</h1>', body ++ end + end diff --git a/dev-ruby/sinatra/sinatra-2.2.0-r1.ebuild b/dev-ruby/sinatra/sinatra-2.2.0-r1.ebuild new file mode 100644 index 000000000000..4a36cb96c31f --- /dev/null +++ b/dev-ruby/sinatra/sinatra-2.2.0-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +USE_RUBY="ruby26 ruby27 ruby30 ruby31" + +RUBY_FAKEGEM_TASK_TEST="MT_NO_PLUGINS=true test:core" + +RUBY_FAKEGEM_EXTRADOC="README.md AUTHORS.md CHANGELOG.md" + +RUBY_FAKEGEM_GEMSPEC="sinatra.gemspec" + +inherit ruby-fakegem + +DESCRIPTION="A DSL for quickly creating web applications in Ruby with minimal effort" +HOMEPAGE="http://www.sinatrarb.com/" +SRC_URI="https://github.com/sinatra/sinatra/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="2" +KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="" + +# https://github.com/sinatra/sinatra/pull/1519 from master. +# https://github.com/sinatra/sinatra/issues/1774 +PATCHES=( "${FILESDIR}/backport-pr-1519.patch" ) + +ruby_add_rdepend " + dev-ruby/mustermann:1 + dev-ruby/rack:2.2 + ~dev-ruby/rack-protection-${PV} + dev-ruby/tilt:2" +ruby_add_bdepend "test? ( >=dev-ruby/rack-test-0.5.6 dev-ruby/erubis dev-ruby/builder <dev-ruby/activesupport-7 )" +ruby_add_bdepend "doc? ( dev-ruby/yard )" + +all_ruby_prepare() { + sed -i -e '/active_support\/core_ext\/hash/igem "activesupport", "<7"' test/helper.rb || die +} diff --git a/dev-ruby/sinatra/sinatra-2.2.1.ebuild b/dev-ruby/sinatra/sinatra-2.2.1.ebuild index 20f026413a36..26896805eb10 100644 --- a/dev-ruby/sinatra/sinatra-2.2.1.ebuild +++ b/dev-ruby/sinatra/sinatra-2.2.1.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI=8 -USE_RUBY="ruby27 ruby30" +USE_RUBY="ruby27 ruby30 ruby31" RUBY_FAKEGEM_TASK_TEST="MT_NO_PLUGINS=true test:core" @@ -21,6 +21,10 @@ SLOT="2" KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" IUSE="" +# https://github.com/sinatra/sinatra/pull/1519 +# https://github.com/sinatra/sinatra/issues/1774 +PATCHES=( "${FILESDIR}/backport-pr-1519.patch" ) + ruby_add_rdepend " dev-ruby/mustermann:1 dev-ruby/rack:2.2 diff --git a/dev-ruby/sus/Manifest b/dev-ruby/sus/Manifest new file mode 100644 index 000000000000..99b67330ae82 --- /dev/null +++ b/dev-ruby/sus/Manifest @@ -0,0 +1 @@ +DIST sus-0.13.0.tar.gz 23399 BLAKE2B f96717409f5f14727b359e39bc1bb4726fe1cae98de46bf06e6e008df9a23746219decdb8de171cbc1c6c39ac84b4011e475daa43c7996c01968f4acc5289c84 SHA512 c0cb1b1d02e2fc812c6b3cf555af59f543bcdd82829d744d0e4fafb9043e503e8c9ebb52da33e56703d23ccaeaff583abf72e1df55a726ceca59d50d21b51eb3 diff --git a/dev-ruby/sus/metadata.xml b/dev-ruby/sus/metadata.xml new file mode 100644 index 000000000000..246d194b7ec0 --- /dev/null +++ b/dev-ruby/sus/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file diff --git a/dev-ruby/sus/sus-0.13.0.ebuild b/dev-ruby/sus/sus-0.13.0.ebuild new file mode 100644 index 000000000000..713c073218b5 --- /dev/null +++ b/dev-ruby/sus/sus-0.13.0.ebuild @@ -0,0 +1,28 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby27 ruby30 ruby31" +RUBY_FAKEGEM_RECIPE_TEST="" +RUBY_FAKEGEM_EXTRADOC="readme.md" +RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec" +inherit ruby-fakegem + +DESCRIPTION="A fast and scalable test runner" +HOMEPAGE="https://github.com/ioquatix/sus" +SRC_URI="https://github.com/ioquatix/sus/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="$(ver_cut 1)" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="" + +all_ruby_prepare() { + sed -i -E 's/require_relative "(.+)"/require File.expand_path("\1")/g' "${RUBY_FAKEGEM_GEMSPEC}" || die + sed -i -E '/^#/!d' "config/${PN}.rb" || die # remove covered coverage +} + +each_ruby_test() { + "${RUBY}" "bin/sus-parallel" || die +} |
