emf2svg 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +17 -0
- data/README.adoc +121 -52
- data/lib/emf2svg/recipe.rb +1 -1
- data/lib/emf2svg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d18e8fc4d10e249a94a57ea78a0418e2de281149c041bed9caafb2e77b3e6a25
|
4
|
+
data.tar.gz: fd5c93bffce5d914332f285b9c5c804eacbdadc2c828d9d4e94cbbac6240e103
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97467ce33575e2cc33c362fd18ce0ba3d543c431a465d8a17224e42e64e8343f0f59b623cc7cd87dca073dc7746eacdb947c2cf2efc263daed131775766a8fd1
|
7
|
+
data.tar.gz: f1007832fcc73405f5132f5bf253905903d22eabac0d9994fc076988480cc4369ed96b57edbc0e56bf061bfebbb15de665878ac5e47534be57eeac8bec8b0559
|
data/.github/workflows/build.yml
CHANGED
@@ -38,6 +38,7 @@ jobs:
|
|
38
38
|
- run: bundle exec rake
|
39
39
|
|
40
40
|
build:
|
41
|
+
name: build ${{ matrix.os }}, ${{ matrix.ruby-version }}, ${{ matrix.platform }}
|
41
42
|
runs-on: ${{ matrix.os }}
|
42
43
|
strategy:
|
43
44
|
fail-fast: false
|
@@ -46,18 +47,23 @@ jobs:
|
|
46
47
|
- os: ubuntu-18.04
|
47
48
|
platform: any
|
48
49
|
ruby-version: '2.7'
|
50
|
+
file: 'skip'
|
49
51
|
- os: ubuntu-18.04
|
50
52
|
platform: x86_64-linux
|
51
53
|
ruby-version: '2.7'
|
54
|
+
file: 'ELF 64-bit LSB shared object, x86-64'
|
52
55
|
- os: windows-latest
|
53
56
|
platform: x64-mingw32
|
54
57
|
ruby-version: '2.7'
|
58
|
+
file: 'skip'
|
55
59
|
- os: windows-latest
|
56
60
|
platform: x64-mingw-ucrt
|
57
61
|
ruby-version: '3.1'
|
62
|
+
file: 'skip'
|
58
63
|
- os: macos-latest
|
59
64
|
platform: x86_64-darwin
|
60
65
|
ruby-version: '2.7'
|
66
|
+
file: 'Mach-O 64-bit dynamically linked shared library x86_64'
|
61
67
|
steps:
|
62
68
|
- uses: actions/checkout@v3
|
63
69
|
|
@@ -86,6 +92,10 @@ jobs:
|
|
86
92
|
run: |
|
87
93
|
ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
|
88
94
|
|
95
|
+
- name: Check file format
|
96
|
+
if: matrix.file != 'skip'
|
97
|
+
run: file $(ls pkg/*/lib/emf2svg/libemf2svg.*) | grep "${{ matrix.file }}"
|
98
|
+
|
89
99
|
test-build:
|
90
100
|
needs: build
|
91
101
|
runs-on: ${{ matrix.os }}
|
@@ -149,16 +159,20 @@ jobs:
|
|
149
159
|
ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
|
150
160
|
|
151
161
|
cross:
|
162
|
+
name: build ${{ matrix.os }}, ${{ matrix.ruby-version }}, ${{ matrix.platform }}
|
152
163
|
runs-on: ${{ matrix.os }}
|
153
164
|
strategy:
|
165
|
+
fail-fast: false
|
154
166
|
matrix:
|
155
167
|
include:
|
156
168
|
- os: ubuntu-latest
|
157
169
|
platform: aarch64-linux
|
158
170
|
ruby-version: '2.7'
|
171
|
+
file: 'ELF 64-bit LSB shared object, ARM aarch64'
|
159
172
|
- os: macos-latest
|
160
173
|
platform: arm64-darwin
|
161
174
|
ruby-version: '2.7'
|
175
|
+
file: 'Mach-O 64-bit dynamically linked shared library arm64'
|
162
176
|
steps:
|
163
177
|
- uses: actions/checkout@v3
|
164
178
|
|
@@ -182,3 +196,6 @@ jobs:
|
|
182
196
|
|
183
197
|
- name: Install gem
|
184
198
|
run: gem install -b pkg/emf2svg-*.gem
|
199
|
+
|
200
|
+
- name: Check file format
|
201
|
+
run: file $(ls pkg/*/lib/emf2svg/libemf2svg.*) | grep "${{ matrix.file }}"
|
data/README.adoc
CHANGED
@@ -1,18 +1,23 @@
|
|
1
|
+
= emf2svg Ruby gem for EMF to SVG conversion
|
2
|
+
|
1
3
|
image:https://github.com/metanorma/emf2svg-ruby/actions/workflows/build.yml/badge.svg["Build", link="https://github.com/metanorma/emf2svg-ruby/actions/workflows/build.yml"]
|
2
4
|
image:https://badge.fury.io/rb/emf2svg.svg["Gem Version", link="https://badge.fury.io/rb/emf2svg"]
|
3
5
|
|
6
|
+
== Purpose
|
7
|
+
|
8
|
+
The `emf2svg` Ruby gem provides a Ruby interface to the
|
9
|
+
https://github.com/kakwa/libemf2svg[libemf2svg] EMF-to-SVG conversion library.
|
10
|
+
|
11
|
+
NOTE: This gem currently uses the
|
12
|
+
https://github.com/metanorma/libemf2svg[Metanorma fork of libemf2svg]
|
13
|
+
until feature up-streaming is complete.
|
4
14
|
|
5
|
-
|
15
|
+
== Prerequisites
|
6
16
|
|
7
|
-
|
8
|
-
emf2svg-ruby provides Ruby front-end to emf to svg converter https://github.com/kakwa/libemf2svg (temporarily using
|
9
|
-
the https://github.com/metanorma/libemf2svg[Metanorma fork] until upstreaming
|
10
|
-
is complete).
|
17
|
+
* Ruby version >= 2.6
|
11
18
|
|
12
|
-
==
|
13
|
-
Ruby >= 2.6
|
19
|
+
== Install
|
14
20
|
|
15
|
-
== Installation
|
16
21
|
Install the gem directly:
|
17
22
|
|
18
23
|
[source,sh]
|
@@ -27,28 +32,100 @@ Or add it to your `Gemfile`:
|
|
27
32
|
gem 'emf2svg'
|
28
33
|
----
|
29
34
|
|
30
|
-
|
31
|
-
|
32
|
-
|
35
|
+
NOTE: For more information on how to install by compiling from source, see
|
36
|
+
<<install-from-source>>.
|
37
|
+
|
38
|
+
|
39
|
+
== Usage
|
40
|
+
|
41
|
+
This gem provides an interface to `libemf2svg`, allowing your Ruby code to
|
42
|
+
directly utilize EMF to SVG conversion facilities.
|
43
|
+
|
44
|
+
There are two ways to provide EMF data to `emf2svg`.
|
45
|
+
|
46
|
+
=== Loading from file
|
47
|
+
|
48
|
+
`Emf2svg.from_file`:: Loads an EMF file directly from the filesystem.
|
49
|
+
|
50
|
+
[example]
|
51
|
+
.Example of using `Emf2svg.from_file` and exporting an SVG file
|
52
|
+
====
|
53
|
+
[source,ruby]
|
54
|
+
----
|
55
|
+
require "emf2svg"
|
56
|
+
|
57
|
+
data = Emf2svg.from_file("example.emf")
|
58
|
+
File.write("output.svg", data, mode: "wb")
|
59
|
+
----
|
60
|
+
====
|
61
|
+
|
62
|
+
=== Loading binary data
|
63
|
+
|
64
|
+
`Emf2svg.from_binary_string`:: Loads EMF content from binary form.
|
65
|
+
|
66
|
+
[example]
|
67
|
+
.Example of using `Emf2svg.from_binary_string` and exporting an SVG file
|
68
|
+
====
|
69
|
+
[source,ruby]
|
70
|
+
----
|
71
|
+
require "emf2svg"
|
72
|
+
|
73
|
+
emf_content = File.read("example.emf", mode: "rb")
|
74
|
+
svg_data = Emf2svg.from_binary_string(emf_content)
|
75
|
+
File.write("output.svg", svg_data, mode: "wb")
|
76
|
+
----
|
77
|
+
====
|
78
|
+
|
79
|
+
|
80
|
+
[[packaging]]
|
81
|
+
== Packaging
|
82
|
+
|
83
|
+
=== Pre-compiled extensions or building from source
|
84
|
+
|
85
|
+
This gem is distributed with pre-compiled native extensions for a set of
|
86
|
+
supported machine architectures.
|
87
|
+
|
88
|
+
On supported platforms, this removes the need for compiling the C extension and
|
89
|
+
the installation of system dependencies. This results in much faster and a more
|
90
|
+
reliable installation step.
|
91
|
+
|
92
|
+
The pre-compiled platforms are:
|
33
93
|
|
34
|
-
|
35
|
-
*
|
36
|
-
*
|
37
|
-
*
|
38
|
-
*
|
39
|
-
* x64-
|
40
|
-
* x64-mingw-ucrt
|
94
|
+
* `x86_64-linux` (GNU and `musl` flavors)
|
95
|
+
* `aarch64-linux` (GNU and `musl` flavors)
|
96
|
+
* `x86_64-darwin`
|
97
|
+
* `arm64-darwin`
|
98
|
+
* `x64-mingw32`
|
99
|
+
* `x64-mingw-ucrt`
|
41
100
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
101
|
+
When installing the gem, Ruby will automatically select a pre-compiled version
|
102
|
+
suitable for your platform, or opt to install from source if the platform
|
103
|
+
is not supported.
|
104
|
+
|
105
|
+
[[install-from-source]]
|
106
|
+
=== Installing from source
|
107
|
+
|
108
|
+
==== General
|
109
|
+
|
110
|
+
For platforms that require compilation, the `emf2svg` build script will
|
111
|
+
automatically compile the native extension locally.
|
112
|
+
|
113
|
+
The `emf2svg` build script maintains and installs all required libraries and
|
114
|
+
other dependencies using the `vcpkg` package manager.
|
115
|
+
|
116
|
+
Prior to installation, the system must already have install the appropriate
|
117
|
+
build system (such as `gcc`, `clang` or Visual Studio), and CMake.
|
118
|
+
|
119
|
+
==== Build prerequisites by platform
|
46
120
|
|
47
121
|
==== Windows
|
48
122
|
|
49
|
-
On Windows all necessary libraries are
|
50
|
-
Studio 2019 with C++ Build Tools
|
51
|
-
|
123
|
+
On Windows, while all necessary libraries are already pre-compiled, Visual
|
124
|
+
Studio 2019 with C++ Build Tools still need to be installed.
|
125
|
+
|
126
|
+
They can be downloaded
|
127
|
+
https://visualstudio.microsoft.com/downloads/[here], or installed with
|
128
|
+
Chocolatey:
|
52
129
|
|
53
130
|
[source,sh]
|
54
131
|
----
|
@@ -57,56 +134,45 @@ choco install visualstudio2019buildtools -y --no-progress --package-parameters "
|
|
57
134
|
|
58
135
|
==== macOS
|
59
136
|
|
137
|
+
On macOS, CMake needs to be installed.
|
138
|
+
|
60
139
|
[source,sh]
|
61
140
|
----
|
62
141
|
brew install cmake
|
63
142
|
----
|
64
143
|
|
65
|
-
==== Linux
|
144
|
+
==== Linux: Debian
|
66
145
|
|
67
|
-
|
146
|
+
On Debian, the following build tools need to be installed.
|
68
147
|
|
69
148
|
[source,sh]
|
70
149
|
----
|
71
|
-
# compiler
|
150
|
+
# Choose your preferred compiler
|
151
|
+
# GCC
|
72
152
|
apt-get install gcc g++ gperf cmake pkg-config
|
73
153
|
# or
|
154
|
+
# clang
|
74
155
|
apt-get install clang gperf cmake pkg-config
|
75
156
|
----
|
76
157
|
|
77
|
-
|
158
|
+
NOTE: On Debian systems, there exists a
|
159
|
+
https://github.com/microsoft/vcpkg/issues/15931[vcpkg bug] that needs to be
|
160
|
+
addressed by installing the `gperf` package in addition to other build tools.
|
78
161
|
|
79
|
-
|
80
|
-
----
|
81
|
-
yum install cmake gcc-c++ gcc
|
82
|
-
----
|
83
|
-
|
84
|
-
== Usage
|
85
|
-
|
86
|
-
This gem embeds libemf2svg, allowing your Ruby code to utilize EMF to SVG
|
87
|
-
conversion facilities.
|
162
|
+
==== Linux: Fedora
|
88
163
|
|
89
|
-
|
90
|
-
----
|
91
|
-
require "emf2svg"
|
164
|
+
On Fedora, the following build tools need to be installed.
|
92
165
|
|
93
|
-
|
94
|
-
File.write("output.svg", data, mode: "wb")
|
166
|
+
[source,sh]
|
95
167
|
----
|
96
|
-
|
97
|
-
It also can use content of emf as an input:
|
98
|
-
|
99
|
-
[source,ruby]
|
168
|
+
yum install cmake gcc-c++ gcc
|
100
169
|
----
|
101
|
-
require "emf2svg"
|
102
170
|
|
103
|
-
emf_content = File.read("example.emf", mode: "rb")
|
104
|
-
svg_data = Emf2svg.from_binary_string(emf_content)
|
105
|
-
File.write("output.svg", svg_data, mode: "wb")
|
106
|
-
----
|
107
171
|
|
108
172
|
== Development
|
109
173
|
|
174
|
+
=== Basic steps
|
175
|
+
|
110
176
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
111
177
|
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
112
178
|
prompt that will allow you to experiment.
|
@@ -117,6 +183,7 @@ release a new version, update the version number in `version.rb`, and then run
|
|
117
183
|
git commits and the created tag, and push the `.gem` file to
|
118
184
|
https://rubygems.org[rubygems.org].
|
119
185
|
|
186
|
+
|
120
187
|
=== Releasing
|
121
188
|
|
122
189
|
Releasing is done automatically with GitHub Actions. Just bump and tag with
|
@@ -136,6 +203,7 @@ For a minor release (0.x.0) use:
|
|
136
203
|
gem bump --version minor --tag --push
|
137
204
|
----
|
138
205
|
|
206
|
+
|
139
207
|
== Contributing
|
140
208
|
|
141
209
|
Bug reports and pull requests are welcome on GitHub at
|
@@ -144,6 +212,7 @@ safe, welcoming space for collaboration, and contributors are expected to adhere
|
|
144
212
|
to the
|
145
213
|
https://github.com/metanorma/emf2svg-ruby/blob/master/CODE_OF_CONDUCT.md[code of conduct].
|
146
214
|
|
215
|
+
|
147
216
|
== Code of Conduct
|
148
217
|
|
149
218
|
Everyone interacting in the emf2svg project's codebases, issue trackers, chat
|
data/lib/emf2svg/recipe.rb
CHANGED
@@ -99,7 +99,7 @@ module Emf2svg
|
|
99
99
|
opts << "-DLONLY=ON"
|
100
100
|
|
101
101
|
unless target_triplet.nil? || drop_target_triplet?
|
102
|
-
opts << "
|
102
|
+
opts << "-DVCPKG_TARGET_TRIPLET=#{target_triplet}"
|
103
103
|
end
|
104
104
|
|
105
105
|
opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
|
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.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|