From e3a09a5f147f43b4b13fa17022fcfae4c4e99f77 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Wed, 4 Sep 2024 07:13:09 +0000 Subject: [PATCH] wkhtmltopdf: restore support for aarch64-linux Some production instances of odoo run on aarch64-linux, which depends on wkhtmltopdf. Commit 569d5e54 moved to the -bin release of wkhtmltopdf but did not include the binary package for aarch64-linux. This commit extends the -bin packaging to pull the "arm64" release for aarch64-linux. Signed-off-by: Sirio Balmelli --- pkgs/tools/graphics/wkhtmltopdf/default.nix | 28 ++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/graphics/wkhtmltopdf/default.nix b/pkgs/tools/graphics/wkhtmltopdf/default.nix index 36c220557cdc..980081b3dde7 100644 --- a/pkgs/tools/graphics/wkhtmltopdf/default.nix +++ b/pkgs/tools/graphics/wkhtmltopdf/default.nix @@ -39,13 +39,7 @@ let ''; }; - linuxAttrs = rec { - version = "0.12.6.1-3"; - src = fetchurl { - url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_amd64.deb"; - hash = "sha256-mLoNFXtQ028jvQ3t9MCqKMewxQ/NzcVKpba7uoGjlB0="; - }; - + _linuxAttrs = { nativeBuildInputs = [ dpkg autoPatchelfHook ]; buildInputs = [ @@ -79,6 +73,22 @@ let runHook postInstall ''; }; + + linuxAttrs.aarch64-linux = rec { + version = "0.12.6.1-3"; + src = fetchurl { + url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_arm64.deb"; + hash = "sha256-tmBhV7J8E+BE0Ku+ZwMB+I3k4Xgq/KT5wGpYF/PgOpw="; + }; + } // _linuxAttrs; + + linuxAttrs.x86_64-linux = rec { + version = "0.12.6.1-3"; + src = fetchurl { + url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_amd64.deb"; + hash = "sha256-mLoNFXtQ028jvQ3t9MCqKMewxQ/NzcVKpba7uoGjlB0="; + }; + } // _linuxAttrs; in stdenv.mkDerivation ({ pname = "wkhtmltopdf"; @@ -105,9 +115,9 @@ stdenv.mkDerivation ({ ''; license = licenses.gpl3Plus; maintainers = with maintainers; [ nbr kalbasit ]; - platforms = [ "x86_64-darwin" "x86_64-linux" ]; + platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ]; }; } // lib.optionalAttrs (stdenv.hostPlatform.isDarwin) darwinAttrs -// lib.optionalAttrs (stdenv.hostPlatform.isLinux) linuxAttrs +// lib.optionalAttrs (stdenv.hostPlatform.isLinux) linuxAttrs.${stdenv.system} )