frigate: fix event preview (#372427)
[NixPkgs.git] / pkgs / by-name / co / colord / package.nix
blob963b8567fa0baa544212d8e9b05db10c4d920498
2   lib,
3   stdenv,
4   fetchurl,
5   nixosTests,
6   bash-completion,
7   glib,
8   polkit,
9   pkg-config,
10   gettext,
11   gusb,
12   lcms2,
13   sqlite,
14   udev,
15   systemd,
16   enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
17   dbus,
18   gobject-introspection,
19   argyllcms,
20   meson,
21   mesonEmulatorHook,
22   ninja,
23   vala,
24   libgudev,
25   wrapGAppsNoGuiHook,
26   shared-mime-info,
27   sane-backends,
28   docbook_xsl,
29   docbook_xsl_ns,
30   docbook_xml_dtd_412,
31   gtk-doc,
32   libxslt,
33   enableDaemon ? true,
36 stdenv.mkDerivation rec {
37   pname = "colord";
38   version = "1.4.6";
40   outputs = [
41     "out"
42     "dev"
43     "devdoc"
44     "man"
45     "installedTests"
46   ];
48   src = fetchurl {
49     url = "https://www.freedesktop.org/software/colord/releases/colord-${version}.tar.xz";
50     sha256 = "dAdjGie/5dG2cueuQndwAcEF2GC3tzkig8jGMA3ojm8=";
51   };
53   patches = [
54     # Put installed tests into its own output
55     ./installed-tests-path.patch
56   ];
58   postPatch = ''
59     for file in data/tests/meson.build lib/colord/cd-test-shared.c lib/colord/meson.build; do
60         substituteInPlace $file --subst-var-by installed_tests_dir "$installedTests"
61     done
62   '';
64   mesonFlags = [
65     "--localstatedir=/var"
66     "-Dinstalled_tests=true"
67     "-Dlibcolordcompat=true"
68     "-Dsane=true"
69     "-Dvapi=true"
70     "-Ddaemon=${lib.boolToString enableDaemon}"
71     "-Ddaemon_user=colord"
72     (lib.mesonBool "systemd" enableSystemd)
74     # The presence of the "udev" pkg-config module (as opposed to "libudev")
75     # indicates whether rules are supported.
76     (lib.mesonBool "udev_rules" (lib.elem "udev" udev.meta.pkgConfigModules))
77   ];
79   nativeBuildInputs =
80     [
81       docbook_xml_dtd_412
82       docbook_xsl
83       docbook_xsl_ns
84       gettext
85       gobject-introspection
86       gtk-doc
87       libxslt
88       meson
89       ninja
90       pkg-config
91       shared-mime-info
92       vala
93       wrapGAppsNoGuiHook
94     ]
95     ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
96       mesonEmulatorHook
97     ];
99   buildInputs =
100     [
101       argyllcms
102       bash-completion
103       dbus
104       glib
105       gusb
106       lcms2
107       libgudev
108       sane-backends
109       sqlite
110       udev
111     ]
112     ++ lib.optionals enableSystemd [
113       systemd
114     ]
115     ++ lib.optionals enableDaemon [
116       polkit
117     ];
119   postInstall = ''
120     glib-compile-schemas $out/share/glib-2.0/schemas
121   '';
123   PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
124   PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
125   PKG_CONFIG_SYSTEMD_TMPFILESDIR = "${placeholder "out"}/lib/tmpfiles.d";
126   PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR = "${placeholder "out"}/share/bash-completion/completions";
127   PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev";
129   passthru = {
130     tests = {
131       installedTests = nixosTests.installed-tests.colord;
132     };
133   };
135   meta = with lib; {
136     description = "System service to manage, install and generate color profiles to accurately color manage input and output devices";
137     homepage = "https://www.freedesktop.org/software/colord/";
138     license = licenses.lgpl2Plus;
139     maintainers = [ maintainers.marcweber ] ++ teams.freedesktop.members;
140     platforms = platforms.linux;
141   };