Commit cc36a298 authored by Ondrej Sury's avatar Ondrej Sury

Use system libmagic instead of yet-another-embedded-file-library

parent 0fa842c5
use-system-libmagic.patch
--- a/ext/charlock_holmes/extconf.rb
+++ b/ext/charlock_holmes/extconf.rb
@@ -45,39 +45,6 @@ unless have_library 'icui18n' and have_h
exit(1)
end
-##
-# libmagic dependency
-#
-
-src = File.basename('file-5.08.tar.gz')
-dir = File.basename(src, '.tar.gz')
-
-Dir.chdir("#{CWD}/src") do
- FileUtils.rm_rf(dir) if File.exists?(dir)
-
- sys("tar zxvf #{src}")
- Dir.chdir(dir) do
- sys("./configure --prefix=#{CWD}/dst/ --disable-shared --enable-static --with-pic")
- sys("patch -p0 < ../file-soft-check.patch")
- sys("make -C src install")
- sys("make -C magic install")
- end
-end
-
-FileUtils.cp "#{CWD}/dst/lib/libmagic.a", "#{CWD}/libmagic_ext.a"
-
-$INCFLAGS[0,0] = " -I#{CWD}/dst/include "
-$LDFLAGS << " -L#{CWD} "
-
-dir_config 'magic'
-unless have_library 'magic_ext' and have_header 'magic.h'
- STDERR.puts "\n\n"
- STDERR.puts "***************************************************************************************"
- STDERR.puts "********* error compiling and linking libmagic. please report issue on github *********"
- STDERR.puts "***************************************************************************************"
- exit(1)
-end
-
$CFLAGS << ' -Wall -funroll-loops'
$CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment