calendar.scm 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015 David Thompson <davet@gnu.org>
  3. ;;; Copyright © 2015, 2016, 2017 Leo Famulari <leo@famulari.name>
  4. ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
  5. ;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
  7. ;;; Copyright © 2016, 2021 Stefan Reichoer <stefan@xsteve.at>
  8. ;;; Copyright © 2018, 2019, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com
  10. ;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
  11. ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
  12. ;;; Copyright © 2020 Peng Mei Yu <pengmeiyu@riseup.net>
  13. ;;; Copyright © 2021 Wamm K. D. <jaft.r@outlook.com>
  14. ;;;
  15. ;;; This file is part of GNU Guix.
  16. ;;;
  17. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  18. ;;; under the terms of the GNU General Public License as published by
  19. ;;; the Free Software Foundation; either version 3 of the License, or (at
  20. ;;; your option) any later version.
  21. ;;;
  22. ;;; GNU Guix is distributed in the hope that it will be useful, but
  23. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  24. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. ;;; GNU General Public License for more details.
  26. ;;;
  27. ;;; You should have received a copy of the GNU General Public License
  28. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  29. (define-module (gnu packages calendar)
  30. #:use-module (gnu packages)
  31. #:use-module ((guix licenses) #:prefix license:)
  32. #:use-module (guix git-download)
  33. #:use-module (guix packages)
  34. #:use-module (guix download)
  35. #:use-module (guix build-system gnu)
  36. #:use-module (guix build-system cmake)
  37. #:use-module (guix build-system python)
  38. #:use-module (gnu packages admin)
  39. #:use-module (gnu packages autotools)
  40. #:use-module (gnu packages base)
  41. #:use-module (gnu packages check)
  42. #:use-module (gnu packages dav)
  43. #:use-module (gnu packages docbook)
  44. #:use-module (gnu packages freedesktop)
  45. #:use-module (gnu packages glib)
  46. #:use-module (gnu packages gnome)
  47. #:use-module (gnu packages gtk)
  48. #:use-module (gnu packages icu4c)
  49. #:use-module (gnu packages perl)
  50. #:use-module (gnu packages pkg-config)
  51. #:use-module (gnu packages python)
  52. #:use-module (gnu packages python-xyz)
  53. #:use-module (gnu packages qt)
  54. #:use-module (gnu packages sphinx)
  55. #:use-module (gnu packages sqlite)
  56. #:use-module (gnu packages tcl)
  57. #:use-module (gnu packages time)
  58. #:use-module (gnu packages xml)
  59. #:use-module (srfi srfi-26))
  60. (define-public date
  61. ;; We make the same choice as the Arch package maintainer by choosing a
  62. ;; recent commit to fix some bugs.
  63. ;; https://github.com/Alexays/Waybar/issues/565
  64. (let ((commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082"))
  65. (package
  66. (name "date")
  67. (version (string-append "2.4.1-" (string-take commit 8)))
  68. (source
  69. (origin
  70. (method git-fetch)
  71. (uri (git-reference
  72. (url "https://github.com/HowardHinnant/date")
  73. (commit "9a0ee2542848ab8625984fc8cdbfb9b5414c0082")))
  74. (file-name (git-file-name name version))
  75. (sha256
  76. (base32 "0yxsn0hj22n61bjywysxqgfv7hj5xvsl6isma95fl8xrimpny083"))
  77. (patches
  78. ;; Install pkg-config files
  79. ;; https://github.com/HowardHinnant/date/pull/538
  80. (search-patches "date-output-pkg-config-files.patch"))))
  81. (inputs (list tzdata))
  82. (build-system cmake-build-system)
  83. (arguments
  84. '(#:configure-flags (list "-DUSE_SYSTEM_TZ_DB=ON"
  85. "-DBUILD_SHARED_LIBS=ON"
  86. "-DBUILD_TZ_LIB=ON"
  87. "-DENABLE_DATE_TESTING=ON")
  88. #:phases
  89. (modify-phases %standard-phases
  90. (add-after 'unpack 'patch-bin-bash
  91. (lambda* (#:key inputs #:allow-other-keys)
  92. (substitute* "compile_fail.sh"
  93. (("/bin/bash") (which "bash")))
  94. #t))
  95. (add-after 'unpack 'patch-zoneinfo-path
  96. (lambda* (#:key inputs #:allow-other-keys)
  97. (substitute* "src/tz.cpp"
  98. (("/usr/share/zoneinfo")
  99. (search-input-directory inputs
  100. "share/zoneinfo")))))
  101. (replace 'check
  102. (lambda _
  103. ;; Disable test that requires checking timezone that
  104. ;; isn't set in the build environment.
  105. (substitute* "CTestTestfile.cmake"
  106. (("add_test.tz_test_pass_zoned_time_deduction_test.*") "")
  107. (("set_tests_properties.tz_test_pass_zoned_time_deduction_test.*") ""))
  108. (invoke "make" "testit"))))))
  109. (synopsis "Date and time library for C++11 and C++14")
  110. (description "Date is a header only C++ library that extends the chrono
  111. date algorithms library for calendar dates and durations. It also provides
  112. the <tz.h> library for handling time zones and leap seconds.")
  113. (home-page "https://howardhinnant.github.io/date/date.html")
  114. (license license:expat))))
  115. (define-public libical
  116. (package
  117. (name "libical")
  118. (version "3.0.10")
  119. (source (origin
  120. (method url-fetch)
  121. (uri (string-append
  122. "https://github.com/libical/libical/releases/download/v"
  123. version "/libical-" version ".tar.gz"))
  124. (sha256
  125. (base32
  126. "1d1nqcfilb4k8bc5x85fhnd26l1ski58wpk2nmds6mlxrzkb6czr"))))
  127. (build-system cmake-build-system)
  128. (arguments
  129. '(#:tests? #f ; test suite appears broken
  130. #:parallel-build? #f ;may cause GIR generation failure
  131. #:configure-flags '("-DSHARED_ONLY=true"
  132. ;; required by evolution-data-server
  133. "-DGOBJECT_INTROSPECTION=true"
  134. "-DICAL_GLIB_VAPI=true")
  135. #:phases
  136. (modify-phases %standard-phases
  137. (add-after 'unpack 'patch-docbook-reference
  138. (lambda* (#:key inputs #:allow-other-keys)
  139. (substitute* "doc/reference/libical-glib/libical-glib-docs.sgml.in"
  140. (("http://www.oasis-open.org/docbook/xml/4.3/")
  141. (string-append (assoc-ref inputs "docbook-xml")
  142. "/xml/dtd/docbook/")))
  143. #t))
  144. (add-before 'configure 'patch-paths
  145. (lambda* (#:key inputs #:allow-other-keys)
  146. ;; TODO: libical 3.1.0 supports using TZDIR instead of a hard-coded
  147. ;; zoneinfo database. When that is released we can drop
  148. ;; the tzdata dependency.
  149. (let ((tzdata (assoc-ref inputs "tzdata")))
  150. (substitute* "src/libical/icaltz-util.c"
  151. (("\\\"/usr/share/zoneinfo\\\",")
  152. (string-append "\"" tzdata "/share/zoneinfo\""))
  153. (("\\\"/usr/lib/zoneinfo\\\",") "")
  154. (("\\\"/etc/zoneinfo\\\",") "")
  155. (("\\\"/usr/share/lib/zoneinfo\\\"") "")))
  156. #t)))))
  157. (native-inputs
  158. (list docbook-xml-4.3
  159. gobject-introspection
  160. gtk-doc/stable
  161. perl
  162. pkg-config
  163. vala))
  164. (inputs
  165. (list glib libxml2 tzdata))
  166. (propagated-inputs
  167. ;; In Requires.private of libical.pc.
  168. (list icu4c))
  169. (home-page "https://libical.github.io/libical/")
  170. (synopsis "iCalendar protocols and data formats implementation")
  171. (description
  172. "Libical is an implementation of the iCalendar protocols and protocol
  173. data units.")
  174. ;; Can be used with either license. See COPYING.
  175. (license (list license:lgpl2.1 license:mpl2.0))))
  176. (define-public khal
  177. (package
  178. (name "khal")
  179. (version "0.10.4")
  180. (source (origin
  181. (method url-fetch)
  182. (uri (pypi-uri "khal" version))
  183. (sha256
  184. (base32
  185. "17qj1n2l39pnzk4vjrmql90z7908nivnzcc2g9nj1h31k859inrz"))))
  186. (build-system python-build-system)
  187. (arguments
  188. `(#:tests? #f ; The test suite is unreliable. See <https://bugs.gnu.org/44197>
  189. #:phases (modify-phases %standard-phases
  190. ;; Building the manpage requires khal to be installed.
  191. (add-after 'install 'manpage
  192. (lambda* (#:key inputs outputs #:allow-other-keys)
  193. ;; Make installed package available for running the tests
  194. (add-installed-pythonpath inputs outputs)
  195. (invoke "make" "--directory=doc/" "man")
  196. (install-file
  197. "doc/build/man/khal.1"
  198. (string-append (assoc-ref outputs "out") "/share/man/man1"))
  199. #t)))))
  200. (native-inputs
  201. (list python-setuptools-scm
  202. ;; Required to build manpage
  203. python-sphinxcontrib-newsfeed python-sphinx))
  204. (inputs
  205. (list sqlite
  206. python-configobj
  207. python-dateutil
  208. python-icalendar
  209. python-tzlocal
  210. python-urwid
  211. python-pytz
  212. python-setproctitle
  213. python-atomicwrites
  214. python-click
  215. python-click-log
  216. python-pyxdg))
  217. (synopsis "Console calendar program")
  218. (description "Khal is a standards based console calendar program,
  219. able to synchronize with CalDAV servers through vdirsyncer.")
  220. (home-page "https://lostpackets.de/khal/")
  221. (license license:expat)))
  222. (define-public remind
  223. (package
  224. (name "remind")
  225. (version "3.3.7")
  226. (source
  227. (origin
  228. (method url-fetch)
  229. (uri (string-append "https://dianne.skoll.ca/projects/remind/download/"
  230. "remind-"
  231. (string-join (map (cut string-pad <> 2 #\0)
  232. (string-split version #\.))
  233. ".")
  234. ".tar.gz"))
  235. (sha256
  236. (base32 "0gca7f5gc0zr111c28hxw4hycz1hr9z7s912bpzm92g1s4llxjc7"))))
  237. (build-system gnu-build-system)
  238. (outputs (list "out"
  239. "tcl")) ; more than doubles the closure by >110 MiB
  240. (arguments
  241. '(#:test-target "test"
  242. #:phases
  243. (modify-phases %standard-phases
  244. (add-after 'install 'split-:tcl
  245. (lambda* (#:key inputs outputs #:allow-other-keys)
  246. (let ((out (assoc-ref outputs "out"))
  247. (tcl (assoc-ref outputs "tcl")))
  248. (for-each
  249. (lambda (file)
  250. (let ((from (string-append out "/" file))
  251. (to (string-append tcl "/" file)))
  252. (mkdir-p (dirname to))
  253. (rename-file from to)
  254. ;; For simplicity, wrap all scripts with the same variables
  255. ;; even though, e.g., inetutils is not needed by cm2rem.tcl.
  256. ;; XXX Using WRAP-SCRIPT currently breaks tkremind.
  257. (wrap-program to
  258. `("PATH" ":" prefix
  259. ,(map (lambda (dir)
  260. (string-append dir "/bin"))
  261. (append (list out tcl)
  262. (map (lambda (input)
  263. (assoc-ref inputs input))
  264. (list "tcl" "tk" "inetutils")))))
  265. `("TCLLIBPATH" " " =
  266. (,(getenv "TCLLIBPATH"))))))
  267. (list "bin/cm2rem.tcl"
  268. "bin/tkremind"))))))))
  269. (inputs
  270. (list inetutils tcl tcllib tk))
  271. (home-page "https://dianne.skoll.ca/projects/remind/")
  272. (synopsis "Sophisticated calendar and alarm program")
  273. (description
  274. "Remind allows you to remind yourself of upcoming events and appointments.
  275. Each reminder or alarm can consist of a message sent to standard output, or a
  276. program to be executed. It also features: sophisticated date calculation,
  277. moon phases, sunrise/sunset, Hebrew calendar, alarms, PostScript output and
  278. proper handling of holidays.")
  279. (license license:gpl2)))
  280. (define-public libhdate
  281. (package
  282. (name "libhdate")
  283. (version "1.6.02")
  284. (source
  285. (origin
  286. (method url-fetch)
  287. (uri (string-append "mirror://sourceforge/libhdate/libhdate/libhdate-"
  288. version "/" name "-" version ".tar.bz2"))
  289. (sha256
  290. (base32
  291. "0qkpq412p78znw8gckwcx3l0wcss9s0dgw1pvjb1ih2pxf6hm4rw"))))
  292. (build-system gnu-build-system)
  293. (home-page "http://libhdate.sourceforge.net/")
  294. (synopsis "Library to use Hebrew dates")
  295. (description "LibHdate is a small library for the Hebrew calendar and times
  296. of day, written in C, and including bindings for C++, pascal, perl, php, python,
  297. and ruby. It includes two illustrative command-line programs, @code{hcal} and
  298. @code{hdate}, and some snippets and scripts written in the binding languages.")
  299. (license license:gpl3+)))
  300. (define-public confclerk
  301. (package
  302. (name "confclerk")
  303. (version "0.6.4")
  304. (source
  305. (origin
  306. (method url-fetch)
  307. (uri (string-append "https://www.toastfreeware.priv.at/tarballs/"
  308. "confclerk/confclerk-" version ".tar.gz"))
  309. (sha256
  310. (base32
  311. "10rhg44px4nvbkd3p341cmp2ds43jn8r4rvgladda9v8zmsgr2b3"))))
  312. (build-system gnu-build-system)
  313. (arguments
  314. '(#:phases
  315. (modify-phases %standard-phases
  316. (replace 'configure
  317. (lambda* (#:key outputs #:allow-other-keys)
  318. (let ((out (assoc-ref outputs "out")))
  319. ;; Install directory is currently hard-coded.
  320. (substitute* "src/app/app.pro"
  321. (("PREFIX = /usr/bin")
  322. (string-append "PREFIX =" out "/bin")))
  323. (invoke "qmake"))))
  324. (add-after 'install 'install-docs
  325. (lambda* (#:key outputs #:allow-other-keys)
  326. (let* ((out (assoc-ref outputs "out"))
  327. (share (string-append out "/share")))
  328. (install-file "data/confclerk.1"
  329. (string-append share "/man/man1"))
  330. (install-file "data/confclerk.desktop"
  331. (string-append share "/applications"))
  332. (install-file "data/confclerk.svg"
  333. (string-append share "/icons/hicolor/scalable/apps"))
  334. #t))))
  335. #:tests? #f)) ; no tests
  336. (native-inputs
  337. (list perl)) ; pod2man
  338. (inputs
  339. (list qtbase-5))
  340. (home-page "https://www.toastfreeware.priv.at/confclerk")
  341. (synopsis "Offline conference schedule application")
  342. (description
  343. "ConfClerk is an application written in Qt, which makes conference schedules
  344. available offline. It displays the conference schedule from various views,
  345. support searches on various items (speaker, speech topic, location, etc.) and
  346. enables you to select favorite events and create your own schedule.
  347. At the moment ConfClerk is able to import schedules in XML format created by
  348. the PentaBarf conference management system (or frab) used by e.g. FOSDEM,
  349. DebConf, FrOSCon, Grazer LinuxTage, and the CCC congresses.
  350. ConfClerk is targeted at mobile devices but works on any system running Qt.")
  351. (license (list license:gpl2+
  352. license:lgpl3)))) ; or cc-by3.0 for src/icons/*
  353. (define-public ccal
  354. (package
  355. (name "ccal")
  356. (version "2.5.3")
  357. (source (origin
  358. (method url-fetch)
  359. (uri (string-append "http://ccal.chinesebay.com/ccal/ccal-"
  360. version ".tar.gz"))
  361. (sha256
  362. (base32
  363. "15nza1d1lvk3dp0wcl53wsd32yhbgyzznha092mh5kh5z74vsk1x"))))
  364. (build-system gnu-build-system)
  365. (arguments
  366. '(#:phases
  367. (modify-phases %standard-phases
  368. (replace 'configure
  369. (lambda* (#:key outputs #:allow-other-keys)
  370. (let ((out (assoc-ref outputs "out")))
  371. (substitute* "Makefile"
  372. (("/usr/local/bin")
  373. (string-append out "/bin"))
  374. (("/usr/local/man")
  375. (string-append out "/share/man"))))
  376. #t))
  377. (add-after 'install 'install-manuals
  378. (lambda _
  379. (invoke "make" "install-man"))))
  380. ;; no tests
  381. #:tests? #f))
  382. (home-page "http://ccal.chinesebay.com/ccal/ccal.htm")
  383. (synopsis "Command line program for Chinese calendar")
  384. (description "@command{ccal} is a command line program which writes a
  385. Gregorian calendar together with Chinese calendar to standard output. Its
  386. usage is similar to the @command{cal} program. In addition to console output,
  387. it can also generate Encapsulated Postscript and HTML table outputs for use in
  388. do-it-yourself calendars and web pages. It supports both simplified and
  389. traditional Chinese characters.")
  390. ;; Both licenses are in use in various source files. Note that
  391. ;; COPYING.LESSER specifies LGPL 3.0, but all source files say
  392. ;; 'Lesser GPL version 2 or later'.
  393. (license (list license:gpl2+ license:lgpl2.1+))))
  394. (define-public gsimplecal
  395. (let ((version "2.2"))
  396. (package
  397. (name "gsimplecal")
  398. (version version)
  399. (source (origin
  400. (method git-fetch)
  401. (uri (git-reference
  402. (url "https://github.com/dmedvinsky/gsimplecal/")
  403. (commit (string-append "v" version))))
  404. (file-name (git-file-name name version))
  405. (sha256 (base32
  406. "1qyf65l088dqsz25hm6s1cv18j52yaias0llqvpqwjfnvssa5cxg"))
  407. (modules '((guix build utils)))))
  408. (build-system gnu-build-system)
  409. (inputs (list gtk+))
  410. (native-inputs
  411. (list autoconf automake pkg-config))
  412. (home-page "https://dmedvinsky.github.io/gsimplecal/")
  413. (synopsis "Lightweight calendar applet")
  414. (description "@command{gsimplecal} is a lightweight calendar application
  415. written in C++ using GTK. Launched once, it pops up a small calendar applet,
  416. launched again it closes the running instance. It can additionally be
  417. configured to show the current time in different timezones.")
  418. (license license:bsd-3))))