pngcheck 0.2.6 → 0.2.7

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: b5346e7ca03a75938de15f52148de7e578c49038fb42e288289571b2781c506c
4
- data.tar.gz: 315fbcad03d7a4996264cfe77837897b87c053cf019482d2909d76faccaad874
3
+ metadata.gz: 3b01aa17b19045ada7e07600dad8b2fd070472d8f5673a10840d642b9556e32c
4
+ data.tar.gz: 25a9d1e18338c3b10edbade539bda19e58e50ecbfb3de547dec1cda22099e713
5
5
  SHA512:
6
- metadata.gz: ebf508fb8d0bffb9e90bc6bbd5e86114ed4216efc7ae84e1d262499e71e59882d746f69d350d0ad8f00890fda65f5c30e7661e3ea426c4130539923f0c8c7d54
7
- data.tar.gz: efe6d966571264cf0560ede66941162006c3d3b2078d30c8501cc120214fbce49dbe85fc2b3e159a05e269fbc9dca331b3942804e751adc6608404602aa4e5b4
6
+ metadata.gz: a66a56aa38c85f6dcace43e4f9d0b1931a3529c5b6a87bca43ed03b2c1d321f0752674a8db7daf2d1c78bb0dd538d1b87debdd0fb4f2c600e4f9bcf17f4bb458
7
+ data.tar.gz: dfbc6da9c6adcbf93c486ec7e352c6446fb2797af96231481431967b45748e2843ee98d3130ff86ff8c39ec7b7ef918571dce4f584af9fcc817f40f95babcba7
data/Rakefile CHANGED
@@ -3,6 +3,7 @@
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
5
  require "rubocop/rake_task"
6
+ require_relative "ext/layout"
6
7
 
7
8
  RSpec::Core::RakeTask.new(:spec)
8
9
  RuboCop::RakeTask.new
@@ -20,14 +21,24 @@ task "gem:native:any" do
20
21
  sh "rake platform:any gem"
21
22
  end
22
23
 
24
+ desc "Download pngcheck source"
25
+ task :pngcheck do
26
+ test_cmd = "test -f #{PNGCHECK_LOCAL}"
27
+ wget_cmd = "wget -nc -nv -O #{PNGCHECK_LOCAL} #{PNGCHECK_URI}"
28
+ sh "#{test_cmd} || #{wget_cmd}"
29
+ end
30
+ task compile: :pngcheck
31
+
23
32
  require "rubygems/package_task"
24
33
 
25
34
  desc "Define the gem task to build on any platform (compile on install)"
26
35
  task "platform:any" do
27
36
  spec = Gem::Specification::load("pngcheck.gemspec").dup
37
+ spec.files << PNGCHECK_LOCAL
28
38
  task = Gem::PackageTask.new(spec)
29
39
  task.define
30
40
  end
41
+ task "gem:native:any": :pngcheck
31
42
 
32
43
  File.readlines(".cross_rubies", chomp: true).each do |platform|
33
44
  desc "Build pre-compiled gem for the #{platform} platform"
@@ -53,6 +64,7 @@ require "rake/clean"
53
64
  CLOBBER.include("pkg")
54
65
  CLEAN.include("ports",
55
66
  "tmp",
67
+ PNGCHECK_LOCAL,
56
68
  "lib/pngcheck/*.dll",
57
69
  "lib/pngcheck/*.dylib",
58
70
  "lib/pngcheck/*.so")
data/ext/layout.rb ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ PNGCHECK_ARCH = "pngcheck-3.0.3.tar.gz"
4
+ PNGCHECK_URI = "http://www.libpng.org/pub/png/src/#{PNGCHECK_ARCH}"
5
+ PNGCHECK_LOCAL = "ext/#{PNGCHECK_ARCH}"
Binary file
@@ -8,14 +8,16 @@ require "shellwords"
8
8
  require "open3"
9
9
  require_relative "version"
10
10
 
11
+ ROOT = Pathname.new(File.expand_path("../..", __dir__))
12
+ require "#{ROOT}/ext/layout.rb"
13
+
11
14
  module PngCheck
12
15
  class Recipe < MiniPortile
13
- ROOT = Pathname.new(File.expand_path("../..", __dir__))
14
16
  COMMON_FLAGS = "-shared -fPIC -Wall -O -DUSE_ZLIB"
15
17
 
16
18
  def files_to_load_all
17
19
  @files << {
18
- url: "http://www.libpng.org/pub/png/src/pngcheck-3.0.3.tar.gz",
20
+ url: "file:#{ROOT}/#{PNGCHECK_LOCAL}", # "http://www.libpng.org/pub/png/src/pngcheck-3.0.3.tar.gz"
19
21
  sha256: "c36a4491634af751f7798ea421321642f9590faa032eccb0dd5fb4533609dee6", # rubocop:disable Layout/LineLength
20
22
  }
21
23
  end
@@ -64,6 +66,15 @@ module PngCheck
64
66
  FileUtils.touch(checkpoint)
65
67
  end
66
68
 
69
+ def download_file_file(uri, full_path)
70
+ if MiniPortile.windows?
71
+ FileUtils.mkdir_p File.dirname(full_path)
72
+ FileUtils.cp uri.to_s.delete_prefix("file:"), full_path
73
+ else
74
+ super
75
+ end
76
+ end
77
+
67
78
  def checkpoint
68
79
  File.join(@target, "#{name}-#{version}-#{host}.installed")
69
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PngCheck
4
- VERSION = "0.2.6"
4
+ VERSION = "0.2.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pngcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-13 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -116,6 +116,8 @@ files:
116
116
  - bin/setup
117
117
  - ext/Makefile
118
118
  - ext/extconf.rb
119
+ - ext/layout.rb
120
+ - ext/pngcheck-3.0.3.tar.gz
119
121
  - ext/wrapper.c
120
122
  - lib/pngcheck.rb
121
123
  - lib/pngcheck/recipe.rb