@@ -65,29 +65,8 @@ def configure_packaged_libraries
65
65
unless File . exist? ( File . join ( recipe . target , recipe . host , recipe . name , recipe . version ) )
66
66
recipe . cook
67
67
end
68
- recipe . activate
69
68
70
- # on macos, pkg-config will not return --cflags without this
71
- ENV [ "PKG_CONFIG_ALLOW_SYSTEM_CFLAGS" ] = "t"
72
-
73
- # only needed for Ruby 3.1.3, see https://bugs.ruby-lang.org/issues/19233
74
- RbConfig ::CONFIG [ "PKG_CONFIG" ] = config_string ( "PKG_CONFIG" ) || "pkg-config"
75
-
76
- lib_path = File . join ( recipe . path , "lib" )
77
- pcfile = File . join ( lib_path , "pkgconfig" , "sqlite3.pc" )
78
- abort_pkg_config ( "pkg_config" ) unless pkg_config ( pcfile )
79
-
80
- # see https://bugs.ruby-lang.org/issues/18490
81
- ldflags = xpopen ( [ "pkg-config" , "--libs" , "--static" , pcfile ] , err : [ :child , :out ] , &:read )
82
- abort_pkg_config ( "xpopen" ) unless $?. success?
83
- ldflags = ldflags . split
84
-
85
- # see https://github.com/flavorjones/mini_portile/issues/118
86
- "-L#{ lib_path } " . tap do |lib_path_flag |
87
- ldflags . prepend ( lib_path_flag ) unless ldflags . include? ( lib_path_flag )
88
- end
89
-
90
- ldflags . each { |ldflag | append_ldflags ( ldflag ) }
69
+ recipe . mkmf_config ( pkg : "sqlite3" )
91
70
end
92
71
end
93
72
@@ -131,6 +110,8 @@ def configure_extension
131
110
end
132
111
133
112
def minimal_recipe
113
+ require "rubygems"
114
+ gem "mini_portile2" , "~> 2.8" # gemspec is not respected at install time
134
115
require "mini_portile2"
135
116
136
117
MiniPortile . new ( libname , sqlite3_config [ :version ] ) . tap do |recipe |
0 commit comments