mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 17:09:10 -07:00
dev-ruby/ffi: backport fix for >=ruby30 & non-pre-generated types.conf
Only shows up on e.g. HPPA or other platforms w/o a pre-generated types.conf. Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -18,23 +18,23 @@ inherit ruby-fakegem toolchain-funcs
|
||||
|
||||
DESCRIPTION="Ruby extension for programmatically loading dynamic libraries"
|
||||
HOMEPAGE="https://wiki.github.com/ffi/ffi"
|
||||
|
||||
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"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/backport-pr-962.patch"
|
||||
"${FILESDIR}/pr-957-sparc.patch" # submitted upstream as https://github.com/ffi/ffi/pull/957
|
||||
"${FILESDIR}/fix-regenerate-types-conf.patch"
|
||||
)
|
||||
|
||||
all_ruby_prepare() {
|
||||
sed -i -e '/tasks/ s:^:#:' \
|
||||
-e '/Gem::Tasks/,/end/ s:^:#:' Rakefile || die
|
||||
|
||||
23
dev-ruby/ffi/files/fix-regenerate-types-conf.patch
Normal file
23
dev-ruby/ffi/files/fix-regenerate-types-conf.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
https://github.com/ffi/ffi/commit/19348fe09e1aeb08424abdf331c3497159139f20
|
||||
|
||||
From 19348fe09e1aeb08424abdf331c3497159139f20 Mon Sep 17 00:00:00 2001
|
||||
From: matoro <matoro@users.noreply.github.com>
|
||||
Date: Tue, 14 Mar 2023 21:03:33 -0400
|
||||
Subject: [PATCH] Update gen/Rakefile for Ruby 3 compat
|
||||
|
||||
Ruby 3 changed the 'mode' argument from an option hash to keyword
|
||||
argument. This change is backwards-compatible with Ruby 2.
|
||||
|
||||
See: https://github.com/ruby/fileutils/commit/482de6d397742526d1111576e2791f9b7051e3c0
|
||||
--- a/gen/Rakefile
|
||||
+++ b/gen/Rakefile
|
||||
@@ -9,7 +9,7 @@ logfile = File.join(File.dirname(__FILE__), 'log')
|
||||
|
||||
file types_conf do |task|
|
||||
options = {}
|
||||
- FileUtils.mkdir_p(File.dirname(task.name), { :mode => 0755 })
|
||||
+ FileUtils.mkdir_p(File.dirname(task.name), mode: 0755)
|
||||
File.open(task.name, File::CREAT|File::TRUNC|File::RDWR, 0644) do |f|
|
||||
f.puts FFI::TypesGenerator.generate(options)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user