emf2svg 1.8.2.1 → 1.8.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 538e00319831dda7add43b965668d972e69d24aea07e84d9a5d25dffb2a7e8b0
4
- data.tar.gz: 767056c9c62621aac370eb67ec6fab184ce815d8a3246c923b1ad568d4b9963b
3
+ metadata.gz: 19c3fdd0a05e010deec1fd9a81c7a4a50975bd7aa7825e2a786e6c26bb6aa7b7
4
+ data.tar.gz: b813a36aa0144ac7bce9c04e24fd2c552fe71406f0c4b43cc8c8541184962be5
5
5
  SHA512:
6
- metadata.gz: 37a2a3f284f0fdea54642343aa4f6c72f74400c657f17ac8c8d63375fdb776597bd923e05c3818da6df8df4b26bfa5f993696a03087d1777625525a583b73487
7
- data.tar.gz: f6cb40efb341c5d63a942495105d9da1c61c48ed0f7bf253ce645c6e76a947e706fed092bbd89ac973283190802b1cb461b292b6180e9ea5685be8dc7914dd5d
6
+ metadata.gz: 5128fcb2a6231aa98a628b3e311f3fce40c166fdea817167064f0d047090055db7068379331ee20786eeff7d3b7e10e096f2377d400515877e1bcb6c3893c3a8
7
+ data.tar.gz: 7458d9fac36d80421280ed1947690dfc09bc7d03533e4c3ba20b53c86f96012de1f212c9e2ef551269f5875de84aa28590b87c3a934d83703600ca62d99c63e4
@@ -72,13 +72,22 @@ jobs:
72
72
  - os: ubuntu-latest
73
73
  platform: x86_64-linux
74
74
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
75
+ - os: ubuntu-24.04-arm
76
+ platform: aarch64-linux
77
+ ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
75
78
  - os: windows-latest
76
79
  platform: x64-mingw32
77
80
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
78
81
  - os: windows-latest
79
82
  platform: x64-mingw-ucrt
80
83
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
84
+ - os: windows-11-arm
85
+ platform: aarch64-mingw-ucrt
86
+ ruby-version: '3.4'
81
87
  - os: macos-latest
88
+ platform: arm64-darwin
89
+ ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
90
+ - os: macos-15-intel
82
91
  platform: x86_64-darwin
83
92
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
84
93
  steps:
@@ -114,8 +123,19 @@ jobs:
114
123
  name: pkg-${{ matrix.platform }}
