dev-ruby/ffi-compiler: revbump 1.0.1-r2, respect *FLAGS

Signed-off-by: matoro <matoro@users.noreply.github.com>
Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
matoro
2022-07-13 19:21:08 -04:00
committed by Matt Turner
parent 4cf664faf6
commit 3e08fd2294
2 changed files with 39 additions and 0 deletions

View File

@@ -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"

View File

@@ -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 = []