libpng 1.6.58.0 → 1.6.58.1

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: 424bb2ec057dfcb24902b7d42a4ca73936d54cd30ca0cbdb81df8277a97d3ba1
4
- data.tar.gz: f424a0836d9ce74aaccacd16ab7aa6cb60aee534576b25a72a4d22d9752b4adc
3
+ metadata.gz: 91ec3180573925adf91a3fb1463a008d05a113f633ca4a4dcd00546008585699
4
+ data.tar.gz: 34cc29c477d3bd9939067304ef3fc21357b773df42022bf16c6ef52323f25c5b
5
5
  SHA512:
6
- metadata.gz: dd873ee26bb9b3a7e2c52cded5e501de1ed59bc1c1250132c60ef71ffdc99af9e5d6a09aa3399f5ddee3eff7a4ced98772fa3eb2f058076e7410e770bd0225ea
7
- data.tar.gz: 40b078365a95aff0413904b94092eed3f76f6f0cc42dd637d5b16c1ee1d72fe2cb05c89ac9f0513f140591dc28ccbc84f997dc3f64ed0e03e53487dd04b9da70
6
+ metadata.gz: 4489b62efba7933a588fabafd4d0cb65122a77d0a363a476a80db1e726affcffbe70a02ac7783b916b867d59ad9a0f6ebd1319d12421a3ab65e74d92822e143c
7
+ data.tar.gz: 34042f2512c7234881c36bbcb140b283f267288d7b0575a71131773a681419f5542b9419de40355a5190050f9415b0081af3396e7115153fb6026575b58d5415
@@ -53,7 +53,7 @@ jobs:
53
53
 
54
54
  - name: Install build tools (Windows)
55
55
  if: startsWith(matrix.os, 'windows')
56
- uses: ilammy/msvc-dev-tools@v1
56
+ uses: step-security/msvc-dev-cmd@v1
57
57
 
58
58
  - run: bundle exec rake
59
59
 
@@ -71,15 +71,24 @@ jobs:
71
71
  - os: ubuntu-latest
72
72
  platform: x86_64-linux
73
73
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
74
+ - os: ubuntu-24.04-arm
75
+ platform: aarch64-linux
76
+ ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
74
77
  - os: windows-latest
75
78
  platform: x64-mingw32
76
79
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
77
80
  - os: windows-latest
78
81
  platform: x64-mingw-ucrt
79
82
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
80
- - os: macos-latest
83
+ - os: windows-11-arm
84
+ platform: aarch64-mingw-ucrt
85
+ ruby-version: '3.4'
86
+ - os: macos-15-intel
81
87
  platform: x86_64-darwin
82
88
  ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
89
+ - os: macos-latest
90
+ platform: arm64-darwin
91
+ ruby-version: ${{ needs.prepare.outputs.default-ruby-version }}
83
92
 
84
93
  steps:
85
94
  - uses: actions/checkout@v4
@@ -103,7 +112,9 @@ jobs:
103
112
 
104
113
  - name: Install build tools (Windows)
105
114
  if: startsWith(matrix.os, 'windows')
106
- uses: ilammy/msvc-dev-tools@v1
115
+ uses: step-security/msvc-dev-cmd@v1
116
+ with:
117
+ arch: ${{ matrix.platform == 'aarch64-mingw-ucrt' && 'arm64' || 'x64' }}
107
118
 
108
119
  - run: bundle exec rake gem:native:${{ matrix.platform }}
109
120
 
@@ -116,5 +127,64 @@ jobs:
116
127
  run: gem install -b pkg/libpng-*.gem
117
128
 
118
129
  - name: Test conversion
130
+ shell: bash
131
+ run: |
132
+ ruby -rlibpng -e 'png = Libpng.encode(2, 2, "\xff" * 16, pixel_format: "RGBA"); File.binwrite("test.png", png); puts Libpng.decode(png, pixel_format: "RGBA").inspect'
133
+
134
+ build_musl:
135
+ name: build ${{ matrix.platform }} (Alpine)
136
+ runs-on: ${{ matrix.os }}
137
+ needs: prepare
138
+ strategy:
139
+ fail-fast: false
140
+ matrix:
141
+ include:
142
+ - os: ubuntu-latest
143
+ platform: x86_64-linux-musl
144
+ - os: ubuntu-24.04-arm
145
+ platform: aarch64-linux-musl
146
+
147
+ steps:
148
+ - uses: actions/checkout@v4
149
+
150
+ # Run the entire build inside an Alpine container via `docker run` rather
151
+ # than the workflow `container:` field. The latter only works on x64
152
+ # runners (Actions' JS runtime has no arm64-musl build), but arm64 Ubuntu
153
+ # runners can run arm64 Alpine images natively via Docker.
154
+ - name: Build in Alpine container
155
+ shell: bash
156
+ env:
157
+ PLATFORM: ${{ matrix.platform }}
158
+ RUBY_VERSION: ${{ needs.prepare.outputs.default-ruby-version }}
119
159
  run: |