115
124
  path: pkg/*.gem
116
125
 
117
- cross-build:
118
- name: build ${{ matrix.os }}, ${{ matrix.ruby-version }}, ${{ matrix.platform }}
126
+ # Musl builds run inside an Alpine container so the resulting libs
127
+ # link against musl libc, not the runner's glibc. They link against
128
+ # the distro's own -dev packages (freetype/fontconfig/libxml2/libpng)
129
+ # via pkg-config -- vcpkg has no public binary cache for musl
130
+ # triplets, so building deps from source would exceed CI timeouts.
131
+ #
132
+ # GitHub Actions does not allow JS-based actions (checkout, upload-
133
+ # artifact, etc.) inside an Alpine container on ARM64 runners
134
+ # (limitation noted at actions/runner#2006). We therefore do the
135
+ # checkout and artifact upload on the host, and run the actual build
136
+ # via `docker run` with the workspace mounted.
137
+ build-musl:
138
+ name: build-musl ${{ matrix.os }}, ${{ matrix.platform }}
119
139
  runs-on: ${{ matrix.os }}
120
140
  needs: prepare
121
141
  strategy:
@@ -123,38 +143,34 @@ jobs:
123
143
  matrix:
124
144
  include:
125
145
  - os: ubuntu-latest
126
- platform: aarch64-linux
127
- ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
128
- - os: macos-latest
129
- platform: arm64-darwin
130
- ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
146
+ platform: x86_64-linux-musl
147
+ - os: ubuntu-24.04-arm
148
+ platform: aarch64-linux-musl
131
149
  steps:
132
150
  - uses: actions/checkout@v4
133
151
 
134
- - name: Install Ubuntu packages
135
- if: startsWith(matrix.os, 'ubuntu')
152
+ - name: Build gem in Alpine container
153
+ env:
154
+ TARGET_PLATFORM: ${{ matrix.platform }}
136
155
  run: |
137
- sudo apt-get update
138
- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf autoconf autoconf-archive automake libtool
139
-
140
- - name: Install macOS packages
141
- if: startsWith(matrix.os, 'macos')
142
- run: brew install gperf autoconf autoconf-archive automake libtool
143
-
144
- - name: Install Ruby
145
- uses: ruby/setup-ruby@master
146
- with:
147
- ruby-version: ${{ matrix.ruby-version }}
148
- bundler-cache: true
149
-
150
- - name: Build native extension
151
- run: bundle exec rake gem:native:${{ matrix.platform }}
152
-
153
- - if: matrix.platform != 'aarch64-linux'
154
- uses: metanorma/ci/native-deps-action@main
155
- with:
156
- libname: emf2svg
157
- directory: lib/emf2svg
156
+ docker run --rm \
157
+ -v "$PWD:/work" \
158
+ -w /work \
159
+ -e target_platform="${TARGET_PLATFORM}" \
160
+ alpine:3.20 sh -c '
161
+ set -eux
162
+ apk add --no-cache \
163
+ build-base bash curl git cmake make ninja gcc g++ gperf \
164
+ automake autoconf autoconf-archive libtool linux-headers \
165
+ perl zip unzip tar python3 pkgconfig \
166
+ freetype-dev fontconfig-dev libpng-dev libxml2-dev \
167
+ gettext-dev zlib-dev \
168
+ ruby ruby-dev ruby-bundler ruby-rake file
169
+ git config --global --add safe.directory /work
170
+ bundle config set --local path vendor/bundle
171
+ bundle install --jobs 4 --retry 3
172
+ bundle exec rake gem:native:"'"${TARGET_PLATFORM}"'"
173
+ '
158
174
 
159
175
  - uses: actions/upload-artifact@v4
160
176
  with:
@@ -162,7 +178,7 @@ jobs:
162
178
  path: pkg/*.gem
163
179
 
164
180
  test-build:
165
- needs: [ prepare, build, cross-build ]
181
+ needs: [ prepare, build, build-musl ]
166
182
  runs-on: ${{ matrix.os }}
167
183
 
168
184
  continue-on-error: ${{ matrix.ruby.experimental }}
@@ -194,7 +210,7 @@ jobs:
194
210
  ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
195
211
 
196
212
  test-build-any:
197
- needs: [ prepare, build, cross-build ]
213
+ needs: [ prepare, build, build-musl ]
198
214
  runs-on: ${{ matrix.os }}
199
215
 
200
216
  continue-on-error: ${{ matrix.ruby.experimental }}
@@ -130,15 +130,24 @@ jobs:
130
130
  - os: ubuntu-latest
131
131
  platform: x86_64-linux
132
132
  ruby-version: '3.3'
133
+ - os: ubuntu-24.04-arm
134
+ platform: aarch64-linux
135
+ ruby-version: '3.3'
133
136
  - os: windows-latest
134
137
  platform: x64-mingw32
135
138
  ruby-version: '3.3'
136
139
  - os: windows-latest
137
140
  platform: x64-mingw-ucrt
138
141
  ruby-version: '3.3'
142
+ - os: windows-11-arm
143
+ platform: aarch64-mingw-ucrt
144
+ ruby-version: '3.4'
139
145
  - os: macos-latest
140
146
  platform: arm64-darwin
141
147
  ruby-version: '3.3'
148
+ - os: macos-15-intel
149
+ platform: x86_64-darwin
150
+ ruby-version: '3.3'
142
151
  steps:
143
152
  - uses: actions/checkout@v4
144
153
  with:
@@ -174,7 +183,16 @@ jobs:
174
183
  run: |
175
184
  ruby -remf2svg -e "puts File.write('output.svg', Emf2svg.from_file('spec/examples/image1.emf'), mode: 'wb')"
176
185
 
177
- cross:
186
+ # Musl builds run inside an Alpine container so the resulting libs
187
+ # link against musl libc, not the runner's glibc. They link against
188
+ # the distro's own -dev packages (freetype/fontconfig/libxml2/libpng)
189
+ # via pkg-config -- vcpkg has no public binary cache for musl
190
+ # triplets, so building deps from source would exceed CI timeouts.
191
+ #
192
+ # GitHub Actions does not allow JS-based actions inside an Alpine
193
+ # container on ARM64 runners. We do checkout + artifact on the host
194
+ # and run the build via `docker run` with the workspace mounted.
195
+ build-musl:
178
196
  needs: bump
179
197
  if: always() && !cancelled() && !failure() && (needs.bump.result == 'success' || needs.bump.result == 'skipped')
180
198
  runs-on: ${{ matrix.os }}
@@ -183,43 +201,44 @@ jobs:
183
201
  matrix:
184
202
  include:
185
203
  - os: ubuntu-latest
186
- platform: aarch64-linux
187
- ruby-version: '3.3'
188
- - os: macos-latest
189
- platform: x86_64-darwin
190
- ruby-version: '3.3'
204
+ platform: x86_64-linux-musl
205
+ - os: ubuntu-24.04-arm
206
+ platform: aarch64-linux-musl
191
207
  steps:
192
208
  - uses: actions/checkout@v4
193
209
  with:
194
210
  ref: ${{ needs.bump.outputs.sha || github.ref }}
195
211
 
196
- - name: Install Ubuntu packages
197
- if: startsWith(matrix.os, 'ubuntu')
212
+ - name: Build gem in Alpine container
213
+ env:
214
+ TARGET_PLATFORM: ${{ matrix.platform }}
198
215
  run: |
199
- sudo apt-get update
200
- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf autoconf autoconf-archive automake libtool
201
-
202
- - name: Install macOS packages
203
- if: startsWith(matrix.os, 'macos')
204
- run: brew install gperf autoconf autoconf-archive automake libtool
205
-
206
- - uses: ruby/setup-ruby@master
207
- with:
208
- ruby-version: ${{ matrix.ruby-version }}
209
- bundler-cache: true
210
-
211
- - run: bundle exec rake gem:native:${{ matrix.platform }}
216
+ docker run --rm \
217
+ -v "$PWD:/work" \
218
+ -w /work \
219
+ -e target_platform="${TARGET_PLATFORM}" \
220
+ alpine:3.20 sh -c '
221
+ set -eux
222
+ apk add --no-cache \
223
+ build-base bash curl git cmake make ninja gcc g++ gperf \
224
+ automake autoconf autoconf-archive libtool linux-headers \
225
+ perl zip unzip tar python3 pkgconfig \
226
+ freetype-dev fontconfig-dev libpng-dev libxml2-dev \
227
+ gettext-dev zlib-dev \
228
+ ruby ruby-dev ruby-bundler ruby-rake file
229
+ git config --global --add safe.directory /work
230
+ bundle config set --local path vendor/bundle
231
+ bundle install --jobs 4 --retry 3
232
+ bundle exec rake gem:native:"'"${TARGET_PLATFORM}"'"
233
+ '
212
234
 
213
235
  - uses: actions/upload-artifact@v4
214
236
  with:
215
237
  name: pkg-${{ matrix.platform }}
216
238
  path: pkg/*.gem
217
239
 
218
- - name: Install gem
219
- run: gem install -b pkg/emf2svg-*.gem
220
-
221
240
  publish:
222
- needs: [ bump, build, cross ]
241
+ needs: [ bump, build, build-musl ]
223
242
  if: always() && !cancelled() && !failure()
224
243
  runs-on: ubuntu-latest
225
244
  steps:
data/README.adoc CHANGED
@@ -149,12 +149,15 @@ reliable installation step.
149
149
 
150
150
  The pre-compiled platforms are:
151
151
 
152
- * `x86_64-linux` (GNU and `musl` flavors)
153
- * `aarch64-linux` (GNU and `musl` flavors)
152
+ * `x86_64-linux` (glibc)
153
+ * `x86_64-linux-musl` (Alpine and other musl-based distros)
154
+ * `aarch64-linux` (glibc)
155
+ * `aarch64-linux-musl` (Alpine and other musl-based distros)
154
156
  * `x86_64-darwin`
155
157
  * `arm64-darwin`
156
- * `x64-mingw32`
157
- * `x64-mingw-ucrt`
158
+ * `x64-mingw32` (legacy RubyInstaller < 3.0)
159
+ * `x64-mingw-ucrt` (RubyInstaller >= 3.1)
160
+ * `aarch64-mingw-ucrt` (Windows on ARM)
158
161
 
159
162
  When installing the gem, Ruby will automatically select a pre-compiled version
160
163
  suitable for your platform, or opt to install from source if the platform
data/Rakefile CHANGED
@@ -34,8 +34,11 @@ end
34
34
  platforms = [
35
35
  "x64-mingw32",
36
36
  "x64-mingw-ucrt",
37
+ "aarch64-mingw-ucrt",
37
38
  "x86_64-linux",
39
+ "x86_64-linux-musl",
38
40
  "aarch64-linux",
41
+ "aarch64-linux-musl",
39
42
  "x86_64-darwin",
40
43
  "arm64-darwin",
41
44
  ]
@@ -38,9 +38,14 @@ module Emf2svg
38
38
 
39
39
  # Since libemf2svg v1.8.2 the source tarball no longer bundles the
40
40
  # vcpkg tool (it moved too fast to ship as a snapshot). We bootstrap
41
- # vcpkg into the work path before CMake configure runs.
41
+ # vcpkg into the work path before CMake configure runs -- unless
42
+ # we're targeting musl, in which case vcpkg has no public binary
43
+ # cache for arm64-linux-musl / x64-linux-musl and would compile
44
+ # every dependency from source (hours). For musl we use the
45
+ # distribution's own -dev packages (freetype, fontconfig, etc.)
46
+ # via pkg-config instead.
42
47
  def configure
43
- bootstrap_vcpkg
48
+ bootstrap_vcpkg unless use_system_libs?
44
49
  export_toolchain_to_env
45
50
  super
46
51
  end
@@ -92,6 +97,11 @@ module Emf2svg
92
97
  end
93
98
 
94
99
  def drop_target_triplet?
100
+ # Windows ARM64 builds against MSVC with static linking. vcpkg's
101
+ # auto-detection would pick arm64-windows (dynamic) instead of
102
+ # arm64-windows-static, so always pass the triplet explicitly.
103
+ return false if target_platform == "aarch64-mingw-ucrt"
104
+
95
105
  windows_native? || host_platform.eql?(target_platform)
96
106
  end
97
107
 
@@ -105,15 +115,25 @@ module Emf2svg
105
115
  opts << "-DCMAKE_BUILD_TYPE=Release"
106
116
  opts << "-DLONLY=ON"
107
117
 
108
- unless target_triplet.nil? || drop_target_triplet?
109
- opts << "-DVCPKG_TARGET_TRIPLET=#{target_triplet}"
118
+ unless use_system_libs?
119
+ unless target_triplet.nil? || drop_target_triplet?
120
+ opts << "-DVCPKG_TARGET_TRIPLET=#{target_triplet}"
121
+ end
122
+ opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
110
123
  end
111
124
 
112
- opts << "-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
113
-
114
125
  opts
115
126
  end
116
127
 
128
+ # Musl builds link against the distro's own -dev packages
129
+ # (freetype, fontconfig, libxml2, libpng) via pkg-config. This
130
+ # sidesteps vcpkg's lack of a public binary cache for musl
131
+ # triplets, which otherwise forces from-source compiles that
132
+ # exceed CI timeouts.
133
+ def use_system_libs?
134
+ target_platform.end_with?("-linux-musl")
135
+ end
136
+
117
137
  def compile
118
138
  execute("compile", "#{make_cmd} --target emf2svg")
119
139
  end
@@ -189,6 +209,12 @@ module Emf2svg
189
209
  case @host
190
210
  when /\Ax86_64.*mingw32/
191
211
  "x64-mingw32"
212
+ when /\A(aarch64|arm64).*mingw.*ucrt/
213
+ "aarch64-mingw-ucrt"
214
+ when /\Ax86_64.*linux-musl/
215
+ "x86_64-linux-musl"
216
+ when /\A(arm64|aarch64).*linux-musl/
217
+ "aarch64-linux-musl"
192
218
  when /\Ax86_64.*linux/
193
219
  "x86_64-linux"
194
220
  when /\A(arm64|aarch64).*linux/
@@ -209,8 +235,14 @@ module Emf2svg
209
235
  "arm64-darwin"
210
236
  when /\Ax86_64.*(darwin|macos|osx)/
211
237
  "x86_64-darwin"
238
+ when /\A(arm64|aarch64).*linux-musl/
239
+ "aarch64-linux-musl"
240
+ when /\Ax86_64.*linux-musl/
241
+ "x86_64-linux-musl"
212
242
  when /\A(arm64|aarch64).*linux/
213
243
  "aarch64-linux"
244
+ when /\Aaarch64-mingw-ucrt/, /\A(arm64|aarch64).*mingw.*ucrt/
245
+ "aarch64-mingw-ucrt"
214
246
  else
215
247
  ENV.fetch("target_platform", host_platform)
216
248
  end
@@ -225,8 +257,14 @@ module Emf2svg
225
257
  "x64-osx"
226
258
  when "aarch64-linux"
227
259
  "arm64-linux"
260
+ when "aarch64-linux-musl"
261
+ "arm64-linux-musl"
228
262
  when "x86_64-linux"
229
263
  "x64-linux"
264
+ when "x86_64-linux-musl"
265
+ "x64-linux-musl"
266
+ when "aarch64-mingw-ucrt"
267
+ "arm64-windows-static"
230
268
  when /\Ax64-mingw(32|-ucrt)/
231
269
  "x64-mingw-static"
232
270
  end
@@ -239,14 +277,16 @@ module Emf2svg
239
277
  /Mach-O 64-bit dynamically linked shared library arm64/
240
278
  when "x86_64-darwin"
241
279
  /Mach-O 64-bit dynamically linked shared library x86_64/
242
- when "aarch64-linux"
280
+ when "aarch64-linux", "aarch64-linux-musl"
243
281
  /ELF 64-bit LSB shared object, ARM aarch64/
244
- when "x86_64-linux"
282
+ when "x86_64-linux", "x86_64-linux-musl"
245
283
  /ELF 64-bit LSB shared object, x86-64/
284
+ when "aarch64-mingw-ucrt"
285
+ # `file` prints "PE32+ executable for MS Windows 6.02 (DLL),
286
+ # ARM64, 6 sections". Note: ARM64 (not AArch64), and (DLL)
287
+ # may appear before or after the arch token.
288
+ /PE32\+ executable.*ARM64/i
246
289
  when /\Ax64-mingw(32|-ucrt)/
247
- # Modern `file` prints e.g. "PE32+ executable for MS Windows 6.00
248
- # (DLL), x86-64, 6 sections"; older prints "PE32+ executable
249
- # (DLL) (console) x86-64, for MS Windows". Match the stable bits.
250
290
  /PE32\+ executable.*\(DLL\).*x86-64/
251
291
  else
252
292
  "skip"
@@ -13,6 +13,6 @@ module Emf2svg
13
13
  #
14
14
  # See README.adoc -> "Versioning" for the rationale and examples.
15
15
  LIBEMF2SVG_VERSION = "1.8.2"
16
- LIBEMF2SVG_RUBY_ITERATION = 1
16
+ LIBEMF2SVG_RUBY_ITERATION = 3
17
17
  VERSION = "#{LIBEMF2SVG_VERSION}.#{LIBEMF2SVG_RUBY_ITERATION}"
18
18
  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.8.2.1
4
+ version: 1.8.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-25 00:00:00.000000000 Z
11
+ date: 2026-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi