Class: LibarchiveBinary::LibexpatRecipe

Inherits:
BaseRecipe
  • Object
show all
Defined in:
lib/ffi-libarchive-binary/libexpat_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

#initializeLibexpatRecipe

Returns a new instance of LibexpatRecipe.



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

def initialize
  super("libexpat", "2.4.9")

  @files << {
    url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.gz",
    sha256: "4415710268555b32c4e5ab06a583bea9fec8ff89333b218b70b43d4ca10e38fa",
  }

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

Instance Method Details

#checkpointObject



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

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

#configureObject



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

def configure
  cmd = ["env", cflags(host), ldflags(host),
         "./configure"] + computed_options
  execute("configure", cmd)
end

#configure_defaultsObject



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

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

#cookObject



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

def cook
  super

  FileUtils.touch(checkpoint)
end

#cook_if_notObject



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

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