erickguan / ffi-icu

FFI wrappers for ICU. MRI extension with the dynamic C library.
https://github.com/erickguan/ffi-icu
MIT License
35 stars 22 forks source link

Allow overriding libicu on MacOS with FFI_ICU_LIB #54

Closed KJTsanaktsidis closed 2 years ago

KJTsanaktsidis commented 2 years ago

I compiled ICU 71 rc1 on my macbook and needed to run the ffi-icu tests against it. I feel like FFI_ICU_LIB should work on MacOS too.

lwelti commented 2 years ago

Nice! I was facing similar problem. let me try it.

lwelti commented 2 years ago

I'm testing it locally and it seems to work, I installed 70.1 with brew, so I get:

irb(main):001:0> ENV["FFI_ICU_LIB"] ="/usr/local/Cellar/icu4c/70.1/lib"
=> "/usr/local/Cellar/icu4c/70.1/lib"
irb(main):002:0> require 'ffi-icu'
=> true
irb(main):003:0> ICU::Lib.version.to_s
=> "70.1"
irb(main):004:0> ICU::TimeFormatting.format(Time.now, skeleton: 'dMMMMyyyyjmm', locale: 'en_US@hours=h24;')
=> "April 1, 2022, 12:08"
irb(main):005:0> ICU::TimeFormatting.format(Time.now, skeleton: 'dMMMMyyyyjmm', locale: 'en_US@hours=h12;')
=> "April 1, 2022, 12:21 PM"
irb(main):006:0> 
lwelti commented 2 years ago

I believe this PR Fixes #39

zenspider commented 2 years ago

DO IT! ❤️