ffi-libarchive-binary 0.3.4-x64-mingw-ucrt → 0.4.0.rc1-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce91bb500da9a7f3ce9ecc4af3bb1c11567fbc6b81dbe535b79728c749e05c18
4
- data.tar.gz: 8eada3f9eced1edca9bdf13e8f4822fd89c04ab94de05f0f4754bae485acfec2
3
+ metadata.gz: 38e0558a7c1151c0e756bb289f7b8d2e2666b00c7b3cb8012795a0e41ac657da
4
+ data.tar.gz: 07c146e7b7363629d817f3f38d560656f9c8c633475ec059492147bb88d6dcd4
5
5
  SHA512:
6
- metadata.gz: 4caf6eca2a70270f48ff79fd259050e95d1f7aaa0a5a155e18382411c1f24939c25d973b348c7f1d5e8ed1afbe74ec0b18ef90e3313c2a4113a5024172185b43
7
- data.tar.gz: 30ec2240e5f8d0b7313d6e233cef873fb1be07eca1bdf7e63f916e3260673fcc827259c06595c1ce8ace6c59a9f752d6f27c1b1473e8c04af923c036f0ec0f4b
6
+ metadata.gz: 236ce7206505b242ed3aa8391d50fedb894581c734670b3af55a0a5274432f023bb91764207825aeb81ff632b404937236b756e5ddf67f9aa03309f5c21cd5b6
7
+ data.tar.gz: 3f65c7f781f28e994b06fe6f7088d0aeb530380a8344b6042e9c8740edb14158a1df242a429b25acd0aefaef12c65ef758c7071642bc24c7c1a872a8f37c580d
@@ -0,0 +1,40 @@
1
+ libraries:
2
+ zlib:
3
+ all:
4
+ version: "1.3.1"
5
+ url: "http://zlib.net/fossils/zlib-1.3.1.tar.gz"
6
+ sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23"
7
+ libexpat:
8
+ all:
9
+ version: "2.6.4"
10
+ url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.gz"
11
+ sha256: "fd03b7172b3bd7427a3e7a812063f74754f24542429b634e0db6511b53fb2278"
12
+ # openssl:
13
+ # version 3.x.y requires pod2man, that is not easily available on Windows
14
+ openssl:
15
+ windows:
16
+ version: "1.1.1w"
17
+ url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz"
18
+ sha256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8"
19
+ all:
20
+ version: "3.3.2"
21
+ url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz"
22
+ sha256: "2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281"
23
+ # xz:
24
+ # versions > 5.2.4 get crazy on MinGW
25
+ # versions <= 5.2.5 do not support arm64-apple-darwin target
26
+ # version 5.2.7 could not be linked statically to libarchive
27
+ xz:
28
+ windows:
29
+ version: "5.2.4"
30
+ url: "https://tukaani.org/xz/xz-5.2.4.tar.gz"
31
+ sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145"
32
+ all:
33
+ version: "5.2.6"
34
+ url: "https://tukaani.org/xz/xz-5.2.6.tar.gz"
35
+ sha256: "a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0"
36
+ libarchive:
37
+ all:
38
+ version: "3.7.7"
39
+ url: "https://www.libarchive.org/downloads/libarchive-3.7.7.tar.gz"
40
+ sha256: "4cc540a3e9a1eebdefa1045d2e4184831100667e6d7d5b315bb1cbc951f8ddff"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "mini_portile2"
4
+ require_relative "configuration"
4
5
 
5
6
  module LibarchiveBinary
6
7
  FORMATS = {
@@ -24,9 +25,17 @@ module LibarchiveBinary
24
25
  "arm64-apple-darwin" => "libarchive.dylib",
25
26
  }.freeze
26
27
 
28
+ ROOT = Pathname.new(File.expand_path("../..", __dir__))
29
+
27
30
  class BaseRecipe < MiniPortile
28
- def initialize(name, version)
29
- super
31
+ def initialize(name)
32
+ library = LibarchiveBinary.library_for(name)
33
+ version = library["version"]
34
+ super(name, version)
35
+ @files << {
36
+ url: library["url"],
37
+ sha256: library["sha256"],
38
+ }
30
39
  @printed = {}
31
40
  end
32
41
 
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "psych"
4
+ require "yaml"
5
+
6
+ module LibarchiveBinary
7
+ def self.libraries
8
+ configuration_file = File.join(File.dirname(__FILE__), "..", "..", "ext", "configuration.yml")
9
+ @@libraries ||= ::YAML.load_file(configuration_file)["libraries"] || {}
10
+ rescue Psych::SyntaxError => e
11
+ puts "Warning: The configuration file '#{configuration_file}' contains invalid YAML syntax."
12
+ puts e.message
13
+ exit 1
14
+ rescue StandardError => e
15
+ puts "An unexpected error occurred while loading the configuration file '#{configuration_file}'."
16
+ puts e.message
17
+ exit 1
18
+ end
19
+
20
+ def self.library_for(libname)
21
+ if MiniPortile::windows?
22
+ libraries[libname]["windows"] || libraries[libname]["all"]
23
+ else
24
+ libraries[libname]["all"]
25
+ end
26
+ rescue StandardError => e
27
+ puts "Failed to load library configuration for '#{libname}'."
28
+ puts e.message
29
+ exit 1
30
+ end
31
+ end
@@ -3,6 +3,7 @@
3
3
  require "pathname"
