charlock_holmes 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7500e422c42f6d71a4c5f9636aacd33b08b18e6b
4
- data.tar.gz: e5b90461b236138f959f2f228c507ecab06f06da
2
+ SHA256:
3
+ metadata.gz: ffcc4d41329191f1628b957954b867ad22194140fa079bafd589298549a44799
4
+ data.tar.gz: e7c548cdf2cda18295cd6481a83ecfb0cee198e521feb18066055e46ac7cd6c4
5
5
  SHA512:
6
- metadata.gz: a29314ed7ad3d8afa68c461d08ef3b6cc09f73d590b35f90200ad93f675288890f40a0d24f7c4d54a8e99792891b58e76d36aa6e476a392b378182fb8dd32537
7
- data.tar.gz: a12c6bc1823c037a6b7b2a2fba7f1531072fc192e5411aa14de8eda041a1e5e92057b81b6344d27fd44f8dc63d81fceb092b1b9ab407ae2c04a158dcd3f87958
6
+ metadata.gz: fbe404468074f6abbd41829f231ef2100d88a5977d8a6f6224d4fa1a51cde13bd1e73a709dacd86e40d1fb7aaae375c901e1a816c16f34a04b9cad58218c31ca
7
+ data.tar.gz: 747277c704835f42878628885a988b463f0adcf0e3e13e8d0678a3f275794bb41922811a8790b7a0462db8559d289f0ca141c26739ea6ec591641d9d6d60b843
@@ -1,14 +1,5 @@
1
1
  require 'mkmf'
2
2
 
3
- CWD = File.expand_path(File.dirname(__FILE__))
4
- def sys(cmd)
5
- puts " -- #{cmd}"
6
- unless ret = xsystem(cmd)
7
- raise "#{cmd} failed, please report issue on https://github.com/brianmario/charlock_holmes"
8
- end
9
- ret
10
- end
11
-
12
3
  if `which make`.strip.empty?
13
4
  STDERR.puts "\n\n"
14
5
  STDERR.puts "***************************************************************************************"
@@ -21,26 +12,29 @@ end
21
12
  # ICU dependency
22
13
  #
23
14
 
24
- dir_config 'icu'
15
+ ldflags = cppflags = nil
16
+
17
+ if RbConfig::CONFIG["host_os"] =~ /darwin/
18
+ begin
19
+ brew_prefix = `brew --prefix icu4c`.chomp
20
+ ldflags = "#{brew_prefix}/lib"
21
+ cppflags = "#{brew_prefix}/include"
22
+ pkg_conf = "#{brew_prefix}/lib/pkgconfig"
23
+ # pkg_config should be less error prone than parsing compiler
24
+ # commandline options, but we need to set default ldflags and cpp flags
25
+ # in case the user doesn't have pkg-config installed
26
+ ENV['PKG_CONFIG_PATH'] ||= pkg_conf
27
+ rescue
28
+ end
29
+ end
25
30
 
26
- rubyopt = ENV.delete("RUBYOPT")
31
+ dir_config 'icu', cppflags, ldflags
27
32
 
28
- icuconfig = ""
29
- icu4c = "/usr"
30
- # detect homebrew installs
31
- if !have_library 'icui18n'
32
- base = if !`which brew`.empty?
33
- `brew --cellar`.strip
34
- elsif File.exists?("/usr/local/Cellar/icu4c")
35
- '/usr/local/Cellar'
36
- end
33
+ pkg_config("icu-i18n")
34
+ pkg_config("icu-io")
35
+ pkg_config("icu-uc")
37
36
 
38
- if base and icu4c = Dir[File.join(base, 'icu4c/*')].sort.last
39
- $INCFLAGS << " -I#{icu4c}/include "
40
- $LDFLAGS << " -L#{icu4c}/lib "
41
- icuconfig = "#{icu4c}/bin/icu-config"
42
- end
43
- end
37
+ $CXXFLAGS << ' -std=c++11'
44
38
 
45
39
  unless have_library 'icui18n' and have_header 'unicode/ucnv.h'
46
40
  STDERR.puts "\n\n"
@@ -54,14 +48,7 @@ have_library 'z' or abort 'libz missing'
54
48
  have_library 'icuuc' or abort 'libicuuc missing'
55
49
  have_library 'icudata' or abort 'libicudata missing'
56
50
 
57
- # icu4c might be built in C++11 mode, but it also might not have been
58
- icuconfig = `which icu-config`.chomp if icuconfig.empty?
59
- if File.exist?(icuconfig) && `#{icuconfig} --cxxflags`.include?("c++11")
60
- $CXXFLAGS << ' -std=c++11'
61
- end
62
-
63
51
  $CFLAGS << ' -Wall -funroll-loops'
64
52
  $CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
65
53
 
66
- ENV['RUBYOPT'] = rubyopt
67
54
  create_makefile 'charlock_holmes/charlock_holmes'
@@ -1,3 +1,3 @@
1
1
  module CharlockHolmes
2
- VERSION = "0.7.6"
2
+ VERSION = "0.7.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: charlock_holmes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lopez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-03-29 00:00:00.000000000 Z
12
+ date: 2019-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -91,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubyforge_project:
95
- rubygems_version: 2.6.11
94
+ rubygems_version: 3.1.0.pre1
96
95
  signing_key:
97
96
  specification_version: 4
98
97
  summary: Character encoding detection, brought to you by ICU