120
- ruby -rlibpng -e "png = Libpng.encode(2, 2, \"\\xff\" * 16, pixel_format: 'RGBA'); File.binwrite('test.png', png); puts Libpng.decode(png, pixel_format: 'RGBA').inspect"
160
+ cat > /tmp/alpine-build.sh <<'BUILD_EOF'
161
+ #!/bin/sh
162
+ set -e
163
+ apk add --no-cache build-base cmake ninja git file zlib-dev
164
+ # The mounted /work volume is owned by the host runner user; git in
165
+ # the container (running as root) refuses to operate on it without
166
+ # this. Without it, `git ls-files` in the gemspec returns empty and
167
+ # the built gem is missing lib/libpng.rb.
168
+ git config --global --add safe.directory /work
169
+ bundle install --jobs 4
170
+ bundle exec rake "gem:native:${PLATFORM}"
171
+ gem install -b pkg/libpng-*.gem
172
+ # Smoke test from /tmp so bundler's source-tree LOAD_PATH doesn't
173
+ # shadow the installed gem. Activate via `gem` so RubyGems resolves
174
+ # the platform-specific binary gem (Alpine Ruby's platform string
175
+ # is *-linux-musl, which must match the gem's platform suffix).
176
+ (cd /tmp && ruby -e 'gem "libpng"; require "libpng"; png = Libpng.encode(2, 2, "\xff" * 16, pixel_format: "RGBA"); File.binwrite("test.png", png); puts Libpng.decode(png, pixel_format: "RGBA").inspect')
177
+ BUILD_EOF
178
+ chmod +x /tmp/alpine-build.sh
179
+ docker run --rm \
180
+ -v "$PWD:/work" \
181
+ -v /tmp/alpine-build.sh:/alpine-build.sh \
182
+ -w /work \
183
+ -e PLATFORM \
184
+ ruby:${RUBY_VERSION}-alpine \
185
+ /alpine-build.sh
186
+
187
+ - uses: actions/upload-artifact@v4
188
+ with:
189
+ name: pkg-${{ matrix.platform }}
190
+ path: pkg/*.gem
@@ -129,15 +129,24 @@ jobs:
129
129
  - os: ubuntu-latest
130
130
  platform: x86_64-linux
131
131
  ruby-version: '3.3'
132
+ - os: ubuntu-24.04-arm
133
+ platform: aarch64-linux
134
+ ruby-version: '3.3'
132
135
  - os: windows-latest
133
136
  platform: x64-mingw32
134
137
  ruby-version: '3.3'
135
138
  - os: windows-latest
136
139
  platform: x64-mingw-ucrt
137
140
  ruby-version: '3.3'
138
- - os: macos-latest
141
+ - os: windows-11-arm
142
+ platform: aarch64-mingw-ucrt
143
+ ruby-version: '3.4'
144
+ - os: macos-15-intel
139
145
  platform: x86_64-darwin
140
146
  ruby-version: '3.3'
147
+ - os: macos-latest
148
+ platform: arm64-darwin
149
+ ruby-version: '3.3'
141
150
  steps:
142
151
  - uses: actions/checkout@v4
143
152
  with:
@@ -161,7 +170,9 @@ jobs:
161
170
 
162
171
  - name: Install build tools (Windows)
163
172
  if: startsWith(matrix.os, 'windows')
164
- uses: ilammy/msvc-dev-tools@v1
173
+ uses: step-security/msvc-dev-cmd@v1
174
+ with:
175
+ arch: ${{ matrix.platform == 'aarch64-mingw-ucrt' && 'arm64' || 'x64' }}
165
176
 
166
177
  - run: bundle exec rake gem:native:${{ matrix.platform }}
167
178
 
@@ -174,10 +185,11 @@ jobs:
174
185
  run: gem install -b pkg/libpng-*.gem
175
186
 
176
187
  - name: Test conversion
188
+ shell: bash
177
189
  run: |
178
- ruby -rlibpng -e "png = Libpng.encode(2, 2, \"\\xff\" * 16, pixel_format: 'RGBA'); puts Libpng.decode(png, pixel_format: 'RGBA').inspect"
190
+ ruby -rlibpng -e 'png = Libpng.encode(2, 2, "\xff" * 16, pixel_format: "RGBA"); puts Libpng.decode(png, pixel_format: "RGBA").inspect'
179
191
 
180
- cross:
192
+ build_musl:
181
193
  needs: bump
182
194
  if: always() && !cancelled() && !failure() && (needs.bump.result == 'success' || needs.bump.result == 'skipped')
183
195
  runs-on: ${{ matrix.os }}
@@ -186,43 +198,45 @@ jobs:
186
198
  matrix:
187
199
  include:
188
200
  - os: ubuntu-latest
189
- platform: aarch64-linux
190
- ruby-version: '3.3'
191
- - os: macos-latest
192
- platform: arm64-darwin
193
- ruby-version: '3.3'
201
+ platform: x86_64-linux-musl
202
+ - os: ubuntu-24.04-arm
203
+ platform: aarch64-linux-musl
194
204
  steps:
195
205
  - uses: actions/checkout@v4
196
206
  with:
197
207
  ref: ${{ needs.bump.outputs.sha || github.ref }}
198
208
 
199
- - name: Install Ubuntu cross-build packages
200
- if: startsWith(matrix.os, 'ubuntu')
209
+ - name: Build in Alpine container
210
+ shell: bash
211
+ env:
212
+ PLATFORM: ${{ matrix.platform }}
201
213
  run: |
202
- sudo apt-get update
203
- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu cmake ninja-build zlib1g-dev:arm64
204
-
205
- - name: Install macOS build packages
206
- if: startsWith(matrix.os, 'macos')
207
- run: brew install cmake ninja
208
-
209
- - uses: ruby/setup-ruby@master
210
- with:
211
- ruby-version: ${{ matrix.ruby-version }}
212
- bundler-cache: true
213
-
214
- - run: bundle exec rake gem:native:${{ matrix.platform }}
214
+ cat > /tmp/alpine-build.sh <<'BUILD_EOF'
215
+ #!/bin/sh
216
+ set -e
217
+ apk add --no-cache build-base cmake ninja git file zlib-dev
218
+ git config --global --add safe.directory /work
219
+ bundle install --jobs 4
220
+ bundle exec rake "gem:native:${PLATFORM}"
221
+ gem install -b pkg/libpng-*.gem
222
+ (cd /tmp && ruby -e 'gem "libpng"; require "libpng"; png = Libpng.encode(2, 2, "\xff" * 16, pixel_format: "RGBA"); puts Libpng.decode(png, pixel_format: "RGBA").inspect')
223
+ BUILD_EOF
224
+ chmod +x /tmp/alpine-build.sh
225
+ docker run --rm \
226
+ -v "$PWD:/work" \
227
+ -v /tmp/alpine-build.sh:/alpine-build.sh \
228
+ -w /work \
229
+ -e PLATFORM \
230
+ ruby:3.3-alpine \
231
+ /alpine-build.sh
215
232
 
216
233
  - uses: actions/upload-artifact@v4
217
234
  with:
218
235
  name: pkg-${{ matrix.platform }}
219
236
  path: pkg/*.gem
220
237
 
221
- - name: Install gem
222
- run: gem install -b pkg/libpng-*.gem
223
-
224
238
  publish:
225
- needs: [ bump, build, cross ]
239
+ needs: [ bump, build, build_musl ]
226
240
  if: always() && !cancelled() && !failure()
227
241
  runs-on: ubuntu-latest
228
242
  steps:
@@ -245,5 +259,23 @@ jobs:
245
259
  uses: rubygems/configure-rubygems-credentials@main
246
260
 
247
261
  - name: Publish to rubygems.org
262
+ shell: bash
248
263
  run: |
249
- for gem in pkg/*.gem; do gem push -V "$gem"; done
264
+ set +e
265
+ for gem in pkg/*.gem; do
266
+ output=$(gem push -V "$gem" 2>&1)
267
+ rc=$?
268
+ if [ $rc -eq 0 ]; then
269
+ echo "$output"
270
+ continue
271
+ fi
272
+ # RubyGems rejects re-pushing the same version with 422, even for
273
+ # identical content. Tolerate that so we can publish newly-added
274
+ # platform variants at a version whose source gem already exists.
275
+ if echo "$output" | grep -qE "already (exists|pushed)|Conflict|Repushing"; then
276
+ echo "Skip $(basename "$gem") (already published)"
277
+ continue
278
+ fi
279
+ echo "$output" >&2
280
+ exit 1
281
+ done
data/Rakefile CHANGED
@@ -34,8 +34,11 @@ end
34
34
  platforms = %w[
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
  ]
data/ext/extconf.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  $: << File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
2
2
 
3
3
  require 'libpng/recipe'
4
+ require 'mkmf'
4
5
 
5
6
  recipe = Libpng::Recipe.new
6
7
  recipe.cook_if_not
8
+
9
+ # RubyGems requires every extconf.rb to leave a Makefile behind, even if
10
+ # no native extension is compiled (libpng is built by Recipe#cook above
11
+ # and loaded via FFI at runtime). dummy_makefile satisfies that contract.
12
+ create_makefile('libpng/dummy')
data/lib/libpng/recipe.rb CHANGED
@@ -32,6 +32,7 @@ module Libpng
32
32
 
33
33
  @target = ROOT.join(@target).to_s
34
34
  @printed = {}
35
+ setup_cross_compile if cross_compile?
35
36
  end
36
37
 
37
38
  # libpng ships a CMake build alongside the autotools one. We use CMake
@@ -69,10 +70,12 @@ module Libpng
69
70
 
70
71
  def install
71
72
  super
72
- # After `make install`, the .so/.dylib/.dll is under ports/<name>/<ver>/lib/.
73
- # Copy it into the gem's lib/libpng/ so FFI can load it at runtime.
74
- libs = Dir.glob(File.join(port_path, 'lib', shared_lib_glob))
75
- raise "no libpng shared lib produced at #{port_path}/lib" if libs.empty?
73
+ # After `make install`, the shared lib lives under ports/<name>/<ver>/.
74
+ # On Linux/macOS that's lib/. On Windows, CMake's GNUInstallDirs puts
75
+ # the .dll in bin/ and the import library (.dll.a) in lib/ — we only
76
+ # ship the .dll, so search both.
77
+ libs = Dir.glob(File.join(port_path, shared_lib_install_glob))
78
+ raise "no libpng shared lib produced under #{port_path}" if libs.empty?
76
79
 
77
80
  target_dir = ROOT.join('lib', 'libpng')
78
81
  FileUtils.mkdir_p(target_dir)
@@ -125,6 +128,16 @@ module Libpng
125
128
  end
126
129
  end
127
130
 
131
+ # Glob (with port_path prefix) for the freshly installed shared lib.
132
+ # On Windows the .dll installs to bin/; on Unix-likes it stays in lib/.
133
+ def shared_lib_install_glob
134
+ if MiniPortile.windows?
135
+ '{bin,lib}/libpng16*.dll'
136
+ else
137
+ "lib/#{shared_lib_glob}"
138
+ end
139
+ end
140
+
128
141
  def each_built_lib(&block)
129
142
  Dir.glob(ROOT.join('lib', 'libpng', shared_lib_glob)).each(&block)
130
143
  end
@@ -134,10 +147,16 @@ module Libpng
134
147
  case @host
135
148
  when /\Ax86_64.*mingw32/
136
149
  'x64-mingw32'
150
+ when /\A(aarch64|arm64).*mingw/
151
+ 'aarch64-mingw-ucrt'
152
+ when /\Ax86_64.*linux-musl/
153
+ 'x86_64-linux-musl'
154
+ when /\A(aarch64|arm64).*linux-musl/
155
+ 'aarch64-linux-musl'
137
156
  when /\Ax86_64.*linux/
138
157
  'x86_64-linux'
139
- when /\A(arm64|aarch64).*linux/
140
- 'arm64-linux'
158
+ when /\A(aarch64|arm64).*linux/
159
+ 'aarch64-linux'
141
160
  when /\Ax86_64.*(darwin|macos|osx)/
142
161
  'x86_64-darwin'
143
162
  when /\A(arm64|aarch64).*(darwin|macos|osx)/
@@ -154,13 +173,49 @@ module Libpng
154
173
  'arm64-darwin'
155
174
  when /\Ax86_64.*(darwin|macos|osx)/
156
175
  'x86_64-darwin'
176
+ when /\A(arm64|aarch64).*linux-musl/
177
+ 'aarch64-linux-musl'
157
178
  when /\A(arm64|aarch64).*linux/
158
179
  'aarch64-linux'
180
+ when /\Ax86_64.*linux-musl/
181
+ 'x86_64-linux-musl'
159
182
  else
160
183
  ENV.fetch('target_platform', host_platform)
161
184
  end
162
185
  end
163
186
 
187
+ def cross_compile?
188
+ target_platform != host_platform
189
+ end
190
+
191
+ # Configure MiniPortile + CMake for cross-compilation. Native builds
192
+ # (host_platform == target_platform) skip this entirely.
193
+ def setup_cross_compile
194
+ # All targeted platforms now have native runners (ubuntu-24.04-arm for
195
+ # aarch64-linux, windows-11-arm for aarch64-mingw-ucrt, Alpine containers
196
+ # for the musl variants). This hook is kept as a seam for future
197
+ # cross-compile targets (e.g. aarch64-linux on an x86_64 host).
198
+ end
199
+
200
+ def cpu_type
201
+ case target_platform
202
+ when 'aarch64-linux', 'aarch64-linux-musl', 'arm64-darwin', 'aarch64-mingw-ucrt' then 'aarch64'
203
+ when 'x86_64-linux', 'x86_64-linux-musl', 'x86_64-darwin', /\Ax64-mingw/ then 'x86_64'
204
+ else
205
+ super
206
+ end
207
+ end
208
+
209
+ def cmake_system_name
210
+ case target_platform
211
+ when 'aarch64-linux', 'x86_64-linux', 'aarch64-linux-musl', 'x86_64-linux-musl' then 'Linux'
212
+ when 'arm64-darwin', 'x86_64-darwin' then 'Darwin'
213
+ when /\A(aarch64-)?mingw/, /\Ax64-mingw/ then 'Windows'
214
+ else
215
+ super
216
+ end
217
+ end
218
+
164
219
  def target_format
165
220
  @target_format ||=
166
221
  case target_platform
@@ -168,10 +223,12 @@ module Libpng
168
223
  /Mach-O 64-bit dynamically linked shared library arm64/
169
224
  when 'x86_64-darwin'
170
225
  /Mach-O 64-bit dynamically linked shared library x86_64/
171
- when 'aarch64-linux'
226
+ when 'aarch64-linux', 'aarch64-linux-musl'
172
227
  /ELF 64-bit LSB shared object, ARM aarch64/
173
- when 'x86_64-linux'
228
+ when 'x86_64-linux', 'x86_64-linux-musl'
174
229
  /ELF 64-bit LSB shared object, x86-64/
230
+ when 'aarch64-mingw-ucrt'
231
+ /PE32\+ executable.*\(DLL\).*ARM64/
175
232
  when /\Ax64-mingw(32|-ucrt)/
176
233
  /PE32\+ executable.*\(DLL\).*x86-64/
177
234
  else
@@ -11,6 +11,6 @@ module Libpng
11
11
  # new libpng release. The iteration resets to 0 each time
12
12
  # LIBPNG_VERSION bumps.
13
13
  LIBPNG_VERSION = '1.6.58'
14
- LIBPNG_RUBY_ITERATION = 0
14
+ LIBPNG_RUBY_ITERATION = 1
15
15
  VERSION = "#{LIBPNG_VERSION}.#{LIBPNG_RUBY_ITERATION}"
16
16
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libpng
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.58.0
4
+ version: 1.6.58.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-07-25 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: ffi
@@ -71,6 +72,7 @@ metadata:
71
72
  source_code_uri: https://github.com/claricle/libpng-ruby
72
73
  changelog_uri: https://github.com/claricle/libpng-ruby/blob/main/README.adoc#versioning
73
74
  rubygems_mfa_required: 'true'
75
+ post_install_message:
74
76
  rdoc_options: []
75
77
  require_paths:
76
78
  - lib
@@ -85,7 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
87
  - !ruby/object:Gem::Version
86
88
  version: '0'
87
89
  requirements: []
88
- rubygems_version: 4.0.16
90
+ rubygems_version: 3.5.22
91
+ signing_key:
89
92
  specification_version: 4
90
93
  summary: libpng for Ruby (pre-compiled, FFI-based).
91
94
  test_files: []