Top Level Namespace

Includes:
Skylight::Util

Defined Under Namespace

Modules: Kernel, Skylight Classes: HighLine, IO, MultiIO, Object, String, StringIO, Thor

Constant Summary collapse

GLIBC_MIN =
2.23
GLIBC_V4_MIN =
2.15
LIBSKYLIGHT_INFO =
{
  "version" => "6.0.0-beta-ec1a887",
  "checksums" => {
    "x86-linux" => "0690d63cb7e249e3d74ad66a86bd886d75fb98650e3e2b029345c9b69d0931b2",
    "x86_64-linux" => "dc97213f8f2aa86278dd8d239db3253ecd95d5daaafa5e825d8dfffa52033177",
    "x86_64-linux-musl" => "963fc2515e3d91b80e2066d28c60ceabf40b88eec976eefa9c57f6be02e75b82",
    "x86_64-darwin" => "79c16cfe98a5c0088175df8936eeeb46ee13fec2c9ecb0294d2622cb3c838666",
    "x86_64-freebsd" => "be2e6d29f343a4c3dc90fc7d4a945fca67eaa062d35bcbca32ce130b022a2ba1",
    "aarch64-linux" => "a3e5c72bbed189138c4350884cb59420deb9b68d0337340b6c2a7e4154e8d41a",
    "aarch64-linux-musl" => "58282d7a638c8144aaee9ad5cb96ae667ea6f981a8ddbef566c8a618d7b82f8c",
    "aarch64-darwin" => "fc4135413cda6130610e7a9c72b2a7af3e9db37107839b0bce7929b2ba55264b"
  }.freeze
}.freeze
SKYLIGHT_INSTALL_LOG =
File.expand_path("install.log", __dir__)
SKYLIGHT_REQUIRED =
ENV.key?("SKYLIGHT_REQUIRED") && ENV.fetch("SKYLIGHT_REQUIRED", nil) !~ /^false$/i
SKYLIGHT_FETCH_LIB =
!ENV.key?("SKYLIGHT_FETCH_LIB") || ENV.fetch("SKYLIGHT_FETCH_LIB", nil) !~ /^false$/i
SKYLIGHT_HDR_PATH =

Directory where skylight.h exists

ENV.fetch("SKYLIGHT_HDR_PATH") { ENV.fetch("SKYLIGHT_LIB_PATH", ".") }
SKYLIGHT_LIB_PATH =
ENV.fetch("SKYLIGHT_LIB_PATH") { File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__) }
SKYLIGHT_SOURCE_URL =
ENV.fetch("SKYLIGHT_SOURCE_URL", nil)
SKYLIGHT_VERSION =
ENV.fetch("SKYLIGHT_VERSION", nil)
SKYLIGHT_CHECKSUM =
ENV.fetch("SKYLIGHT_CHECKSUM", nil)
SKYLIGHT_EXT_STRICT =
ENV.key?("SKYLIGHT_EXT_STRICT") && ENV.fetch("SKYLIGHT_EXT_STRICT", nil) =~ /^true$/i
LOG =

Setup logger

Logger.new(MultiIO.new($stdout, File.open(SKYLIGHT_INSTALL_LOG, "a")))
SRC_PATH =

Where the ruby binding src is

File.expand_path(__dir__)

Instance Method Summary collapse

Instance Method Details

#fail(msg, type = :error) ⇒ Object

Handles terminating in the case of a failure. If we have a bug, we do not want to break our customer’s deploy, but extconf.rb requires a Makefile to be present upon a successful exit. To satisfy this requirement, we create a dummy Makefile.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'ext/extconf.rb', line 79

def fail(msg, type = :error)
  LOG.send type, msg

  if SKYLIGHT_REQUIRED
    exit 1
  else
    File.open("Makefile", "w") do |file|
      file.puts "default:"
      file.puts "install:"
    end

    exit
  end
end

#find_file(file, root = nil) ⇒ Object

By this point, libskylight is present =====


194
195
196
197
198
# File 'ext/extconf.rb', line 194

def find_file(file, root = nil)
  path = File.expand_path(file, root || ".")

  fail "#{file} missing; path=#{root}" unless File.exist?(path)
end