diff mbox series

[bug#47268] gnu: Add apostrophe.

Message ID 20210319175601.13766-1-leo.prikler@student.tugraz.at
State Accepted
Headers show
Series [bug#47268] gnu: Add apostrophe. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Leo Prikler March 19, 2021, 5:56 p.m. UTC
* gnu/packages/gnome.scm (apostrophe): New variable.
---
 gnu/packages/gnome.scm | 64 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

Comments

Léo Le Bouter March 19, 2021, 7:58 p.m. UTC | #1
I did some license auditing and it turns out apostrophe/latex_to_PNG.py is under
the Expat license so I added that to the list. Then I saw some optional
dependencies could be added upstream such as js-mathjax, then I tried to add
texlive related optional dependencies but I could not succeed finding the
smallest combination of them that made actual file format exporting features of
the program work so we'll assume the user will have to figure that out.

Also, the program does not work in a --pure environment without '-E
XDG_RUNTIME_DIR' for some reason, otherwise all good!

Leo Prikler (1):
  gnu: Add apostrophe.

 gnu/packages/gnome.scm | 68 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 34cd0fa992..060f467fa9 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -125,6 +125,7 @@ 
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
+  #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
@@ -11569,6 +11570,69 @@  and toolbars.")
 GTK+.  It integrates well with the GNOME desktop environment.")
     (license license:gpl3+)))
 
+(define-public apostrophe
+  (package
+    (name "apostrophe")
+    (version "2.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.gnome.org/somas/apostrophe")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1qzy3zhi18wf42m034s8kcmx9gl05j620x3hf6rnycq2fvy7g4gz"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:glib-or-gtk? #t
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-meson
+           (lambda _
+             (substitute* "build-aux/meson_post_install.py"
+               (("gtk-update-icon-cache") "true"))
+             #t))
+         (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((prog (string-append (assoc-ref outputs "out")
+                                        "/bin/apostrophe"))
+                   (pylib (string-append (assoc-ref outputs "out")
+                                         "/lib/python"
+                                         ,(version-major+minor
+                                           (package-version python))
+                                         "/site-packages")))
+               (wrap-program prog
+                 `("PYTHONPATH" = (,(getenv "PYTHONPATH") ,pylib))
+                 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))
+                 `("PATH" prefix (,(string-append (assoc-ref inputs "pandoc")
+                                                  "/bin"))))
+               #t))))))
+    (inputs
+     `(("glib" ,glib)
+       ("gobject-introspection" ,gobject-introspection)
+       ("gspell" ,gspell)
+       ("gtk+" ,gtk+)
+       ("libhandy" ,libhandy)
+       ("pandoc" ,pandoc)
+       ("python-chardet" ,python-chardet)
+       ("python-levenshtein" ,python-levenshtein)
+       ("python-regex" ,python-regex)
+       ("python-pycairo" ,python-pycairo)
+       ("python-pygobject" ,python-pygobject)
+       ("python-pyenchant" ,python-pyenchant)
+       ("python-pypandoc" ,python-pypandoc)
+       ("webkitgtk" ,webkitgtk)))
+    (native-inputs
+     `(("gettext" ,gettext-minimal)
+       ("glib:bin" ,glib "bin")
+       ("pkg-config" ,pkg-config)))
+    (home-page "https://gitlab.gnome.org/somas/apostrophe")
+    (synopsis "Markdown editor written in Python with GTK+")
+    (description "Apostrophe is a GTK+ based distraction free Markdown editor.
+It uses pandoc as back-end for parsing Markdown.")
+    (license license:gpl3)))
+
 (define-public libratbag
   (package
     (name "libratbag")