pololu / nixcrpkgs

Tools for cross-compiling standalone applications using Nix.
Other
200 stars 17 forks source link

Add qt6.qt5compat #9

Closed JustinLex closed 1 year ago

JustinLex commented 1 year ago

Hi all,

I'm not very experienced with C compiler toolchains, but this has been such a super helpful tool for setting up Windows cross-compilation. I'm using this to set up automated builds for a cross-platform app over at https://github.com/unraid/usb-creator/tree/automated-builds.

One of the issues I encountered is that the app I'm working on pulls in quazip, which requires QT::Core5Compat.

I went and implemented Core5Compat compilation with your intuitive module system, and this PR is meant to upstream this module tooling that I'm using.

On a related note, I also looked into adding a Quazip package to this project, and I did get it to compile for windows with these cmake flags:

-DBUILD_SHARED_LIBS=OFF  -DQUAZIP_FETCH_LIBS=OFF -DQUAZIP_BZIP2=OFF

(building a DLL ran into zlib conflicts) But I had massive issues with zlib when trying to compile the final app, which seems to be a common problem with static QT apps that use zlib.

DavidEGrayson commented 1 year ago

Thanks! I'm glad you are finding this project useful and were able to understand the code. I merged your additions in. The qt5compat module seems to build for Linux, Windows, and macOS, but I'm not sure it's really usable on all those platforms. In commit a744ea216c7af92b791acd5d80cb6f9022c01716, you can see the commented-out code I attempted to add to get qt5compat's example program to get built, but there is an error coming from CMake about FindWrapIconv.cmake not being found when I run nix-build -A linux32.qt6.examples.