59 lines
1.7 KiB
Ruby
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.9",
|
|
:revision => "edce128b42401fb89ca18f501ae2be1449cdc6b2"
|
|
head "https://github.com/pimutils/khal.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "fe245aa76344628390b7dee623c52cb01d7f5ab2cd0deb89f4e16a5b02f55898" => :high_sierra
|
|
sha256 "708968ff9cc6966ce3ebef56185fc91a14ecebebd5562756f9113f1dd8866106" => :sierra
|
|
sha256 "f7a7f4e11251fed7e03fe45280030b9cda5693ebef46934dca3012ad560642b5" => :el_capitan
|
|
end
|
|
|
|
depends_on "python"
|
|
|
|
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
|
|
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
|
|
[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
|