diff --git a/.docker/Dockerfile-almalinux_8 b/.docker/Dockerfile-almalinux_8 new file mode 100644 index 00000000..39ff7225 --- /dev/null +++ b/.docker/Dockerfile-almalinux_8 @@ -0,0 +1,5 @@ +FROM almalinux/almalinux:8 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-archlinux b/.docker/Dockerfile-archlinux index aef7b3f5..386c50eb 100644 --- a/.docker/Dockerfile-archlinux +++ b/.docker/Dockerfile-archlinux @@ -1,8 +1,7 @@ -FROM archlinux:latest +FROM archlinux ENV DEBIAN_FRONTEND noninteractive -RUN pacman -Sy --noconfirm \ - ruby fontconfig freetype2 libjpeg libpng libxext libxrender +RUN pacman -Sy --noconfirm ruby fontconfig freetype2 libjpeg libpng libxext libxrender openssl-1.1 CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-centos_6 b/.docker/Dockerfile-centos_6 index b15c5d5a..689f4525 100644 --- a/.docker/Dockerfile-centos_6 +++ b/.docker/Dockerfile-centos_6 @@ -1,5 +1,9 @@ FROM centos:6 -RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext +RUN rm -f /etc/yum.repos.d/CentOS-Base.repo && \ + sed -i "s/enabled=0/enabled=1/g" /etc/yum.repos.d/CentOS-Vault.repo && \ + yum clean all && \ + yum update -y && \ + yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-centos_8 b/.docker/Dockerfile-centos_8 index cdf38156..3b3fb7b5 100644 --- a/.docker/Dockerfile-centos_8 +++ b/.docker/Dockerfile-centos_8 @@ -1,5 +1,20 @@ FROM centos:8 +# https://centos.org/centos-stream/#centos-stream-8 +# Replace mirror +RUN find /etc/yum.repos.d -type f -exec sed -i 's/mirrorlist=http:\/\/mirrorlist.centos.org/\#mirrorlist=http:\/\/mirrorlist.centos.org/g' {} \; +RUN find /etc/yum.repos.d -type f -exec sed -i 's/\#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g' {} \; +RUN dnf update -y + +# Swap versions +RUN dnf swap centos-linux-repos centos-stream-repos -y +RUN dnf update -y +RUN dnf install centos-release-stream -y +RUN dnf swap centos-{linux,stream}-repos -y + +# Sync +RUN dnf distro-sync -y + RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_10_arm b/.docker/Dockerfile-debian_10_arm new file mode 100644 index 00000000..0666c57b --- /dev/null +++ b/.docker/Dockerfile-debian_10_arm @@ -0,0 +1,8 @@ +FROM --platform=arm64 debian:10 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_11 b/.docker/Dockerfile-debian_11 new file mode 100644 index 00000000..9ad7544c --- /dev/null +++ b/.docker/Dockerfile-debian_11 @@ -0,0 +1,8 @@ +FROM debian:11 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_11_arm b/.docker/Dockerfile-debian_11_arm new file mode 100644 index 00000000..0e23b901 --- /dev/null +++ b/.docker/Dockerfile-debian_11_arm @@ -0,0 +1,8 @@ +FROM --platform=arm64 debian:11 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_12 b/.docker/Dockerfile-debian_12 new file mode 100644 index 00000000..08a734fd --- /dev/null +++ b/.docker/Dockerfile-debian_12 @@ -0,0 +1,8 @@ +FROM debian:12 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_12_arm b/.docker/Dockerfile-debian_12_arm new file mode 100644 index 00000000..ee3aa5da --- /dev/null +++ b/.docker/Dockerfile-debian_12_arm @@ -0,0 +1,8 @@ +FROM --platform=arm64 debian:12 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_13 b/.docker/Dockerfile-debian_13 new file mode 100644 index 00000000..822dead4 --- /dev/null +++ b/.docker/Dockerfile-debian_13 @@ -0,0 +1,8 @@ +FROM debian:13 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_9 b/.docker/Dockerfile-debian_9 index cc66dfaf..b7acc99b 100644 --- a/.docker/Dockerfile-debian_9 +++ b/.docker/Dockerfile-debian_9 @@ -2,7 +2,12 @@ FROM debian:9 ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update +RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list + +RUN apt-get -o Acquire::Check-Valid-Until=false update && \ + apt-get -o Acquire::AllowInsecureRepositories=true update + RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_9_arm b/.docker/Dockerfile-debian_9_arm new file mode 100644 index 00000000..710ed424 --- /dev/null +++ b/.docker/Dockerfile-debian_9_arm @@ -0,0 +1,13 @@ +FROM --platform=arm64 debian:9 + +ENV DEBIAN_FRONTEND noninteractive + +RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list + +RUN apt-get -o Acquire::Check-Valid-Until=false update && \ + apt-get -o Acquire::AllowInsecureRepositories=true update + +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-oraclelinux_8 b/.docker/Dockerfile-oraclelinux_8 new file mode 100644 index 00000000..6e976ed9 --- /dev/null +++ b/.docker/Dockerfile-oraclelinux_8 @@ -0,0 +1,5 @@ +FROM oraclelinux:8 + +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_8 b/.docker/Dockerfile-rockylinux_8 new file mode 100644 index 00000000..e636fa47 --- /dev/null +++ b/.docker/Dockerfile-rockylinux_8 @@ -0,0 +1,5 @@ +FROM rockylinux/rockylinux:8 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-deepin b/.docker/Dockerfile-ubuntu_22.04 similarity index 85% rename from .docker/Dockerfile-deepin rename to .docker/Dockerfile-ubuntu_22.04 index 5b59ddc2..9bf1cde3 100644 --- a/.docker/Dockerfile-deepin +++ b/.docker/Dockerfile-ubuntu_22.04 @@ -1,4 +1,4 @@ -FROM deepin/deepin-core:latest +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive diff --git a/.docker/Dockerfile-ubuntu_24.04 b/.docker/Dockerfile-ubuntu_24.04 new file mode 100644 index 00000000..49fa3fc3 --- /dev/null +++ b/.docker/Dockerfile-ubuntu_24.04 @@ -0,0 +1,8 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update +RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..cacb5775 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: [push, pull_request] + +jobs: + tests-on-x86-mac: + runs-on: macos-13 + strategy: + matrix: + ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] + steps: + - uses: actions/checkout@v4 + + - name: Install Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Install dependencies + run: bundle install + + - name: Run tests with Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} + run: bundle exec rake + tests-on-x86-docker: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.2'] + steps: + - uses: actions/checkout@v4 + + - name: Install Ruby ${{ matrix.ruby-version }} on ubuntu + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Install dependencies + run: bundle install + + - name: Run tests on docker(x86) + run: bundle exec rake + tests-on-arm: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.2'] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - uses: actions/checkout@v4 + - name: Install Ruby ${{ matrix.ruby-version }} on ubuntu + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + - name: Run tests on docker(arm64) + env: + ARM: 1 + COMPOSE_FILE: docker-compose-arm.yml + run: | + set -xeu + sudo apt update + sudo apt-get install -y docker-compose + bundle install + bundle exec rake + + diff --git a/.gitignore b/.gitignore index d326d68f..7d03bc07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,31 @@ .DS_Store pkg/* +Gemfile.lock +bin/wkhtmltopdf_archlinux_amd64 bin/wkhtmltopdf_centos_6_amd64 +bin/wkhtmltopdf_centos_6_i386 bin/wkhtmltopdf_centos_7_amd64 +bin/wkhtmltopdf_centos_7_i386 bin/wkhtmltopdf_centos_8_amd64 bin/wkhtmltopdf_debian_9_amd64 +bin/wkhtmltopdf_debian_9_arm64 +bin/wkhtmltopdf_debian_9_i386 bin/wkhtmltopdf_debian_10_amd64 +bin/wkhtmltopdf_debian_10_arm64 +bin/wkhtmltopdf_debian_10_i386 +bin/wkhtmltopdf_debian_11_amd64 +bin/wkhtmltopdf_debian_11_arm64 +bin/wkhtmltopdf_debian_11_i386 +bin/wkhtmltopdf_debian_12_amd64 +bin/wkhtmltopdf_debian_12_arm64 +bin/wkhtmltopdf_debian_12_i386 bin/wkhtmltopdf_macos_cocoa bin/wkhtmltopdf_ubuntu_16.04_amd64 -bin/wkhtmltopdf_ubuntu_18.04_amd64 -bin/wkhtmltopdf_ubuntu_20.04_amd64 -bin/wkhtmltopdf_centos_6_i386 -bin/wkhtmltopdf_centos_7_i386 -bin/wkhtmltopdf_debian_9_i386 -bin/wkhtmltopdf_debian_10_i386 bin/wkhtmltopdf_ubuntu_16.04_i386 +bin/wkhtmltopdf_ubuntu_18.04_amd64 bin/wkhtmltopdf_ubuntu_18.04_i386 -bin/wkhtmltopdf_archlinux_amd64 +bin/wkhtmltopdf_ubuntu_20.04_amd64 +bin/wkhtmltopdf_ubuntu_20.04_arm64 +bin/wkhtmltopdf_ubuntu_21.10_amd64 +bin/wkhtmltopdf_ubuntu_22.04_amd64 +bin/wkhtmltopdf_ubuntu_22.04_arm64 diff --git a/CHANGELOG b/CHANGELOG.md similarity index 64% rename from CHANGELOG rename to CHANGELOG.md index 56683727..e42a0e34 100644 --- a/CHANGELOG +++ b/CHANGELOG.md @@ -1,3 +1,31 @@ +# 0.12.6.10 + +- Add support for Debian 13 (with Debian 12 binaries) + +# 0.12.6.9 + +- Add support to ubuntu 22.04 and 24.04 in arm64 +- Add support for KDE Neon 22.04 & 24.04 (Ubuntu derivative) + +# 0.12.6.8 + +- Add support for Ubuntu 24.04 using the Ubuntu 22.04 binary +- Add support for Linux Mint 22 using the Ubuntu 22.04 binary +- Add support for Alibaba Cloud Linux using the CentOS 8 binary +- Add support for AlmaLinux using the CentOS 8 binary +- Fix Amazon Linux 2023 support using the CentOS binaries + +# 0.12.6.7 + +- Setup of GitHub action test automation for Linux/MacOS builds +- Add URLs to gemspec for inclusion on Rubygems.org +- Add support for several new Linux binaries for Debian, Centos, Ubuntu, Mint, Oracle, Tuxedo +- Add support for several arm64 Linux binaries + +# 0.12.6.6 + +Add support for Ubuntu 22.04 + # 0.12.6.5 Fix ability to use on Debian 9 systems @@ -64,4 +92,3 @@ Update MacOS `wkhtmltopdf` binary to 0.9.9 # 0.9.9 Update `wkhtmltopdf` binaries with version 0.9.9 - diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..5f10ba8c --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +gemspec diff --git a/README.md b/README.md index fa7a7dad..042f6cd7 100644 --- a/README.md +++ b/README.md @@ -51,15 +51,26 @@ macOS Binaries should be compressed with `gzip --best` after extracting. The matching binary will be extracted on first execution of `bin/wkhtmltopdf`. -## Testing with Docker +Hints for compressing binaries -Make sure you have Docker and Docker Compose installed (see https://docs.docker.com/compose/install/ for more -information). +Debian/Ubuntu + user/local/bin refers to the extracted binaries directory + gzip --best -c usr/local/bin/wkhtmltopdf > wkhtmltopdf_ubuntu_22.04.amd64.gz + +## Testing -There are Dockerfiles for the supported Linux based distributions under `.docker`. You can build them all with -`docker-compose build` and run each individually with e.g. `docker-compose run ubuntu_18.04`. +To execute gem tests locally, install in your OS: -There also is a rudimentary minitest test that simply invokes `docker-compose run` for each distribution and -expects to see the output of `wkhtmltopdf --version`. Just run `rake` to run it. +- Docker +- Docker compose +- Ruby +- Bundler -You can clean up after testing with `docker-compose down --rmi all`. +Then, execute the commands below: + +```bash +git clone https://github.com/zakird/wkhtmltopdf_binary_gem +cd wkhtmltopdf_binary_gem/ +bundle install +bundle exec rake +``` diff --git a/bin/wkhtmltopdf b/bin/wkhtmltopdf index c06450fb..2c00ad54 100755 --- a/bin/wkhtmltopdf +++ b/bin/wkhtmltopdf @@ -10,35 +10,72 @@ require 'rbconfig' require 'zlib' +def architecture + case RbConfig::CONFIG['host_cpu'] + when *%w[arm64 aarch64 arch64] + 'arm64' + when 'x86_64' + 'amd64' + else + 'i386' + end +end + suffix = case RbConfig::CONFIG['host_os'] when /linux/ os = `. /etc/os-release 2> /dev/null && echo ${ID}_${VERSION_ID}`.strip - os_based_on_ubuntu_16_04 = os.start_with?('ubuntu_16.') || os.start_with?('ubuntu_17.') - os = 'ubuntu_16.04' if os_based_on_ubuntu_16_04 - - os_based_on_ubuntu_18_04 = os.start_with?('ubuntu_18.') || os.start_with?('ubuntu_19.') || os.start_with?('elementary') || os.start_with?('linuxmint') || os.start_with?('pop') || os.start_with?('zorin') - os = 'ubuntu_18.04' if os_based_on_ubuntu_18_04 - - os_based_on_ubuntu_20_04 = os.start_with?('ubuntu_20.') - os = 'ubuntu_20.04' if os_based_on_ubuntu_20_04 - - os_based_on_centos_6 = (os.empty? && File.read('/etc/centos-release').start_with?('CentOS release 6')) || (os.start_with?('amzn_') && !os.start_with?('amzn_2')) - os = 'centos_6' if os_based_on_centos_6 + os = 'ubuntu_16.04' if os.start_with?('ubuntu_16.') || + os.start_with?('ubuntu_17.') || + os.start_with?('linuxmint_18.') + + os = 'ubuntu_18.04' if os.start_with?('ubuntu_18.') || + os.start_with?('ubuntu_19.') || + os.start_with?('elementary') || + os.start_with?('linuxmint_19.') || + os.start_with?('pop') || + os.start_with?('zorin') + + os = 'ubuntu_20.04' if os.start_with?('ubuntu_20.') || + os.start_with?('linuxmint_20.') + + os = 'ubuntu_21.10' if os.start_with?('ubuntu_21.') || + os.start_with?('linuxmint_21.') + + os = 'ubuntu_22.04' if os.start_with?('ubuntu_22.') || + os.start_with?('ubuntu_24.') || + os.start_with?('tuxedo_22.') || + os.start_with?('neon_24.') || + os.start_with?('neon_22.') || + os.start_with?('linuxmint_22') + + os = 'centos_6' if (os.start_with?('amzn_') && os != 'amzn_2' && os != 'amzn_2023') || + (os.empty? && File.read('/etc/centos-release').start_with?('CentOS release 6')) + + os = 'centos_7' if (os.start_with?('amzn_2') && !os.start_with?('amzn_20')) || + os.start_with?('rhel_7.') + + os = 'centos_8' if os.start_with?('rocky_8') || + os.start_with?('rhel_8.') || + os.start_with?('ol_8.') || + os.start_with?('almalinux_8') || + os.start_with?('alinux_') || + os == 'amzn_2023' + + os_based_on_debian_9 = os.start_with?('debian_9') || + os.start_with?('deepin') + os = 'debian_9' if os_based_on_debian_9 - os_based_on_centos_7 = os.start_with?('amzn_2') - os = 'centos_7' if os_based_on_centos_7 + os = 'debian_10' if !os_based_on_debian_9 && os.start_with?('debian_10') - os_based_on_debian_9 = (/(debian_9|deepin)/ =~ os) - os = 'debian_9' if os_based_on_debian_9 + os = 'debian_11' if !os_based_on_debian_9 && os.start_with?('debian_11') - os_based_on_debian = !os_based_on_debian_9 && os.start_with?('debian') - os = 'debian_10' if os_based_on_debian + os = 'debian_12' if !os_based_on_debian_9 && os.start_with?('debian_12') - os_based_on_archlinux = os.start_with?('arch_') || os.start_with?('manjaro_') - os = 'archlinux' if os_based_on_archlinux + os = 'debian_12' if !os_based_on_debian_9 && os.start_with?('debian_13') - architecture = RbConfig::CONFIG['host_cpu'] == 'x86_64' ? 'amd64' : 'i386' + os = 'archlinux' if os.start_with?('arch_') || + os.start_with?('manjaro_') "#{os}_#{architecture}" when /darwin/ @@ -58,8 +95,8 @@ if File.exist?("#{binary}.gz") && !File.exist?(binary) end unless File.exist? binary - raise 'Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 ' \ - 'CentOS 6/7/8, Debian 9/10, archlinux amd64, or intel-based Cocoa macOS ' \ + 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 ' \ "(missing binary: #{binary})." end diff --git a/bin/wkhtmltopdf_debian_10_arm64.gz b/bin/wkhtmltopdf_debian_10_arm64.gz new file mode 100755 index 00000000..35398a3b Binary files /dev/null and b/bin/wkhtmltopdf_debian_10_arm64.gz differ diff --git a/bin/wkhtmltopdf_debian_11_amd64.gz b/bin/wkhtmltopdf_debian_11_amd64.gz new file mode 100644 index 00000000..35da9cd2 Binary files /dev/null and b/bin/wkhtmltopdf_debian_11_amd64.gz differ diff --git a/bin/wkhtmltopdf_debian_11_arm64.gz b/bin/wkhtmltopdf_debian_11_arm64.gz new file mode 100644 index 00000000..0ca3b644 Binary files /dev/null and b/bin/wkhtmltopdf_debian_11_arm64.gz differ diff --git a/bin/wkhtmltopdf_debian_11_i386.gz b/bin/wkhtmltopdf_debian_11_i386.gz new file mode 100644 index 00000000..ad70311a Binary files /dev/null and b/bin/wkhtmltopdf_debian_11_i386.gz differ diff --git a/bin/wkhtmltopdf_debian_12_amd64.gz b/bin/wkhtmltopdf_debian_12_amd64.gz new file mode 100755 index 00000000..c6c415ea Binary files /dev/null and b/bin/wkhtmltopdf_debian_12_amd64.gz differ diff --git a/bin/wkhtmltopdf_debian_12_arm64.gz b/bin/wkhtmltopdf_debian_12_arm64.gz new file mode 100755 index 00000000..e46c0089 Binary files /dev/null and b/bin/wkhtmltopdf_debian_12_arm64.gz differ diff --git a/bin/wkhtmltopdf_debian_12_i386.gz b/bin/wkhtmltopdf_debian_12_i386.gz new file mode 100755 index 00000000..4f706148 Binary files /dev/null and b/bin/wkhtmltopdf_debian_12_i386.gz differ diff --git a/bin/wkhtmltopdf_debian_9_arm64.gz b/bin/wkhtmltopdf_debian_9_arm64.gz new file mode 100755 index 00000000..8dd9d69c Binary files /dev/null and b/bin/wkhtmltopdf_debian_9_arm64.gz differ diff --git a/bin/wkhtmltopdf_ubuntu_20.04_arm64.gz b/bin/wkhtmltopdf_ubuntu_20.04_arm64.gz new file mode 100644 index 00000000..87352ca4 Binary files /dev/null and b/bin/wkhtmltopdf_ubuntu_20.04_arm64.gz differ diff --git a/bin/wkhtmltopdf_ubuntu_21.10_amd64.gz b/bin/wkhtmltopdf_ubuntu_21.10_amd64.gz new file mode 100644 index 00000000..1889a418 Binary files /dev/null and b/bin/wkhtmltopdf_ubuntu_21.10_amd64.gz differ diff --git a/bin/wkhtmltopdf_ubuntu_22.04_amd64.gz b/bin/wkhtmltopdf_ubuntu_22.04_amd64.gz new file mode 100644 index 00000000..a1b0037b Binary files /dev/null and b/bin/wkhtmltopdf_ubuntu_22.04_amd64.gz differ diff --git a/bin/wkhtmltopdf_ubuntu_22.04_arm64.gz b/bin/wkhtmltopdf_ubuntu_22.04_arm64.gz new file mode 100644 index 00000000..c5e5156f Binary files /dev/null and b/bin/wkhtmltopdf_ubuntu_22.04_arm64.gz differ diff --git a/docker-compose-arm.yml b/docker-compose-arm.yml new file mode 100644 index 00000000..cba273b2 --- /dev/null +++ b/docker-compose-arm.yml @@ -0,0 +1,44 @@ +version: '3' + +services: + debian_9: + build: + context: . + dockerfile: .docker/Dockerfile-debian_9_arm + volumes: + - .:/root/wkhtmltopdf_binary_gem + + debian_10: + build: + context: . + dockerfile: .docker/Dockerfile-debian_10_arm + volumes: + - .:/root/wkhtmltopdf_binary_gem + + debian_11: + build: + context: . + dockerfile: .docker/Dockerfile-debian_11_arm + volumes: + - .:/root/wkhtmltopdf_binary_gem + + debian_12: + build: + context: . + dockerfile: .docker/Dockerfile-debian_12_arm + volumes: + - .:/root/wkhtmltopdf_binary_gem + + ubuntu_22.04: + build: + context: . + dockerfile: .docker/Dockerfile-ubuntu_22.04 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + ubuntu_24.04: + build: + context: . + dockerfile: .docker/Dockerfile-ubuntu_24.04 + volumes: + - .:/root/wkhtmltopdf_binary_gem diff --git a/docker-compose.yml b/docker-compose.yml index 41b060e1..dcdeed40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,6 @@ version: '3' services: - ubuntu_16.04: build: context: . @@ -23,6 +22,13 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem + ubuntu_22.04: + build: + context: . + dockerfile: .docker/Dockerfile-ubuntu_22.04 + volumes: + - .:/root/wkhtmltopdf_binary_gem + debian_9: build: context: . @@ -37,6 +43,27 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem + debian_11: + build: + context: . + dockerfile: .docker/Dockerfile-debian_11 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + debian_12: + build: + context: . + dockerfile: .docker/Dockerfile-debian_12 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + debian_13: + build: + context: . + dockerfile: .docker/Dockerfile-debian_13 + volumes: + - .:/root/wkhtmltopdf_binary_gem + centos_6: build: context: . @@ -58,10 +85,24 @@ services: volumes: - .:/root/wkhtmltopdf_binary_gem - deepin: + oraclelinux_8: + build: + context: . + dockerfile: .docker/Dockerfile-oraclelinux_8 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + rockylinux_8: + build: + context: . + dockerfile: .docker/Dockerfile-rockylinux_8 + volumes: + - .:/root/wkhtmltopdf_binary_gem + + almalinux_8: build: context: . - dockerfile: .docker/Dockerfile-deepin + dockerfile: .docker/Dockerfile-almalinux_8 volumes: - .:/root/wkhtmltopdf_binary_gem diff --git a/test/test_with_docker.rb b/test/test_with_docker.rb index b0bd2244..4a0b7fcd 100644 --- a/test/test_with_docker.rb +++ b/test/test_with_docker.rb @@ -1,54 +1,97 @@ require 'minitest/autorun' +def macos? + ENV['RUNNER_OS'] && ENV['RUNNER_OS'] == 'macOS' +end + +def arm? + ENV['ARM'] +end + class WithDockerTest < Minitest::Test - # Run code before a group of test (see: https://github.com/seattlerb/minitest#how-to-run-code-before-a-group-of-tests) SETUP = begin - `docker-compose build` - end + `docker-compose build --no-cache` if !macos? + end def test_centos_6 - test with: 'centos_6' + test_on_x86 with: 'centos_6' end def test_centos_7 - test with: 'centos_7' + test_on_x86 with: 'centos_7' end def test_centos_8 - test with: 'centos_8' + test_on_x86 with: 'centos_8' end def test_debian_9 - test with: 'debian_9' + test_on_x86_and_arm with: 'debian_9' end def test_debian_10 - test with: 'debian_10' + test_on_x86_and_arm with: 'debian_10' + end + + def test_debian_11 + test_on_x86_and_arm with: 'debian_11' + end + + def test_debian_12 + test_on_x86_and_arm with: 'debian_12' + end + + def test_debian_13 + test_on_x86 with: 'debian_13' end def test_with_ubuntu_16 - test with: 'ubuntu_16.04' + test_on_x86 with: 'ubuntu_16.04' end def test_with_ubuntu_18 - test with: 'ubuntu_18.04' + test_on_x86 with: 'ubuntu_18.04' end def test_with_ubuntu_20 - test with: 'ubuntu_20.04' + test_on_x86 with: 'ubuntu_20.04' + end + + def test_with_ubuntu_22 + test_on_x86_and_arm with: 'ubuntu_22.04' + end + + def test_with_ubuntu_24 + test_on_x86_and_arm with: 'ubuntu_24.04' end def test_with_archlinux - test with: 'archlinux' + test_on_x86 with: 'archlinux' + end + + def test_rockylinux_8 + test_on_x86 with: 'rockylinux_8' + end + + def test_almalinux_8 + test_on_x86 with: 'almalinux_8' end def test_with_macos - assert_equal `bin/wkhtmltopdf --version`.strip, 'wkhtmltopdf 0.12.6 (with patched qt)' + assert_equal('wkhtmltopdf 0.12.6 (with patched qt)', `bin/wkhtmltopdf --version`.strip) if macos? end private - def test(with:) - assert_equal `docker-compose run --rm #{with}`.strip, 'wkhtmltopdf 0.12.6 (with patched qt)' + def test_on_x86(with:) + test_on_docker(with: with) if !macos? && !arm? + end + + def test_on_x86_and_arm(with:) + test_on_docker(with: with) unless macos? + end + + def test_on_docker(with:) + assert_match(/wkhtmltopdf 0\.12\.6(.1)? \(with patched qt\)/, `docker-compose run --rm #{with}`.strip) end end diff --git a/wkhtmltopdf-binary.gemspec b/wkhtmltopdf-binary.gemspec index 87869977..df3ee79a 100644 --- a/wkhtmltopdf-binary.gemspec +++ b/wkhtmltopdf-binary.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = "wkhtmltopdf-binary" - s.version = "0.12.6.5" + s.version = "0.12.6.10" s.license = "Apache-2.0" s.author = "Zakir Durumeric" s.email = "zakird@gmail.com" @@ -11,6 +11,11 @@ Gem::Specification.new do |s| s.files = Dir['bin/*'] s.executables << "wkhtmltopdf" s.require_path = '.' + s.homepage = 'https://github.com/zakird/wkhtmltopdf_binary_gem' + + s.metadata['source_code_uri'] = s.homepage + s.metadata['changelog_uri'] = "#{s.homepage}/blob/master/CHANGELOG.md" s.add_development_dependency "minitest" + s.add_development_dependency "rake" end