Paperwork for MacOS

Ok I’ve got a running version of Paperwork on my Mac using Homebrew :partying_face:

Here’s what I did:

  1. brew install gobject-introspection gtk+3 libnotify poppler libhandy tesseract tesseract-lang
  2. Clone git repo and create a virtual environment
  3. Run pip install . in every module
  4. pip install python-poppler setuptools to add missing python dependencies
  5. Disable scanning paperwork-gtk plugins remove paperwork_backend.docscan.libinsane
  6. Apply this patch:
diff --git a/openpaperwork-gtk/src/openpaperwork_gtk/fs/gio.py b/openpaperwork-gtk/src/openpaperwork_gtk/fs/gio.py
--- a/openpaperwork-gtk/src/openpaperwork_gtk/fs/gio.py	(revision 3f51346f3f04dd16f4e7adde78e4e4adc19fab68)
+++ b/openpaperwork-gtk/src/openpaperwork_gtk/fs/gio.py	(date 1711078177905)
@@ -3,6 +3,7 @@
 import logging
 import os
 import tempfile
+import platform
 
 try:
     from gi.repository import Gio
@@ -581,7 +582,7 @@
         return True
 
     def fs_get_mime(self, uri):
-        if os.name == 'nt':
+        if platform.system() in ['Windows', 'Darwin']:
             # WORKAROUND(Jflesch):
             # Gio.File.query_info().get_content_type() returns crap on Windows
             # (for instance '.pdf' instead of 'application/pdf').
  1. Start paperwork with paperwork-gtk

If I look at all the workarounds necessary for Windows, I guess there are plenty of hidden bugs that we need to sort out.

Anyway, you should probably decide how you want to distribute Paperwork on MacOS. I see two possibilities:

  1. Using a homebrew formula
  2. Use gtk-osx as recommended by PyGObject (Application Deployment — PyGObject)

I really don’t have any experience with packaging but I tend to the homebrew approach because it’s easier.

Regarding the CI you requested I’ve found https://circleci.com/ which is also used by Gnome but I haven’t looked into that.

@jflesch Let me know if I should focus on packaging or create a CI runner for the tests.

1 Like