diff --git a/.docker/.dockerignore b/.docker/.dockerignore new file mode 100644 index 0000000..c52fb12 --- /dev/null +++ b/.docker/.dockerignore @@ -0,0 +1,4 @@ +bin/* +!bin/download_link_matrix.rb +!bin/wkhtmltopdf +!bin/wkhtmltopdf-binary.rb diff --git a/.docker/Dockerfile-amazonlinux2 b/.docker/Dockerfile-amazonlinux2 new file mode 100644 index 0000000..727b5b3 --- /dev/null +++ b/.docker/Dockerfile-amazonlinux2 @@ -0,0 +1,8 @@ +FROM amazonlinux:2 + +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext gzip + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . + +CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-archlinux b/.docker/Dockerfile-archlinux index 0b30ab7..737b826 100644 --- a/.docker/Dockerfile-archlinux +++ b/.docker/Dockerfile-archlinux @@ -4,4 +4,8 @@ ENV DEBIAN_FRONTEND noninteractive RUN pacman -Sy --noconfirm ruby fontconfig freetype2 libjpeg libpng libxext libxrender +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . + CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version +# CMD /bin/bash diff --git a/.docker/Dockerfile-centos_6 b/.docker/Dockerfile-centos_6 index 689f452..34bf8e7 100644 --- a/.docker/Dockerfile-centos_6 +++ b/.docker/Dockerfile-centos_6 @@ -6,4 +6,7 @@ RUN rm -f /etc/yum.repos.d/CentOS-Base.repo && \ yum update -y && \ yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . + CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-centos_7 b/.docker/Dockerfile-centos_7 index 0092377..5946371 100644 --- a/.docker/Dockerfile-centos_7 +++ b/.docker/Dockerfile-centos_7 @@ -1,5 +1,9 @@ FROM centos:7 -RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext +RUN yum -y groupinstall "Development Tools" +RUN yum install -y ruby libjpeg-turbo libXrender fontconfig libXext zlib-devel openssl11-libs + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-centos_8 b/.docker/Dockerfile-centos_8 index 3b3fb7b..4505d6d 100644 --- a/.docker/Dockerfile-centos_8 +++ b/.docker/Dockerfile-centos_8 @@ -17,4 +17,7 @@ RUN dnf distro-sync -y RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . + CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_10 b/.docker/Dockerfile-debian_10 index 390809b..4aca4de 100644 --- a/.docker/Dockerfile-debian_10 +++ b/.docker/Dockerfile-debian_10 @@ -3,6 +3,9 @@ FROM debian:10 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 curl + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-debian_9 b/.docker/Dockerfile-debian_9 index cc66dfa..05edbb1 100644 --- a/.docker/Dockerfile-debian_9 +++ b/.docker/Dockerfile-debian_9 @@ -3,6 +3,9 @@ FROM debian:9 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 +RUN apt-get install -y ruby libjpeg62-turbo libpng16-16 libxrender1 libfontconfig1 libxext6 curl + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-rockylinux_8 b/.docker/Dockerfile-rockylinux_8 index e636fa4..3940fe1 100644 --- a/.docker/Dockerfile-rockylinux_8 +++ b/.docker/Dockerfile-rockylinux_8 @@ -1,5 +1,8 @@ FROM rockylinux/rockylinux:8 -RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext +RUN yum install -y ruby libjpeg-turbo libpng libXrender fontconfig libXext cpio + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-ubuntu_16.04 b/.docker/Dockerfile-ubuntu_16.04 index 9a971b1..0b7765b 100644 --- a/.docker/Dockerfile-ubuntu_16.04 +++ b/.docker/Dockerfile-ubuntu_16.04 @@ -3,6 +3,9 @@ FROM ubuntu:16.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 +RUN apt-get install -y ruby libjpeg-turbo8 libxrender1:arm64 libxtst6:arm64 libfontconfig1 curl + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-ubuntu_18.04 b/.docker/Dockerfile-ubuntu_18.04 index d2e46a1..ba0792b 100644 --- a/.docker/Dockerfile-ubuntu_18.04 +++ b/.docker/Dockerfile-ubuntu_18.04 @@ -3,6 +3,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 +RUN apt-get install -y ruby libjpeg-turbo8 libxrender1:arm64 libxtst6:arm64 libfontconfig1 curl + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.docker/Dockerfile-ubuntu_20.04 b/.docker/Dockerfile-ubuntu_20.04 index 97eaa81..baa826c 100644 --- a/.docker/Dockerfile-ubuntu_20.04 +++ b/.docker/Dockerfile-ubuntu_20.04 @@ -3,6 +3,9 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update -RUN apt-get install -y ruby libjpeg8 libxrender1 libfontconfig1 +RUN apt-get install -y ruby libjpeg-turbo8 libxrender1:arm64 libxtst6:arm64 libfontconfig1 curl + +WORKDIR /root/wkhtmltopdf_binary_gem +COPY . . CMD /root/wkhtmltopdf_binary_gem/bin/wkhtmltopdf --version diff --git a/.gitignore b/.gitignore index a37d8c9..1155ef7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,8 @@ .DS_Store pkg/* Gemfile.lock -bin/wkhtmltopdf_centos_6_amd64 -bin/wkhtmltopdf_centos_7_amd64 -bin/wkhtmltopdf_centos_8_amd64 -bin/wkhtmltopdf_debian_9_amd64 -bin/wkhtmltopdf_debian_10_amd64 -bin/wkhtmltopdf_macos_cocoa -bin/wkhtmltopdf_ubuntu_16.04_amd64 -bin/wkhtmltopdf_ubuntu_18.04_amd64 -bin/wkhtmltopdf_ubuntu_20.04_amd64 -bin/wkhtmltopdf_ubuntu_22.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_i386 -bin/wkhtmltopdf_archlinux_amd64 + +bin/* +!bin/download_link_matrix.rb +!bin/wkhtmltopdf +!bin/wkhtmltopdf-binary.rb diff --git a/bin/download_link_matrix.rb b/bin/download_link_matrix.rb new file mode 100644 index 0000000..f7bdeff --- /dev/null +++ b/bin/download_link_matrix.rb @@ -0,0 +1,64 @@ +links = [ + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.msvc2015-win64.exe', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.msvc2015-win32.exe', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.mxe-cross-win64.7z', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.mxe-cross-win32.7z', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-2/wkhtmltox-0.12.6-2.macos-cocoa.pkg', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_i386.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_arm64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_ppc64le.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.raspberrypi.buster_armhf.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_i386.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_arm64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.raspberrypi.stretch_armhf.deb', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_arm64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_ppc64el.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_arm64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_ppc64le.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_i386.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_arm64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_ppc64le.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.xenial_amd64.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.xenial_i386.deb', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.xenial_arm64.deb', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.aarch64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.ppc64le.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.x86_64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.i686.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.aarch64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos7.ppc64le.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos6.x86_64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos6.i686.rpm', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.amazonlinux2.x86_64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.amazonlinux2.aarch64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-4/wkhtmltox-0.12.6-4.amazonlinux2_lambda.zip', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.opensuse.leap15.x86_64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.opensuse.leap15.aarch64.rpm', + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.opensuse.leap15.ppc64le.rpm', + + 'https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-3/wkhtmltox-0.12.6-3.archlinux-x86_64.pkg.tar.xz', +] + +DOWNLOAD_LINK_MATRIX = {} + +links.each do |link| + version, binary = link.sub('https://github.com/wkhtmltopdf/packaging/releases/download/','').split('/') + binary.sub!(/wkhtmltox[-_]#{version}\./, '') + + platform, architecture = binary.split(/[\.\-\_]/,2) + architecture.sub!(/\.(pkg\.tar\.xz|rpm|deb|zip|exe|pkg|7z)/,'') + + DOWNLOAD_LINK_MATRIX[platform] ||= {} + DOWNLOAD_LINK_MATRIX[platform][architecture] = link +end diff --git a/bin/wkhtmltopdf b/bin/wkhtmltopdf index 52cda52..d5fbfaa 100755 --- a/bin/wkhtmltopdf +++ b/bin/wkhtmltopdf @@ -9,69 +9,107 @@ require 'rbconfig' require 'zlib' +require File.expand_path(File.dirname(__FILE__) + '/download_link_matrix') -suffix = case RbConfig::CONFIG['host_os'] +os_architecture = case RbConfig::CONFIG['host_os'] when /linux/ os = `. /etc/os-release 2> /dev/null && echo ${ID}_${VERSION_ID}`.strip - os = 'ubuntu_16.04' if os.start_with?('ubuntu_16.') || + os = 'xenial' 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 = 'bionic' 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 = 'focal' if os.start_with?('ubuntu_20.') || os.start_with?('ubuntu_21.') || os.start_with?('linuxmint_20.') - os = 'ubuntu_22.04' if os.start_with?('ubuntu_22.') || + os = 'jammy' if os.start_with?('ubuntu_22.') || os.start_with?('linuxmint_21.') - os = 'centos_6' if (os.start_with?('amzn_') && os != 'amzn_2') || + os = 'centos6' if (os.start_with?('amzn_') && os != 'amzn_2') || + os.start_with?('centos_6') || (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 = 'centos7' if os.start_with?('rhel_7.') || + os.start_with?('centos_7') + + os = 'centos8' if os.start_with?('rocky_8') || + os.start_with?('centos_8') || + os.start_with?('rhel_8.') - os = 'centos_8' if os.start_with?('rocky_8') || os.start_with?('rhel_8.') + os = 'amazonlinux2' if os.start_with?('amzn_2') && !os.start_with?('amzn_20') os_based_on_debian_9 = os.start_with?('debian_9') || os.start_with?('deepin') - os = 'debian_9' if os_based_on_debian_9 + os = 'stretch' if os_based_on_debian_9 - os = 'debian_10' if !os_based_on_debian_9 && os.start_with?('debian') + os = 'buster' if !os_based_on_debian_9 && os.start_with?('debian') os = 'archlinux' if os.start_with?('arch_') || os.start_with?('manjaro_') - - architecture = RbConfig::CONFIG['host_cpu'] == 'x86_64' ? 'amd64' : 'i386' - - "#{os}_#{architecture}" + architecture = case RbConfig::CONFIG['host_cpu'] + when /x86_64/ + %w[xenial focal bionic stretch buster].any?{|d| os == d} ? 'amd64' : 'x86_64' + when /aarch64/ + %w[xenial focal bionic stretch buster].any?{|d| os == d} ? 'arm64' : 'aarch64' + when /arm64/ + 'arm64' + else + os.start_with?('centos') ? 'i686' : 'i386' + end + + [os, architecture] when /darwin/ - 'macos_cocoa' + ['macos', 'cocoa'] else - 'unknown' + ['unknown', 'unknown'] end +download_path = DOWNLOAD_LINK_MATRIX[os_architecture[0]][os_architecture[1]] + +suffix = "#{os_architecture[0]}_#{os_architecture[1]}" suffix = ENV['WKHTMLTOPDF_HOST_SUFFIX'] unless ENV['WKHTMLTOPDF_HOST_SUFFIX'].to_s.empty? +gem_directory = File.expand_path(File.dirname(__FILE__)) +downloaded_file_name = gem_directory + "/" + download_path.split('/')[-1] + binary = "#{__FILE__}_#{suffix}" +binary = "#{gem_directory}/#{binary}".sub('bin/bin', 'bin') unless binary.start_with?(gem_directory) + +Dir.chdir(gem_directory) do + if !File.exist?("#{binary}.gz") + `curl -LJ --silent "#{download_path}" --output "#{downloaded_file_name}"` + `rpm2cpio "#{downloaded_file_name}" | cpio -idm --quiet` if downloaded_file_name.end_with?('.rpm') + `dpkg -x "#{downloaded_file_name}" .` if downloaded_file_name.end_with?('.deb') + `tar -xf "#{downloaded_file_name}"` if downloaded_file_name.end_with?('.tar.xz') + if downloaded_file_name.end_with?('.pkg') + `xar -xf "#{downloaded_file_name}"; cat Payload | gunzip -dc | cpio -i` + `cp "#{gem_directory}/usr/local/share/wkhtmltox-installer/wkhtmltox.tar.gz" "#{binary}.gz"` + elsif downloaded_file_name.end_with?('.tar.xz') + `gzip --best --quiet -c usr/bin/wkhtmltopdf > #{binary}.gz` + else + `gzip --best --quiet -c usr/local/bin/wkhtmltopdf > #{binary}.gz` + end + end -if File.exist?("#{binary}.gz") && !File.exist?(binary) - File.open binary, 'wb', 0o755 do |file| - Zlib::GzipReader.open("#{binary}.gz") { |gzip| file << gzip.read } + if File.exist?("#{binary}.gz") && !File.exist?("#{binary}") + File.open binary, 'wb', 0o755 do |file| + Zlib::GzipReader.open("#{binary}.gz") { |gzip| file << gzip.read } + end end -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, Archlinux amd64, or Intel-based Cocoa macOS ' \ - "(missing binary: #{binary})." -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, Archlinux amd64, or Intel-based Cocoa macOS ' \ + "(missing binary: #{binary})." + end -exec *$*.unshift(binary) + exec *$*.unshift(binary) +end diff --git a/bin/wkhtmltopdf_archlinux_amd64.gz b/bin/wkhtmltopdf_archlinux_amd64.gz deleted file mode 100755 index 092ef0b..0000000 Binary files a/bin/wkhtmltopdf_archlinux_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_centos_6_amd64.gz b/bin/wkhtmltopdf_centos_6_amd64.gz deleted file mode 100755 index f7f86e0..0000000 Binary files a/bin/wkhtmltopdf_centos_6_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_centos_6_i386.gz b/bin/wkhtmltopdf_centos_6_i386.gz deleted file mode 100755 index 5ffc2fb..0000000 Binary files a/bin/wkhtmltopdf_centos_6_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_centos_7_amd64.gz b/bin/wkhtmltopdf_centos_7_amd64.gz deleted file mode 100755 index 881dc12..0000000 Binary files a/bin/wkhtmltopdf_centos_7_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_centos_7_i386.gz b/bin/wkhtmltopdf_centos_7_i386.gz deleted file mode 100755 index 0d0659e..0000000 Binary files a/bin/wkhtmltopdf_centos_7_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_centos_8_amd64.gz b/bin/wkhtmltopdf_centos_8_amd64.gz deleted file mode 100644 index 3a93856..0000000 Binary files a/bin/wkhtmltopdf_centos_8_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_debian_10_amd64.gz b/bin/wkhtmltopdf_debian_10_amd64.gz deleted file mode 100644 index dd49842..0000000 Binary files a/bin/wkhtmltopdf_debian_10_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_debian_10_i386.gz b/bin/wkhtmltopdf_debian_10_i386.gz deleted file mode 100644 index f71af91..0000000 Binary files a/bin/wkhtmltopdf_debian_10_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_debian_9_amd64.gz b/bin/wkhtmltopdf_debian_9_amd64.gz deleted file mode 100755 index d532c94..0000000 Binary files a/bin/wkhtmltopdf_debian_9_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_debian_9_i386.gz b/bin/wkhtmltopdf_debian_9_i386.gz deleted file mode 100755 index 0e808d5..0000000 Binary files a/bin/wkhtmltopdf_debian_9_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_macos_cocoa.gz b/bin/wkhtmltopdf_macos_cocoa.gz deleted file mode 100755 index 5c5f5cc..0000000 Binary files a/bin/wkhtmltopdf_macos_cocoa.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_ubuntu_16.04_amd64.gz b/bin/wkhtmltopdf_ubuntu_16.04_amd64.gz deleted file mode 100755 index cad38a4..0000000 Binary files a/bin/wkhtmltopdf_ubuntu_16.04_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_ubuntu_16.04_i386.gz b/bin/wkhtmltopdf_ubuntu_16.04_i386.gz deleted file mode 100755 index e86e0ae..0000000 Binary files a/bin/wkhtmltopdf_ubuntu_16.04_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_ubuntu_18.04_amd64.gz b/bin/wkhtmltopdf_ubuntu_18.04_amd64.gz deleted file mode 100755 index 2fbed74..0000000 Binary files a/bin/wkhtmltopdf_ubuntu_18.04_amd64.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_ubuntu_18.04_i386.gz b/bin/wkhtmltopdf_ubuntu_18.04_i386.gz deleted file mode 100755 index 3fe90f9..0000000 Binary files a/bin/wkhtmltopdf_ubuntu_18.04_i386.gz and /dev/null differ diff --git a/bin/wkhtmltopdf_ubuntu_20.04_amd64.gz b/bin/wkhtmltopdf_ubuntu_20.04_amd64.gz deleted file mode 100644 index 1889a41..0000000 Binary files a/bin/wkhtmltopdf_ubuntu_20.04_amd64.gz and /dev/null differ diff --git a/docker-compose.yml b/docker-compose.yml index 8027c66..ab0465a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,22 +6,16 @@ services: build: context: . dockerfile: .docker/Dockerfile-ubuntu_16.04 - volumes: - - .:/root/wkhtmltopdf_binary_gem ubuntu_18.04: build: context: . dockerfile: .docker/Dockerfile-ubuntu_18.04 - volumes: - - .:/root/wkhtmltopdf_binary_gem ubuntu_20.04: build: context: . dockerfile: .docker/Dockerfile-ubuntu_20.04 - volumes: - - .:/root/wkhtmltopdf_binary_gem ubuntu_22.04: build: @@ -34,46 +28,40 @@ services: build: context: . dockerfile: .docker/Dockerfile-debian_9 - volumes: - - .:/root/wkhtmltopdf_binary_gem debian_10: build: context: . dockerfile: .docker/Dockerfile-debian_10 - volumes: - - .:/root/wkhtmltopdf_binary_gem centos_6: + platform: linux/x86_64 build: context: . dockerfile: .docker/Dockerfile-centos_6 - volumes: - - .:/root/wkhtmltopdf_binary_gem centos_7: build: context: . dockerfile: .docker/Dockerfile-centos_7 - volumes: - - .:/root/wkhtmltopdf_binary_gem centos_8: build: context: . dockerfile: .docker/Dockerfile-centos_8 - volumes: - - .:/root/wkhtmltopdf_binary_gem + rockylinux_8: build: context: . dockerfile: .docker/Dockerfile-rockylinux_8 - volumes: - - .:/root/wkhtmltopdf_binary_gem archlinux: + platform: linux/x86_64 build: context: . dockerfile: .docker/Dockerfile-archlinux - volumes: - - .:/root/wkhtmltopdf_binary_gem + + amazonlinux2: + build: + context: . + dockerfile: .docker/Dockerfile-amazonlinux2 diff --git a/test/test_with_docker.rb b/test/test_with_docker.rb index 387a347..65bbf0d 100644 --- a/test/test_with_docker.rb +++ b/test/test_with_docker.rb @@ -6,7 +6,7 @@ def macos? class WithDockerTest < Minitest::Test SETUP = begin - `docker-compose build --no-cache` unless macos? + `docker-compose build` unless macos? end def test_centos_6 @@ -29,37 +29,41 @@ def test_debian_10 test with: 'debian_10' end - def test_with_ubuntu_16 + def test_ubuntu_16 test with: 'ubuntu_16.04' end - def test_with_ubuntu_18 + def test_ubuntu_18 test with: 'ubuntu_18.04' end - def test_with_ubuntu_20 + def test_ubuntu_20 test with: 'ubuntu_20.04' end - def test_with_ubuntu_22 + def test_ubuntu_22 test with: 'ubuntu_22.04' end - def test_with_archlinux + def test_archlinux test with: 'archlinux' end def test_rockylinux_8 test with: 'rockylinux_8' end + + def test_amazonlinux2 + test with: 'amazonlinux2' + end - def test_with_macos - assert_equal(`bin/wkhtmltopdf --version`.strip, 'wkhtmltopdf 0.12.6 (with patched qt)') if macos? + def test_macos + 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)') unless macos? + assert_equal('wkhtmltopdf 0.12.6 (with patched qt)', `docker-compose run --rm #{with}`.strip) unless macos? end end diff --git a/wkhtmltopdf-binary.gemspec b/wkhtmltopdf-binary.gemspec index ba25552..37651a4 100644 --- a/wkhtmltopdf-binary.gemspec +++ b/wkhtmltopdf-binary.gemspec @@ -8,7 +8,11 @@ Gem::Specification.new do |s| s.email = "zakird@gmail.com" s.platform = Gem::Platform::RUBY s.summary = "Provides binaries for WKHTMLTOPDF project in an easily accessible package." - s.files = Dir['bin/*'] + s.files = Dir[ + 'bin/download_link_matrix.rb', + 'bin/wkhtmltopdf', + 'bin/wkhtmltopdf-binary.rb', + ] s.executables << "wkhtmltopdf" s.require_path = '.'