From 8049bd5b4ed36609d3bd76585d48f0be4ad4c594 Mon Sep 17 00:00:00 2001 From: Vincent Liggio <2916193+vliggio@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:13:54 -0400 Subject: [PATCH 1/2] Support RHEL/Rocky/AlmaLinux 9 & 10 and Fedora via the Debian 12 binary RHEL 9/10 and their clones (Rocky, AlmaLinux, Oracle Linux, CentOS Stream), plus modern Fedora, ship OpenSSL 3 and a newer glibc. The Debian 12 binary links libssl.so.3 and runs on them, whereas the CentOS 8 binary links the now-absent libssl.so.1.1. Map these distros to the Debian 12 binary and add Docker-based tests for Rocky/AlmaLinux 9 & 10 and Fedora. Fixes #191 (Rocky/RHEL/AlmaLinux 9), #169 (CentOS Stream 9), #182 (Fedora). Co-Authored-By: Claude Opus 4.8 --- .docker/Dockerfile-almalinux_10 | 5 +++++ .docker/Dockerfile-almalinux_9 | 5 +++++ .docker/Dockerfile-fedora | 5 +++++ .docker/Dockerfile-rockylinux_10 | 5 +++++ .docker/Dockerfile-rockylinux_9 | 5 +++++ bin/wkhtmltopdf | 21 ++++++++++++++++++- docker-compose.yml | 35 ++++++++++++++++++++++++++++++++ test/test_with_docker.rb | 20 ++++++++++++++++++ 8 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 .docker/Dockerfile-almalinux_10 create mode 100644 .docker/Dockerfile-almalinux_9 create mode 100644 .docker/Dockerfile-fedora create mode 100644 .docker/Dockerfile-rockylinux_10 create mode 100644 .docker/Dockerfile-rockylinux_9 diff --git a/.docker/Dockerfile-almalinux_10 b/.docker/Dockerfile-almalinux_10 new file mode 100644 index 0000000..30fee6b --- /dev/null +++ b/.docker/Dockerfile-almalinux_10 @@ -0,0 +1,5 @@ +FROM almalinux/almalinux:10 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-almalinux_9 b/.docker/Dockerfile-almalinux_9 new file mode 100644 index 0000000..e29fc42 --- /dev/null +++ b/.docker/Dockerfile-almalinux_9 @@ -0,0 +1,5 @@ +FROM almalinux/almalinux:9 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-fedora b/.docker/Dockerfile-fedora new file mode 100644 index 0000000..7ff49cf --- /dev/null +++ b/.docker/Dockerfile-fedora @@ -0,0 +1,5 @@ +FROM fedora:42 + +RUN dnf install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-rockylinux_10 b/.docker/Dockerfile-rockylinux_10 new file mode 100644 index 0000000..95c1744 --- /dev/null +++ b/.docker/Dockerfile-rockylinux_10 @@ -0,0 +1,5 @@ +FROM rockylinux/rockylinux:10 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-rockylinux_9 b/.docker/Dockerfile-rockylinux_9 new file mode 100644 index 0000000..3a30243 --- /dev/null +++ b/.docker/Dockerfile-rockylinux_9 @@ -0,0 +1,5 @@ +FROM rockylinux/rockylinux:9 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/bin/wkhtmltopdf b/bin/wkhtmltopdf index 2c00ad5..8d41899 100755 --- a/bin/wkhtmltopdf +++ b/bin/wkhtmltopdf @@ -62,6 +62,24 @@ suffix = case RbConfig::CONFIG['host_os'] os.start_with?('alinux_') || os == 'amzn_2023' + # RHEL 9/10 and their clones (Rocky, AlmaLinux, Oracle, CentOS Stream), + # plus modern Fedora, ship OpenSSL 3 and a newer glibc, so the Debian 12 + # binary (which links libssl.so.3) runs on them while the CentOS 8 binary + # (OpenSSL 1.1) does not. See issues #191 (RHEL/Rocky 9), #169 (CentOS + # Stream 9) and #182 (Fedora) at + # https://github.com/zakird/wkhtmltopdf_binary_gem/issues + os = 'debian_12' if os.start_with?('rocky_9') || + os.start_with?('rocky_10') || + os.start_with?('rhel_9.') || + os.start_with?('rhel_10.') || + os.start_with?('ol_9.') || + os.start_with?('ol_10.') || + os.start_with?('almalinux_9') || + os.start_with?('almalinux_10') || + os.start_with?('centos_9') || + os.start_with?('centos_10') || + os.start_with?('fedora') + os_based_on_debian_9 = os.start_with?('debian_9') || os.start_with?('deepin') os = 'debian_9' if os_based_on_debian_9 @@ -96,7 +114,8 @@ end unless File.exist? binary raise 'Invalid platform, must be running on Ubuntu 16.04/18.04/20.04/22.04, ' \ - 'CentOS 6/7/8, Debian 9/10/11/12, Archlinux amd64, Debian 9/10/11/12 arm64, or Intel-based Cocoa macOS ' \ + 'CentOS 6/7/8, RHEL/Rocky/AlmaLinux 8/9/10, Fedora, Debian 9/10/11/12/13, Archlinux amd64, ' \ + 'Debian 9/10/11/12 arm64, or Intel-based Cocoa macOS ' \ "(missing binary: #{binary})." end diff --git a/docker-compose.yml b/docker-compose.yml index dcdeed4..3a19fb0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -106,6 +106,41 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem + rockylinux_9: + build: + context: . + dockerfile: .docker/Dockerfile-rockylinux_9 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + almalinux_9: + build: + context: . + dockerfile: .docker/Dockerfile-almalinux_9 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + rockylinux_10: + build: + context: . + dockerfile: .docker/Dockerfile-rockylinux_10 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + almalinux_10: + build: + context: . + dockerfile: .docker/Dockerfile-almalinux_10 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + fedora: + build: + context: . + dockerfile: .docker/Dockerfile-fedora + volumes: + - .:/root/wkhtmltopdf_binary_gem + archlinux: build: context: . diff --git a/test/test_with_docker.rb b/test/test_with_docker.rb index 4a0b7fc..6295910 100644 --- a/test/test_with_docker.rb +++ b/test/test_with_docker.rb @@ -77,6 +77,26 @@ def test_almalinux_8 test_on_x86 with: 'almalinux_8' end + def test_rockylinux_9 + test_on_x86 with: 'rockylinux_9' + end + + def test_almalinux_9 + test_on_x86 with: 'almalinux_9' + end + + def test_rockylinux_10 + test_on_x86 with: 'rockylinux_10' + end + + def test_almalinux_10 + test_on_x86 with: 'almalinux_10' + end + + def test_fedora + test_on_x86 with: 'fedora' + end + def test_with_macos assert_equal('wkhtmltopdf 0.12.6 (with patched qt)', `bin/wkhtmltopdf --version`.strip) if macos? end From 4124016ddd37691727420a34185b4e8666108219 Mon Sep 17 00:00:00 2001 From: Vincent Liggio <2916193+vliggio@users.noreply.github.com> Date: Tue, 16 Jun 2026 16:21:59 -0400 Subject: [PATCH 2/2] Sort the new distro entries alphabetically Co-Authored-By: Claude Opus 4.8 --- bin/wkhtmltopdf | 16 ++++++++-------- docker-compose.yml | 20 ++++++++++---------- test/test_with_docker.rb | 16 ++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/bin/wkhtmltopdf b/bin/wkhtmltopdf index 8d41899..79c9def 100755 --- a/bin/wkhtmltopdf +++ b/bin/wkhtmltopdf @@ -68,17 +68,17 @@ suffix = case RbConfig::CONFIG['host_os'] # (OpenSSL 1.1) does not. See issues #191 (RHEL/Rocky 9), #169 (CentOS # Stream 9) and #182 (Fedora) at # https://github.com/zakird/wkhtmltopdf_binary_gem/issues - os = 'debian_12' if os.start_with?('rocky_9') || - os.start_with?('rocky_10') || - os.start_with?('rhel_9.') || - os.start_with?('rhel_10.') || - os.start_with?('ol_9.') || - os.start_with?('ol_10.') || - os.start_with?('almalinux_9') || + os = 'debian_12' if os.start_with?('almalinux_9') || os.start_with?('almalinux_10') || os.start_with?('centos_9') || os.start_with?('centos_10') || - os.start_with?('fedora') + os.start_with?('fedora') || + os.start_with?('ol_9.') || + os.start_with?('ol_10.') || + os.start_with?('rhel_9.') || + os.start_with?('rhel_10.') || + os.start_with?('rocky_9') || + os.start_with?('rocky_10') os_based_on_debian_9 = os.start_with?('debian_9') || os.start_with?('deepin') diff --git a/docker-compose.yml b/docker-compose.yml index 3a19fb0..f70d678 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -106,38 +106,38 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem - rockylinux_9: + almalinux_9: build: context: . - dockerfile: .docker/Dockerfile-rockylinux_9 + dockerfile: .docker/Dockerfile-almalinux_9 volumes: - .:/root/wkhtmltopdf_binary_gem - almalinux_9: + almalinux_10: build: context: . - dockerfile: .docker/Dockerfile-almalinux_9 + dockerfile: .docker/Dockerfile-almalinux_10 volumes: - .:/root/wkhtmltopdf_binary_gem - rockylinux_10: + fedora: build: context: . - dockerfile: .docker/Dockerfile-rockylinux_10 + dockerfile: .docker/Dockerfile-fedora volumes: - .:/root/wkhtmltopdf_binary_gem - almalinux_10: + rockylinux_9: build: context: . - dockerfile: .docker/Dockerfile-almalinux_10 + dockerfile: .docker/Dockerfile-rockylinux_9 volumes: - .:/root/wkhtmltopdf_binary_gem - fedora: + rockylinux_10: build: context: . - dockerfile: .docker/Dockerfile-fedora + dockerfile: .docker/Dockerfile-rockylinux_10 volumes: - .:/root/wkhtmltopdf_binary_gem diff --git a/test/test_with_docker.rb b/test/test_with_docker.rb index 6295910..217269c 100644 --- a/test/test_with_docker.rb +++ b/test/test_with_docker.rb @@ -77,18 +77,10 @@ def test_almalinux_8 test_on_x86 with: 'almalinux_8' end - def test_rockylinux_9 - test_on_x86 with: 'rockylinux_9' - end - def test_almalinux_9 test_on_x86 with: 'almalinux_9' end - def test_rockylinux_10 - test_on_x86 with: 'rockylinux_10' - end - def test_almalinux_10 test_on_x86 with: 'almalinux_10' end @@ -97,6 +89,14 @@ def test_fedora test_on_x86 with: 'fedora' end + def test_rockylinux_9 + test_on_x86 with: 'rockylinux_9' + end + + def test_rockylinux_10 + test_on_x86 with: 'rockylinux_10' + end + def test_with_macos assert_equal('wkhtmltopdf 0.12.6 (with patched qt)', `bin/wkhtmltopdf --version`.strip) if macos? end