PKGBUILD Suggestion: Patch MComix 1.2.1 to make it work alongside python2-pillow 6.0.0


Because of breaking changes in python2-pillow (and python-pillow) 6.0.0, MComix 1.2.1 is currently totally broken and unusable in Testing and Unstable. When trying to launch it from the terminal, I get the following output:

[ami@xfcenew Bureau]$ mcomix
Traceback (most recent call last):
  File "/usr/bin/mcomix", line 11, in <module>
    load_entry_point('mcomix==1.2.1', 'console_scripts', 'mcomix')()
  File "/usr/lib/python2.7/site-packages/mcomix/", line 206, in run
    assert PIL.Image.VERSION >= '1.1.5'
AttributeError: 'module' object has no attribute 'VERSION'
[ami@xfcenew Bureau]$

This is a well known issue and reported on Arch Linux bug tracker. See here:

Upstream fixed the issue on their side with commit 486f02 in master, but have not made a new release yet (they didn't do any new release since February 2016 actually).

I do not use this application myself, but even, I still tried to fix the issue by backporting this commit in the source code for version 1.2.1. It looks like my fix works fine on my side, although I only did the test on a VM.

Here's my PKGBUILD. Consider it as a proof of concept and feel free to adapt it as you want (if you decide to make an overlay of course).!llMxCa6L!FOtkjH9Y4KzTfvR2wxxi6WXYIHJFs4K6yF7obYF11Hw

I don't know how to download a .diff or .patch file from SourceForge, so I had to made the .diff file myself.

The build time should not be much an issue, it should be something really quick to build (it took a few seconds on my machine).

The overlay package will be needed for all branches that has python2-pillow 6.0.0, so currently Unstable and Testing (and Stable soon, when there will be a sync between Stable and Testing).

Thanks in advance.

mcomix broke after latest update on testing branch
[Stable Update] 2019-04-20 - Nvidia, Kernels, Deepin

Just for future reference, an "easy" way to provide a diff for a PKGBUILD is something like:

yay -G mcomix
cd mcomix
git init
git add .
# EDIT PKGBUILD etc. etc.
git diff > my-patch.diff

then you can share just the contents of my-patch.diff and it can be applied to the original source with git apply my-patch.diff.


diff --git c/486f02.diff i/486f02.diff
new file mode 100644
index 0000000..0558840
--- /dev/null
+++ i/486f02.diff
@@ -0,0 +1,15 @@
+--- a/mcomix/
++++ b/mcomix/
+@@ -203,7 +203,11 @@
+     try:
+         import PIL.Image
+-        assert PIL.Image.VERSION >= '1.1.5'
++        try:
++            assert PIL.Image.VERSION >= '1.1.5'
++        except AttributeError:
++            # Field VERSION deprecated in Pillow 5.2.0 and dropped in 6.0.0
++            assert PIL.__version__ >= '5.2.0'
+     except AssertionError:
+         log.error( _("You don't have the required version of the Python Imaging"), end=' ')
diff --git c/PKGBUILD i/PKGBUILD
index b372bf3..6ce0091 100644
@@ -1,12 +1,13 @@
 # Maintainer: schuay <>
 # Contributor: Ray Powell <>
 pkgdesc="A user-friendly, customizable image viewer specifically designed to handle comic books"
 depends=('pygtk' 'python2-pillow' 'xdg-utils' 'python2' \
          'desktop-file-utils' 'hicolor-icon-theme' 'python2-setuptools')
@@ -16,20 +17,32 @@ optdepends=('libunrar: for rar compressed comics'
             'p7zip: for 7zip compressed comics')
+        "486f02.diff")
+         'e033a538925e6119a540bf084f1de878')
+prepare() {
+  cd "${srcdir}"/${pkgname}-${pkgver}
+  #Backport commit 486f02eef164df451a72598ce5989a1b37b49c60 to source code so mcomix 1.2.1 works
+  #with python2-pillow 6.0.0 (See
+  #
+  patch -p1 -i ../486f02.diff
+  #Remove this patch once there is a new version from upstream that works correctly w/ pillow 6.0.0
 package() {
-  cd ${srcdir}/${pkgname}-${pkgver}
+  cd "${srcdir}"/${pkgname}-${pkgver}
-  export PYTHONPATH=${pkgdir}/usr/lib/python2.7/site-packages/
+  export PYTHONPATH="${pkgdir}"/usr/lib/python2.7/site-packages/
   mkdir -p $PYTHONPATH
   python2 install --prefix=/usr --optimize=1 \
-    --single-version-externally-managed --root=${pkgdir}
+    --single-version-externally-managed --root="${pkgdir}"
-  install -Dm755 mime/comicthumb ${pkgdir}/usr/bin/comicthumb
-  install -Dm644 mime/comicthumb.1.gz ${pkgdir}/usr/share/man/man1/comicthumb.1.gz
-  install -Dm644 mime/comicthumb.thumbnailer ${pkgdir}/usr/share/thumbnailers/comicthumb.thumbnailer
+  install -Dm755 mime/comicthumb "${pkgdir}"/usr/bin/comicthumb
+  install -Dm644 mime/comicthumb.1.gz "${pkgdir}"/usr/share/man/man1/comicthumb.1.gz
+  install -Dm644 mime/comicthumb.thumbnailer "${pkgdir}"/usr/share/thumbnailers/comicthumb.thumbnailer

Building soon, will be in unstable shortly.

mcomix-1.2.1-4.1 is now in unstable .

1 Like