diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 9a6e38187f..b14ebd8218 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -33,6 +33,23 @@ mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "GRANT ALL PRIVILEGES ON mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "FLUSH PRIVILEGES" install_whktml() { + local arch os_like wkhtml_package + + arch="$(dpkg --print-architecture)" + os_like="$(. /etc/os-release && printf '%s %s' "$ID" "$ID_LIKE")" + + if echo "$os_like" | grep -Eq '(^| )ubuntu( |$)'; then + wkhtml_package="wkhtmltox_0.12.6.1-3.jammy_${arch}.deb" + elif echo "$os_like" | grep -Eq '(^| )debian( |$)'; then + wkhtml_package="wkhtmltox_0.12.6.1-3.bookworm_${arch}.deb" + fi + + if [ -n "$wkhtml_package" ] \ + && wget -O "/tmp/${wkhtml_package}" "https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/${wkhtml_package}" \ + && sudo apt install -y xvfb xfonts-75dpi xfonts-base "/tmp/${wkhtml_package}"; then + return + fi + wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz tar -xf /tmp/wkhtmltox.tar.xz -C /tmp sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf diff --git a/README.md b/README.md index 2c4c1024f8..e87df96681 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,11 @@ Use the following credentials to log in: ### Local -1. Set up bench by following the [Installation Steps](https://frappeframework.com/docs/user/en/installation) and start the server and keep it running +1. Set up bench by following the [Installation Steps](https://docs.frappe.io/framework/user/en/installation) and start the server and keep it running ```sh - $ bench start + bench start ``` + For Debian and Ubuntu derivatives, install the distro-specific `wkhtmltox` package from the official [wkhtmltopdf packaging releases](https://github.com/wkhtmltopdf/packaging/releases/tag/0.12.6.1-3) (`bookworm` for Debian/Parrot, `jammy` for Ubuntu) instead of using the placeholder `wkhtmltox_file.deb` command from the generic downloads page. 2. In a separate terminal window, run the following commands ```sh $ bench new-site hrms.localhost