homebrew-core/Formula/khal.rb

59 lines
1.7 KiB
Ruby

class Khal < Formula
include Language::Python::Virtualenv
desc "CLI calendar application."
homepage "https://lostpackets.de/khal/"
url "https://github.com/pimutils/khal.git",
:tag => "v0.9.3",
:revision => "1c41fae70eac6a138d68e84dbd971d13aff6fdee"
head "https://github.com/pimutils/khal.git"
bottle do
sha256 "d7a1285feb4d66315e7f217df6ad962841a234fb3f5a37e8911310a97b1e41bb" => :sierra
sha256 "d17fb2cfbcfb7c94c822da7a22f516f7985ce3c94299a5a3b913e2347b57b096" => :el_capitan
sha256 "ccfb9dfa012687c98032faca2be743fab246bd1f6876c6ae4a22de7713b0a5ac" => :yosemite
end
depends_on :python3
def install
venv = virtualenv_create(libexec, "python3")
system libexec/"bin/pip", "install", "-v", "--no-binary", ":all:",
"--ignore-installed", buildpath
system libexec/"bin/pip", "uninstall", "-y", name
venv.pip_install_and_link buildpath
end
test do
ENV["LC_ALL"] = "en_US.UTF-8"
ENV["LANG"] = "en_US.UTF-8"
(testpath/".calendar/test/01ef8547.ics").write <<-EOS.undent
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART;VALUE=DATE:20130726
SUMMARY:testevent
DTEND;VALUE=DATE:20130727
LAST-MODIFIED:20130725T142824Z
DTSTAMP:20130725T142824Z
CREATED:20130725T142824Z
UID:01ef8547
END:VEVENT
END:VCALENDAR
EOS
(testpath/".config/khal/config").write <<-EOS.undent
[calendars]
[[test]]
path = #{testpath}/.calendar/test/
color = light gray
[sqlite]
path = #{testpath}/.calendar/khal.db
[locale]
firstweekday = 0
[default]
default_calendar = test
EOS
system "#{bin}/khal", "--no-color", "search", "testevent"
end
end