nixos/librenms: use db socket when set and add package option (#359182)
[NixPkgs.git] / pkgs / development / libraries / kde-frameworks / kdoctools / default.nix
blob2347920c863d0242be6c329e76697a3d88eafabf
2   mkDerivation,
3   lib,
4   stdenv,
5   fetchpatch,
6   extra-cmake-modules,
7   docbook_xml_dtd_45,
8   docbook_xsl_ns,
9   karchive,
10   ki18n,
11   qtbase,
12   perl,
13   perlPackages,
16 mkDerivation {
17   pname = "kdoctools";
18   nativeBuildInputs = [
19     extra-cmake-modules
20     # The build system insists on having native Perl.
21     perl
22     perlPackages.URI
23   ];
24   propagatedBuildInputs = [
25     # kdoctools at runtime actually needs Perl for the platform kdoctools is
26     # running on, not necessarily native perl.
27     perl
28     perlPackages.URI
29     qtbase
30   ];
31   buildInputs = [
32     karchive
33     ki18n
34   ];
35   outputs = [
36     "out"
37     "dev"
38   ];
39   patches =
40     [ ./kdoctools-no-find-docbook-xml.patch ]
41     # kf.doctools.core: Error: Could not find kdoctools catalogs
42     ++ lib.optionals stdenv.hostPlatform.isDarwin [
43       (fetchpatch {
44         name = "kdoctools-relocate-datapath.patch";
45         url = "https://github.com/msys2/MINGW-packages/raw/0900785a1f4e4146ab9561fb92a1c70fa70fcfc4/mingw-w64-kdoctools-qt5/0001-kdoctools-relocate-datapath.patch";
46         hash = "sha256-MlokdrabXavWHGXYmdz9zZDJQIwAdNxebJBSAH2Z3vI=";
47       })
48     ];
49   cmakeFlags = [
50     "-DDocBookXML4_DTD_DIR=${docbook_xml_dtd_45}/xml/dtd/docbook"
51     "-DDocBookXSL_DIR=${docbook_xsl_ns}/xml/xsl/docbook"
52   ];
53   postFixup = ''
54     moveToOutput "share/doc" "$dev"
55     moveToOutput "share/man" "$dev"
56   '';