gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / rednotebook.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages rednotebook)
20 #:use-module (guix packages)
21 #:use-module (guix git-download)
22 #:use-module (guix build-system python)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (gnu packages python)
25 #:use-module (gnu packages glib)
26 #:use-module (gnu packages gtk)
27 #:use-module (gnu packages webkit)
28 #:use-module (gnu packages python-xyz))
29
30 (define-public rednotebook
31 (package
32 (name "rednotebook")
33 (version "2.11.1")
34 (source
35 (origin
36 (method git-fetch)
37 (uri (git-reference
38 (url "https://github.com/jendrikseipp/rednotebook")
39 (commit (string-append "v" version))))
40 (file-name (git-file-name name version))
41 (sha256
42 (base32 "04c7a0wgmdl88v9386y1052c38ajbkryiwhqps5lx34d4g7r6hm1"))))
43 (build-system python-build-system)
44 (arguments
45 ;; Tests fail to find the "_" function.
46 ;; It should be defined in rednotebook/info.py if '_' is not a member of
47 ;; 'builtins'. It is either not defined or not exported during the check
48 ;; phase. The program does not have this problem after it is installed.
49 ;; TODO: Fix tests.
50 `(#:tests? #f
51 #:imported-modules ((guix build glib-or-gtk-build-system)
52 ,@%python-build-system-modules)
53 #:modules ((ice-9 match)
54 (guix build python-build-system)
55 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
56 (guix build utils))
57 #:phases
58 (modify-phases %standard-phases
59 ;; Make sure rednotebook can find the typelibs and webkitgtk shared
60 ;; libraries.
61 (add-before 'wrap 'wrap-with-library-paths
62 (lambda* (#:key inputs outputs #:allow-other-keys)
63 (let ((out (assoc-ref outputs "out"))
64 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
65 (webkitgtk-path (string-append
66 (assoc-ref inputs "webkitgtk")
67 "/lib")))
68 (wrap-program (string-append out "/bin/rednotebook")
69 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
70 `("LD_LIBRARY_PATH" ":" prefix (,webkitgtk-path)))
71 #t))))))
72 (inputs
73 `(("gtk+" ,gtk+)
74 ("gtksourceview" ,gtksourceview-3)
75 ("python-pyyaml" ,python-pyyaml)
76 ("python-pygobject" ,python-pygobject)
77 ("webkitgtk" ,webkitgtk)))
78 ;; TODO: package the following for python3 (if possible), add them as
79 ;; dependencies, and remove them from rednotebook source:
80 ;; pygtkspellcheck, elib.intl, msgfmt, txt2tags
81 ;; TODO: package and add pyenchant for python3 and add it as a dependency.
82 (home-page "https://www.rednotebook.app")
83 (synopsis "Daily journal with calendar, templates and keyword searching")
84 (description
85 "RedNotebook is a modern desktop journal. It lets you format, tag and
86 search your entries. You can also add pictures, links and customizable
87 templates, spell check your notes, and export to plain text, HTML, Latex or
88 PDF.")
89 (license (list license:gpl2+ ; rednotebook, txt2tags
90 license:lgpl3+ ; elib.intl
91 license:gpl3+)))) ; pygtkspellcheck