Sha256: 2fca7cdf32e8a52c11b9b0ae9b1252d90957663192c2bd17c21e0b9452cf0ff3

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true, encoding: ASCII-8BIT

require 'fileutils'
require 'libuv'

module FFI::Platform
    def self.ia32?
        ARCH == "i386"
    end

    def self.x64?
        ARCH == "x86_64"
    end
end

# Ensure the submodule is cloned
file 'ext/libcouchbase/include' do
    system 'git', 'submodule', 'update', '--init'
end

file 'ext/libcouchbase/build' => 'ext/libcouchbase/include' do
    FileUtils.mkdir('ext/libcouchbase/build')
end

file 'ext/libcouchbase/build/makefile' => 'ext/libcouchbase/build' do
    result = nil
    Dir.chdir("ext/libcouchbase") do |path|
        result = system './cmake/configure', '-with-libuv', ::File.expand_path('../../', ::Libuv::Ext.path_to_internal_libuv)
    end
    raise 'could not find cmake on path' unless result
end

file "ext/libcouchbase/build/lib/libcouchbase_libuv.#{FFI::Platform::LIBSUFFIX}" => 'ext/libcouchbase/build/makefile' do
    result = nil
    Dir.chdir('ext/libcouchbase/build') do |path|
        result = system 'make'
    end
    raise 'make failed' unless result
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
libcouchbase-1.3.0 lib/libcouchbase/ext/tasks.rb
libcouchbase-1.2.8 lib/libcouchbase/ext/tasks.rb
libcouchbase-1.2.7 lib/libcouchbase/ext/tasks.rb
libcouchbase-1.2.6 lib/libcouchbase/ext/tasks.rb
libcouchbase-1.2.5 lib/libcouchbase/ext/tasks.rb
libcouchbase-1.2.4 lib/libcouchbase/ext/tasks.rb