From 608ef255c3e852c39131336fe27a18273e50c9a2 Mon Sep 17 00:00:00 2001 From: "Satadru Pramanik, DO, MPH, MEng" Date: Thu, 9 May 2024 22:27:10 -0400 Subject: [PATCH] Re-add wkhtmltox (#9773) * Revert "Remove wkhtmltox (#9772)" This reverts commit f35e69ff3982d7baba26f6d1f5148862cc5da60d. * fixup package file and update compatibility and deps Signed-off-by: Satadru Pramanik * update activity in packages.yaml Signed-off-by: Satadru Pramanik --------- Signed-off-by: Satadru Pramanik --- lib/fixup.rb | 3 +-- manifest/x86_64/w/wkhtmltox.filelist | 12 +++++++++ packages/wkhtmltox.rb | 39 ++++++++++++++++++++++++++++ tools/packages.yaml | 5 ++++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 manifest/x86_64/w/wkhtmltox.filelist create mode 100644 packages/wkhtmltox.rb diff --git a/lib/fixup.rb b/lib/fixup.rb index 93f1e7745..7efc02202 100644 --- a/lib/fixup.rb +++ b/lib/fixup.rb @@ -61,8 +61,7 @@ pkg_update_arr = [ { pkg_name: 'qtwebsockets', pkg_rename: 'qt5_websockets', pkg_deprecated: nil, comments: nil }, { pkg_name: 'qtx11extras', pkg_rename: 'qt5_x11extras', pkg_deprecated: nil, comments: nil }, { pkg_name: 'ruby_debug', pkg_rename: nil, pkg_deprecated: true, comments: 'Integrated into ruby package.' }, - { pkg_name: 'wget', pkg_rename: 'wget2', pkg_deprecated: nil, comments: 'Renamed to better match upstream.' }, - { pkg_name: 'wkhtmltox', pkg_rename: nil, pkg_deprecated: true, comments: 'Deprecated upstream with unpatched CVE-2022-35583.' } + { pkg_name: 'wget', pkg_rename: 'wget2', pkg_deprecated: nil, comments: 'Renamed to better match upstream.' } ] pkg_update_arr.each do |pkg| diff --git a/manifest/x86_64/w/wkhtmltox.filelist b/manifest/x86_64/w/wkhtmltox.filelist new file mode 100644 index 000000000..2c4be59bf --- /dev/null +++ b/manifest/x86_64/w/wkhtmltox.filelist @@ -0,0 +1,12 @@ +/usr/local/bin/wkhtmltoimage +/usr/local/bin/wkhtmltopdf +/usr/local/include/wkhtmltox/dllbegin.inc +/usr/local/include/wkhtmltox/dllend.inc +/usr/local/include/wkhtmltox/image.h +/usr/local/include/wkhtmltox/pdf.h +/usr/local/lib64/libwkhtmltox.so +/usr/local/lib64/libwkhtmltox.so.0 +/usr/local/lib64/libwkhtmltox.so.0.12 +/usr/local/lib64/libwkhtmltox.so.0.12.4 +/usr/local/share/man/man1/wkhtmltoimage.1.zst +/usr/local/share/man/man1/wkhtmltopdf.1.zst diff --git a/packages/wkhtmltox.rb b/packages/wkhtmltox.rb new file mode 100644 index 000000000..00902f183 --- /dev/null +++ b/packages/wkhtmltox.rb @@ -0,0 +1,39 @@ +require 'package' + +class Wkhtmltox < Package + description 'Convert HTML to PDF using Webkit (QtWebKit)' + homepage 'https://wkhtmltopdf.org/' + version '0.12.4' + license 'LGPL-3' + compatibility 'x86_64' + source_url({ + x86_64: 'https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz' + }) + source_sha256({ + x86_64: '049b2cdec9a8254f0ef8ac273afaf54f7e25459a273e27189591edc7d7cf29db' + }) + + depends_on 'gcc_lib' # R + depends_on 'glibc' # R + depends_on 'libx11' # R + depends_on 'libxext' # R + depends_on 'libxrender' # R + depends_on 'zlibpkg' # R + + def self.install + FileUtils.mkdir_p CREW_DEST_PREFIX + FileUtils.mkdir_p CREW_DEST_LIB_PREFIX + FileUtils.cp_r 'bin/', CREW_DEST_PREFIX + FileUtils.cp_r Dir.glob('lib/*'), CREW_DEST_LIB_PREFIX + FileUtils.cp_r 'share/', CREW_DEST_PREFIX + FileUtils.cp_r 'include/', CREW_DEST_PREFIX + end + + def self.postinstall + ExitMessage.add <<~EOT1.lightpurple + Note that the wkkhtmlto{image,pdf} programs are vulnerable as per + CVE-2020-21365 and CVE-2022-35583. As such, please be careful with + html files that you convert with this package. + EOT1 + end +end diff --git a/tools/packages.yaml b/tools/packages.yaml index ee536fb13..0ef31e974 100644 --- a/tools/packages.yaml +++ b/tools/packages.yaml @@ -9136,6 +9136,11 @@ url: https://github.com/charmbracelet/wishlist/releases activity: high --- kind: url +name: wkhtmltox +url: https://github.com/wkhtmltopdf/wkhtmltopdf/releases +activity: none +--- +kind: url name: wl_clipboard url: https://github.com/bugaevc/wl-clipboard/releases/ activity: medium