Sha256: 01f0bff0643b9736c1ef39b6820129a1a18079052fbd65b58227a1899f7e3940

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

temporary_hack = "delete this line when https://github.com/testdouble/standard/pull/498 lands in a release" # rubocop:disable Lint/UselessAssignment

def darwin_check
  require "pathname"
  src = $srcdir || __dir__ # standard:disable Style/GlobalVars
  require_relative Pathname.new("#{src}/../../lib/getargv_ruby/version.rb").realpath.to_s
  abort <<EOF unless RUBY_PLATFORM.include?("darwin")

   getargv can only work on macOS, fix your Gemfile like this:

   gem "getargv", "~> #{Getargv::VERSION}", platforms: :ruby, install_if: RbConfig::CONFIG["host_os"].include?("darwin")

EOF
end

darwin_check
arch_dir = RbConfig::CONFIG["rubyarchhdrdir"]
# `xcode-select --print-path`/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby.h
unless File.exist?(arch_dir)
  arch_dir.sub!(RUBY_PLATFORM.split("-").last, Dir.entries(File.dirname(arch_dir)).reject { |d| d.start_with?(".", "ruby") }.first.split("-").last)
end

require "mkmf"

unless have_library("getargv", "get_argv_of_pid", "libgetargv.h")
  abort "libgetargv is missing, please install libgetargv."
end

create_makefile("getargv_ruby/getargv_ruby")

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
getargv-0.3.0-universal-darwin ext/getargv_ruby/extconf.rb
getargv-0.2.0-universal-darwin ext/getargv_ruby/extconf.rb
getargv-0.1.0-x86_64-darwin-21 ext/getargv_ruby/extconf.rb