Package Details: mingw-w64-qt5-base-static 5.7.1-1

Git Clone URL: https://aur.archlinux.org/mingw-w64-qt5-base-static.git (read-only)
Package Base: mingw-w64-qt5-base-static
Description: A cross-platform application and UI framework (mingw-w64)
Upstream URL: https://www.qt.io/
Licenses: custom, GPL3, LGPL3, FDL
Groups: mingw-w64-qt, mingw-w64-qt5
Submitter: ant32
Maintainer: Martchus
Last Packager: Martchus
Votes: 7
Popularity: 0.625698
First Submitted: 2013-08-28 23:57
Last Updated: 2016-12-24 12:07

Required by (54)

Sources (27)

  • 0001-Fix-qwindows-plugin-linking-with-system-freetype.patch
  • 0002-Fix-oci-config-test-on-windows.patch
  • 0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch
  • 0004-Fix-building-mysql-driver-under-mingw.patch
  • 0005-Support-ANGLE-switches-via-configure-shell-script.patch
  • 0006-Use-external-ANGLE-library.patch
  • 0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch
  • 0008-Make-sure-.pc-files-are-installed-correctly.patch
  • 0009-Don-t-add-resource-files-to-LIBS-parameter.patch
  • 0010-Prevent-debug-library-names-in-pkg-config-files.patch
  • 0011-Fix-linking-against-static-D-Bus.patch
  • 0012-Adjust-win32-g-mkspecs-profile.patch
  • 0013-Fix-linking-against-external-harfbuzz.patch
  • 0014-Fix-linking-against-static-pcre.patch
  • 0015-Rename-qtmain-to-qt5main.patch
  • 0016-Build-dynamic-host-libraries.patch
  • 0017-Enable-rpath-for-build-tools.patch
  • 0018-Use-system-zlib-for-build-tools.patch
  • 0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch
  • 0020-Use-.dll.a-as-import-lib-extension.patch
  • 0021-Merge-shared-and-static-library-trees.patch
  • 0022-Allow-usage-of-static-version-with-CMake.patch
  • 0023-Use-correct-pkg-config-static-flag.patch
  • 0024-Use-shared-static-version-of-MariaDB.patch
  • 0025-Use-shared-static-version-of-PostgreSQL.patch
  • 0026-Fix-qt5_wrap_ui-macro.patch
  • https://download.qt.io/official_releases/qt/5.7/5.7.1/submodules/qtbase-opensource-src-5.7.1.tar.xz

Pinned Comments

Martchus commented on 2017-01-10 21:24

Notes about using static Qt with CMake:

* Checkout the notes about the static version in the PKGBUILD itself
* Seems like find_package(Qt5Core) is still required when building static version. I think this is not really a problem, one just has to know it.
* Here is a simple example: https://github.com/oggio88/Qt-CMake-HelloWorld/compare/master...Martchus:mingw-w64-static
* I also included a commits showing how to link statically against against Qt plugins and dependencies of Qt itself.

Martchus commented on 2016-07-10 19:47

All my packages are managed at GitHub where you can also contribute directly: https://github.com/Martchus/PKGBUILDs
Patches for this package are managed at: https://github.com/Martchus/qtbase/tree/5.7.0-mingw-w64

There also exist a binary repository: https://martchus.no-ip.biz/repo/arch/ownstuff

For general discussion and issues not only concerning this variant please use the comment section of the package mingw-w64-qt5-base.

Latest Comments

woggioni commented on 2017-01-12 09:18

@Martchus Great job! Thank you

Martchus commented on 2017-01-11 19:41

@woggioni I tested again. My applications have no further dependencies. However, Dependency Walker shows that the hello world app links against all Qt dependencies and the standard library dynamically. I used regular wine command to test yesterday but I might have set WINEPATH some time ago so I didn't notice.

Linking dynamically against the standard library should be ok. Telling the build system to do otherwise is nothing the Qt packages should enforce. I would also say that linking dynamically against Qt dependencies is a valid configuration and hence static linkage for all libraries should not be enforced from the Qt-side or this package.

But of course this is certainly not what most people (including me) want. So to achieve static linking against all libraries I did the following in my own build scripts:
* Add linker flags for linking statically against *all* libraries: `-static -static-libstdc++ -static-libgcc`
* Make CMake aware of the meaning of such flags by enabling the target properties `LINK_SEARCH_START_STATIC` and `LINK_SEARCH_END_STATIC`

