tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
wkhtmltopdf-bin: add support for Linux
Wael M. Nasreddine
3 years ago
c67eb446
e703a434
+74
-21
2 changed files
expand all
collapse all
unified
split
pkgs
tools
graphics
wkhtmltopdf-bin
default.nix
top-level
all-packages.nix
+71
-20
pkgs/tools/graphics/wkhtmltopdf-bin/default.nix
···
1
-
{ stdenv, lib, fetchurl, wkhtmltopdf, xar, cpio }:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3
-
stdenv.mkDerivation rec {
0
0
0
0
0
0
4
5
-
pname = "wkhtmltopdf-bin";
6
-
version = "0.12.6-1";
7
-
sha256 = "1db59kdprzpmvdj1bg47lmfgi3zlvzvqif11sbym9hw61xy6gp3d";
8
-
src = fetchurl {
9
-
url =
10
-
"https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox-${version}.macos-cocoa.pkg";
11
-
inherit sha256;
0
0
0
0
0
12
};
13
14
-
buildInputs = [ xar cpio ];
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
15
16
-
unpackPhase = ''
17
-
xar -xf $src
18
-
zcat Payload | cpio -i
19
-
tar -xf usr/local/share/wkhtmltox-installer/wkhtmltox.tar.gz
20
-
'';
21
22
-
installPhase = ''
23
-
mkdir -p $out
24
-
cp -r bin include lib share $out/
25
-
'';
0
0
0
0
26
27
dontStrip = true;
28
···
46
'';
47
license = licenses.gpl3Plus;
48
maintainers = with maintainers; [ nbr ];
49
-
platforms = [ "x86_64-darwin" ];
50
};
51
}
0
0
0
···
1
+
{ lib
2
+
, autoPatchelfHook
3
+
, cpio
4
+
, freetype
5
+
, zlib
6
+
, openssl
7
+
, dpkg
8
+
, fetchurl
9
+
, gcc-unwrapped
10
+
, libjpeg8
11
+
, libpng
12
+
, fontconfig
13
+
, stdenv
14
+
, wkhtmltopdf
15
+
, xar
16
+
, xorg
17
+
}:
18
19
+
let
20
+
darwinAttrs = rec {
21
+
version = "0.12.6-2";
22
+
src = fetchurl {
23
+
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox-${version}.macos-cocoa.pkg";
24
+
sha256 = "sha256-gaZrd7UI/t6NvKpnEnIDdIN2Vos2c6F/ZhG21R6YlPg=";
25
+
};
26
27
+
nativeBuildInputs = [ xar cpio ];
28
+
29
+
unpackPhase = ''
30
+
xar -xf $src
31
+
zcat Payload | cpio -i
32
+
tar -xf usr/local/share/wkhtmltox-installer/wkhtmltox.tar.gz
33
+
'';
34
+
35
+
installPhase = ''
36
+
mkdir -p $out
37
+
cp -r bin include lib share $out/
38
+
'';
39
};
40
41
+
linuxAttrs = rec {
42
+
version = "0.12.6-3";
43
+
src = fetchurl {
44
+
url = "https://github.com/wkhtmltopdf/packaging/releases/download/${version}/wkhtmltox-${version}.archlinux-x86_64.pkg.tar.xz";
45
+
sha256 = "sha256-6Ewu8sPRbqvYWj27mBlQYpEN+mb+vKT46ljrdEUxckI=";
46
+
};
47
+
48
+
nativeBuildInputs = [ autoPatchelfHook ];
49
+
50
+
buildInputs = [
51
+
xorg.libXext
52
+
xorg.libXrender
53
+
54
+
freetype
55
+
openssl
56
+
zlib
57
+
58
+
(lib.getLib fontconfig)
59
+
(lib.getLib gcc-unwrapped)
60
+
(lib.getLib libjpeg8)
61
+
(lib.getLib libpng)
62
+
];
63
64
+
unpackPhase = "tar -xf $src";
0
0
0
0
65
66
+
installPhase = ''
67
+
mkdir -p $out
68
+
cp -r usr/bin usr/include usr/lib usr/share $out/
69
+
'';
70
+
};
71
+
in
72
+
stdenv.mkDerivation ({
73
+
pname = "wkhtmltopdf-bin";
74
75
dontStrip = true;
76
···
94
'';
95
license = licenses.gpl3Plus;
96
maintainers = with maintainers; [ nbr ];
97
+
platforms = [ "x86_64-darwin" "x86_64-linux" ];
98
};
99
}
100
+
// lib.optionalAttrs (stdenv.hostPlatform.isDarwin) darwinAttrs
101
+
// lib.optionalAttrs (stdenv.hostPlatform.isLinux) linuxAttrs
102
+
)
+3
-1
pkgs/top-level/all-packages.nix
···
12027
12028
wkhtmltopdf = libsForQt514.callPackage ../tools/graphics/wkhtmltopdf { };
12029
12030
-
wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin { };
0
0
12031
12032
wml = callPackage ../development/web/wml { };
12033
···
12027
12028
wkhtmltopdf = libsForQt514.callPackage ../tools/graphics/wkhtmltopdf { };
12029
12030
+
wkhtmltopdf-bin = callPackage ../tools/graphics/wkhtmltopdf-bin {
12031
+
libjpeg8 = libjpeg.override { enableJpeg8 = true; };
12032
+
};
12033
12034
wml = callPackage ../development/web/wml { };
12035