ffi-libarchive-binary 0.3.4-x86_64-linux → 0.4.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a6f659f28579d54d6283b181edc870b0fa19df6e10f59357f8122840fabd4ee
4
- data.tar.gz: 41bf5f76ce82215baeea079af3574eed1e2709c8dfe21f27836399bf9cdfd2a4
3
+ metadata.gz: 014dd315fec1e4df6cd708fc8c63f59adf2e350d5e58696c9e5470788caff6d4
4
+ data.tar.gz: 1e0f8dd117dc0c542d7cb9ae596312e43c548fec867cf34b0b170b37af13f876
5
5
  SHA512:
6
- metadata.gz: 01d40d6c0491799f05848be9bfe3dca8371f9f6d705f11a91b7afeb0e9612563df1e98ecd0fb000b9acf269b27eb4e5ac2d3eecd61ee1e38aa1a72d824f4893d
7
- data.tar.gz: 1036732b57449bb1991ecd6802934ddfd82ac2c7aa5210a0896ae742c8839a336b9c7164d04ee214b7768dd6d72472f000c7c49c957a16e1b4aba59026ed5a01
6
+ metadata.gz: bffead51bc0684793f3d1a6380c4bd83c6dfa913ed7444770b59b8861984aa18393f1ced52677822b1c3b92d74bb0403914693e988458b43ca70d6507ed2b0c6
7
+ data.tar.gz: b02273eb1b6032cacd6afebc19aae23c56700b62dae64c482a744afb92d0b8eb2ebbafcae1f8bd076f6a2408a0bb8b0bb66b9b413f596f5b8814ce8f4226a41b
@@ -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,18 @@ 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
+ @target = ROOT.join(@target).to_s
36
+ @files << {
37
+ url: library["url"],
38
+ sha256: library["sha256"],
39
+ }
30
40
  @printed = {}
31
41
  end
32
42
 
@@ -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,13 +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
23
- @target = ROOT.join(@target).to_s
18
+ super("openssl")
24
19
  end
25
20
 
26
21
  def configure
@@ -49,15 +44,5 @@ module LibarchiveBinary
49
44
 
50
45
  FileUtils.touch(checkpoint)
51
46
  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
47
  end
63
48
  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"
5
5
  end
@@ -4,37 +4,8 @@ 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
-
23
- @target = ROOT.join(@target).to_s
24
- end
25
-
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
- }
8
+ super("xz")
38
9
  end
39
10
 
40
11
  def configure_defaults
@@ -5,17 +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
-
18
- @target = ROOT.join(@target).to_s
9
+ super("zlib")
19
10
  end
20
11
 
21
12
  def configure_defaults
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
5
5
  platform: x86_64-linux
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-25 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.so
136
138
  - lib/ffi-libarchive-binary/libarchive_recipe.rb
137
139
  - lib/ffi-libarchive-binary/libexpat_recipe.rb