pico_phone 0.1.0 → 0.2.0
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
- data/ext/pico_phone/extconf.rb +55 -19
- data/lib/pico_phone/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc8105979753453ad832807392c9074623d3ab0160b19d67efd199e88dce17a7
|
|
4
|
+
data.tar.gz: 9425033b3da7e0534e7380f04daf6c22120e0389b5ac31b5a7dd4e5edad0bbe9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efb809a5ddd9d44d76b0a7313de264c9b02582cb1fb0630eba8bfdd2c4f7f2a0764b161db0cb5b641261e25423890372e97c45537d05ada848630a4ee5f79fb4
|
|
7
|
+
data.tar.gz: 85897848c871c1da097d9c17f4eebdc9ef516997997738fa97dee5b516ce8587d760b2191e2d52d42dddfd35e0081501d040c74cf935ca193652a7f8061cc243
|
data/ext/pico_phone/extconf.rb
CHANGED
|
@@ -2,29 +2,65 @@ require "mkmf-rice"
|
|
|
2
2
|
|
|
3
3
|
$CXXFLAGS << ' -std=c++17'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
VENDOR_INSTALL = File.expand_path("vendor/install", __dir__)
|
|
6
|
+
NATIVE_BUILD = ENV["PICO_PHONE_NATIVE_BUILD"] == "1"
|
|
7
|
+
|
|
8
|
+
if NATIVE_BUILD
|
|
9
|
+
# Static linking against vendored libraries for native gem builds.
|
|
10
|
+
# All five dependencies are baked into the .so — users need nothing installed.
|
|
11
|
+
$INCFLAGS << " -I#{VENDOR_INSTALL}/include"
|
|
12
|
+
|
|
13
|
+
static_libs = []
|
|
14
|
+
static_libs << "#{VENDOR_INSTALL}/lib/libphonenumber.a"
|
|
15
|
+
static_libs << "#{VENDOR_INSTALL}/lib/libprotobuf.a"
|
|
16
|
+
static_libs += Dir["#{VENDOR_INSTALL}/lib/libabsl_*.a"].sort
|
|
17
|
+
|
|
18
|
+
if RUBY_PLATFORM.include?("darwin")
|
|
19
|
+
boost_prefix = `brew --prefix boost 2>/dev/null`.strip
|
|
20
|
+
icu_prefix = `brew --prefix icu4c@78 2>/dev/null`.strip
|
|
21
|
+
|
|
22
|
+
%w[libboost_date_time libboost_thread libboost_atomic].each do |lib|
|
|
23
|
+
static_libs << "#{boost_prefix}/lib/#{lib}.a"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
%w[libicui18n libicuuc libicudata].each do |lib|
|
|
27
|
+
static_libs << "#{icu_prefix}/lib/#{lib}.a"
|
|
28
|
+
end
|
|
29
|
+
else
|
|
30
|
+
# Linux: libphonenumber was built with USE_BOOST=OFF so no Boost needed.
|
|
31
|
+
# Ubuntu's libicu-dev static archives are not compiled with -fPIC and cannot
|
|
32
|
+
# be linked into a shared object. Link ICU dynamically instead — libicu74 is
|
|
33
|
+
# part of the Ubuntu 24.04 base system and is present in the target environment.
|
|
34
|
+
$LOCAL_LIBS << " -licui18n -licuuc -licudata -lpthread -ldl"
|
|
15
35
|
end
|
|
16
|
-
end
|
|
17
36
|
|
|
18
|
-
$LOCAL_LIBS <<
|
|
37
|
+
$LOCAL_LIBS << " " + static_libs.join(" ")
|
|
19
38
|
|
|
20
|
-
unless find_header(
|
|
21
|
-
|
|
39
|
+
unless find_header("phonenumbers/phonenumberutil.h")
|
|
40
|
+
abort "Could not find phonenumberutil.h in #{VENDOR_INSTALL}/include — run build_deps.sh first"
|
|
41
|
+
end
|
|
42
|
+
else
|
|
43
|
+
# Dynamic linking against system/Homebrew libraries (default developer workflow).
|
|
44
|
+
if RUBY_PLATFORM.include?("darwin")
|
|
45
|
+
%w[libphonenumber protobuf abseil].each do |pkg|
|
|
46
|
+
prefix = `brew --prefix #{pkg} 2>/dev/null`.strip
|
|
47
|
+
next if prefix.empty?
|
|
48
|
+
$INCFLAGS << " -I#{prefix}/include"
|
|
49
|
+
$LDFLAGS << " -L#{prefix}/lib"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
$LOCAL_LIBS << " -lphonenumber"
|
|
22
54
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
55
|
+
unless find_header("phonenumbers/phonenumberutil.h")
|
|
56
|
+
abort <<~MSG
|
|
57
|
+
|
|
58
|
+
Could not find libphonenumber. Please install it before installing this gem:
|
|
59
|
+
macOS: brew install libphonenumber
|
|
60
|
+
Ubuntu: sudo apt-get install libphonenumber-dev
|
|
61
|
+
Fedora: sudo dnf install libphonenumber-devel
|
|
62
|
+
MSG
|
|
63
|
+
end
|
|
28
64
|
end
|
|
29
65
|
|
|
30
66
|
create_makefile("pico_phone/pico_phone")
|
data/lib/pico_phone/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pico_phone
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabi Jack
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
11
|
date: 2026-07-03 00:00:00.000000000 Z
|
|
@@ -87,6 +88,7 @@ licenses:
|
|
|
87
88
|
metadata:
|
|
88
89
|
homepage_uri: https://github.com/gjack/pico_phone
|
|
89
90
|
source_code_uri: https://github.com/gjack/pico_phone
|
|
91
|
+
post_install_message:
|
|
90
92
|
rdoc_options: []
|
|
91
93
|
require_paths:
|
|
92
94
|
- lib
|
|
@@ -101,7 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
101
103
|
- !ruby/object:Gem::Version
|
|
102
104
|
version: '0'
|
|
103
105
|
requirements: []
|
|
104
|
-
rubygems_version: 3.
|
|
106
|
+
rubygems_version: 3.5.22
|
|
107
|
+
signing_key:
|
|
105
108
|
specification_version: 4
|
|
106
109
|
summary: A thin Ruby wrapper around Google's libphonenumber for parsing, validating,
|
|
107
110
|
and formatting phone numbers
|