mkmf-lite 0.7.4 → 0.7.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83a4d986b70bc7bcd5c5787245bd5b76f335dc6079124d6bdd18847b128dcb3c
4
- data.tar.gz: c688342d4e86a77221dbbd2dd12fc3c3a77ac92892bb4aab230af11bc50ff5ec
3
+ metadata.gz: 3d3876fab22593f1d61c44718bc4fa4a582ce639230745ebed95c61b99a2a164
4
+ data.tar.gz: 74188f32f661c473e575412c095ea7cdd78493af4a25bfbde1934bad604b04ec
5
5
  SHA512:
6
- metadata.gz: c36047013680595f8776cd8e87813ccf4fdf2aac43056d6ffc676c61c262f502e8c3114b3a09ca6b1610eede8ea6c3b59bce4e8631e0e785afd385c789d61aad
7
- data.tar.gz: 0ef5c1481603d4ffdc840d6f468f4ddcaa0e03b81f2648e6395f48df72b21d772c24ff17638db365d2c1316f57e24cff8ac6880b7895b5710178625df43bf4be
6
+ metadata.gz: 30e2efbd8e802dbcf0237a9a5a514e7f39218702a0713ae7868135b06b9052e43be975e4a4ca9e347135f437ff1d48bbeaf8692d7d76db523b76f26aaaf1072d
7
+ data.tar.gz: d7c9e01c1cdcb5f8ad94a7a2a82c16c143f2e4140da64a78c7f399a69e15830270b99c290c0844577cd738a136266490fa1cec5e376e45d50e80c4d8ad2448ca
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.7.5 - 24-Dec-2025
2
+ * Automatically include homebrew lib for have_library on Macs.
3
+ * Modified the have_library to work with or without leading "lib".
4
+
1
5
  ## 0.7.4 - 23-Dec-2025
2
6
  * Added have_library method.
3
7
 
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.4'
19
+ MKMF_LITE_VERSION = '0.7.5'
20
20
 
21
21
  private
22
22
 
@@ -73,6 +73,22 @@ module Mkmf
73
73
 
74
74
  memoize :cpp_libraries
75
75
 
76
+ def cpp_library_paths
77
+ paths = []
78
+
79
+ # Add Homebrew library paths on macOS
80
+ if RbConfig::CONFIG['host_os'].match?(/darwin/)
81
+ # Apple Silicon Macs
82
+ paths << '-L/opt/homebrew/lib' if File.directory?('/opt/homebrew/lib')
83
+ # Intel Macs
84
+ paths << '-L/usr/local/lib' if File.directory?('/usr/local/lib')
85
+ end
86
+
87
+ paths.empty? ? nil : paths.join(' ')
88
+ end
89
+
90
+ memoize :cpp_library_paths
91
+
76
92
  public
77
93
 
78
94
  # Check for the presence of the given +header+ file. You may optionally
@@ -117,7 +133,14 @@ module Mkmf
117
133
  #
118
134
  # Returns true if the library can be linked, or false otherwise.
119
135
  #
136
+ # Note: The library name should not include the 'lib' prefix or file
137
+ # extension. For example, use 'xerces-c' not 'libxerces-c' or 'libxerces-c.dylib'.
138
+ # However, if the 'lib' prefix is provided, it will be automatically stripped.
139
+ #
120
140
  def have_library(library, function = nil, headers = [])
141
+ # Strip 'lib' prefix if present (e.g., 'libxerces-c' -> 'xerces-c')
142
+ library = library.sub(/^lib/, '') unless windows_with_cl_compiler?
143
+
121
144
  headers = get_header_string(headers)
122
145
  erb = ERB.new(read_template('have_library.erb'))
123
146
  code = erb.result(binding)
@@ -224,6 +247,7 @@ module Mkmf
224
247
  def build_compile_command(command_options = nil, library_options = nil)
225
248
  command_parts = [cpp_command]
226
249
  command_parts << command_options if command_options
250
+ command_parts << cpp_library_paths if cpp_library_paths
227
251
  command_parts << cpp_libraries if cpp_libraries
228
252
  command_parts << cpp_defs
229
253
  command_parts << cpp_out_file
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.4'
6
+ spec.version = '0.7.5'
7
7
  spec.author = 'Daniel J. Berger'
8
8
  spec.license = 'Apache-2.0'
9
9
  spec.email = 'djberg96@gmail.com'
@@ -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.4')
23
+ expect(described_class::MKMF_LITE_VERSION).to eq('0.7.5')
24
24
  expect(described_class::MKMF_LITE_VERSION).to be_frozen
25
25
  end
26
26
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmf-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
metadata.gz.sig CHANGED
Binary file