Class: LibarchiveBinary::OpensslRecipe

Inherits:
BaseRecipe
  • Object
show all
Defined in:
lib/ffi-libarchive-binary/openssl_recipe.rb

Instance Method Summary collapse

Methods inherited from BaseRecipe

#apple_arch_flag, #cflags, #cross_compiler_env, #ldflags, #message

Constructor Details

#initializeOpensslRecipe

Returns a new instance of OpensslRecipe.



21
22
23
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 21

def initialize
  super("openssl")
end

Instance Method Details

#checkpointObject



43
44
45
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 43

def checkpoint
  File.join(@target, "#{name}-#{version}-#{host}.installed")
end

#configureObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 25

def configure
  os_compiler = OS_COMPILERS[@host]
  common_opts = ["--openssldir=#{ROOT}/ports/SSL", "--libdir=lib", "no-tests", "no-shared"] +
    computed_options.grep(/--prefix/)

  # Set cross-compiler environment variables for aarch64
  env_vars = cross_compiler_env(@host)
  env_prefix = env_vars.empty? ? ENV_CMD : ENV_CMD + env_vars.map { |k, v| "#{k}=#{v}" }

  cmd = if os_compiler.nil?
          message("OpensslRecipe: guessing with 'config' for '#{@host}'\n")
          env_prefix + ["./config"] + common_opts
        else
          env_prefix + ["./Configure"] + common_opts + [os_compiler]
        end
  execute("configure", cmd)
end

#cookObject



51
52
53
54
55
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 51

def cook
  super

  FileUtils.touch(checkpoint)
end

#cook_if_notObject



47
48
49
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 47

def cook_if_not
  cook unless File.exist?(checkpoint)
end