Skip to content

Commit

Permalink
Embed source instead of linking
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Dec 23, 2014
1 parent cb90dfc commit 4c0b70a
Show file tree
Hide file tree
Showing 136 changed files with 11 additions and 53,530 deletions.
10 changes: 9 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ end

task :vendor do
version = "1.0.3"
sh "cd vendor && curl -L https://github.com/maxmind/libmaxminddb/releases/download/#{version}/libmaxminddb-#{version}.tar.gz | tar xz"
mkdir_p "tmp/"
dir = "tmp/libmaxminddb-#{version}"
cd "tmp/" do
sh "curl -L https://github.com/maxmind/libmaxminddb/releases/download/#{version}/libmaxminddb-#{version}.tar.gz | tar xz"
end
cp "#{dir}/src/maxminddb-compat-util.h", "ext/geoip2_compat/maxminddb-compat-util.h"
cp "#{dir}/src/maxminddb.c", "ext/geoip2_compat/maxminddb.c"
cp "#{dir}/include/maxminddb.h", "ext/geoip2_compat/maxminddb.h"
cp "#{dir}/include/maxminddb_config.h.in", "ext/geoip2_compat/maxminddb_config.h"
end

task default: [:compile, :download, :test]
17 changes: 2 additions & 15 deletions ext/geoip2_compat/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

ROOT = File.expand_path("../../..", __FILE__)
$defs << ' -DPACKAGE_VERSION=\"1.0.3\"'

Dir.chdir("#{ROOT}/vendor/libmaxminddb-1.0.3") do
system "./configure", "--prefix", "#{ROOT}/ext/libmaxminddb"
system "make", "install"
end

$INCFLAGS << " -I#{ROOT}/ext/libmaxminddb/include "
$LDFLAGS << " -L#{ROOT}/ext/libmaxminddb/lib "

if have_header('maxminddb.h') && have_library('maxminddb')
create_makefile("#{extension_name}/#{extension_name}")
else
puts "Couldn't find libmaxminddb"
exit(1)
end
create_makefile("#{extension_name}/#{extension_name}")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file removed vendor/libmaxminddb-1.0.3/AUTHORS
Empty file.
105 changes: 0 additions & 105 deletions vendor/libmaxminddb-1.0.3/Changes.md

This file was deleted.

202 changes: 0 additions & 202 deletions vendor/libmaxminddb-1.0.3/LICENSE

This file was deleted.

39 changes: 0 additions & 39 deletions vendor/libmaxminddb-1.0.3/Makefile.am

This file was deleted.

Loading

0 comments on commit 4c0b70a

Please sign in to comment.