about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/colord
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/colord')
-rw-r--r--nixpkgs/pkgs/tools/misc/colord/default.nix114
-rw-r--r--nixpkgs/pkgs/tools/misc/colord/installed-tests-path.patch72
2 files changed, 186 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/misc/colord/default.nix b/nixpkgs/pkgs/tools/misc/colord/default.nix
new file mode 100644
index 000000000000..89435332c9cb
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/colord/default.nix
@@ -0,0 +1,114 @@
+{ lib, stdenv
+, fetchurl
+, nixosTests
+, bash-completion
+, glib
+, polkit
+, pkg-config
+, gettext
+, gusb
+, lcms2
+, sqlite
+, systemd
+, dbus
+, gobject-introspection
+, argyllcms
+, meson
+, ninja
+, vala
+, libgudev
+, wrapGAppsHook
+, shared-mime-info
+, sane-backends
+, docbook_xsl
+, docbook_xsl_ns
+, docbook_xml_dtd_412
+, gtk-doc
+, libxslt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "colord";
+  version = "1.4.5";
+
+  outputs = [ "out" "dev" "devdoc" "man" "installedTests" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/colord/releases/${pname}-${version}.tar.xz";
+    sha256 = "05sydi6qqqx1rrqwnga1vbg9srkf89wdcfw5w4p4m7r37m2flx5p";
+  };
+
+  patches = [
+    # Put installed tests into its own output
+    ./installed-tests-path.patch
+  ];
+
+  postPatch = ''
+    for file in data/tests/meson.build lib/colord/cd-test-shared.c lib/colord/meson.build; do
+        substituteInPlace $file --subst-var-by installed_tests_dir "$installedTests"
+    done
+  '';
+
+  mesonFlags = [
+    "--localstatedir=/var"
+    "-Dinstalled_tests=true"
+    "-Dlibcolordcompat=true"
+    "-Dsane=true"
+    "-Dvapi=true"
+    "-Ddaemon_user=colord"
+  ];
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_412
+    docbook_xsl
+    docbook_xsl_ns
+    gettext
+    gobject-introspection
+    gtk-doc
+    libxslt
+    meson
+    ninja
+    pkg-config
+    shared-mime-info
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    argyllcms
+    bash-completion
+    dbus
+    glib
+    gusb
+    lcms2
+    libgudev
+    polkit
+    sane-backends
+    sqlite
+    systemd
+  ];
+
+  postInstall = ''
+    glib-compile-schemas $out/share/glib-2.0/schemas
+  '';
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
+  PKG_CONFIG_SYSTEMD_TMPFILESDIR = "${placeholder "out"}/lib/tmpfiles.d";
+  PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions";
+  PKG_CONFIG_UDEV_UDEVDIR = "${placeholder "out"}/lib/udev";
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.colord;
+    };
+  };
+
+  meta = with lib; {
+    description = "System service to manage, install and generate color profiles to accurately color manage input and output devices";
+    homepage = "https://www.freedesktop.org/software/colord/";
+    license = licenses.lgpl2Plus;
+    maintainers = [ maintainers.marcweber ] ++ teams.freedesktop.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/misc/colord/installed-tests-path.patch b/nixpkgs/pkgs/tools/misc/colord/installed-tests-path.patch
new file mode 100644
index 000000000000..6d91cbbcb022
--- /dev/null
+++ b/nixpkgs/pkgs/tools/misc/colord/installed-tests-path.patch
@@ -0,0 +1,72 @@
+diff --git a/data/tests/meson.build b/data/tests/meson.build
+index 8b38f10..250582c 100644
+--- a/data/tests/meson.build
++++ b/data/tests/meson.build
+@@ -17,6 +17,6 @@ if get_option('installed_tests')
+       'test.ccss',
+       'test.sp',
+     ],
+-    install_dir: join_paths(libexecdir, 'installed-tests', 'colord')
++    install_dir: join_paths('@installed_tests_dir@', 'libexec', 'installed-tests', 'colord')
+   )
+ endif
+diff --git a/lib/colord/cd-test-shared.c b/lib/colord/cd-test-shared.c
+index c3b9d23..7577e13 100644
+--- a/lib/colord/cd-test-shared.c
++++ b/lib/colord/cd-test-shared.c
+@@ -45,7 +45,8 @@ cd_test_get_filename (const gchar *filename)
+ 
+ 	/* running in the installed system */
+ 	if (g_getenv ("INSTALLED_TESTS") != NULL) {
+-		return g_build_filename (LIBEXECDIR,
++		return g_build_filename ("@installed_tests_dir@",
++					 "libexec",
+ 					 "installed-tests",
+ 					 PACKAGE_NAME,
+ 					 filename,
+diff --git a/lib/colord/meson.build b/lib/colord/meson.build
+index 61f0518..df71358 100644
+--- a/lib/colord/meson.build
++++ b/lib/colord/meson.build
+@@ -214,20 +214,20 @@ endif
+ if get_option('installed_tests')
+ con2 = configuration_data()
+ con2.set('installedtestsdir',
+-         join_paths(libexecdir, 'installed-tests', 'colord'))
++         join_paths('@installed_tests_dir@', 'libexec', 'installed-tests', 'colord'))
+ configure_file(
+   input : 'colord-daemon.test.in',
+   output : 'colord-daemon.test',
+   configuration : con2,
+   install: true,
+-  install_dir: join_paths('share', 'installed-tests', 'colord'),
++  install_dir: join_paths('@installed_tests_dir@', 'share', 'installed-tests', 'colord'),
+ )
+ configure_file(
+   input : 'colord-private.test.in',
+   output : 'colord-private.test',
+   configuration : con2,
+   install: true,
+-  install_dir: join_paths('share', 'installed-tests', 'colord'),
++  install_dir: join_paths('@installed_tests_dir@', 'share', 'installed-tests', 'colord'),
+ )
+ endif
+ 
+@@ -254,7 +254,7 @@ if get_option('tests')
+       '-DTESTDATADIR="' + testdatadir + '"',
+     ],
+     install : get_option('installed_tests'),
+-    install_dir : join_paths(libexecdir, 'installed-tests', 'colord'),
++    install_dir : join_paths('@installed_tests_dir@','libexec', 'installed-tests', 'colord'),
+   )
+   test('colord-test-private', e)
+   e = executable(
+@@ -278,7 +278,7 @@ if get_option('tests')
+       '-DTESTDATADIR="' + testdatadir + '"',
+     ],
+     install : get_option('installed_tests'),
+-    install_dir : join_paths(libexecdir, 'installed-tests', 'colord'),
++    install_dir : join_paths('@installed_tests_dir@', 'libexec', 'installed-tests', 'colord'),
+   )
+   test('colord-test-daemon', e)
+ endif