Class: LibarchiveBinary::OpensslRecipe

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

Constant Summary collapse

ROOT =
Pathname.new(File.expand_path("../..", __dir__))

Instance Method Summary collapse

Methods inherited from BaseRecipe

#apple_arch_flag, #cflags, #ldflags, #message

Constructor Details

#initializeOpensslRecipe

Returns a new instance of OpensslRecipe.



19
20
21
22
23
24
25
26
27
28
# File 'lib/ffi-libarchive-binary/openssl_recipe.rb', line 19

def initialize
  super("openssl", "1.1.1n")

  @files << {
    url: "https://www.openssl.org/source/openssl-1.1.1n.tar.gz",
    sha256: "40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a",
  }

  @target = ROOT.join(@target).to_s
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



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

def configure
  os_compiler = OS_COMPILERS[@host]
  common_opts = ["--openssldir=#{ROOT}/ports/SSL", "no-tests", "no-shared"] +
    computed_options.grep(/--prefix/)
  cmd = if os_compiler.nil?
          message("OpensslRecipe: guessing with 'config' for '#{@host}'\n")
          ENV_CMD + ["./config"] + common_opts
        else
          ENV_CMD + ["./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