calendar.scm 17 KB

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