Sha256: d6ac0ef141ff043a52658be048b2532e11f8cbd108f18d415333579a4817328b

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

require "mini_portile2"

module LibarchiveBinary
  # based on 
  class LibexpatRecipe < MiniPortile
    ROOT = Pathname.new(File.expand_path("../..", __dir__))

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

      @files << {
        url: "https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.gz",
        sha256: "a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b"
      }

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

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

    def configure
      cmd = ["env", "CFLAGS=-fPIC", "LDFLAGS=-fPIC", "./configure"] + computed_options
      execute("configure", cmd)
    end

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

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

    def cook
      super

      FileUtils.touch(checkpoint)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ffi-libarchive-binary-0.2.6-x86-mingw32 lib/ffi-libarchive-binary/libexpat_recipe.rb
ffi-libarchive-binary-0.2.6-x64-mingw32 lib/ffi-libarchive-binary/libexpat_recipe.rb
ffi-libarchive-binary-0.2.6-x64-mingw-ucrt lib/ffi-libarchive-binary/libexpat_recipe.rb
ffi-libarchive-binary-0.2.5-x86-mingw32 lib/ffi-libarchive-binary/libexpat_recipe.rb
ffi-libarchive-binary-0.2.5-x64-mingw32 lib/ffi-libarchive-binary/libexpat_recipe.rb