emf2svg 1.1.1-x86_64-darwin → 1.2.0-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: d2b7c416028ac95dfde225998a55fadddd8adb36ecc9716cfb366720b2f4a310
4
- data.tar.gz: b75e36fc384037be9f0c9f4a21e3d6df7c63ca2d5ec7ae347e41ae95a68f2f0b
3
+ metadata.gz: 3455719344ef397a8cb692b5bcda4fc6c1cad48c9f7353596499c53f67f4a905
4
+ data.tar.gz: a304b90a7fe25261407283b00e161a18349d93b34a30989e226de81f30732a5d
5
5
  SHA512:
6
- metadata.gz: 1bae4156b0818fbd29ca3b669d4ebaae0f713bb5d1d1d0357d2c0e42b82a2f938f411a4d4f3156dcf1277598678e2174dd0511d80eeb2636ede175ee1b84ff1c
7
- data.tar.gz: 79b1389bba3b41a2de9b95af5f63030f01efaaeeac69897b832a5ecd9e654d2c7111b703932072b7f8658c3a4972931edc4347ac8655a16b057b66d5a6ba950c
6
+ metadata.gz: 3b264271fc2f67135bda5116ed33a770a1834c46689a610b55a5e68fefb35742a3131649b39a4be59c7c36727518326cc60f635f7f5557c9217848c83460982e
7
+ data.tar.gz: 6053b88ce2e2a61c2da36f4191aaf9e0fa0167fe989df15724f53909e7cb70d7ed1cbcf2917d4a018624308e0604ee5d6961585842cd5487f9354097c01f180c
@@ -2,7 +2,7 @@ name: main
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ main, master ]
5
+ branches: [ main ]
6
6
  pull_request:
7
7
  workflow_dispatch:
8
8
 
@@ -10,6 +10,7 @@ jobs:
10
10
  test:
11
11
  runs-on: ${{ matrix.os }}
12
12
  strategy:
13
+ max-parallel: 3
13
14
  fail-fast: false
14
15
  matrix:
15
16
  os: [ ubuntu-18.04, ubuntu-latest, windows-latest, macos-latest ]
@@ -22,14 +23,15 @@ jobs:
22
23
 
23
24
  - uses: ruby/setup-ruby@v1
24
25
  with:
25
- ruby-version: ${{ matrix.ruby-version }}
26
26
  bundler-cache: true
27
+ ruby-version: ${{ matrix.ruby-version }}
27
28
 
28
29
  - run: bundle exec rake
29
30
 
30
31
  build:
31
32
  runs-on: ${{ matrix.os }}
32
33
  strategy:
34
+ max-parallel: 3
33
35
  fail-fast: false
34
36
  matrix:
35
37
  include:
@@ -74,6 +76,7 @@ jobs:
74
76
  needs: build
75
77
  runs-on: ${{ matrix.os }}
76
78
  strategy:
79
+ max-parallel: 3
77
80
  fail-fast: false
78
81
  matrix:
79
82
  include:
@@ -101,6 +104,7 @@ jobs:
101
104
  - os: macos-latest
102
105
  platform: x86_64-darwin
103
106
  ruby-version: '2.7'
107
+
104
108
  steps:
105
109
  - uses: actions/checkout@v2
106
110
 
@@ -124,3 +128,36 @@ jobs:
124
128
  - name: Test conversion
125
129
  run: |
126
130
  ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
