summary refs log tree commit diff
path: root/pkgs/applications/misc/redshift/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-05-15 23:43:30 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-05-16 01:02:31 -0500
commitbb831b7946bb504fbeaf05fca8698598505d3e76 (patch)
treece34a4e1264713653e2f089082e7efd54a44f1c0 /pkgs/applications/misc/redshift/default.nix
parentd6c9efa223a9bb39b38378b5ee5e7b5490a70071 (diff)
downloadnixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar.gz
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar.bz2
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar.lz
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar.xz
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.tar.zst
nixpkgs-bb831b7946bb504fbeaf05fca8698598505d3e76.zip
redshift: support macosx
Diffstat (limited to 'pkgs/applications/misc/redshift/default.nix')
-rw-r--r--pkgs/applications/misc/redshift/default.nix30
1 files changed, 23 insertions, 7 deletions
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index b7ab092bbc0..dc31da671e9 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -1,6 +1,12 @@
 { stdenv, fetchFromGitHub, fetchurl, autoconf, automake, gettext, intltool
-, libtool, pkgconfig, wrapGAppsHook, wrapPython, geoclue2, gobjectIntrospection
-, gtk3, python, pygobject3, pyxdg, libdrm, libxcb, hicolor-icon-theme }:
+, libtool, pkgconfig, wrapGAppsHook, wrapPython, gobjectIntrospection
+, gtk3, python, pygobject3, hicolor-icon-theme, pyxdg
+
+, withCoreLocation ? stdenv.isDarwin, CoreLocation, Foundation, Cocoa
+, withQuartz ? stdenv.isDarwin, ApplicationServices
+, withRandr ? stdenv.isLinux, libxcb
+, withDrm ? stdenv.isLinux, libdrm
+, withGeoclue ? stdenv.isLinux, geoclue }:
 
 stdenv.mkDerivation rec {
   name = "redshift-${version}";
@@ -29,15 +35,25 @@ stdenv.mkDerivation rec {
     wrapPython
   ];
 
+  configureFlags = [
+    "--enable-randr=${if withRandr then "yes" else "no"}"
+    "--enable-geoclue2=${if withGeoclue then "yes" else "no"}"
+    "--enable-drm=${if withDrm then "yes" else "no"}"
+    "--enable-quartz=${if withQuartz then "yes" else "no"}"
+    "--enable-corelocation=${if withCoreLocation then "yes" else "no"}"
+  ];
+
   buildInputs = [
-    geoclue2
     gobjectIntrospection
     gtk3
-    libdrm
-    libxcb
     python
     hicolor-icon-theme
-  ];
+  ] ++ stdenv.lib.optional  withRandr        libxcb
+    ++ stdenv.lib.optional  withGeoclue      geoclue
+    ++ stdenv.lib.optional  withDrm          libdrm
+    ++ stdenv.lib.optional  withQuartz       ApplicationServices
+    ++ stdenv.lib.optionals withCoreLocation [ CoreLocation Foundation Cocoa ]
+    ;
 
   pythonPath = [ pygobject3 pyxdg ];
 
@@ -59,7 +75,7 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.gpl3Plus;
     homepage = http://jonls.dk/redshift;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ yegortimoshenko ];
   };
 }