emf2svg 1.1.1-x86_64-linux → 1.3.0-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +43 -2
- data/.github/workflows/release.yml +39 -1
- data/.rubocop.yml +2 -1
- data/Rakefile +11 -1
- data/emf2svg.gemspec +1 -1
- data/lib/emf2svg/libemf2svg.so +0 -0
- data/lib/emf2svg/recipe.rb +68 -5
- data/lib/emf2svg/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c97332398805ddf4b0ab23e10ca8c83f798d0fac88a290b336d9c5e3c79d28
|
4
|
+
data.tar.gz: e8f9fcaa174837ef74e89fef0a9b2596ade0c3eacfa9fbd8c75d162aa3426f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc6e6bc9d8f32a1c51d4a87a128a7e44f3bf36223a7498a12ca464e9b134b111b7fc5ccd5f109876a917b7b1240f38990b0885ca3fac06b9445f6cae8a8e5c43
|
7
|
+
data.tar.gz: 90991eadcfd362f2ca769919166df55f4c5c731118de2e42a4ec79039c82e93fb75b45d71e2100c39e26652093fede4ba9108da8a979b64ae8291c87ee7d93a3
|
data/.github/workflows/main.yml
CHANGED
@@ -2,7 +2,7 @@ name: main
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [ main
|
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: 4
|
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: 4
|
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: 4
|
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,40 @@ 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: 4
|
136
|
+
fail-fast: false
|
137
|
+
matrix:
|
138
|
+
include:
|
139
|
+
- os: ubuntu-latest
|
140
|
+
platform: arm64-linux
|
141
|
+
ruby-version: '2.7'
|
142
|
+
- os: macos-latest
|
143
|
+
platform: arm64-darwin
|
144
|
+
ruby-version: '2.7'
|
145
|
+
steps:
|
146
|
+
- uses: actions/checkout@v2
|
147
|
+
|
148
|
+
- name: Install packages
|
149
|
+
if: matrix.os == 'ubuntu-latest'
|
150
|
+
run: |
|
151
|
+
sudo apt-get update
|
152
|
+
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf
|
153
|
+
|
154
|
+
- uses: ruby/setup-ruby@v1
|
155
|
+
with:
|
156
|
+
ruby-version: ${{ matrix.ruby-version }}
|
157
|
+
bundler-cache: true
|
158
|
+
|
159
|
+
- run: bundle exec rake gem:native:${{ matrix.platform }}
|
160
|
+
|
161
|
+
- uses: actions/upload-artifact@v2
|
162
|
+
with:
|
163
|
+
name: pkg
|
164
|
+
path: pkg/*.gem
|
165
|
+
|
166
|
+
- name: Install gem
|
167
|
+
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,45 @@ 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-latest
|
61
|
+
platform: arm64-linux
|
62
|
+
ruby-version: '2.7'
|
63
|
+
- os: macos-latest
|
64
|
+
platform: arm64-darwin
|
65
|
+
ruby-version: '2.7'
|
66
|
+
steps:
|
67
|
+
- uses: actions/checkout@v2
|
68
|
+
|
69
|
+
- name: Install packages
|
70
|
+
if: matrix.os == 'ubuntu-latest'
|
71
|
+
run: |
|
72
|
+
sudo apt-get update
|
73
|
+
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf
|
74
|
+
|
75
|
+
- uses: ruby/setup-ruby@v1
|
76
|
+
with:
|
77
|
+
ruby-version: ${{ matrix.ruby-version }}
|
78
|
+
bundler-cache: true
|
79
|
+
|
80
|
+
- run: bundle exec rake gem:native:${{ matrix.platform }}
|
81
|
+
|
82
|
+
- uses: actions/upload-artifact@v2
|
83
|
+
with:
|
84
|
+
name: pkg
|
85
|
+
path: pkg/*.gem
|
86
|
+
|
87
|
+
- name: Install gem
|
88
|
+
run: gem install -b pkg/emf2svg-*.gem
|
89
|
+
|
52
90
|
publish:
|
53
|
-
needs: build
|
91
|
+
needs: [ build, cross ]
|
54
92
|
runs-on: ubuntu-latest
|
55
93
|
steps:
|
56
94
|
- uses: actions/checkout@v2
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -34,13 +34,23 @@ platforms = [
|
|
34
34
|
"x64-mingw32",
|
35
35
|
"x64-mingw-ucrt",
|
36
36
|
"x86_64-linux",
|
37
|
+
"arm64-linux",
|
38
|
+
"aarch64-linux",
|
37
39
|
"x86_64-darwin",
|
40
|
+
"arm64-darwin",
|
41
|
+
"aarch64-darwin",
|
42
|
+
"x86_64-macos",
|
43
|
+
"arm64-macos",
|
44
|
+
"aarch64-macos",
|
45
|
+
"x86_64-osx",
|
46
|
+
"arm64-osx",
|
47
|
+
"aarch64-osx",
|
38
48
|
]
|
39
49
|
|
40
50
|
platforms.each do |platform|
|
41
51
|
desc "Build pre-compiled gem for the #{platform} platform"
|
42
52
|
task "gem:native:#{platform}" do
|
43
|
-
sh "rake compile platform:#{platform} gem"
|
53
|
+
sh "rake compile platform:#{platform} gem target_platform=#{platform}"
|
44
54
|
end
|
45
55
|
|
46
56
|
desc "Define the gem task to build on the #{platform} platform (binary gem)"
|
data/emf2svg.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "Ruby interface to libemf2svg."
|
12
12
|
spec.homepage = "https://github.com/metanorma/emf2svg-ruby"
|
13
13
|
spec.license = "BSD-2-Clause"
|
14
|
-
spec.required_ruby_version = ">= 2.
|
14
|
+
spec.required_ruby_version = ">= 2.5.0"
|
15
15
|
|
16
16
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
17
|
spec.metadata["source_code_uri"] = "https://github.com/metanorma/emf2svg-ruby"
|
data/lib/emf2svg/libemf2svg.so
CHANGED
Binary file
|
data/lib/emf2svg/recipe.rb
CHANGED
@@ -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.
|
11
|
+
super("libemf2svg", "1.6.0")
|
11
12
|
|
12
13
|
@files << {
|
13
|
-
url: "https://github.com/metanorma/libemf2svg/releases/download/
|
14
|
-
sha256: "
|
14
|
+
url: "https://github.com/metanorma/libemf2svg/releases/download/v1.6.0/libemf2svg.tar.gz",
|
15
|
+
sha256: "0f186f40b98c06acdec1278a314cEc1f093e7504d34f7a15b697ebfe6c4d3097", # rubocop:disable Layout/LineLength
|
15
16
|
}
|
16
17
|
|
17
18
|
@target = ROOT.join(@target).to_s
|
@@ -28,8 +29,65 @@ 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 /\A(arm64|aarch64).*linux/
|
44
|
+
"arm64-linux"
|
45
|
+
when /\Ai[3-6]86.*linux/
|
46
|
+
"x86-linux"
|
47
|
+
when /\Ax86_64.*(darwin|macos|osx)/
|
48
|
+
"x86_64-darwin"
|
49
|
+
when /\A(arm64|aarch64).*(darwin|macos|osx)/
|
50
|
+
"arm64-darwin"
|
51
|
+
else
|
52
|
+
@host
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def target_platform
|
57
|
+
@target_platform ||=
|
58
|
+
case ENV["target_platform"]
|
59
|
+
when /\A(arm64|aarch64).*(darwin|macos|osx)/
|
60
|
+
"arm64-darwin"
|
61
|
+
when /\Ac86_64.*(darwin|macos|osx)/
|
62
|
+
"x86_64-darwin"
|
63
|
+
when /\A(arm64|aarch64).*linux/
|
64
|
+
"arm64-linux"
|
65
|
+
else
|
66
|
+
ENV["target_platform"] || host_platform
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def target_triplet
|
71
|
+
@target_triplet ||=
|
72
|
+
case target_platform
|
73
|
+
when "arm64-darwin"
|
74
|
+
"arm64-osx"
|
75
|
+
when "x86_64-darwin"
|
76
|
+
"x86_64-osx"
|
77
|
+
else
|
78
|
+
target_platform
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
83
|
+
# rubocop:enable Metrics/MethodLength
|
84
|
+
|
85
|
+
def cross_compiling?
|
86
|
+
not host_platform.eql? target_platform
|
87
|
+
end
|
88
|
+
|
31
89
|
def checkpoint
|
32
|
-
File.join(@target, "#{name}-#{version}-#{
|
90
|
+
File.join(@target, "#{name}-#{version}-#{target_platform}.installed")
|
33
91
|
end
|
34
92
|
|
35
93
|
def configure_defaults
|
@@ -37,10 +95,15 @@ module Emf2svg
|
|
37
95
|
|
38
96
|
opts << "-DCMAKE_BUILD_TYPE=Release"
|
39
97
|
|
40
|
-
if MiniPortile.windows?
|
98
|
+
if MiniPortile.windows? || cross_compiling?
|
41
99
|
opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
|
42
100
|
end
|
43
101
|
|
102
|
+
if cross_compiling? && (not MiniPortile.windows?)
|
103
|
+
message("Cross-compiling on #{host_platform} for #{target_platform}\n")
|
104
|
+
opts << "-DVCPKG_TARGET_TRIPLET=#{target_triplet}"
|
105
|
+
end
|
106
|
+
|
44
107
|
opts
|
45
108
|
end
|
46
109
|
|
data/lib/emf2svg/version.rb
CHANGED
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.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
requirements:
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 2.
|
112
|
+
version: 2.5.0
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|