ffi-libarchive-binary 0.3.2-x86_64-darwin → 0.4.0.rc1-x86_64-darwin

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: 23574bba1caf3bb0fcde75c36ccb845f4e99ac32f065baa6e3da8b87c143b842
4
- data.tar.gz: 24cab2e6c1e6bde37d6f54814ca50a821d571902d3665466884da4b61b5df054
3
+ metadata.gz: '074084f27227ad30d49f781694c48eea0c1aaed75b789fb5ec2426cfc80275ea'
4
+ data.tar.gz: bda32e68a1bf9ae4274663457d4268eb8e02ecc9c16f173152c27270181020fe
5
5
  SHA512:
6
- metadata.gz: 1f912f9abe91fed87cd235862aba11ce8e8bad9576cb988cb617105e6359f4de9d6cd919da123248428d7eae51739ea08eb72886017463afb604705f657e2b0f
7
- data.tar.gz: 26a4d747d6fffc6b37060cafa42931c64778a6be4e7035207a87245a0ec0ef1c9f6037b90c5c736ab2ee4b074b10171d10a7fbd6d58581110aaf2628997686d0
6
+ metadata.gz: cea9a48513d8967465aca5f99ca9ee4c7bb19864e198646e15ae90e6738b221b691bdd8656abd671fe3f9a592a692214464c6e39d6e634a764566f20fc80fbd4
7
+ data.tar.gz: 3bd9da90d80e5c99312b9e7e68fb5ce8848b69a12ce2df1da1db0f7d606781f8b1cfca5397747426aed8748a2e26102ed30f6613ef9932da19463b345ac93ae9
data/.rubocop.yml CHANGED
@@ -4,6 +4,7 @@ inherit_from:
4
4
  AllCops:
5
5
  TargetRubyVersion: 2.7
6
6
  SuggestExtensions: false
7
+ NewCops: enable
7
8
  Exclude:
8
9
  - 'ffi-libarchive-binary.gemspec'
9
10
  - 'tmp/**/*'
@@ -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,22 +13,15 @@ require_relative "xz_recipe"
12
13
  module LibarchiveBinary
13
14
  class LibarchiveRecipe < MiniPortileCMake
14
15
  ROOT = Pathname.new(File.expand_path("../..", __dir__))
15
- #
16
- # libarchive 3.7.x uses new GLIBC packaging ( links to libc only and not to pthread, dl, ...)
17
- # this does not link work on Ubuntu 20 with GLIBC 3.21
18
- #
19
- # Cannot build 3.7.x on Ubuntu 22 either because it creates a reference to GLIB 3.22 (min) that does
20
- # not resolve on Ubuntu 20
21
- #
22
- # So without patching we are stick to 3.6.2 until Ubuntu 20 shall be supported
23
- #
16
+ NAME = "libarchive"
24
17
  def initialize
25
- super("libarchive", "3.6.2")
18
+ libarchive = LibarchiveBinary.library_for(NAME)
19
+ super(NAME, libarchive["version"])
26
20
  @printed = {}
27
21
 
28
22
  @files << {
29
- url: "https://www.libarchive.org/downloads/libarchive-3.6.2.tar.gz",
30
- sha256: "ba6d02f15ba04aba9c23fd5f236bb234eab9d5209e95d1c4df85c44d5f19b9b3",
23
+ url: libarchive["url"],
24
+ sha256: libarchive["sha256"],
31
25
  }
32
26
 
33
27
  @target = ROOT.join(@target).to_s
@@ -53,9 +47,9 @@ module LibarchiveBinary
53
47
  "-DENABLE_ZLIB::BOOL=ON", "-DENABLE_BZip2:BOOL=OFF", "-DENABLE_LIBXML2:BOOL=OFF",
54
48
  "-DENABLE_EXPAT::BOOL=ON", "-DENABLE_TAR:BOOL=OFF", "-DENABLE_ICONV::BOOL=OFF",
55
49
  "-DENABLE_CPIO::BOOL=OFF", "-DENABLE_CAT:BOOL=OFF", "-DENABLE_ACL:BOOL=OFF",
56
- "-DENABLE_TEST:BOOL=OFF", "-DENABLE_UNZIP:BOOL=OFF",
57
- "-DCMAKE_INCLUDE_PATH=#{include_path}",
58
- "-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}"
59
53
  ]
60
54
  end
61
55
 
@@ -76,7 +70,7 @@ module LibarchiveBinary
76
70
 
77
71
  def library_path
78
72
  paths = [@zlib_recipe.path, @expat_recipe.path, @openssl_recipe.path, @xz_recipe.path]
79
- paths.map { |k| "#{k}/lib" }.join(";")
73
+ paths.map { |k| "#{k}/lib;#{k}/lib64" }.join(";")
80
74
  end
81
75
 
82
76
  def activate
@@ -136,6 +130,27 @@ module LibarchiveBinary
136
130
  @lib_fullpath ||= lib_filename.nil? ? nil : File.join(lib_workpath, lib_filename)
137
131
  end
138
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
+
139
154
  def verify_lib
140
155
  begin
141
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,16 +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", "1.1.1n")
21
-
22
- @files << {
23
- url: "https://www.openssl.org/source/openssl-1.1.1n.tar.gz",
24
- sha256: "40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a",
25
- }
26
-
18
+ super("openssl")
27
19
  @target = ROOT.join(@target).to_s
28
20
  end
29
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LibarchiveBinary
4
- VERSION = "0.3.2"
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.2
4
+ version: 0.4.0.rc1
5
5
  platform: x86_64-darwin
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.dylib
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.1.6
166
168
  signing_key: