Description: rebuild with swig

--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,20 @@
 from distutils.core import setup, Extension
+from distutils.command.build_py import build_py as build_py_orig
 import sys, os
 
+# custom build_py command which runs build_ext first
+# this is necessary because build_py needs the fitz.py which is only generated
+# by SWIG in the build_ext step
+class build_ext_first(build_py_orig):
+    def run(self):
+        self.run_command("build_ext")
+        return super().run()
+
 # check the platform
 if sys.platform.startswith("linux"):
     module = Extension(
         "fitz._fitz",  # name of the module
-        ["fitz/fitz_wrap.c"],  # C source file
+        ["fitz/fitz.i"],
         include_dirs=[  # we need the path of the MuPDF and zlib headers
             "/usr/include/mupdf",
             "/usr/local/include/mupdf",
@@ -82,6 +91,7 @@ setup(
     author="Ruikai Liu, Jorj McKie",
     author_email="jorj.x.mckie@outlook.de",
     license="GPLv3+",
+    cmdclass={'build_py': build_ext_first},
     ext_modules=[module],
     py_modules=["fitz.fitz", "fitz.utils"],
 )