4
4
  require "open3"
5
5
 
6
+ require_relative "configuration"
6
7
  require_relative "base_recipe"
7
8
  require_relative "zlib_recipe"
8
9
  require_relative "libexpat_recipe"
@@ -12,13 +13,15 @@ require_relative "xz_recipe"
12
13
  module LibarchiveBinary
13
14
  class LibarchiveRecipe < MiniPortileCMake
14
15
  ROOT = Pathname.new(File.expand_path("../..", __dir__))
16
+ NAME = "libarchive"
15
17
  def initialize
16
- super("libarchive", "3.7.7")
18
+ libarchive = LibarchiveBinary.library_for(NAME)
19
+ super(NAME, libarchive["version"])
17
20
  @printed = {}
18
21
 
19
22
  @files << {
20
- url: "https://www.libarchive.org/downloads/libarchive-3.7.7.tar.gz",
21
- sha256: "4cc540a3e9a1eebdefa1045d2e4184831100667e6d7d5b315bb1cbc951f8ddff",
23
+ url: libarchive["url"],
24
+ sha256: libarchive["sha256"],
22
25
  }
23
26
 
24
27
  @target = ROOT.join(@target).to_s
@@ -44,9 +47,9 @@ module LibarchiveBinary
44
47
  "-DENABLE_ZLIB::BOOL=ON", "-DENABLE_BZip2:BOOL=OFF", "-DENABLE_LIBXML2:BOOL=OFF",
45
48
  "-DENABLE_EXPAT::BOOL=ON", "-DENABLE_TAR:BOOL=OFF", "-DENABLE_ICONV::BOOL=OFF",
46
49
  "-DENABLE_CPIO::BOOL=OFF", "-DENABLE_CAT:BOOL=OFF", "-DENABLE_ACL:BOOL=OFF",
47
- "-DENABLE_TEST:BOOL=OFF", "-DENABLE_UNZIP:BOOL=OFF",
48
- "-DCMAKE_INCLUDE_PATH=#{include_path}",
49
- "-DCMAKE_LIBRARY_PATH=#{library_path}"
50
+ "-DENABLE_TEST:BOOL=OFF", "-DENABLE_UNZIP:BOOL=OFF", "-DOPENSSL_USE_STATIC_LIBS=ON",
51
+ "-DCMAKE_INCLUDE_PATH:STRING=#{include_path}",
52
+ "-DCMAKE_LIBRARY_PATH:STRING=#{library_path}"
50
53
  ]
51
54
  end
52
55
 
@@ -67,7 +70,7 @@ module LibarchiveBinary
67
70
 
68
71
  def library_path
69
72
  paths = [@zlib_recipe.path, @expat_recipe.path, @openssl_recipe.path, @xz_recipe.path]
70
- paths.map { |k| "#{k}/lib" }.join(";")
73
+ paths.map { |k| "#{k}/lib;#{k}/lib64" }.join(";")
71
74
  end
72
75
 
73
76
  def activate
@@ -127,6 +130,27 @@ module LibarchiveBinary
127
130
  @lib_fullpath ||= lib_filename.nil? ? nil : File.join(lib_workpath, lib_filename)
128
131
  end
129
132
 
133
+ def libraries
134
+ configuration_file = File.join(File.dirname(__FILE__), "..", "..", "ext", "configuration.yml")
135
+ @libraries ||= ::YAML.load_file(configuration_file)["libraries"] || {}
136
+ rescue Psych::SyntaxError => e
137
+ puts "Warning: The configuration file '#{configuration_file}' contains invalid YAML syntax."
138
+ puts e.message
139
+ exit 1
140
+ rescue StandardError => e
141
+ puts "An unexpected error occurred while loading the configuration file '#{configuration_file}'."
142
+ puts e.message
143
+ exit 1
144
+ end
145
+
146
+ def library_for(libname)
147
+ libraries[libname][MiniPortile::windows? ? "windows" : "all"]
148
+ rescue StandardError => e
149
+ puts "Failed to load library configuration for '#{libname}'."
150
+ puts e.message
151
+ exit 1
152
+ end
153
+
130
154
  def verify_lib
131
155
  begin
132
156
  out, = Open3.capture2("file #{lib_fullpath}")
@@ -4,15 +4,8 @@ require_relative "base_recipe"
4
4
 
5
5
  module LibarchiveBinary