131
+
132
+ cross:
133
+ runs-on: ${{ matrix.os }}
134
+ strategy:
135
+ max-parallel: 3
136
+ fail-fast: false
137
+ matrix:
138
+ include:
139
+ - os: ubuntu-18.04
140
+ platform: arm64-linux
141
+ ruby-version: '2.7'
142
+ steps:
143
+ - uses: actions/checkout@v2
144
+
145
+ - name: Install packages
146
+ run: |
147
+ sudo apt-get update
148
+ sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf
149
+
150
+ - uses: ruby/setup-ruby@v1
151
+ with:
152
+ ruby-version: ${{ matrix.ruby-version }}
153
+ bundler-cache: true
154
+
155
+ - run: bundle exec rake gem:native:${{ matrix.platform }}
156
+
157
+ - uses: actions/upload-artifact@v2
158
+ with:
159
+ name: pkg
160
+ path: pkg/*.gem
161
+
162
+ - name: Install gem
163
+ run: gem install -b pkg/emf2svg-*.gem
@@ -9,6 +9,7 @@ jobs:
9
9
  build:
10
10
  runs-on: ${{ matrix.os }}
11
11
  strategy:
12
+ max-parallel: 3
12
13
  fail-fast: false
13
14
  matrix:
14
15
  include:
@@ -49,8 +50,41 @@ jobs:
49
50
  run: |
50
51
  ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
51
52
 
53
+ cross:
54
+ runs-on: ${{ matrix.os }}
55
+ strategy:
56
+ max-parallel: 3
57
+ fail-fast: false
58
+ matrix:
59
+ include:
60
+ - os: ubuntu-18.04
61
+ platform: arm64-linux
62
+ ruby-version: '2.7'
63
+ steps:
64
+ - uses: actions/checkout@v2
65
+
66
+ - name: Install packages
67
+ run: |
68
+ sudo apt-get update
69
+ sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf
70
+
71
+ - uses: ruby/setup-ruby@v1
72
+ with:
73
+ ruby-version: ${{ matrix.ruby-version }}
74
+ bundler-cache: true
75
+
76
+ - run: bundle exec rake gem:native:${{ matrix.platform }}
77
+
78
+ - uses: actions/upload-artifact@v2
79
+ with:
80
+ name: pkg
81
+ path: pkg/*.gem
82
+
83
+ - name: Install gem
84
+ run: gem install -b pkg/emf2svg-*.gem
85
+
52
86
  publish:
53
- needs: build
87
+ needs: [ build, cross ]
54
88
  runs-on: ubuntu-latest
55
89
  steps:
56
90
  - uses: actions/checkout@v2
data/.rubocop.yml CHANGED
@@ -3,6 +3,7 @@ inherit_from:
3
3
 
4
4
  AllCops:
5
5
  TargetRubyVersion: 2.7
6
+ SuggestExtensions: false
6
7
 
7
8
  Gemspec/RequireMFA:
8
9
  Enabled: false
data/Rakefile CHANGED
@@ -34,13 +34,14 @@ platforms = [
34
34
  "x64-mingw32",
35
35
  "x64-mingw-ucrt",
36
36
  "x86_64-linux",
37
+ "arm64-linux",
37
38
  "x86_64-darwin",
38
39
  ]
39
40
 
40
41
  platforms.each do |platform|
41
42
  desc "Build pre-compiled gem for the #{platform} platform"
42
43
  task "gem:native:#{platform}" do
43
- sh "rake compile platform:#{platform} gem"
44
+ sh "rake compile platform:#{platform} gem target_platform=#{platform}"
44
45
  end
45
46
 
46
47
  desc "Define the gem task to build on the #{platform} platform (binary gem)"
Binary file
@@ -1,3 +1,4 @@
1
+ require "rbconfig"
1
2
  require "mini_portile2"
2
3
  require "pathname"
3
4
  require "tmpdir"
@@ -7,11 +8,11 @@ module Emf2svg
7
8
  ROOT = Pathname.new(File.expand_path("../..", __dir__))
8
9
 
9
10
  def initialize
10
- super("libemf2svg", "1.3.1")
11
+ super("libemf2svg", "1.4.0")
11
12
 
12
13
  @files << {
13
- url: "https://github.com/metanorma/libemf2svg/releases/download/1.3.1/libemf2svg.tar.gz",
14
- sha256: "732c60c54d0692a8634221e6ffb0733ad0bb1d9a246a03ba2433c535441eb73e", # rubocop:disable Layout/LineLength
14
+ url: "https://github.com/metanorma/libemf2svg/releases/download/v1.4.0/libemf2svg.tar.gz",
15
+ sha256: "e05081986a0ec6c5bd494068825c7b55dd21fa1814942a61293b225af2d957d2", # rubocop:disable Layout/LineLength
15
16
  }
16
17
 
17
18
  @target = ROOT.join(@target).to_s
@@ -28,8 +29,42 @@ module Emf2svg
28
29
  FileUtils.touch(checkpoint)
29
30
  end
30
31
 
32
+ # rubocop:disable Metrics/MethodLength
33
+ # rubocop:disable Metrics/CyclomaticComplexity
34
+ def host_platform
35
+ @host_platform ||=
36
+ case @host
37
+ when /\Ax86_64.*mingw32/
38
+ "x64-mingw32"
39
+ when /\Ai[3-6]86.*mingw32/
40
+ "x86-mingw32"
41
+ when /\Ax86_64.*linux/
42
+ "x86_64-linux"
43
+ when /\Aarm64.*linux/
44
+ "xarm64-linux"
45
+ when /\Ai[3-6]86.*linux/
46
+ "x86-linux"
47
+ when /\Ax86_64.*darwin/
48
+ "x86_64-darwin"
49
+ when /\Aarm64.*darwin/
50
+ "arm64-darwin"
51
+ else
52
+ raise "CrossRuby.platform: unsupported host: #{@host}"
53
+ end
54
+ end
55
+ # rubocop:enable Metrics/CyclomaticComplexity
56
+ # rubocop:enable Metrics/MethodLength
57
+
58
+ def target_platform
59
+ @target_platform = ENV["target_platform"] || host_platform
60
+ end
61
+
62
+ def cross_compiling?
63
+ not host_platform.eql? target_platform
64
+ end
65
+
31
66
  def checkpoint
32
- File.join(@target, "#{name}-#{version}-#{host}.installed")
67
+ File.join(@target, "#{name}-#{version}-#{target_platform}.installed")
33
68
  end
34
69
 
35
70
  def configure_defaults
@@ -37,10 +72,15 @@ module Emf2svg
37
72
 
38
73
  opts << "-DCMAKE_BUILD_TYPE=Release"
39
74
 
40
- if MiniPortile.windows?
75
+ if MiniPortile.windows? || cross_compiling?
41
76
  opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
42
77
  end
43
78
 
79
+ if cross_compiling? && (not MiniPortile.windows?)
80
+ message("Cross-compiling on #{host_platform} for #{target_platform}\n")
81
+ opts << "-DVCPKG_TARGET_TRIPLET=#{target_platform}"
82
+ end
83
+
44
84
  opts
45
85
  end
46
86
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Emf2svg
4
- VERSION = "1.1.1"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emf2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2022-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi