charlock_holmes 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -4
- data/ext/charlock_holmes/extconf.rb +40 -4
- data/lib/charlock_holmes/version.rb +1 -1
- metadata +5 -4
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -77,12 +77,12 @@ The first parameter is the content to transcode, the second is the source encodi
|
|
77
77
|
|
78
78
|
## Installing
|
79
79
|
|
80
|
-
If the traditional `gem install charlock_holmes` doesn't work, you may need to specify the path to your installation of ICU
|
80
|
+
If the traditional `gem install charlock_holmes` doesn't work, you may need to specify the path to your installation of ICU using the `--with-icu-dir` option during the gem install.
|
81
81
|
|
82
|
-
At the time of writing, Homebrew for OSX installs ICU (icu4c is the package name)
|
82
|
+
At the time of writing, Homebrew for OSX installs ICU (icu4c is the package name) as a keg-only install so you'll have to specify the location during the gem install:
|
83
83
|
|
84
|
-
`gem install charlock_holmes -- --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1
|
84
|
+
`gem install charlock_holmes -- --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1`
|
85
85
|
|
86
86
|
If you're using Bundler and need to specify a custom path(s), you can do so with the `bundle config` command:
|
87
87
|
|
88
|
-
`bundle config build.charlock_holmes --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1
|
88
|
+
`bundle config build.charlock_holmes --with-icu-dir=/usr/local/Cellar/icu4c/4.4.1`
|
@@ -1,7 +1,45 @@
|
|
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 http://github.com/brianmario/charlock_holmes"
|
8
|
+
end
|
9
|
+
ret
|
10
|
+
end
|
11
|
+
|
12
|
+
if `which make`.strip.empty?
|
13
|
+
STDERR.puts "\n\n"
|
14
|
+
STDERR.puts "***************************************************************************************"
|
15
|
+
STDERR.puts "*************** make required (apt-get install make build-essential) =( ***************"
|
16
|
+
STDERR.puts "***************************************************************************************"
|
17
|
+
exit(1)
|
18
|
+
end
|
19
|
+
|
20
|
+
unless File.exists?(CWD + '/libmagic_ext.a')
|
21
|
+
src = File.basename('file-5.08.tar.gz')
|
22
|
+
dir = File.basename(src, '.tar.gz')
|
23
|
+
|
24
|
+
Dir.chdir("#{CWD}/src") do
|
25
|
+
FileUtils.rm_rf(dir) if File.exists?(dir)
|
26
|
+
|
27
|
+
sys("tar zxvf #{src}")
|
28
|
+
Dir.chdir(dir) do
|
29
|
+
sys("./configure --prefix=#{CWD}/dst/ --disable-shared --enable-static")
|
30
|
+
sys("make")
|
31
|
+
sys("make install")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
FileUtils.cp "#{CWD}/dst/lib/libmagic.a", "#{CWD}/libmagic_ext.a"
|
36
|
+
end
|
37
|
+
|
38
|
+
$INCFLAGS[0,0] = "-I#{CWD}/dst/include "
|
39
|
+
$LDFLAGS << " -L#{CWD}"
|
40
|
+
|
3
41
|
$CFLAGS << ' -Wall -funroll-loops'
|
4
|
-
$CFLAGS << ' -Wextra -O0 -ggdb3'
|
42
|
+
$CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
|
5
43
|
|
6
44
|
dir_config 'icu'
|
7
45
|
$CFLAGS << ' -I/usr/local/Cellar/icu4c/4.4.1/include'
|
@@ -9,8 +47,6 @@ $LDFLAGS << ' -L/usr/local/Cellar/icu4c/4.4.1/lib'
|
|
9
47
|
have_library 'icui18n'
|
10
48
|
|
11
49
|
dir_config 'magic'
|
12
|
-
|
13
|
-
$CFLAGS << ' -I/usr/local/Cellar/libmagic/5.04/include'
|
14
|
-
have_library 'magic'
|
50
|
+
have_library 'magic_ext'
|
15
51
|
|
16
52
|
create_makefile 'charlock_holmes'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: charlock_holmes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 3
|
10
|
+
version: 0.6.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Lopez
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-09-01 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- ext/charlock_holmes/encoding_detector.c
|
90
90
|
- ext/charlock_holmes/ext.c
|
91
91
|
- ext/charlock_holmes/extconf.rb
|
92
|
+
- ext/charlock_holmes/src/file-5.08.tar.gz
|
92
93
|
- lib/charlock_holmes.rb
|
93
94
|
- lib/charlock_holmes/encoding_detector.rb
|
94
95
|
- lib/charlock_holmes/string.rb
|