takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
930 stars 123 forks source link

Package PyGI App with MSYS2 #183

Closed danyeaw closed 5 years ago

danyeaw commented 5 years ago

The pygi_mpl_numpy uses the pygobjectwin32 pygi-aio package to provide the PyGI bindings. Most of the active PyGObject apps are building and packaging using MSYS2. The PyGObject docs detail how to setup MSYS2 to run a GTK 3 app.

Would it be possible to use pynsist using this approach?

takluyver commented 5 years ago

It might be, but I haven't investigated it. If you figure it out, another example would be welcome. There are probably two basic approaches:

  1. Use a custom template to bundle the MSYS2 installer into your own installer, and run it as part of the setup.
  2. Get the files you need from MSYS2 and repackage them in your own installer.

1 might be simpler in the short term, but if 2 works, I'd expect it to build smaller, faster, more reliable installers. There's a mismatch between how GObject introspection wants to work, with the GObject libraries installed as system components, and how Pynsist wants to work, with as much as possible bundled as part of your application.

Or possibly it won't work at all. Pynsist bundles the Windows build of Python from python.org. I know some of the Unix-on-Windows tools are incompatible with that, but I don't know the details of msys2. If not, feel free to reuse any components & ideas from Pynsist to build a different kind of installer.

danyeaw commented 5 years ago

@takluyver Thanks for the explanation and the nice library :heart: . It sounds like Pynsist bundling the Windows Python build would be challenging for this use case, since the libraries would all be built using mingw-64's GCC for Windows, and Python would be built using MSVC. I'll go ahead and close this issue, but keep in mind that I might be able to reuse parts of the library if I end up rolling my own packaging.