Sha256: 30263c47922e8ab01664d07572f349257c2ac082f9ef3d2ace6dab90709b702b

Contents?: true

Size: 1.89 KB

Versions: 16

Compression:

Stored size: 1.89 KB

Contents

# Workaround to make Rubygems believe it builds a native gem

def emulate_extension_install(extension_name)
  File.open('Makefile', 'w') { |f| f.write "all:\n\ninstall:\n\n" }
  File.open('make', 'w') do |f|
    f.write '#!/bin/sh'
    f.chmod f.stat.mode | 0111
  end
  File.open(extension_name + '.so', 'w') {}
  File.open(extension_name + '.dll', 'w') {}
  File.open('nmake.bat', 'w') { |f| }
end

emulate_extension_install('fsevent')


# Compile the actual fsevent_sleep binary

if `uname -s`.chomp == 'Darwin'
  gem_root = File.expand_path(File.join('..', '..'))
  darwin_version = `uname -r`.to_i
  sdk_version = darwin_version < 20 ? "10.#{darwin_version - 4}" : darwin_version - 9

  `mkdir -p #{File.join(gem_root, 'bin')}`
  if ENV.has_key?('FSEVENT_SLEEP')
    require 'fileutils'
    FileUtils.cp(ENV['FSEVENT_SLEEP'], "#{gem_root}/bin/fsevent_sleep", :preserve => true)
    fail "Installation of fsevent_sleep binary failed - see README for assistance" unless File.executable?("#{gem_root}/bin/fsevent_sleep")
  elsif File.exists?('/Developer/Applications/Xcode.app')
    `CFLAGS='-isysroot /Developer/SDKs/MacOSX#{sdk_version}.sdk -mmacosx-version-min=#{sdk_version}' /usr/bin/gcc -framework CoreServices -o "#{gem_root}/bin/fsevent_sleep" fsevent_sleep.c`
    fail "Compilation of fsevent_sleep binary failed - see README for assistance" unless File.executable?("#{gem_root}/bin/fsevent_sleep")
  elsif File.exists?('/Applications/Xcode.app') # Xcode 4.3
    `CFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{sdk_version}.sdk -mmacosx-version-min=#{sdk_version}' /usr/bin/gcc -framework CoreServices -o "#{gem_root}/bin/fsevent_sleep" fsevent_sleep.c`
    fail "Compilation of fsevent_sleep binary failed - see README for assistance" unless File.executable?("#{gem_root}/bin/fsevent_sleep")
  else
    fail "Xcode not found - see README for assistance"
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.20/ext/fsevent/extconf.rb
autotest-fsevent-0.2.20 ext/fsevent/extconf.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
cloudsmith-api-1.120.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
cloudsmith-api-1.61.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
cloudsmith-api-1.42.3 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
cloudsmith-api-1.33.7 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
cloudsmith-api-1.30.0 vendor/bundle/ruby/2.6.0/gems/autotest-fsevent-0.2.19/ext/fsevent/extconf.rb
autotest-fsevent-0.2.19 ext/fsevent/extconf.rb