mkmf-lite 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +3 -0
- data/lib/mkmf/lite.rb +28 -7
- data/mkmf-lite.gemspec +4 -2
- data/spec/mkmf_lite_spec.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +5 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e85aa72d40bbefbc3868cfce08cdadcd27f2715f96aead7b7055808ea724f5f
|
4
|
+
data.tar.gz: 415625060ad8e4d9d6998f581af4eeb0adb5c69f0a012a827956cfc19f173ff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af36e6b2ffc4d90cb1faf28ebe141547b2459819f95caf6b5dded3e51dce35667eb8ea9b0bf81443146495f42c341f56f81d27d3b7b3a7862e9c2a492b4c848d
|
7
|
+
data.tar.gz: f78fc8d5f051406690b1d7b1b362868be38fd25a45ad140cec40bc9aaf58d0ebdf2a2b53b5c0ca4660954266938be91405660bee3fe85ad0f3a340002d92e25b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
data/lib/mkmf/lite.rb
CHANGED
@@ -16,7 +16,7 @@ module Mkmf
|
|
16
16
|
extend Memoist
|
17
17
|
|
18
18
|
# The version of the mkmf-lite library
|
19
|
-
MKMF_LITE_VERSION = '0.7.
|
19
|
+
MKMF_LITE_VERSION = '0.7.2'
|
20
20
|
|
21
21
|
private
|
22
22
|
|
@@ -135,12 +135,20 @@ module Mkmf
|
|
135
135
|
# If this method fails an error is raised. This could happen if the constant
|
136
136
|
# can't be found and/or the header files do not include the indicated constant.
|
137
137
|
#
|
138
|
-
def check_valueof(constant, headers = [])
|
138
|
+
def check_valueof(constant, headers = [], *directories)
|
139
139
|
headers = get_header_string(headers)
|
140
140
|
erb = ERB.new(read_template('check_valueof.erb'))
|
141
141
|
code = erb.result(binding)
|
142
142
|
|
143
|
-
|
143
|
+
if directories.empty?
|
144
|
+
options = nil
|
145
|
+
else
|
146
|
+
options = ''
|
147
|
+
directories.each{ |dir| options += "-I#{dir} " }
|
148
|
+
options.rstrip!
|
149
|
+
end
|
150
|
+
|
151
|
+
try_to_execute(code, options)
|
144
152
|
end
|
145
153
|
|
146
154
|
memoize :check_valueof
|
@@ -158,12 +166,20 @@ module Mkmf
|
|
158
166
|
# utsname = check_sizeof('struct utsname', 'sys/utsname.h')
|
159
167
|
# end
|
160
168
|
#
|
161
|
-
def check_sizeof(type, headers = [])
|
169
|
+
def check_sizeof(type, headers = [], *directories)
|
162
170
|
headers = get_header_string(headers)
|
163
171
|
erb = ERB.new(read_template('check_sizeof.erb'))
|
164
172
|
code = erb.result(binding)
|
165
173
|
|
166
|
-
|
174
|
+
if directories.empty?
|
175
|
+
options = nil
|
176
|
+
else
|
177
|
+
options = ''
|
178
|
+
directories.each{ |dir| options += "-I#{dir} " }
|
179
|
+
options.rstrip!
|
180
|
+
end
|
181
|
+
|
182
|
+
try_to_execute(code, options)
|
167
183
|
end
|
168
184
|
|
169
185
|
memoize :check_sizeof
|
@@ -206,7 +222,7 @@ module Mkmf
|
|
206
222
|
# we don't actually care about the reason for failure, though a Ruby
|
207
223
|
# error is raised if the compilation step fails.
|
208
224
|
#
|
209
|
-
def try_to_execute(code)
|
225
|
+
def try_to_execute(code, command_options = nil)
|
210
226
|
begin
|
211
227
|
result = 0
|
212
228
|
|
@@ -216,7 +232,12 @@ module Mkmf
|
|
216
232
|
Dir.chdir(Dir.tmpdir) do
|
217
233
|
File.write(cpp_source_file, code)
|
218
234
|
|
219
|
-
|
235
|
+
if command_options
|
236
|
+
command = "#{cpp_command} #{command_options} #{cpp_libraries} #{cpp_defs} "
|
237
|
+
else
|
238
|
+
command = "#{cpp_command} #{cpp_libraries} #{cpp_defs} "
|
239
|
+
end
|
240
|
+
|
220
241
|
command += "#{cpp_out_file} "
|
221
242
|
command += cpp_source_file
|
222
243
|
|
data/mkmf-lite.gemspec
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'mkmf-lite'
|
5
5
|
spec.summary = 'A lighter version of mkmf designed for use as a library'
|
6
|
-
spec.version = '0.7.
|
6
|
+
spec.version = '0.7.2'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.license = 'Apache-2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
@@ -27,7 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
28
28
|
'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
|
29
29
|
'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
30
|
-
'rubygems_mfa_required' => 'true'
|
30
|
+
'rubygems_mfa_required' => 'true',
|
31
|
+
'github_repo' => 'https://github.com/djberg96/mkmf-lite',
|
32
|
+
'funding_uri' => 'https://github.com/sponsors/djberg96'
|
31
33
|
}
|
32
34
|
|
33
35
|
spec.description = <<-EOF
|
data/spec/mkmf_lite_spec.rb
CHANGED
@@ -20,7 +20,7 @@ RSpec.describe Mkmf::Lite do
|
|
20
20
|
|
21
21
|
describe 'constants' do
|
22
22
|
example 'version information' do
|
23
|
-
expect(described_class::MKMF_LITE_VERSION).to eq('0.7.
|
23
|
+
expect(described_class::MKMF_LITE_VERSION).to eq('0.7.2')
|
24
24
|
expect(described_class::MKMF_LITE_VERSION).to be_frozen
|
25
25
|
end
|
26
26
|
end
|
@@ -96,8 +96,8 @@ RSpec.describe Mkmf::Lite do
|
|
96
96
|
expect{ subject.check_valueof }.to raise_error(ArgumentError)
|
97
97
|
end
|
98
98
|
|
99
|
-
example 'check_valueof accepts
|
100
|
-
expect{ subject.check_valueof(constant, 'stdio.h',
|
99
|
+
example 'check_valueof accepts directory arguments' do
|
100
|
+
expect{ subject.check_valueof(constant, 'stdio.h', ['/usr/include']) }.not_to raise_error
|
101
101
|
end
|
102
102
|
|
103
103
|
example 'check_valueof works with one or two arguments' do
|
@@ -122,8 +122,8 @@ RSpec.describe Mkmf::Lite do
|
|
122
122
|
expect{ subject.check_sizeof }.to raise_error(ArgumentError)
|
123
123
|
end
|
124
124
|
|
125
|
-
example 'check_sizeof accepts
|
126
|
-
expect{ subject.check_sizeof('div_t', 'stdlib.h',
|
125
|
+
example 'check_sizeof accepts directory arguments' do
|
126
|
+
expect{ subject.check_sizeof('div_t', 'stdlib.h', ['/usr/include']) }.not_to raise_error
|
127
127
|
end
|
128
128
|
|
129
129
|
example 'check_sizeof works with one or two arguments' do
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkmf-lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
@@ -35,7 +34,7 @@ cert_chain:
|
|
35
34
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
35
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
36
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
37
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
39
38
|
dependencies:
|
40
39
|
- !ruby/object:Gem::Dependency
|
41
40
|
name: ptools
|
@@ -160,7 +159,8 @@ metadata:
|
|
160
159
|
source_code_uri: https://github.com/djberg96/mkmf-lite
|
161
160
|
wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
|
162
161
|
rubygems_mfa_required: 'true'
|
163
|
-
|
162
|
+
github_repo: https://github.com/djberg96/mkmf-lite
|
163
|
+
funding_uri: https://github.com/sponsors/djberg96
|
164
164
|
rdoc_options: []
|
165
165
|
require_paths:
|
166
166
|
- lib
|
@@ -175,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
|
-
rubygems_version: 3.5
|
179
|
-
signing_key:
|
178
|
+
rubygems_version: 3.6.5
|
180
179
|
specification_version: 4
|
181
180
|
summary: A lighter version of mkmf designed for use as a library
|
182
181
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|