Class: LibarchiveBinary::LibexpatRecipe

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

Instance Method Summary collapse

Methods inherited from BaseRecipe

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

Constructor Details

#initializeLibexpatRecipe

Returns a new instance of LibexpatRecipe.



7
8
9
10
11
# File 'lib/ffi-libarchive-binary/libexpat_recipe.rb', line 7

def initialize
  super("libexpat")

  @target = ROOT.join(@target).to_s
end

Instance Method Details

#checkpointObject



28
29
30
# File 'lib/ffi-libarchive-binary/libexpat_recipe.rb', line 28

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

#configureObject



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

def configure
  # Set cross-compiler environment variables for aarch64
  env_vars = cross_compiler_env(host)
  cmd = ["env"] + env_vars.map { |k, v| "#{k}=#{v}" } +
        [cflags(host), ldflags(host), "./configure"] + computed_options
  execute("configure", cmd)
end

#configure_defaultsObject



13
14
15
16
17
18
# File 'lib/ffi-libarchive-binary/libexpat_recipe.rb', line 13

def configure_defaults
  [
    "--host=#{@host}",        "--disable-shared", "--enable-static",
    "--without-tests",        "--without-examples"
  ]
end

#cookObject



36
37
38
39
40
# File 'lib/ffi-libarchive-binary/libexpat_recipe.rb', line 36

def cook
  super

  FileUtils.touch(checkpoint)
end

#cook_if_notObject



32
33
34
# File 'lib/ffi-libarchive-binary/libexpat_recipe.rb', line 32

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