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..79c9def 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?('almalinux_9') || + os.start_with?('almalinux_10') || + os.start_with?('centos_9') || + os.start_with?('centos_10') || + 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') 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..f70d678 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -106,6 +106,41 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem + almalinux_9: + build: + context: . + dockerfile: .docker/Dockerfile-almalinux_9 + 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 + + rockylinux_9: + build: + context: . + dockerfile: .docker/Dockerfile-rockylinux_9 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + rockylinux_10: + build: + context: . + dockerfile: .docker/Dockerfile-rockylinux_10 + volumes: + - .:/root/wkhtmltopdf_binary_gem + archlinux: build: context: . diff --git a/test/test_with_docker.rb b/test/test_with_docker.rb index 4a0b7fc..217269c 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_almalinux_9 + test_on_x86 with: 'almalinux_9' + end + + def test_almalinux_10 + test_on_x86 with: 'almalinux_10' + end + + 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