rednotebook.scm 4.0 KB

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