Class: LibarchiveBinary::XZRecipe

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

#initializeXZRecipe

As of 19.10.2022

versions > 5.2.4 get crazy on MinGW
versions <= 5.2.5 do not support arm64-apple-darwin target
version 5.2.7 could not be linked statically to libarchive


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 14

def initialize
  if MiniPortile::windows?
    super("xz", "5.2.4")
    windows_files
  else
    super("xz", "5.2.6")
    not_windows_files
  end

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

Instance Method Details

#checkpointObject



55
56
57
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 55

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

#configureObject



49
50
51
52
53
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 49

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

#configure_defaultsObject



40
41
42
43
44
45
46
47
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 40

def configure_defaults
  [
    "--host=#{@host}",
    "--disable-doc",      "--disable-xz",       "--with-pic",
    "--disable-xzdec",    "--disable-lzmadec",  "--disable-lzmainfo",
    "--disable-scripts",  "--disable-shared",   "--enable-static"
  ]
end

#cookObject



63
64
65
66
67
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 63

def cook
  super

  FileUtils.touch(checkpoint)
end

#cook_if_notObject



59
60
61
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 59

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

#not_windows_filesObject



33
34
35
36
37
38
# File 'lib/ffi-libarchive-binary/xz_recipe.rb', line 33

def not_windows_files
  @files << {
    url: "https://tukaani.org/xz/xz-5.2.6.tar.gz",
    sha256: "a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0",
  }
end

#windows_filesObject



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

def windows_files
  @files << {
    url: "https://tukaani.org/xz/xz-5.2.4.tar.gz",
    sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145",
  }
end