6
6
  class LibexpatRecipe < BaseRecipe
7
- ROOT = Pathname.new(File.expand_path("../..", __dir__))
8
-
9
7
  def initialize
10
- super("libexpat", "2.6.4")
11
-
12
- @files << {
13
- url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.gz",
14
- sha256: "fd03b7172b3bd7427a3e7a812063f74754f24542429b634e0db6511b53fb2278",
15
- }
8
+ super("libexpat")
16
9
 
17
10
  @target = ROOT.join(@target).to_s
18
11
  end
@@ -14,12 +14,8 @@ module LibarchiveBinary
14
14
  ENV_CMD = ["env", "CFLAGS=-fPIC", "LDFLAGS=-fPIC"].freeze
15
15
 
16
16
  class OpensslRecipe < BaseRecipe
17
- ROOT = Pathname.new(File.expand_path("../..", __dir__))
18
-
19
17
  def initialize
20
- super("openssl", MiniPortile::windows? ? "1.1.1w" : "3.3.2")
21
-
22
- @files << source_archive
18
+ super("openssl")
23
19
  @target = ROOT.join(@target).to_s
24
20
  end
25
21
 
@@ -49,15 +45,5 @@ module LibarchiveBinary
49
45
 
50
46
  FileUtils.touch(checkpoint)
51
47
  end
52
-
53
- def source_archive
54
- if MiniPortile::windows?
55
- { url: "https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz",
56
- sha256: "cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8" }
57
- else
58
- { url: "https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz",
59
- sha256: "2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5fc3d281" }
60
- end
61
- end
62
48
  end
63
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LibarchiveBinary
4
- VERSION = "0.3.4"
4
+ VERSION = "0.4.0.rc1"
5
5
  end
@@ -4,39 +4,11 @@ require_relative "base_recipe"
4
4
 
5
5
  module LibarchiveBinary
6
6
  class XZRecipe < BaseRecipe
7
- ROOT = Pathname.new(File.expand_path("../..", __dir__))
8
-
9
- # As of 19.10.2022
10
- # versions > 5.2.4 get crazy on MinGW
11
- # versions <= 5.2.5 do not support arm64-apple-darwin target
12
- # version 5.2.7 could not be linked statically to libarchive
13
-
14
7
  def initialize
15
- if MiniPortile::windows?
16
- super("xz", "5.2.4")
17
- windows_files
18
- else
19
- super("xz", "5.2.6")
20
- not_windows_files
21
- end
22
-
8
+ super("xz")
23
9
  @target = ROOT.join(@target).to_s
24
10
  end
25
11
 
26
- def windows_files
27
- @files << {
28
- url: "https://tukaani.org/xz/xz-5.2.4.tar.gz",
29
- sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145",
30
- }
31
- end
32
-
33
- def not_windows_files
34
- @files << {
35
- url: "https://tukaani.org/xz/xz-5.2.6.tar.gz",
36
- sha256: "a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0",
37
- }
38
- end
39
-
40
12
  def configure_defaults
41
13
  [
42
14
  "--host=#{@host}",
@@ -5,16 +5,8 @@ require_relative "base_recipe"
5
5
 
6
6
  module LibarchiveBinary
7
7
  class ZLibRecipe < BaseRecipe
8
- ROOT = Pathname.new(File.expand_path("../..", __dir__))
9
-
10
8
  def initialize
11
- super("zlib", "1.3.1")
12
-
13
- @files << {
14
- url: "http://zlib.net/fossils/zlib-1.3.1.tar.gz",
15
- sha256: "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23",
16
- }
17
-
9
+ super("zlib")
18
10
  @target = ROOT.join(@target).to_s
19
11
  end
20
12
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-libarchive-binary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0.rc1
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2024-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,10 +128,12 @@ files:
128
128
  - README.adoc
129
129
  - Rakefile
130
130
  - ext/Makefile
131
+ - ext/configuration.yml
131
132
  - ext/extconf.rb
132
133
  - ffi-libarchive-binary.gemspec
133
134
  - lib/ffi-libarchive-binary.rb
134
135
  - lib/ffi-libarchive-binary/base_recipe.rb
136
+ - lib/ffi-libarchive-binary/configuration.rb
135
137
  - lib/ffi-libarchive-binary/libarchive.dll
136
138
  - lib/ffi-libarchive-binary/libarchive_recipe.rb
137
139
  - lib/ffi-libarchive-binary/libexpat_recipe.rb
@@ -158,9 +160,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
160
  version: 2.7.0
159
161
  required_rubygems_version: !ruby/object:Gem::Requirement
160
162
  requirements:
161
- - - ">="
163
+ - - ">"
162
164
  - !ruby/object:Gem::Version
163
- version: '0'
165
+ version: 1.3.1
164
166
  requirements: []
165
167
  rubygems_version: 3.3.27
166
168
  signing_key: