1{
2 qtModule,
3 stdenv,
4 lib,
5 fetchurl,
6 qtbase,
7 qtdeclarative,
8 qtlocation,
9 qtmultimedia,
10 qtsensors,
11 qtwebchannel,
12 fontconfig,
13 libwebp,
14 libxml2,
15 libxslt,
16 sqlite,
17 systemd,
18 glib,
19 gst_all_1,
20 cmake,
21 bison,
22 flex,
23 gdb,
24 gperf,
25 perl,
26 pkg-config,
27 python3,
28 ruby,
29}:
30
31let
32 hyphen = stdenv.mkDerivation rec {
33 pname = "hyphen";
34 version = "2.8.8";
35 src = fetchurl {
36 url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz";
37 sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705";
38 };
39 postPatch = ''
40 patchShebangs tests
41 '';
42 buildInputs = [ perl ];
43 };
44in
45qtModule {
46 pname = "qtwebkit";
47 propagatedBuildInputs = [
48 qtbase
49 qtdeclarative
50 qtlocation
51 qtsensors
52 qtwebchannel
53 ]
54 ++ lib.optional stdenv.hostPlatform.isDarwin qtmultimedia;
55 buildInputs = [
56 fontconfig
57 libwebp
58 libxml2
59 libxslt
60 sqlite
61 glib
62 gst_all_1.gstreamer
63 gst_all_1.gst-plugins-base
64 hyphen
65 ];
66 nativeBuildInputs = [
67 bison
68 flex
69 gdb
70 gperf
71 perl
72 pkg-config
73 python3
74 ruby
75 cmake
76 ];
77
78 cmakeFlags = [
79 "-DPORT=Qt"
80 ]
81 ++ lib.optionals stdenv.hostPlatform.isDarwin [
82 "-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
83 "-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
84 "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
85 ];
86
87 env.NIX_CFLAGS_COMPILE = toString (
88 [
89 # with gcc7 this warning blows the log over Hydra's limit
90 "-Wno-expansion-to-defined"
91 ]
92 # with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
93 ++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
94 # with clang this warning blows the log over Hydra's limit
95 ++ lib.optional stdenv.hostPlatform.isDarwin "-Wno-inconsistent-missing-override"
96 ++ lib.optional (
97 !stdenv.hostPlatform.isDarwin
98 ) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"''
99 );
100
101 doCheck = false; # fails 13 out of 13 tests (ctest)
102
103 # remove forbidden references to $TMPDIR
104 preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
105 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/libexec/*
106 '';
107
108 enableParallelBuilding = true;
109
110 meta = {
111 maintainers = with lib.maintainers; [
112 abbradar
113 periklis
114 ];
115 knownVulnerabilities = [
116 "QtWebkit upstream is unmaintained and receives no security updates, see https://blogs.gnome.org/mcatanzaro/2022/11/04/stop-using-qtwebkit/"
117 ];
118 };
119}