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.6.4")

  @files << {
    url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.gz",
    sha256: "fd03b7172b3bd7427a3e7a812063f74754f24542429b634e0db6511b53fb2278",
  }

  @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