Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wkhtmltopdf: unbreak package #327641

Merged
merged 3 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions pkgs/tools/graphics/wkhtmltopdf-bin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
, zlib
, openssl
, fetchurl
, dpkg
, gcc-unwrapped
, libjpeg8
, libjpeg
, libpng
, fontconfig
, stdenv
Expand Down Expand Up @@ -39,13 +40,13 @@ let
};

linuxAttrs = rec {
version = "0.12.6-3";
version = "0.12.6.1-3";
src = fetchurl {
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox-${version}.archlinux-x86_64.pkg.tar.xz";
sha256 = "sha256-6Ewu8sPRbqvYWj27mBlQYpEN+mb+vKT46ljrdEUxckI=";
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox_${version}.bookworm_amd64.deb";
hash = "sha256-mLoNFXtQ028jvQ3t9MCqKMewxQ/NzcVKpba7uoGjlB0=";
};

nativeBuildInputs = [ autoPatchelfHook ];
nativeBuildInputs = [ dpkg autoPatchelfHook ];

buildInputs = [
xorg.libXext
Expand All @@ -57,16 +58,24 @@ let

(lib.getLib fontconfig)
(lib.getLib gcc-unwrapped)
(lib.getLib libjpeg8)
(lib.getLib libjpeg)
(lib.getLib libpng)
];

unpackPhase = "tar -xf $src";
unpackPhase = ''
runHook preUnpack

mkdir pkg
dpkg-deb -x $src pkg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does fetchzip decompress it? idk

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technally yes, there is one package doing it, pkgs/by-name/te/tetrio-desktop/package.nix. All of the others are using fetchurl.

I prefer using fetchurl as the hash is on the content and can be easily calculated separately.


runHook postUnpack
'';

installPhase = ''
runHook preInstall
mkdir -p $out
cp -r usr/bin usr/include usr/lib usr/share $out/

cp -r pkg/usr/local $out

runHook postInstall
'';
};
Expand Down
57 changes: 0 additions & 57 deletions pkgs/tools/graphics/wkhtmltopdf/default.nix

This file was deleted.

7 changes: 2 additions & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14432,11 +14432,8 @@ with pkgs;

wireguard-go = callPackage ../tools/networking/wireguard-go { };

wkhtmltopdf = libsForQt5.callPackage ../tools/graphics/wkhtmltopdf { };

wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin {
openssl = openssl_1_1;
};
wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin { };
wkhtmltopdf = wkhtmltopdf-bin;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hydra doesn't allow aliases to be passed to packages.

we could rename all the inputs, or keep this manual alias here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


wml = callPackage ../development/web/wml { };

Expand Down