See https://github.com/Martchus/cpp-utilities/blob/master/cmake/modules/BasicConfig.cmake#L90 and https://github.com/Martchus/cpp-utilities/blob/master/cmake/modules/AppTarget.cmake#L40

I also updated the example now: https://github.com/Martchus/Qt-CMake-HelloWorld/tree/mingw-w64-static

woggioni commented on 2017-01-11 17:23

@Martchus do you use /usr/bin/wine or /usr/bin/${arch}-w64-mingw32-wine? Because the second one works without having to copy the dll since it sets WINEPATH before calling wine, /usr/bin/wine on my machine requires all the dlls in the executable folder instead

Martchus commented on 2017-01-11 16:54

@woggioni No, this is not expected behavior. But I can not reproduce the issue.

* tested yesterday the hello world project with wine and there were no complaints about missing libs
* my own apps have no further dependencies, too: https://martchus.no-ip.biz/repo/win/static/

Note that only `find_package(Qt5Core)` is required. You should *not* add it to `target_link_libraries`.

woggioni commented on 2017-01-11 16:47

Thanks Martchus, your workaround seems to do the job.
I just noticed that even compiling the hello word example with "-static -static-libgcc -static-libstdc++"
the generated executable needs a long list of dll, located under /usr/x86_64/bin (namely libbz2-1.dll libgcc_s_seh-1.dll libgraphite2.dll libiconv-2.dll libjpeg-8.dll libpcre-1.dll libstdc++-6.dll zlib1.dll libfreetype-6.dll libglib-2.0-0.dll libharfbuzz-0.dll libintl-8.dll libpcre16-0.dll libpng16-16.dll libwinpthread-1.dll), is this this the expected behaviour? In particular, it is funny that libstdc++ is needed since I asked explicitely the compiler to statically link it. I ask because, to me, the main point of linking Qt statically is to have a single executable file for my program and not having to distribute a long list of dlls alongside the main executable

Martchus commented on 2017-01-10 21:24

Notes about using static Qt with CMake:

* Checkout the notes about the static version in the PKGBUILD itself
* Seems like find_package(Qt5Core) is still required when building static version. I think this is not really a problem, one just has to know it.
* Here is a simple example: https://github.com/oggio88/Qt-CMake-HelloWorld/compare/master...Martchus:mingw-w64-static
* I also included a commits showing how to link statically against against Qt plugins and dependencies of Qt itself.

woggioni commented on 2017-01-10 10:19

@Martchus I tried to compile your project (https://github.com/Martchus/qtutilities) and it has the same problem as mine if you set QT_LINKAGE=STATIC in CMakeCache.txt

Martchus commented on 2017-01-09 21:58

I can reproduce the issue with your minimal hello world example and it happens only when using the static variant.

The qt5_wrap_cpp is yet another issue and seems to be the same problems as I already encountered with Qt5::lrelease/lupdate/lconvert. Unfortunately I don't know the source of this problem and could just provide (yet another) workaround. But I guess it is not too important because everybody uses automoc which is the real concern here.

Interestingly, the more complicated CMake projects I use for building my own applications such as Syncthing Tray and qtutilities work. The project also relies on automoc and autouic. As you can see in the log it generates everything correctly: http://paste.opensuse.org/86983509

So I'll try to figure out what my project does differently. This could then be a workaround at least.

woggioni commented on 2017-01-09 12:48

Actually I was using version 5.7.0-10, I tried to compile the latest version (5.7.1-1) but it stuck with

./.obj/release/qtextdocument_p.o: In function `ZN16QFragmentMapDataI17QTextFragmentDataE14createFragmentEv':
/home/woggioni/Scaricati/build/aur-mingw-w64-qt5-base/src/qtbase-opensource-src-5.7.1/include/QtGui/5.7.1/QtGui/private/../../../../../src/gui/text/qfragmentmap_p.h:258: undefined reference to `_imp___Z26qCalculateGrowingBlockSizejjj'

then I installed the binary version of 5.7.1-1 from your personal repo of both mingw-w64-qt5-base and mingw-w64-qt5-base-static and got the same result (AUTOMOC and AUTOUIC not working with static libs)

Martchus commented on 2017-01-09 12:10

Your project file looks good - strange because building my own projects (https://github.com/Martchus/qtutilities/blob/master/cmake/modules/QtConfig.cmake#L262) works (also when only building the static version).

The issue might be similar to the Qt5::lrelease/lupdate/lconvert issue (https://aur.archlinux.org/packages/mingw-w64-qt5-tools/). Just strange that is only happens when using the static version.

But I'll look into it again using exactly your project file. I assume you use the latest version of the package?

All comments