homebrew-core/Formula/redshift.rb
2018-05-25 09:58:16 +02:00

82 lines
2.3 KiB
Ruby

class Redshift < Formula
desc "Adjust color temperature of your screen according to your surroundings"
homepage "http://jonls.dk/redshift/"
url "https://github.com/jonls/redshift/releases/download/v1.12/redshift-1.12.tar.xz"
sha256 "d2f8c5300e3ce2a84fe6584d2f1483aa9eadc668ab1951b2c2b8a03ece3a22ba"
bottle do
sha256 "39794fc0af4bae10ccfa98921acb933c414dbb858e25515dfbff38659d7b8b77" => :high_sierra
sha256 "30ff6fd3a0bb4d73bd9c3855467fe9b0cf78c8f084083e103ef702587fba98cc" => :sierra
sha256 "365aba46b3ea942d56749f405633093fc7e774bc4b27acefdc5ed0a87bdd4d67" => :el_capitan
end
head do
url "https://github.com/jonls/redshift.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "glib"
def install
args = %W[
--prefix=#{prefix}
--enable-corelocation
--disable-silent-rules
--disable-dependency-tracking
--disable-geoclue
--disable-geoclue2
--enable-quartz
--with-systemduserunitdir=no
--disable-gui
]
system "./bootstrap" if build.head?
system "./configure", *args
system "make", "install"
pkgshare.install "redshift.conf.sample"
end
def caveats; <<~EOS
A sample .conf file has been installed to #{opt_pkgshare}.
Please note redshift expects to read its configuration file from
#{ENV["HOME"]}/.config/redshift/redshift.conf
EOS
end
plist_options :manual => "redshift"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/redshift</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
EOS
end
test do
system "#{bin}/redshift", "-V"
end
end