From 3759e1163fa5425082c866dc2c1301f563945f9f Mon Sep 17 00:00:00 2001 From: Aleksandr Vodyanov Date: Thu, 13 Feb 2025 12:25:48 +0300 Subject: [PATCH] [DO-981] qt package (!15) Co-authored-by: aleksandr.vodyanov Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/15 --- recipes/bison/all/conandata.yml | 63 + recipes/bison/all/conanfile.py | 168 ++ ...e_pipe-uses-O_TEXT-not-O_BINARY-mode.patch | 29 + ...e_pipe-uses-O_TEXT-not-O_BINARY-mode.patch | 29 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + ...in-binary-mode-MS-ftell-bug-ks-68337.patch | 26 + .../all/patches/0003-3.5.3-msvc-changes.patch | 261 +++ .../all/patches/0004-3.5.3-relocatable.patch | 753 ++++++++ ...b-limit-search-range-of-_setmaxstdio.patch | 38 + ...-dont-link-bison-against-libreadline.patch | 14 + recipes/bison/all/test_package/CMakeLists.txt | 20 + .../all/test_package/CMakeUserPresets.json | 9 + recipes/bison/all/test_package/conanfile.py | 38 + recipes/bison/all/test_package/mc_parser.yy | 42 + recipes/bison/config.yml | 9 + recipes/expat/all/conandata.yml | 31 + recipes/expat/all/conanfile.py | 102 ++ .../0001-2.3.0-relax-vs-restriction.patch | 13 + recipes/expat/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/expat/all/test_package/conanfile.py | 26 + recipes/expat/all/test_package/test_package.c | 64 + .../all/test_package_module/CMakeLists.txt | 22 + .../all/test_package_module/conanfile.py | 26 + .../expat/all/test_v1_package/CMakeLists.txt | 8 + .../expat/all/test_v1_package/conanfile.py | 18 + .../all/test_v1_package_module/CMakeLists.txt | 8 + .../all/test_v1_package_module/conanfile.py | 18 + recipes/expat/config.yml | 19 + recipes/ffmpeg/all/conanfile.py | 25 +- recipes/fontconfig/all/conandata.yml | 16 + recipes/fontconfig/all/conanfile.py | 132 ++ .../all/patches/0001-meson-win32.patch | 19 + .../all/test_package/CMakeLists.txt | 8 + .../all/test_package/CMakeUserPresets.json | 10 + .../fontconfig/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 24 + .../all/test_v1_package/CMakeLists.txt | 9 + .../all/test_v1_package/conanfile.py | 17 + recipes/fontconfig/config.yml | 7 + recipes/gperf/all/conandata.yml | 7 + recipes/gperf/all/conanfile.py | 99 + .../0001-remove-register-keyword.patch | 13 + recipes/gperf/all/test_package/conanbuild.sh | 1 + .../conanbuildenv-release-x86_64.sh | 19 + recipes/gperf/all/test_package/conanfile.py | 13 + recipes/gperf/all/test_package/conanrun.sh | 1 + .../conanrunenv-release-x86_64.sh | 14 + .../all/test_package/deactivate_conanbuild.sh | 1 + ...deactivate_conanbuildenv-release-x86_64.sh | 5 + .../all/test_package/deactivate_conanrun.sh | 1 + recipes/gperf/config.yml | 3 + recipes/icu/all/conandata.yml | 49 + recipes/icu/all/conanfile.py | 374 ++++ .../icu/all/patches/0001-69.1-fix-mingw.patch | 43 + .../icu/all/patches/0001-76.1-fix-mingw.patch | 47 + .../patches/0002-74.2-fix-emscripten.patch | 109 ++ recipes/icu/all/test_package/CMakeLists.txt | 12 + .../all/test_package/CMakeUserPresets.json | 9 + recipes/icu/all/test_package/conanfile.py | 26 + recipes/icu/all/test_package/test_package.cpp | 623 +++++++ recipes/icu/config.yml | 13 + recipes/libmysqlclient/all/conandata.yml | 40 + recipes/libmysqlclient/all/conanfile.py | 287 +++ .../patches/0004-fix-805-cpp17-build.patch | 13 + ...5-fix-macos-12.0.x-version-detection.patch | 13 + .../patches/0006-fix-cpp20-build-8.0.29.patch | 17 + .../patches/0006-fix-cpp20-build-8.1.0.patch | 17 + .../all/test_package/CMakeLists.txt | 7 + .../all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 8 + .../all/test_v1_package/CMakeLists.txt | 10 + .../all/test_v1_package/conanfile.py | 18 + recipes/libmysqlclient/config.yml | 11 + recipes/libpq/all/conandata.yml | 39 + recipes/libpq/all/conanfile.py | 288 +++ .../14/002-mingw-build-static-libraries.patch | 39 + ...set-_app_data-instead-of-BIO_-get-se.patch | 193 ++ ...set-_app_data-instead-of-BIO_-get-se.patch | 193 ++ .../15/001-mingw-build-static-libraries.patch | 39 + recipes/libpq/all/test_package/CMakeLists.txt | 6 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/libpq/all/test_package/conanfile.py | 26 + recipes/libpq/all/test_package/test_package.c | 17 + .../libpq/all/test_v1_package/CMakeLists.txt | 8 + .../libpq/all/test_v1_package/conanfile.py | 18 + recipes/libpq/config.yml | 9 + recipes/libxml2/all/conandata.yml | 37 + recipes/libxml2/all/conanfile.py | 414 +++++ .../test_cmake_module_package/CMakeLists.txt | 26 + .../test_cmake_module_package/conanfile.py | 27 + .../libxml2/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + recipes/libxml2/all/test_package/books.xml | 120 ++ recipes/libxml2/all/test_package/conanfile.py | 27 + .../libxml2/all/test_package/test_package.c | 45 + .../CMakeLists.txt | 8 + .../test_v1_cmake_module_package/conanfile.py | 18 + .../all/test_v1_package/CMakeLists.txt | 8 + .../libxml2/all/test_v1_package/conanfile.py | 18 + recipes/libxml2/config.yml | 25 + recipes/md4c/all/conandata.yml | 23 + recipes/md4c/all/conanfile.py | 115 ++ .../patches/0.4.8-0001-honor-vc-runtime.patch | 18 + .../patches/0.5.1-0001-honor-vc-runtime.patch | 29 + .../patches/0.5.2-0001-honor-vc-runtime.patch | 27 + recipes/md4c/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/md4c/all/test_package/conanfile.py | 26 + recipes/md4c/all/test_package/test_package.c | 57 + recipes/md4c/config.yml | 7 + recipes/odbc/all/conandata.yml | 18 + recipes/odbc/all/conanfile.py | 149 ++ .../0001-duplicated-get-connection.patch | 11 + .../patches/0002-missing-declarations.patch | 53 + recipes/odbc/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + recipes/odbc/all/test_package/conanfile.py | 27 + recipes/odbc/all/test_package/test_package.c | 17 + recipes/odbc/config.yml | 7 + recipes/openal-soft/all/conandata.yml | 12 + recipes/openal-soft/all/conanfile.py | 158 ++ ...-fix-al-optional-in-if-compile-error.patch | 47 + ...002-fix-pulseaudio-find-package-vars.patch | 15 + .../all/test_package/CMakeLists.txt | 22 + .../all/test_package/CMakeUserPresets.json | 9 + .../openal-soft/all/test_package/conanfile.py | 26 + .../all/test_package/test_package.c | 134 ++ recipes/openal-soft/config.yml | 5 + recipes/opengl/all/conanfile.py | 68 + .../test_cmake_module_package/CMakeLists.txt | 31 + .../test_cmake_module_package/conanfile.py | 26 + .../opengl/all/test_package/CMakeLists.txt | 31 + .../all/test_package/CMakeUserPresets.json | 10 + recipes/opengl/all/test_package/conanfile.py | 26 + recipes/opengl/all/test_package/osx.mm | 31 + .../opengl/all/test_package/test_package.cpp | 47 + recipes/opengl/all/test_package/win.cpp | 58 + .../CMakeLists.txt | 8 + .../test_v1_cmake_module_package/conanfile.py | 17 + .../opengl/all/test_v1_package/CMakeLists.txt | 8 + .../opengl/all/test_v1_package/conanfile.py | 17 + recipes/opengl/config.yml | 3 + recipes/qt/5.x.x/conandata.yml | 48 + recipes/qt/5.x.x/conanfile.py | 1591 ++++++++++++++++ ...001-Find-fontconfig-using-pkg-config.patch | 56 + .../qt/5.x.x/patches/337f28c9ab-5.15.8.patch | 39 + ...10-fix-macos-cpp-lib-memory-resource.patch | 43 + ...12-fix-macos-cpp-lib-memory-resource.patch | 43 + .../5.15.14-macos-chromium-newer-sdks.patch | 13 + ...5.14-macos-qtlocation-utility-header.patch | 13 + ...5.15.14-macos-qtwebengine-rpath-link.patch | 13 + .../5.15.14-qtwebengine-missing-deps.patch | 12 + ....7-fix-macos-cpp-lib-memory-resource.patch | 43 + ...qmake-default-libdirs-apple-clang-15.patch | 26 + ...Fix-errors-and-warnings-for-perfetto.patch | 101 + recipes/qt/5.x.x/patches/aa2a39dea5.diff | 29 + .../qt/5.x.x/patches/android-backtrace.diff | 19 + recipes/qt/5.x.x/patches/android-new-ndk.diff | 27 + recipes/qt/5.x.x/patches/android-openssl.diff | 13 + recipes/qt/5.x.x/patches/c72097e.diff | 42 + ...romium-skia-missing-iterator-include.patch | 10 + .../chromium-v8-missing-constexpr.patch | 46 + .../patches/ffmpeg-x86-optimization.patch | 64 + recipes/qt/5.x.x/patches/fix-macdeployqt.diff | 66 + .../patches/qtconnectivity-1-fixes.patch | 45 + .../5.x.x/patches/qtdeclarative-1-fixes.patch | 94 + recipes/qt/5.x.x/patches/qtlocation-1.patch | 23 + recipes/qt/5.x.x/patches/qtmultimedia-1.patch | 22 + .../qt/5.x.x/patches/qttools-1-fixes.patch | 94 + recipes/qt/5.x.x/patches/skia-cd397f3.diff | 25 + recipes/qt/5.x.x/qtmodules5.15.10.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.11.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.12.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.13.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.14.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.16.conf | 326 ++++ recipes/qt/5.x.x/qtmodules5.15.9.conf | 326 ++++ .../qt/5.x.x/test_v1_package/CMakeLists.txt | 23 + recipes/qt/5.x.x/test_v1_package/conanfile.py | 134 ++ recipes/qt/5.x.x/test_v1_package/meson.build | 6 + .../qt/5.x.x/test_v1_package/test_package.pro | 14 + recipes/qt/6.x.x/conandata.yml | 95 + recipes/qt/6.x.x/conanfile.py | 1619 +++++++++++++++++ recipes/qt/6.x.x/patches/32fa63f.patch | 28 + recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch | 28 + recipes/qt/6.x.x/patches/c72097e.diff | 42 + recipes/qt/6.x.x/patches/c72097e_6.6.0.diff | 42 + recipes/qt/6.x.x/patches/d13958d.diff | 26 + .../fix-long-path-on-windows_6.5.3.patch | 16 + .../fix-long-path-on-windows_6.6.0.patch | 16 + .../fix-long-path-on-windows_6.6.1.patch | 16 + recipes/qt/6.x.x/patches/fix_cmake3.28.patch | 45 + .../qt/6.x.x/patches/qt6-pri-helpers-fix.diff | 15 + recipes/qt/6.x.x/qtmodules6.5.3.conf | 332 ++++ recipes/qt/6.x.x/qtmodules6.6.3.conf | 338 ++++ recipes/qt/6.x.x/qtmodules6.7.3.conf | 338 ++++ recipes/qt/6.x.x/test_package/CMakeLists.txt | 18 + recipes/qt/6.x.x/test_package/conanfile.py | 47 + recipes/qt/6.x.x/test_package/example.qrc | 5 + recipes/qt/6.x.x/test_package/greeter.h | 26 + recipes/qt/6.x.x/test_package/resource.txt | 1 + .../6.x.x/test_package/test_macos_bundle.cpp | 7 + .../qt/6.x.x/test_package/test_package.cpp | 48 + .../qt/6.x.x/test_v1_package/CMakeLists.txt | 25 + recipes/qt/6.x.x/test_v1_package/conanfile.py | 134 ++ recipes/qt/6.x.x/test_v1_package/meson.build | 6 + .../qt/6.x.x/test_v1_package/test_package.pro | 14 + recipes/qt/config.yml | 9 + recipes/xkbcommon/all/conandata.yml | 25 + recipes/xkbcommon/all/conanfile.py | 180 ++ .../xkbcommon/all/test_package/CMakeLists.txt | 7 + .../all/test_package/CMakeUserPresets.json | 9 + .../xkbcommon/all/test_package/conanfile.py | 27 + .../all/test_package/test_package.cpp | 8 + recipes/xkbcommon/config.yml | 17 + recipes/xkeyboard-config/all/conanfile.py | 51 + .../build-release/conan/conanbuild.sh | 1 + .../conan/conanbuildenv-release-x86_64.sh | 18 + .../build-release/conan/conanrun.sh | 1 + .../conan/conanrunenv-release-x86_64.sh | 14 + .../conan/deactivate_conanbuild.sh | 1 + ...deactivate_conanbuildenv-release-x86_64.sh | 4 + .../conan/deactivate_conanrun.sh | 1 + .../build-release/conan/xkeyboard-config.pc | 8 + .../all/test_package/conanfile.py | 23 + recipes/xkeyboard-config/config.yml | 3 + 228 files changed, 16106 insertions(+), 12 deletions(-) create mode 100644 recipes/bison/all/conandata.yml create mode 100644 recipes/bison/all/conanfile.py create mode 100644 recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch create mode 100644 recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch create mode 100644 recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch create mode 100644 recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch create mode 100644 recipes/bison/all/patches/0004-3.5.3-relocatable.patch create mode 100644 recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch create mode 100644 recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch create mode 100644 recipes/bison/all/test_package/CMakeLists.txt create mode 100644 recipes/bison/all/test_package/CMakeUserPresets.json create mode 100644 recipes/bison/all/test_package/conanfile.py create mode 100644 recipes/bison/all/test_package/mc_parser.yy create mode 100644 recipes/bison/config.yml create mode 100644 recipes/expat/all/conandata.yml create mode 100644 recipes/expat/all/conanfile.py create mode 100644 recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch create mode 100644 recipes/expat/all/test_package/CMakeLists.txt create mode 100644 recipes/expat/all/test_package/CMakeUserPresets.json create mode 100644 recipes/expat/all/test_package/conanfile.py create mode 100644 recipes/expat/all/test_package/test_package.c create mode 100644 recipes/expat/all/test_package_module/CMakeLists.txt create mode 100644 recipes/expat/all/test_package_module/conanfile.py create mode 100644 recipes/expat/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/expat/all/test_v1_package/conanfile.py create mode 100644 recipes/expat/all/test_v1_package_module/CMakeLists.txt create mode 100644 recipes/expat/all/test_v1_package_module/conanfile.py create mode 100644 recipes/expat/config.yml create mode 100644 recipes/fontconfig/all/conandata.yml create mode 100644 recipes/fontconfig/all/conanfile.py create mode 100644 recipes/fontconfig/all/patches/0001-meson-win32.patch create mode 100644 recipes/fontconfig/all/test_package/CMakeLists.txt create mode 100644 recipes/fontconfig/all/test_package/CMakeUserPresets.json create mode 100644 recipes/fontconfig/all/test_package/conanfile.py create mode 100644 recipes/fontconfig/all/test_package/test_package.c create mode 100644 recipes/fontconfig/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/fontconfig/all/test_v1_package/conanfile.py create mode 100644 recipes/fontconfig/config.yml create mode 100644 recipes/gperf/all/conandata.yml create mode 100644 recipes/gperf/all/conanfile.py create mode 100644 recipes/gperf/all/patches/0001-remove-register-keyword.patch create mode 100644 recipes/gperf/all/test_package/conanbuild.sh create mode 100644 recipes/gperf/all/test_package/conanbuildenv-release-x86_64.sh create mode 100644 recipes/gperf/all/test_package/conanfile.py create mode 100644 recipes/gperf/all/test_package/conanrun.sh create mode 100644 recipes/gperf/all/test_package/conanrunenv-release-x86_64.sh create mode 100644 recipes/gperf/all/test_package/deactivate_conanbuild.sh create mode 100644 recipes/gperf/all/test_package/deactivate_conanbuildenv-release-x86_64.sh create mode 100644 recipes/gperf/all/test_package/deactivate_conanrun.sh create mode 100644 recipes/gperf/config.yml create mode 100644 recipes/icu/all/conandata.yml create mode 100644 recipes/icu/all/conanfile.py create mode 100644 recipes/icu/all/patches/0001-69.1-fix-mingw.patch create mode 100644 recipes/icu/all/patches/0001-76.1-fix-mingw.patch create mode 100644 recipes/icu/all/patches/0002-74.2-fix-emscripten.patch create mode 100644 recipes/icu/all/test_package/CMakeLists.txt create mode 100644 recipes/icu/all/test_package/CMakeUserPresets.json create mode 100644 recipes/icu/all/test_package/conanfile.py create mode 100644 recipes/icu/all/test_package/test_package.cpp create mode 100644 recipes/icu/config.yml create mode 100644 recipes/libmysqlclient/all/conandata.yml create mode 100644 recipes/libmysqlclient/all/conanfile.py create mode 100644 recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch create mode 100644 recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch create mode 100644 recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch create mode 100644 recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch create mode 100644 recipes/libmysqlclient/all/test_package/CMakeLists.txt create mode 100644 recipes/libmysqlclient/all/test_package/conanfile.py create mode 100644 recipes/libmysqlclient/all/test_package/test_package.c create mode 100644 recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libmysqlclient/all/test_v1_package/conanfile.py create mode 100644 recipes/libmysqlclient/config.yml create mode 100644 recipes/libpq/all/conandata.yml create mode 100644 recipes/libpq/all/conanfile.py create mode 100644 recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch create mode 100644 recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch create mode 100644 recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch create mode 100644 recipes/libpq/all/test_package/CMakeLists.txt create mode 100644 recipes/libpq/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libpq/all/test_package/conanfile.py create mode 100644 recipes/libpq/all/test_package/test_package.c create mode 100644 recipes/libpq/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libpq/all/test_v1_package/conanfile.py create mode 100644 recipes/libpq/config.yml create mode 100644 recipes/libxml2/all/conandata.yml create mode 100644 recipes/libxml2/all/conanfile.py create mode 100644 recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_cmake_module_package/conanfile.py create mode 100644 recipes/libxml2/all/test_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_package/CMakeUserPresets.json create mode 100644 recipes/libxml2/all/test_package/books.xml create mode 100644 recipes/libxml2/all/test_package/conanfile.py create mode 100644 recipes/libxml2/all/test_package/test_package.c create mode 100644 recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py create mode 100644 recipes/libxml2/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/libxml2/all/test_v1_package/conanfile.py create mode 100644 recipes/libxml2/config.yml create mode 100644 recipes/md4c/all/conandata.yml create mode 100644 recipes/md4c/all/conanfile.py create mode 100644 recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch create mode 100644 recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch create mode 100644 recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch create mode 100644 recipes/md4c/all/test_package/CMakeLists.txt create mode 100644 recipes/md4c/all/test_package/CMakeUserPresets.json create mode 100644 recipes/md4c/all/test_package/conanfile.py create mode 100644 recipes/md4c/all/test_package/test_package.c create mode 100644 recipes/md4c/config.yml create mode 100644 recipes/odbc/all/conandata.yml create mode 100644 recipes/odbc/all/conanfile.py create mode 100644 recipes/odbc/all/patches/0001-duplicated-get-connection.patch create mode 100644 recipes/odbc/all/patches/0002-missing-declarations.patch create mode 100644 recipes/odbc/all/test_package/CMakeLists.txt create mode 100644 recipes/odbc/all/test_package/CMakeUserPresets.json create mode 100644 recipes/odbc/all/test_package/conanfile.py create mode 100644 recipes/odbc/all/test_package/test_package.c create mode 100644 recipes/odbc/config.yml create mode 100644 recipes/openal-soft/all/conandata.yml create mode 100644 recipes/openal-soft/all/conanfile.py create mode 100644 recipes/openal-soft/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch create mode 100644 recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch create mode 100644 recipes/openal-soft/all/test_package/CMakeLists.txt create mode 100644 recipes/openal-soft/all/test_package/CMakeUserPresets.json create mode 100644 recipes/openal-soft/all/test_package/conanfile.py create mode 100644 recipes/openal-soft/all/test_package/test_package.c create mode 100644 recipes/openal-soft/config.yml create mode 100644 recipes/opengl/all/conanfile.py create mode 100644 recipes/opengl/all/test_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_cmake_module_package/conanfile.py create mode 100644 recipes/opengl/all/test_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_package/CMakeUserPresets.json create mode 100644 recipes/opengl/all/test_package/conanfile.py create mode 100644 recipes/opengl/all/test_package/osx.mm create mode 100644 recipes/opengl/all/test_package/test_package.cpp create mode 100644 recipes/opengl/all/test_package/win.cpp create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_cmake_module_package/conanfile.py create mode 100644 recipes/opengl/all/test_v1_package/CMakeLists.txt create mode 100644 recipes/opengl/all/test_v1_package/conanfile.py create mode 100644 recipes/opengl/config.yml create mode 100644 recipes/qt/5.x.x/conandata.yml create mode 100644 recipes/qt/5.x.x/conanfile.py create mode 100644 recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch create mode 100644 recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch create mode 100644 recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch create mode 100644 recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch create mode 100644 recipes/qt/5.x.x/patches/aa2a39dea5.diff create mode 100644 recipes/qt/5.x.x/patches/android-backtrace.diff create mode 100644 recipes/qt/5.x.x/patches/android-new-ndk.diff create mode 100644 recipes/qt/5.x.x/patches/android-openssl.diff create mode 100644 recipes/qt/5.x.x/patches/c72097e.diff create mode 100644 recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch create mode 100644 recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch create mode 100644 recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch create mode 100644 recipes/qt/5.x.x/patches/fix-macdeployqt.diff create mode 100644 recipes/qt/5.x.x/patches/qtconnectivity-1-fixes.patch create mode 100644 recipes/qt/5.x.x/patches/qtdeclarative-1-fixes.patch create mode 100644 recipes/qt/5.x.x/patches/qtlocation-1.patch create mode 100644 recipes/qt/5.x.x/patches/qtmultimedia-1.patch create mode 100644 recipes/qt/5.x.x/patches/qttools-1-fixes.patch create mode 100644 recipes/qt/5.x.x/patches/skia-cd397f3.diff create mode 100644 recipes/qt/5.x.x/qtmodules5.15.10.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.11.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.12.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.13.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.14.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.16.conf create mode 100644 recipes/qt/5.x.x/qtmodules5.15.9.conf create mode 100644 recipes/qt/5.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/qt/5.x.x/test_v1_package/conanfile.py create mode 100644 recipes/qt/5.x.x/test_v1_package/meson.build create mode 100644 recipes/qt/5.x.x/test_v1_package/test_package.pro create mode 100644 recipes/qt/6.x.x/conandata.yml create mode 100644 recipes/qt/6.x.x/conanfile.py create mode 100644 recipes/qt/6.x.x/patches/32fa63f.patch create mode 100644 recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch create mode 100644 recipes/qt/6.x.x/patches/c72097e.diff create mode 100644 recipes/qt/6.x.x/patches/c72097e_6.6.0.diff create mode 100644 recipes/qt/6.x.x/patches/d13958d.diff create mode 100644 recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch create mode 100644 recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch create mode 100644 recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch create mode 100644 recipes/qt/6.x.x/patches/fix_cmake3.28.patch create mode 100644 recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff create mode 100644 recipes/qt/6.x.x/qtmodules6.5.3.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.6.3.conf create mode 100644 recipes/qt/6.x.x/qtmodules6.7.3.conf create mode 100644 recipes/qt/6.x.x/test_package/CMakeLists.txt create mode 100644 recipes/qt/6.x.x/test_package/conanfile.py create mode 100644 recipes/qt/6.x.x/test_package/example.qrc create mode 100644 recipes/qt/6.x.x/test_package/greeter.h create mode 100644 recipes/qt/6.x.x/test_package/resource.txt create mode 100644 recipes/qt/6.x.x/test_package/test_macos_bundle.cpp create mode 100644 recipes/qt/6.x.x/test_package/test_package.cpp create mode 100644 recipes/qt/6.x.x/test_v1_package/CMakeLists.txt create mode 100644 recipes/qt/6.x.x/test_v1_package/conanfile.py create mode 100644 recipes/qt/6.x.x/test_v1_package/meson.build create mode 100644 recipes/qt/6.x.x/test_v1_package/test_package.pro create mode 100644 recipes/qt/config.yml create mode 100644 recipes/xkbcommon/all/conandata.yml create mode 100644 recipes/xkbcommon/all/conanfile.py create mode 100644 recipes/xkbcommon/all/test_package/CMakeLists.txt create mode 100644 recipes/xkbcommon/all/test_package/CMakeUserPresets.json create mode 100644 recipes/xkbcommon/all/test_package/conanfile.py create mode 100644 recipes/xkbcommon/all/test_package/test_package.cpp create mode 100644 recipes/xkbcommon/config.yml create mode 100644 recipes/xkeyboard-config/all/conanfile.py create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuild.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/conanrun.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuild.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrun.sh create mode 100644 recipes/xkeyboard-config/all/test_package/build-release/conan/xkeyboard-config.pc create mode 100644 recipes/xkeyboard-config/all/test_package/conanfile.py create mode 100644 recipes/xkeyboard-config/config.yml diff --git a/recipes/bison/all/conandata.yml b/recipes/bison/all/conandata.yml new file mode 100644 index 0000000..16bdbe2 --- /dev/null +++ b/recipes/bison/all/conandata.yml @@ -0,0 +1,63 @@ +sources: + "3.8.2": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/bison/bison-3.8.2.tar.gz" + sha256: "06c9e13bdf7eb24d4ceb6b59205a4f67c2c7e7213119644430fe82fbd14a0abb" + "3.7.6": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/bison/bison-3.7.6.tar.gz" + sha256: "69dc0bb46ea8fc307d4ca1e0b61c8c355eb207d0b0c69f4f8462328e74d7b9ea" + "3.7.1": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/bison/bison-3.7.1.tar.gz" + sha256: "1dd952839cf0d5a8178c691eeae40dc48fa50d18dcce648b1ad9ae0195367d13" + "3.5.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/gnu/bison/bison-3.5.3.tar.gz" + sha256: "34e201d963156618a0ea5bc87220f660a1e08403dd3c7c7903d4f38db3f40039" +patches: + "3.8.2": + - patch_file: "patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.6": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + "3.7.1": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" + - patch_file: "patches/0006-dont-link-bison-against-libreadline.patch" + patch_description: "Don't link bison against libreadline" + patch_type: "portability" + "3.5.3": + - patch_file: "patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch" + patch_description: "use O_TEXT instead of O_BINARY for pipe" + patch_type: "portability" + - patch_file: "patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch" + patch_description: "windows: open source file in binary mode" + patch_type: "portability" + - patch_file: "patches/0003-3.5.3-msvc-changes.patch" + patch_description: "windows: fix build" + patch_type: "portability" + - patch_file: "patches/0004-3.5.3-relocatable.patch" + patch_description: "Relocatable" + patch_type: "portability" + - patch_file: "patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch" + patch_description: "msvc: limit search range of _setmaxstdio" + patch_type: "portability" diff --git a/recipes/bison/all/conanfile.py b/recipes/bison/all/conanfile.py new file mode 100644 index 0000000..98dd943 --- /dev/null +++ b/recipes/bison/all/conanfile.py @@ -0,0 +1,168 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, replace_in_file +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, unix_path +import os + +required_conan_version = ">=1.54.0" + + +class BisonConan(ConanFile): + name = "bison" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/bison/" + description = "Bison is a general-purpose parser generator" + topics = ("bison", "parser") + license = "GPL-3.0-or-later" + settings = "os", "arch", "compiler", "build_type" + options = { + "fPIC": [True, False], + } + default_options = { + "fPIC": True, + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("m4/1.4.19") + + def validate(self): + if is_msvc(self) and self.version == "3.8.2": + raise ConanInvalidConfiguration( + f"{self.ref} is not yet ready for Visual Studio, use previous version " + "or open a pull request on https://github.com/conan-io/conan-center-index/pulls" + ) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + if is_msvc(self): + self.tool_requires("automake/1.16.5") + if self.settings.os != "Windows": + self.tool_requires("flex/2.6.4") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + tc.configure_args.extend([ + "--enable-relocatable", + "--disable-nls", + "--datarootdir=${prefix}/res", + ]) + if self.settings.compiler == "apple-clang": + tc.configure_args.append("gl_cv_compiler_check_decl_option=") + if is_msvc(self): + # Avoid a `Assertion Failed Dialog Box` during configure with build_type=Debug + # Visual Studio does not support the %n format flag: + # https://docs.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions + # Because the %n format is inherently insecure, it is disabled by default. If %n is encountered in a format string, + # the invalid parameter handler is invoked, as described in Parameter Validation. To enable %n support, see _set_printf_count_output. + tc.configure_args.extend([ + "gl_cv_func_printf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + "gl_cv_func_snprintf_directive_n=no", + ]) + tc.extra_cflags.append("-FS") + env = tc.environment() + if is_msvc(self): + automake_conf = self.dependencies.build["automake"].conf_info + compile_wrapper = unix_path(self, automake_conf.get("user.automake:compile-wrapper", check_type=str)) + ar_wrapper = unix_path(self, automake_conf.get("user.automake:lib-wrapper", check_type=str)) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} lib") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + tc.generate(env) + + def _patch_sources(self): + apply_conandata_patches(self) + + makefile = os.path.join(self.source_folder, "Makefile.in") + yacc = os.path.join(self.source_folder, "src", "yacc.in") + + if self.settings.os == "Windows": + # replace embedded unix paths by windows paths + replace_in_file(self, makefile, + "echo '#define BINDIR \"$(bindir)\"';", + "echo '#define BINDIR \"$(shell cygpath -m \"$(bindir)\")\"';") + replace_in_file(self, makefile, + "echo '#define PKGDATADIR \"$(pkgdatadir)\"';", + "echo '#define PKGDATADIR \"$(shell cygpath -m \"$(pkgdatadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATADIR \"$(datadir)\"';", + "echo '#define DATADIR \"$(shell cygpath -m \"$(datadir)\")\"';") + replace_in_file(self, makefile, + "echo '#define DATAROOTDIR \"$(datarootdir)\"';", + "echo '#define DATAROOTDIR \"$(shell cygpath -m \"$(datarootdir)\")\"';") + + replace_in_file(self, makefile, + "dist_man_MANS = $(top_srcdir)/doc/bison.1", + "dist_man_MANS =") + replace_in_file(self, yacc, "@prefix@", "$CONAN_BISON_ROOT") + replace_in_file(self, yacc, "@bindir@", "$CONAN_BISON_ROOT/bin") + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.install() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + if is_msvc(self): + rename(self, os.path.join(self.package_folder, "lib", "liby.a"), + os.path.join(self.package_folder, "lib", "y.lib")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libs = ["y"] + self.cpp_info.resdirs = ["res"] + + bison_root = self.package_folder.replace("\\", "/") + self.buildenv_info.define_path("CONAN_BISON_ROOT", bison_root) + + pkgdir = os.path.join(self.package_folder, "res", "bison") + self.buildenv_info.define_path("BISON_PKGDATADIR", pkgdir) + + # yacc is a shell script, so requires a shell (such as bash) + yacc = os.path.join(self.package_folder, "bin", "yacc").replace("\\", "/") + self.conf_info.define("user.bison:yacc", yacc) + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + self.env_info.CONAN_BISON_ROOT = self.package_folder.replace("\\", "/") + self.env_info.BISON_PKGDATADIR = pkgdir + self.user_info.YACC = yacc diff --git a/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000..b40517e --- /dev/null +++ b/recipes/bison/all/patches/0001-3.8-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -213,10 +213,10 @@ create_pipe (const char *progname, + xalloc_die (); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch b/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch new file mode 100644 index 0000000..9f229b7 --- /dev/null +++ b/recipes/bison/all/patches/0001-create_pipe-uses-O_TEXT-not-O_BINARY-mode.patch @@ -0,0 +1,29 @@ +From dffa2a21edeba243ef76b75e0c2081ec15fe95bd Mon Sep 17 00:00:00 2001 +From: SSE4 +Date: Wed, 3 Apr 2019 19:48:12 +0700 +Subject: [PATCH 3/4] 0003 + +--- + lib/spawn-pipe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/spawn-pipe.c b/lib/spawn-pipe.c +index 3af5167..09e9cad 100644 +--- a/lib/spawn-pipe.c ++++ b/lib/spawn-pipe.c +@@ -137,10 +137,10 @@ create_pipe (const char *progname, + prog_argv = prepare_spawn (prog_argv); + + if (pipe_stdout) +- if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ifd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + if (pipe_stdin) +- if (pipe2_safer (ofd, O_BINARY | O_CLOEXEC) < 0) ++ if (pipe2_safer (ofd, O_TEXT | O_CLOEXEC) < 0) + error (EXIT_FAILURE, errno, _("cannot create pipe")); + /* Data flow diagram: + * +-- +2.7.4.windows.1 + diff --git a/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..faa2c49 --- /dev/null +++ b/recipes/bison/all/patches/0002-3.5.3-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -268,6 +268,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -278,7 +278,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..9737127 --- /dev/null +++ b/recipes/bison/all/patches/0002-3.7.1-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -256,6 +256,14 @@ caret_free (void) + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -266,7 +266,7 @@ caret_set_file (const char *file) + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch b/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch new file mode 100644 index 0000000..2310d29 --- /dev/null +++ b/recipes/bison/all/patches/0002-3.7.6-open-source-file-in-binary-mode-MS-ftell-bug-ks-68337.patch @@ -0,0 +1,26 @@ +--- src/location.c ++++ src/location.c +@@ -258,6 +258,14 @@ + static bool + caret_set_file (const char *file) + { ++#if defined(_WIN32) ++ /* ftell() is unusable on Windows in the face of text files ++ that use just LF and not Windows-style CR-LF as newlines ++ http://support.microsoft.com/kb/68337 */ ++ char fopen_mode[3] = "rb"; ++#else ++ char fopen_mode[2] = "r"; ++#endif + /* If a different file than before, close and let the rest open + the new one. */ + if (caret_info.pos.file && caret_info.pos.file != file) +@@ -268,7 +268,7 @@ + if (!caret_info.pos.file) + { + caret_info.pos.file = file; +- if ((caret_info.file = fopen (caret_info.pos.file, "r"))) ++ if ((caret_info.file = fopen (caret_info.pos.file, fopen_mode))) + { + /* If the file is not regular (imagine #line 1 "/dev/stdin" + in the input file for instance), don't try to quote the diff --git a/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch b/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch new file mode 100644 index 0000000..56aeeeb --- /dev/null +++ b/recipes/bison/all/patches/0003-3.5.3-msvc-changes.patch @@ -0,0 +1,261 @@ +src/parse-gram.y and src/scan-gram.l should be modified as well, +but aren't to avoid a dependency on a already-built flex and bison. + +--- src/location.c ++++ src/location.c +@@ -25,9 +25,13 @@ + #include + #include + #include /* fileno */ ++#ifndef _WIN32 + #include ++#endif + #include /* fstat */ ++#ifndef _WIN32 + #include ++#endif + + #ifdef WINSIZE_IN_PTEM + # include +--- src/parse-gram.c ++++ src/parse-gram.c +@@ -991,7 +991,7 @@ tron (yyo); + + case 43: /* "character literal" */ + #line 217 "src/parse-gram.y" +- { fputs (char_name (((*yyvaluep).CHAR)), yyo); } ++ { fputs (char_name (((*yyvaluep).CHAR_LITERAL)), yyo); } + #line 996 "src/parse-gram.c" + break; + +@@ -1027,7 +1027,7 @@ tron (yyo); + + case 56: /* "integer" */ + #line 234 "src/parse-gram.y" +- { fprintf (yyo, "%d", ((*yyvaluep).INT)); } ++ { fprintf (yyo, "%d", ((*yyvaluep).INTEGER)); } + #line 1032 "src/parse-gram.c" + break; + +@@ -2216,13 +2216,13 @@ yyreduce: + + case 12: + #line 330 "src/parse-gram.y" +- { expected_sr_conflicts = (yyvsp[0].INT); } ++ { expected_sr_conflicts = (yyvsp[0].INTEGER); } + #line 2221 "src/parse-gram.c" + break; + + case 13: + #line 331 "src/parse-gram.y" +- { expected_rr_conflicts = (yyvsp[0].INT); } ++ { expected_rr_conflicts = (yyvsp[0].INTEGER); } + #line 2227 "src/parse-gram.c" + break; + +@@ -2775,7 +2775,7 @@ yyreduce: + + case 102: + #line 679 "src/parse-gram.y" +- { grammar_current_rule_dprec_set ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_dprec_set ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2780 "src/parse-gram.c" + break; + +@@ -2787,13 +2787,13 @@ yyreduce: + + case 104: + #line 683 "src/parse-gram.y" +- { grammar_current_rule_expect_sr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_sr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2792 "src/parse-gram.c" + break; + + case 105: + #line 685 "src/parse-gram.y" +- { grammar_current_rule_expect_rr ((yyvsp[0].INT), (yylsp[0])); } ++ { grammar_current_rule_expect_rr ((yyvsp[0].INTEGER), (yylsp[0])); } + #line 2798 "src/parse-gram.c" + break; + +@@ -2860,9 +2860,9 @@ yyreduce: + complain_indent (&loc, complaint, &indent, + _("definition of %s"), var); + } +- (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR)), (yylsp[0])); ++ (yyval.id) = symbol_get (char_name ((yyvsp[0].CHAR_LITERAL)), (yylsp[0])); + symbol_class_set ((yyval.id), token_sym, (yylsp[0]), false); +- symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR), (yylsp[0])); ++ symbol_user_token_number_set ((yyval.id), (yyvsp[0].CHAR_LITERAL), (yylsp[0])); + } + #line 2868 "src/parse-gram.c" + break; +--- src/parse-gram.h ++++ src/parse-gram.h +@@ -122,7 +122,7 @@ extern int gram_debug; + BRACED_CODE = 40, + BRACED_PREDICATE = 41, + BRACKETED_ID = 42, +- CHAR = 43, ++ CHAR_LITERAL = 43, + COLON = 44, + EPILOGUE = 45, + EQUAL = 46, +@@ -135,7 +135,7 @@ extern int gram_debug; + TAG = 53, + TAG_ANY = 54, + TAG_NONE = 55, +- INT = 56, ++ INTEGER = 56, + PERCENT_PARAM = 57, + PERCENT_UNION = 58, + PERCENT_EMPTY = 59 +@@ -162,7 +162,7 @@ union GRAM_STYPE + /* code_props_type */ + code_props_type code_props_type; + /* "integer" */ +- int INT; ++ int INTEGER; + /* int.opt */ + int yytype_81; + /* named_ref.opt */ +@@ -226,7 +226,7 @@ union GRAM_STYPE + /* variable */ + uniqstr variable; + /* "character literal" */ +- unsigned char CHAR; ++ unsigned char CHAR_LITERAL; + /* value */ + value_type value; + #line 233 "src/parse-gram.h" +--- src/reader.c ++++ src/reader.c +@@ -803,7 +803,7 @@ check_and_convert_grammar (void) + + $accept: %start $end. */ + { +- symbol_list *p = symbol_list_sym_new (accept, empty_loc); ++ symbol_list *p = symbol_list_sym_new (bison_accept, empty_loc); + p->rhs_loc = grammar->rhs_loc; + p->next = symbol_list_sym_new (startsymbol, empty_loc); + p->next->next = symbol_list_sym_new (endtoken, empty_loc); +--- src/reduce.c ++++ src/reduce.c +@@ -160,9 +160,9 @@ inaccessable_symbols (void) + bitset Pp = bitset_create (nrules, BITSET_FIXED); + + /* If the start symbol isn't useful, then nothing will be useful. */ +- if (bitset_test (N, accept->content->number - ntokens)) ++ if (bitset_test (N, bison_accept->content->number - ntokens)) + { +- bitset_set (V, accept->content->number); ++ bitset_set (V, bison_accept->content->number); + + while (1) + { +@@ -301,7 +301,7 @@ nonterminals_reduce (void) + for (item_number *rhsp = rules[r].rhs; 0 <= *rhsp; ++rhsp) + if (ISVAR (*rhsp)) + *rhsp = symbol_number_as_item_number (nterm_map[*rhsp - ntokens]); +- accept->content->number = nterm_map[accept->content->number - ntokens]; ++ bison_accept->content->number = nterm_map[bison_accept->content->number - ntokens]; + } + + nsyms -= nuseless_nonterminals; +@@ -381,7 +381,7 @@ reduce_grammar (void) + { + reduce_print (); + +- if (!bitset_test (N, accept->content->number - ntokens)) ++ if (!bitset_test (N, bison_accept->content->number - ntokens)) + complain (&startsymbol_loc, fatal, + _("start symbol %s does not derive any sentence"), + startsymbol->tag); +--- src/scan-gram.c ++++ src/scan-gram.c +@@ -2223,12 +2223,12 @@ YY_RULE_SETUP + case 65: + YY_RULE_SETUP + #line 308 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 10, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 10, *loc)); + YY_BREAK + case 66: + YY_RULE_SETUP + #line 309 "/Users/akim/src/gnu/bison/src/scan-gram.l" +-RETURN_VALUE (INT, scan_integer (yytext, 16, *loc)); ++RETURN_VALUE (INTEGER, scan_integer (yytext, 16, *loc)); + YY_BREAK + /* Identifiers may not start with a digit. Yet, don't silently + accept "1FOO" as "1 FOO". */ +@@ -2575,21 +2575,21 @@ YY_RULE_SETUP + { + STRING_FINISH; + loc->start = token_start; +- val->CHAR = last_string[0]; ++ val->CHAR_LITERAL = last_string[0]; + + /* FIXME: Eventually, make these errors. */ + if (last_string[0] == '\0') + { + complain (loc, Wother, _("empty character literal")); + /* '\0' seems dangerous even if we are about to complain. */ +- val->CHAR = '\''; ++ val->CHAR_LITERAL = '\''; + } + else if (last_string[1] != '\0') + complain (loc, Wother, + _("extra characters in character literal")); + STRING_FREE; + BEGIN INITIAL; +- return CHAR; ++ return CHAR_LITERAL; + } + YY_BREAK + case 95: +--- src/symtab.c ++++ src/symtab.c +@@ -52,7 +52,7 @@ static semantic_type **semantic_types_sorted = NULL; + symbol *errtoken = NULL; + symbol *undeftoken = NULL; + symbol *endtoken = NULL; +-symbol *accept = NULL; ++symbol *bison_accept = NULL; + symbol *startsymbol = NULL; + location startsymbol_loc; + +@@ -843,9 +843,9 @@ symbols_new (void) + symbol_free); + + /* Construct the accept symbol. */ +- accept = symbol_get ("$accept", empty_loc); +- accept->content->class = nterm_sym; +- accept->content->number = nvars++; ++ bison_accept = symbol_get ("$accept", empty_loc); ++ bison_accept->content->class = nterm_sym; ++ bison_accept->content->number = nvars++; + + /* Construct the error token */ + errtoken = symbol_get ("error", empty_loc); +--- src/symtab.h ++++ src/symtab.h +@@ -248,7 +248,7 @@ extern symbol *endtoken; + /** The genuine start symbol. + + $accept: start-symbol $end */ +-extern symbol *accept; ++extern symbol *bison_accept; + + /** The user start symbol. */ + extern symbol *startsymbol; +--- src/ielr.c ++++ src/ielr.c +@@ -429,7 +429,7 @@ + check all predecessors' goto follows for the LHS. */ + if (item_number_is_rule_number (ritem[s->items[item] - 2])) + { +- aver (lhs != accept->content->number); ++ aver (lhs != bison_accept->content->number); + for (state **predecessor = predecessors[s->number]; + *predecessor; + ++predecessor) diff --git a/recipes/bison/all/patches/0004-3.5.3-relocatable.patch b/recipes/bison/all/patches/0004-3.5.3-relocatable.patch new file mode 100644 index 0000000..991f41c --- /dev/null +++ b/recipes/bison/all/patches/0004-3.5.3-relocatable.patch @@ -0,0 +1,753 @@ +--- Makefile.in ++++ Makefile.in +@@ -637,10 +637,10 @@ am_src_bison_OBJECTS = src/bison-AnnotationList.$(OBJEXT) \ + src/bison-main.$(OBJEXT) src/bison-muscle-tab.$(OBJEXT) \ + src/bison-named-ref.$(OBJEXT) src/bison-nullable.$(OBJEXT) \ + src/bison-output.$(OBJEXT) src/bison-parse-gram.$(OBJEXT) \ +- src/bison-print-graph.$(OBJEXT) src/bison-print-xml.$(OBJEXT) \ +- src/bison-print.$(OBJEXT) src/bison-reader.$(OBJEXT) \ +- src/bison-reduce.$(OBJEXT) src/bison-relation.$(OBJEXT) \ +- src/bison-scan-code-c.$(OBJEXT) \ ++ src/bison-pathtools.$(OBJEXT) src/bison-print-graph.$(OBJEXT) \ ++ src/bison-print-xml.$(OBJEXT) src/bison-print.$(OBJEXT) \ ++ src/bison-reader.$(OBJEXT) src/bison-reduce.$(OBJEXT) \ ++ src/bison-relation.$(OBJEXT) src/bison-scan-code-c.$(OBJEXT) \ + src/bison-scan-gram-c.$(OBJEXT) \ + src/bison-scan-skel-c.$(OBJEXT) src/bison-state.$(OBJEXT) \ + src/bison-symlist.$(OBJEXT) src/bison-symtab.$(OBJEXT) \ +@@ -878,6 +878,7 @@ am__depfiles_remade = examples/c++/$(DEPDIR)/simple-simple.Po \ + src/$(DEPDIR)/bison-named-ref.Po \ + src/$(DEPDIR)/bison-nullable.Po src/$(DEPDIR)/bison-output.Po \ + src/$(DEPDIR)/bison-parse-gram.Po \ ++ src/$(DEPDIR)/bison-pathtools.Po \ + src/$(DEPDIR)/bison-print-graph.Po \ + src/$(DEPDIR)/bison-print-xml.Po src/$(DEPDIR)/bison-print.Po \ + src/$(DEPDIR)/bison-reader.Po src/$(DEPDIR)/bison-reduce.Po \ +@@ -3169,6 +3170,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +@@ -3992,6 +3995,8 @@ src/bison-output.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-parse-gram.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) ++src/bison-pathtools.$(OBJEXT): src/$(am__dirstamp) \ ++ src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-graph.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) + src/bison-print-xml.$(OBJEXT): src/$(am__dirstamp) \ +@@ -4317,6 +4322,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-nullable.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-output.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-parse-gram.Po@am__quote@ # am--include-marker ++@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-pathtools.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-graph.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print-xml.Po@am__quote@ # am--include-marker + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/bison-print.Po@am__quote@ # am--include-marker +@@ -7283,6 +7289,20 @@ src/bison-parse-gram.obj: src/parse-gram.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-parse-gram.obj `if test -f 'src/parse-gram.c'; then $(CYGPATH_W) 'src/parse-gram.c'; else $(CYGPATH_W) '$(srcdir)/src/parse-gram.c'; fi` + ++src/bison-pathtools.o: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.o -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.o `test -f 'src/pathtools.c' || echo '$(srcdir)/'`src/pathtools.c ++ ++src/bison-pathtools.obj: src/pathtools.c ++@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-pathtools.obj -MD -MP -MF src/$(DEPDIR)/bison-pathtools.Tpo -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-pathtools.Tpo src/$(DEPDIR)/bison-pathtools.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pathtools.c' object='src/bison-pathtools.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -c -o src/bison-pathtools.obj `if test -f 'src/pathtools.c'; then $(CYGPATH_W) 'src/pathtools.c'; else $(CYGPATH_W) '$(srcdir)/src/pathtools.c'; fi` ++ + src/bison-print-graph.o: src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bison_CPPFLAGS) $(CPPFLAGS) $(src_bison_CFLAGS) $(CFLAGS) -MT src/bison-print-graph.o -MD -MP -MF src/$(DEPDIR)/bison-print-graph.Tpo -c -o src/bison-print-graph.o `test -f 'src/print-graph.c' || echo '$(srcdir)/'`src/print-graph.c + @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/bison-print-graph.Tpo src/$(DEPDIR)/bison-print-graph.Po +@@ -9079,6 +9099,7 @@ distclean: distclean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +@@ -9464,6 +9485,7 @@ maintainer-clean: maintainer-clean-recursive + -rm -f src/$(DEPDIR)/bison-nullable.Po + -rm -f src/$(DEPDIR)/bison-output.Po + -rm -f src/$(DEPDIR)/bison-parse-gram.Po ++ -rm -f src/$(DEPDIR)/bison-pathtools.Po + -rm -f src/$(DEPDIR)/bison-print-graph.Po + -rm -f src/$(DEPDIR)/bison-print-xml.Po + -rm -f src/$(DEPDIR)/bison-print.Po +--- src/files.c ++++ src/files.c +@@ -1,4 +1,5 @@ + /* Open and close files for Bison. ++ rse-gram.Po + + Copyright (C) 1984, 1986, 1989, 1992, 2000-2015, 2018-2020 Free + Software Foundation, Inc. +@@ -35,6 +36,7 @@ + #include "files.h" + #include "getargs.h" + #include "gram.h" ++#include "pathtools.h" + + /* Initializing some values below (such SPEC_NAME_PREFIX to 'yy') is + tempting, but don't do that: for the time being our handling of the +@@ -417,7 +419,11 @@ pkgdatadir (void) + else + { + char const *cp = getenv ("BISON_PKGDATADIR"); +- return cp ? cp : relocate2 (PKGDATADIR, &relocate_buffer); ++ if (cp) { ++ return cp; ++ } ++ const char *_dir = single_path_relocation(BINDIR, PKGDATADIR); ++ return _dir; + } + } + +--- src/local.mk ++++ src/local.mk +@@ -71,6 +71,8 @@ src_bison_SOURCES = \ + src/output.c \ + src/output.h \ + src/parse-gram.y \ ++ src/pathtools.c \ ++ src/pathtools.h \ + src/print-graph.c \ + src/print-graph.h \ + src/print-xml.c \ +--- src/output.c ++++ src/output.c +@@ -21,6 +21,7 @@ + #include + #include "system.h" + ++#include + #include /* IS_PATH_WITH_DIR */ + #include + #include +@@ -41,6 +42,7 @@ + #include "scan-skel.h" + #include "symtab.h" + #include "tables.h" ++#include "pathtools.h" + + static struct obstack format_obstack; + +@@ -573,7 +575,7 @@ static void + output_skeleton (void) + { + /* Compute the names of the package data dir and skeleton files. */ +- char const *m4 = (m4 = getenv ("M4")) ? m4 : M4; ++ char const *m4 = (m4 = getenv ("M4")) ? m4 : "m4" EXEEXT; //single_path_relocation(BINDIR, M4); + char const *datadir = pkgdatadir (); + char *skeldir = xpath_join (datadir, "skeletons"); + char *m4sugar = xpath_join (datadir, "m4sugar/m4sugar.m4"); +--- /dev/null ++++ src/pathtools.c +@@ -0,0 +1,536 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#include "config.h" ++#if defined(__APPLE__) ++#include ++#else ++#include ++#include ++#endif ++#include ++#include ++#include ++#if defined(__linux__) ++#include ++#endif ++#include ++ ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++/* If you don't define this, then get_executable_path() ++ can only use argv[0] which will often not work well */ ++#define IMPLEMENT_SYS_GET_EXECUTABLE_PATH ++ ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++/* Nothing needed, unistd.h is enough. */ ++#elif defined(__APPLE__) ++#include ++#elif defined(_WIN32) ++#define WIN32_MEAN_AND_LEAN ++#include ++#include ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ ++#include "pathtools.h" ++ ++char * ++malloc_copy_string(char const * original) ++{ ++ char * result = (char *) malloc (sizeof (char*) * strlen (original)+1); ++ if (result != NULL) ++ { ++ strcpy (result, original); ++ } ++ return result; ++} ++ ++void ++sanitise_path(char * path) ++{ ++ size_t path_size = strlen (path); ++ ++ /* Replace any '\' with '/' */ ++ char * path_p = path; ++ while ((path_p = strchr (path_p, '\\')) != NULL) ++ { ++ *path_p = '/'; ++ } ++ /* Replace any '//' with '/' */ ++ path_p = path; ++ while ((path_p = strstr (path_p, "//")) != NULL) ++ { ++ memmove (path_p, path_p + 1, path_size--); ++ } ++ return; ++} ++ ++char * ++get_relative_path(char const * from_in, char const * to_in) ++{ ++ size_t from_size = (from_in == NULL) ? 0 : strlen (from_in); ++ size_t to_size = (to_in == NULL) ? 0 : strlen (to_in); ++ size_t max_size = (from_size + to_size) * 2 + 4; ++ char * scratch_space = (char *) alloca (from_size + 1 + to_size + 1 + max_size + max_size); ++ char * from; ++ char * to; ++ char * common_part; ++ char * result; ++ size_t count; ++ ++ /* No to, return "./" */ ++ if (to_in == NULL) ++ { ++ return malloc_copy_string ("./"); ++ } ++ ++ /* If alloca failed or no from was given return a copy of to */ ++ if ( from_in == NULL ++ || scratch_space == NULL ) ++ { ++ return malloc_copy_string (to_in); ++ } ++ ++ from = scratch_space; ++ strcpy (from, from_in); ++ to = from + from_size + 1; ++ strcpy (to, to_in); ++ common_part = to + to_size + 1; ++ result = common_part + max_size; ++ simplify_path (from); ++ simplify_path (to); ++ ++ result[0] = '\0'; ++ ++ size_t match_size_dirsep = 0; /* The match size up to the last /. Always wind back to this - 1 */ ++ size_t match_size = 0; /* The running (and final) match size. */ ++ size_t largest_size = (from_size > to_size) ? from_size : to_size; ++ int to_final_is_slash = (to[to_size-1] == '/') ? 1 : 0; ++ char from_c; ++ char to_c; ++ for (match_size = 0; match_size < largest_size; ++match_size) ++ { ++ /* To simplify the logic, always pretend the strings end with '/' */ ++ from_c = (match_size < from_size) ? from[match_size] : '/'; ++ to_c = (match_size < to_size) ? to[match_size] : '/'; ++ ++ if (from_c != to_c) ++ { ++ if (from_c != '\0' || to_c != '\0') ++ { ++ match_size = match_size_dirsep; ++ } ++ break; ++ } ++ else if (from_c == '/') ++ { ++ match_size_dirsep = match_size; ++ } ++ } ++ strncpy (common_part, from, match_size); ++ common_part[match_size] = '\0'; ++ from += match_size; ++ to += match_size; ++ size_t ndotdots = 0; ++ char const* from_last = from + strlen(from) - 1; ++ while ((from = strchr (from, '/')) && from != from_last) ++ { ++ ++ndotdots; ++ ++from; ++ } ++ for (count = 0; count < ndotdots; ++count) ++ { ++ strcat(result, "../"); ++ } ++ if (strlen(to) > 0) ++ { ++ strcat(result, to+1); ++ } ++ /* Make sure that if to ends with '/' result does the same, and ++ vice-versa. */ ++ size_t size_result = strlen(result); ++ if ((to_final_is_slash == 1) ++ && (!size_result || result[size_result-1] != '/')) ++ { ++ strcat (result, "/"); ++ } ++ else if (!to_final_is_slash ++ && size_result && result[size_result-1] == '/') ++ { ++ result[size_result-1] = '\0'; ++ } ++ ++ return malloc_copy_string (result); ++} ++ ++void ++simplify_path(char * path) ++{ ++ ssize_t n_toks = 1; /* in-case we need an empty initial token. */ ++ ssize_t i, j; ++ size_t tok_size; ++ size_t in_size = strlen (path); ++ int it_ended_with_a_slash = (path[in_size - 1] == '/') ? 1 : 0; ++ char * result = path; ++ sanitise_path(result); ++ char * result_p = result; ++ ++ do ++ { ++ ++n_toks; ++ ++result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ result_p = result; ++ char ** toks = (char **) alloca (sizeof (char const*) * n_toks); ++ n_toks = 0; ++ do ++ { ++ if (result_p > result) ++ { ++ *result_p++ = '\0'; ++ } ++ else if (*result_p == '/') ++ { ++ /* A leading / creates an empty initial token. */ ++ toks[n_toks++] = result_p; ++ *result_p++ = '\0'; ++ } ++ toks[n_toks++] = result_p; ++ } while ((result_p = strchr (result_p, '/')) != NULL); ++ ++ /* Remove all non-leading '.' and any '..' we can match ++ with an earlier forward path (i.e. neither '.' nor '..') */ ++ for (i = 1; i < n_toks; ++i) ++ { ++ int removals[2] = { -1, -1 }; ++ if ( strcmp (toks[i], "." ) == 0) ++ { ++ removals[0] = i; ++ } ++ else if ( strcmp (toks[i], ".." ) == 0) ++ { ++ /* Search backwards for a forward path to collapse. ++ If none are found then the .. also stays. */ ++ for (j = i - 1; j > -1; --j) ++ { ++ if ( strcmp (toks[j], "." ) ++ && strcmp (toks[j], ".." ) ) ++ { ++ removals[0] = j; ++ removals[1] = i; ++ break; ++ } ++ } ++ } ++ for (j = 0; j < 2; ++j) ++ { ++ if (removals[j] >= 0) /* Can become -2 */ ++ { ++ --n_toks; ++ memmove (&toks[removals[j]], &toks[removals[j]+1], (n_toks - removals[j])*sizeof (char*)); ++ --i; ++ if (!j) ++ { ++ --removals[1]; ++ } ++ } ++ } ++ } ++ result_p = result; ++ for (i = 0; i < n_toks; ++i) ++ { ++ tok_size = strlen(toks[i]); ++ memcpy (result_p, toks[i], tok_size); ++ result_p += tok_size; ++ if ((!i || tok_size) && ((i < n_toks - 1) || it_ended_with_a_slash == 1)) ++ { ++ *result_p = '/'; ++ ++result_p; ++ } ++ } ++ *result_p = '\0'; ++} ++ ++/* Returns actual_to by calculating the relative path from -> to and ++ applying that to actual_from. An assumption that actual_from is a ++ dir is made, and it may or may not end with a '/' */ ++char const * ++get_relocated_path (char const * from, char const * to, char const * actual_from) ++{ ++ char const * relative_from_to = get_relative_path (from, to); ++ char * actual_to = (char *) malloc (strlen(actual_from) + 2 + strlen(relative_from_to)); ++ return actual_to; ++} ++ ++int ++get_executable_path(char const * argv0, char * result, ssize_t max_size) ++{ ++ char * system_result = (char *) alloca (max_size); ++ ssize_t system_result_size = -1; ++ ssize_t result_size = -1; ++ ++ if (system_result != NULL) ++ { ++#if defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) ++#if defined(__linux__) ++ system_result_size = readlink("/proc/self/exe", system_result, max_size); ++#elif defined(__APPLE__) ++ uint32_t bufsize = (uint32_t)max_size; ++ if (_NSGetExecutablePath(system_result, &bufsize) == 0) ++ { ++ system_result_size = (ssize_t)bufsize; ++ } ++#elif defined(_WIN32) ++ unsigned long bufsize = (unsigned long)max_size; ++ system_result_size = GetModuleFileNameA(NULL, system_result, bufsize); ++ if (system_result_size == 0 || system_result_size == (ssize_t)bufsize) ++ { ++ /* Error, possibly not enough space. */ ++ system_result_size = -1; ++ } ++ else ++ { ++ /* Early conversion to unix slashes instead of more changes ++ everywhere else .. */ ++ char * winslash; ++ system_result[system_result_size] = '\0'; ++ while ((winslash = strchr (system_result, '\\')) != NULL) ++ { ++ *winslash = '/'; ++ } ++ } ++#else ++#warning "Don't know how to get executable path on this system" ++#endif ++#endif /* defined(IMPLEMENT_SYS_GET_EXECUTABLE_PATH) */ ++ } ++ /* Use argv0 as a default in-case of failure */ ++ if (system_result_size != -1) ++ { ++ strncpy (result, system_result, system_result_size); ++ result[system_result_size] = '\0'; ++ } ++ else ++ { ++ if (argv0 != NULL) ++ { ++ strncpy (result, argv0, max_size); ++ result[max_size-1] = '\0'; ++ } ++ else ++ { ++ result[0] = '\0'; ++ } ++ } ++ result_size = strlen (result); ++ return result_size; ++} ++ ++char const * ++strip_n_prefix_folders(char const * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return NULL; ++ } ++ ++ if (path[0] != '/') ++ { ++ return path; ++ } ++ ++ char const * last = path; ++ while (n-- && path != NULL) ++ { ++ last = path; ++ path = strchr (path + 1, '/'); ++ } ++ return (path == NULL) ? last : path; ++} ++ ++void ++strip_n_suffix_folders(char * path, size_t n) ++{ ++ if (path == NULL) ++ { ++ return; ++ } ++ while (n--) ++ { ++ if (strrchr (path + 1, '/')) ++ { ++ *strrchr (path + 1, '/') = '\0'; ++ } ++ else ++ { ++ return; ++ } ++ } ++ return; ++} ++ ++size_t ++split_path_list(char const * path_list, char split_char, char *** arr) ++{ ++ size_t path_count; ++ size_t path_list_size; ++ char const * path_list_p; ++ ++ path_list_p = path_list; ++ if (path_list == NULL || path_list[0] == '\0') ++ { ++ return 0; ++ } ++ path_list_size = strlen (path_list); ++ ++ path_count = 0; ++ do ++ { ++ ++path_count; ++ ++path_list_p; ++ } ++ while ((path_list_p = strchr (path_list_p, split_char)) != NULL); ++ ++ /* allocate everything in one go. */ ++ char * all_memory = (char *) malloc (sizeof (char *) * path_count + strlen(path_list) + 1); ++ if (all_memory == NULL) ++ return 0; ++ *arr = (char **)all_memory; ++ all_memory += sizeof (char *) * path_count; ++ ++ path_count = 0; ++ path_list_p = path_list; ++ char const * next_path_list_p = 0; ++ do ++ { ++ next_path_list_p = strchr (path_list_p, split_char); ++ if (next_path_list_p != NULL) ++ { ++ ++next_path_list_p; ++ } ++ size_t this_size = (next_path_list_p != NULL) ++ ? next_path_list_p - path_list_p - 1 ++ : &path_list[path_list_size] - path_list_p; ++ memcpy (all_memory, path_list_p, this_size); ++ all_memory[this_size] = '\0'; ++ (*arr)[path_count++] = all_memory; ++ all_memory += this_size + 1; ++ } while ((path_list_p = next_path_list_p) != NULL); ++ ++ return path_count; ++} ++ ++char * ++get_relocated_path_list(char const * from, char const * to_path_list) ++{ ++ char exe_path[32768]; ++ char * temp; ++ get_executable_path (NULL, &exe_path[0], sizeof (exe_path) / sizeof (exe_path[0])); ++ if ((temp = strrchr (exe_path, '/')) != NULL) ++ { ++ temp[1] = '\0'; ++ } ++ ++ char **arr = NULL; ++ /* Ask Alexey why he added this. Are we not 100% sure ++ that we're dealing with unix paths here? */ ++ char split_char = ':'; ++ if (strchr (to_path_list, ';')) ++ { ++ split_char = ';'; ++ } ++ size_t count = split_path_list (to_path_list, split_char, &arr); ++ int result_size = 1 + (count - 1); /* count - 1 is for ; delim. */ ++ size_t exe_path_size = strlen (exe_path); ++ size_t i; ++ /* Space required is: ++ count * (exe_path_size + strlen (rel_to_datadir)) ++ rel_to_datadir upper bound is: ++ (count * strlen (from)) + (3 * num_slashes (from)) ++ + strlen(arr[i]) + 1. ++ .. pathalogically num_slashes (from) is strlen (from) ++ (from = ////////) */ ++ size_t space_required = (count * (exe_path_size + 4 * strlen (from))) + count - 1; ++ for (i = 0; i < count; ++i) ++ { ++ space_required += strlen (arr[i]); ++ } ++ char * scratch = (char *) alloca (space_required); ++ if (scratch == NULL) ++ return NULL; ++ for (i = 0; i < count; ++i) ++ { ++ char * rel_to_datadir = get_relative_path (from, arr[i]); ++ scratch[0] = '\0'; ++ arr[i] = scratch; ++ strcat (scratch, exe_path); ++ strcat (scratch, rel_to_datadir); ++ simplify_path (arr[i]); ++ size_t arr_i_size = strlen (arr[i]); ++ result_size += arr_i_size; ++ scratch = arr[i] + arr_i_size + 1; ++ } ++ char * result = (char *) malloc (result_size); ++ if (result == NULL) ++ { ++ return NULL; ++ } ++ result[0] = '\0'; ++ for (i = 0; i < count; ++i) ++ { ++ strcat (result, arr[i]); ++ if (i != count-1) ++ { ++#if defined(_WIN32) ++ strcat (result, ";"); ++#else ++ strcat (result, ":"); ++#endif ++ } ++ } ++ free ((void*)arr); ++ return result; ++} ++ ++char * ++single_path_relocation(const char *from, const char *to) ++{ ++ char exe_path[PATH_MAX]; ++ get_executable_path (NULL, &exe_path[0], sizeof(exe_path)/sizeof(exe_path[0])); ++ if (strrchr (exe_path, '/') != NULL) ++ { ++ strrchr (exe_path, '/')[1] = '\0'; ++ } ++ char * rel_to_datadir = get_relative_path (from, to); ++ strcat (exe_path, rel_to_datadir); ++ simplify_path (&exe_path[0]); ++ return malloc_copy_string(exe_path); ++} ++ ++char * ++pathlist_relocation(const char *from_path, const char *to_path_list) ++{ ++ static char stored_path[PATH_MAX]; ++ static int stored = 0; ++ if (stored == 0) ++ { ++ char const * relocated = get_relocated_path_list(from_path, to_path_list); ++ strncpy (stored_path, relocated, PATH_MAX); ++ stored_path[PATH_MAX-1] = '\0'; ++ free ((void *)relocated); ++ stored = 1; ++ } ++ return stored_path; ++} +--- /dev/null ++++ src/pathtools.h +@@ -0,0 +1,53 @@ ++/* ++ .Some useful path tools. ++ .ASCII only for now. ++ .Written by Ray Donnelly in 2014. ++ .Licensed under CC0 (and anything. ++ .else you need to license it under). ++ .No warranties whatsoever. ++ .email: . ++ */ ++ ++#ifndef PATHTOOLS_H ++#define PATHTOOLS_H ++ ++#include ++#if defined(__APPLE__) ++#include ++#else ++#include ++#endif ++#include ++ ++char * malloc_copy_string(char const * original); ++ ++/* In-place replaces any '\' with '/' and any '//' with '/' */ ++void sanitise_path(char * path); ++ ++/* Uses a host OS specific function to determine the path of the executable, ++ if IMPLEMENT_SYS_GET_EXECUTABLE_PATH is defined, otherwise uses argv0. */ ++int get_executable_path(char const * argv0, char * result, ssize_t max_size); ++ ++/* Where possible, in-place removes occourances of '.' and 'path/..' */ ++void simplify_path(char * path); ++ ++/* Allocates (via malloc) and returns the path to get from from to to. */ ++char * get_relative_path(char const * from, char const * to); ++ ++size_t split_path_list(char const * path_list, char split_char, char *** arr); ++ ++/* Advances path along by the amount that removes n prefix folders. */ ++char const * ++strip_n_prefix_folders(char const * path, size_t n); ++ ++/* NULL terminates path to remove n suffix folders. */ ++void ++strip_n_suffix_folders(char * path, size_t n); ++ ++char const * get_relocated_path (char const * from, char const * to, char const * actual_from); ++char * get_relocated_path_list(char const * from, char const * to_path_list); ++ ++char * single_path_relocation(const char *from, const char *to); ++char * pathlist_relocation(const char *from_path, const char *to_path_list); ++ ++#endif /* PATHTOOLS_H */ +-- +2.21.1 + diff --git a/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch b/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch new file mode 100644 index 0000000..be69712 --- /dev/null +++ b/recipes/bison/all/patches/0005-gnulib-limit-search-range-of-_setmaxstdio.patch @@ -0,0 +1,38 @@ +This avoid showing a `Assertion Failed Dialog Box` during configure and running bison with the assertion failur: + +``` +Expression: new_maximum >= _IOB_ENTRIES && new_maximum <= _NHANDLE_ +``` + +msdn documentation of _setmaxstdio at +https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio + +Summary: +maximum of 8192 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library. + +Kudos to @SSE4 for finding the rootcause at +https://github.com/conan-io/conan-center-index/pull/2334#issuecomment-668171405 + + +--- lib/getdtablesize.c ++++ lib/getdtablesize.c +@@ -79,12 +79,18 @@ getdtablesize (void) + freed when we call _setmaxstdio with the original value. */ + int orig_max_stdio = _getmaxstdio (); + unsigned int bound; +- for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) ++#ifdef _MSC_VER ++# define BOUND_START 0x2000 ++#else ++# define BOUND_START 0x10000 ++#endif ++ for (bound = BOUND_START; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) + ; + _setmaxstdio_nothrow (orig_max_stdio); + dtablesize = bound; + } + return dtablesize; ++#undef BOUND_START + } + + #else diff --git a/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch b/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch new file mode 100644 index 0000000..377c9d4 --- /dev/null +++ b/recipes/bison/all/patches/0006-dont-link-bison-against-libreadline.patch @@ -0,0 +1,14 @@ +build: don't link bison against libreadline +Reported by Paul Smith . +https://lists.gnu.org/r/bug-bison/2020-10/msg00001.html + +--- a/Makefile.in ++++ b/Makefile.in +@@ -3456,7 +3456,6 @@ + $(LIB_SETLOCALE_NULL) \ + $(LIBICONV) \ + $(LIBINTL) \ +- $(LIBREADLINE) \ + $(LIBTEXTSTYLE) + + @ENABLE_YACC_TRUE@nodist_bin_SCRIPTS = src/yacc diff --git a/recipes/bison/all/test_package/CMakeLists.txt b/recipes/bison/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..569311b --- /dev/null +++ b/recipes/bison/all/test_package/CMakeLists.txt @@ -0,0 +1,20 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(BISON REQUIRED) + +set(BISON_VARS + BISON_FOUND + BISON_EXECUTABLE + BISON_VERSION +) + +foreach(BISON_VAR ${BISON_VARS}) + message("${BISON_VAR}: ${${BISON_VAR}}") + if(NOT ${BISON_VAR}) + message(FATAL_ERROR "${BISON_VAR} NOT FOUND") + endif() +endforeach() + +bison_target(McParser mc_parser.yy "${CMAKE_CURRENT_BINARY_DIR}/mc_parser.cpp") +add_library(${PROJECT_NAME} STATIC ${BISON_McParser_OUTPUTS}) diff --git a/recipes/bison/all/test_package/CMakeUserPresets.json b/recipes/bison/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/bison/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/bison/all/test_package/conanfile.py b/recipes/bison/all/test_package/conanfile.py new file mode 100644 index 0000000..dd177dd --- /dev/null +++ b/recipes/bison/all/test_package/conanfile.py @@ -0,0 +1,38 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.microsoft import unix_path +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + win_bash = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def layout(self): + cmake_layout(self) + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + if self._settings_build.os == "Windows": + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _mc_parser_source(self): + return os.path.join(self.source_folder, "mc_parser.yy") + + def test(self): + self.run("bison --version") + self.run("yacc --version") + self.run(f"bison -d {unix_path(self, self._mc_parser_source)}") diff --git a/recipes/bison/all/test_package/mc_parser.yy b/recipes/bison/all/test_package/mc_parser.yy new file mode 100644 index 0000000..f09b5cc --- /dev/null +++ b/recipes/bison/all/test_package/mc_parser.yy @@ -0,0 +1,42 @@ +%{ +#include +#include +#include +#include //-- I need this for atoi +using namespace std; + +int yylex(); +int yyerror(const char *p) { cerr << "Error!" << endl; return 42; } +%} + +%union { + int val; + char sym; +}; +%token NUM +%token OPA OPM LP RP STOP +%type exp term sfactor factor res + +%% +run: res run | res /* forces bison to process many stmts */ + +res: exp STOP { cout << $1 << endl; } + +exp: exp OPA term { $$ = ($2 == '+' ? $1 + $3 : $1 - $3); } +| term { $$ = $1; } + +term: term OPM factor { $$ = ($2 == '*' ? $1 * $3 : $1 / $3); } +| sfactor { $$ = $1; } + +sfactor: OPA factor { $$ = ($1 == '+' ? $2 : -$2); } +| factor { $$ = $1; } + +factor: NUM { $$ = $1; } +| LP exp RP { $$ = $2; } + +%% +int main() +{ + yyparse(); + return 0; +} diff --git a/recipes/bison/config.yml b/recipes/bison/config.yml new file mode 100644 index 0000000..7e22e45 --- /dev/null +++ b/recipes/bison/config.yml @@ -0,0 +1,9 @@ +versions: + "3.8.2": + folder: all + "3.7.6": + folder: all + "3.7.1": + folder: all + "3.5.3": + folder: all diff --git a/recipes/expat/all/conandata.yml b/recipes/expat/all/conandata.yml new file mode 100644 index 0000000..8e1f63e --- /dev/null +++ b/recipes/expat/all/conandata.yml @@ -0,0 +1,31 @@ +sources: + "2.6.4": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_6_4/expat-2.6.4.tar.xz" + sha256: "a695629dae047055b37d50a0ff4776d1d45d0a4c842cf4ccee158441f55ff7ee" + "2.6.3": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_6_3/expat-2.6.3.tar.xz" + sha256: "274db254a6979bde5aad404763a704956940e465843f2a9bd9ed7af22e2c0efc" + "2.6.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_6_2/expat-2.6.2.tar.xz" + sha256: "ee14b4c5d8908b1bec37ad937607eab183d4d9806a08adee472c3c3121d27364" + "2.6.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_6_0/expat-2.6.0.tar.xz" + sha256: "cb5f5a8ea211e1cabd59be0a933a52e3c02cc326e86a4d387d8d218e7ee47a3e" + "2.5.0": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.xz" + sha256: "ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe" + "2.4.9": + sha256: "6e8c0728fe5c7cd3f93a6acce43046c5e4736c7b4b68e032e9350daa0efc0354" + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.xz" + "2.4.8": + sha256: "f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25" + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz" + "2.3.0": + sha256: "89df123c62f2c2e2b235692d9fe76def6a9ab03dbe95835345bf412726eb1987" + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz" + "2.2.10": + sha256: "bf42d1f52371d23684de36cc6d2f0f1acd02de264d1105bdc17792bbeb7e7ceb" + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/libexpat/libexpat/releases/download/R_2_2_10/expat-2.2.10.tar.gz" +patches: + "2.3.0": + - patch_file: "patches/0001-2.3.0-relax-vs-restriction.patch" diff --git a/recipes/expat/all/conanfile.py b/recipes/expat/all/conanfile.py new file mode 100644 index 0000000..baaf7c0 --- /dev/null +++ b/recipes/expat/all/conanfile.py @@ -0,0 +1,102 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +import os + +required_conan_version = ">=1.53.0" + + +class ExpatConan(ConanFile): + name = "expat" + description = "Fast streaming XML parser written in C." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/libexpat/libexpat" + topics = ("xml", "parsing") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "char_type": ["char", "wchar_t", "ushort"], + "large_size": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "char_type": "char", + "large_size": False, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["EXPAT_BUILD_DOCS"] = False + tc.variables["EXPAT_BUILD_EXAMPLES"] = False + tc.variables["EXPAT_SHARED_LIBS"] = self.options.shared + tc.variables["EXPAT_BUILD_TESTS"] = False + tc.variables["EXPAT_BUILD_TOOLS"] = False + tc.variables["EXPAT_CHAR_TYPE"] = self.options.char_type + if is_msvc(self): + tc.variables["EXPAT_MSVC_STATIC_CRT"] = is_msvc_static_runtime(self) + tc.variables["EXPAT_BUILD_PKGCONFIG"] = False + tc.variables["EXPAT_LARGE_SIZE"] = self.options.large_size + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "EXPAT") + self.cpp_info.set_property("cmake_module_target_name", "EXPAT::EXPAT") + self.cpp_info.set_property("cmake_file_name", "expat") + self.cpp_info.set_property("cmake_target_name", "expat::expat") + self.cpp_info.set_property("pkg_config_name", "expat") + + self.cpp_info.libs = collect_libs(self) + if not self.options.shared: + self.cpp_info.defines = ["XML_STATIC"] + if self.options.get_safe("char_type") in ("wchar_t", "ushort"): + self.cpp_info.defines.append("XML_UNICODE") + elif self.options.get_safe("char_type") == "wchar_t": + self.cpp_info.defines.append("XML_UNICODE_WCHAR_T") + if self.options.large_size: + self.cpp_info.defines.append("XML_LARGE_SIZE") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("m") + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "EXPAT" + self.cpp_info.names["cmake_find_package_multi"] = "expat" diff --git a/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch b/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch new file mode 100644 index 0000000..e365197 --- /dev/null +++ b/recipes/expat/all/patches/0001-2.3.0-relax-vs-restriction.patch @@ -0,0 +1,13 @@ +diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt +index e3564691..0dc5cf80 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -133,7 +133,7 @@ if(MSVC) + # Minimum supported MSVC version is 1910 = Visual Studio 15.0/2017 + # See also https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + if(MSVC_VERSION VERSION_LESS 1910) +- message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is not a supported Visual Studio compiler version. Please use Visual Studio 15.0/2017 or any later version.") ++ message(WARNING "MSVC_VERSION ${MSVC_VERSION} is not a supported Visual Studio compiler version. Please use Visual Studio 15.0/2017 or any later version.") + endif() + endif() + diff --git a/recipes/expat/all/test_package/CMakeLists.txt b/recipes/expat/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..5129dd0 --- /dev/null +++ b/recipes/expat/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(expat REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE expat::expat) diff --git a/recipes/expat/all/test_package/CMakeUserPresets.json b/recipes/expat/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/expat/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/expat/all/test_package/conanfile.py b/recipes/expat/all/test_package/conanfile.py new file mode 100644 index 0000000..98ab558 --- /dev/null +++ b/recipes/expat/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/expat/all/test_package/test_package.c b/recipes/expat/all/test_package/test_package.c new file mode 100644 index 0000000..71ad7b8 --- /dev/null +++ b/recipes/expat/all/test_package/test_package.c @@ -0,0 +1,64 @@ +/* This is simple demonstration of how to use expat. This program + reads an XML document from standard input and writes a line with + the name of each element to standard output indenting child + elements by one tab stop more than their parent element. + It must be used with Expat compiled for UTF-8 output. +*/ + +#include +#include "expat.h" + +#ifdef XML_UNICODE_WCHAR_T +#include +#endif + +#ifdef XML_LARGE_SIZE +#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400 +#define XML_FMT_INT_MOD "I64" +#else +#define XML_FMT_INT_MOD "ll" +#endif +#else +#define XML_FMT_INT_MOD "l" +#endif + +static void XMLCALL +startElement(void *userData, const XML_Char *name, const XML_Char **atts) +{ + int i; + int *depthPtr = (int *)userData; + (void)atts; + + for (i = 0; i < *depthPtr; i++) + putchar('\t'); +#ifdef XML_UNICODE_WCHAR_T + fputws(name, stdout); +#else + puts(name); +#endif + *depthPtr += 1; +} + +static void XMLCALL +endElement(void *userData, const XML_Char *name) +{ + int *depthPtr = (int *)userData; + (void)name; + + *depthPtr -= 1; +} + +int +main(int argc, char *argv[]) +{ + XML_Parser parser = XML_ParserCreate(NULL); + int depth = 0; + (void)argc; + (void)argv; + + XML_SetUserData(parser, &depth); + XML_SetElementHandler(parser, startElement, endElement); + XML_ParserFree(parser); + printf("Test application successfully ran!\n"); + return 0; +} diff --git a/recipes/expat/all/test_package_module/CMakeLists.txt b/recipes/expat/all/test_package_module/CMakeLists.txt new file mode 100644 index 0000000..9d264c4 --- /dev/null +++ b/recipes/expat/all/test_package_module/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package LANGUAGES C) + +find_package(EXPAT REQUIRED MODULE) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE EXPAT::EXPAT) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindEXPAT.html +# are properly defined in conan generators +set(_custom_vars + EXPAT_INCLUDE_DIRS + EXPAT_LIBRARIES + EXPAT_FOUND +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/expat/all/test_package_module/conanfile.py b/recipes/expat/all/test_package_module/conanfile.py new file mode 100644 index 0000000..98ab558 --- /dev/null +++ b/recipes/expat/all/test_package_module/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/expat/all/test_v1_package/CMakeLists.txt b/recipes/expat/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..de3b75d --- /dev/null +++ b/recipes/expat/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/expat/all/test_v1_package/conanfile.py b/recipes/expat/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5a05af3 --- /dev/null +++ b/recipes/expat/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/expat/all/test_v1_package_module/CMakeLists.txt b/recipes/expat/all/test_v1_package_module/CMakeLists.txt new file mode 100644 index 0000000..1626621 --- /dev/null +++ b/recipes/expat/all/test_v1_package_module/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package_module/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package_module/) diff --git a/recipes/expat/all/test_v1_package_module/conanfile.py b/recipes/expat/all/test_v1_package_module/conanfile.py new file mode 100644 index 0000000..5f9efeb --- /dev/null +++ b/recipes/expat/all/test_v1_package_module/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/expat/config.yml b/recipes/expat/config.yml new file mode 100644 index 0000000..3fbe2e2 --- /dev/null +++ b/recipes/expat/config.yml @@ -0,0 +1,19 @@ +versions: + "2.6.4": + folder: all + "2.6.3": + folder: all + "2.6.2": + folder: all + "2.6.0": + folder: all + "2.5.0": + folder: all + "2.4.9": + folder: all + "2.4.8": + folder: all + "2.3.0": + folder: all + "2.2.10": + folder: all diff --git a/recipes/ffmpeg/all/conanfile.py b/recipes/ffmpeg/all/conanfile.py index 77f71ce..9fa9e9b 100644 --- a/recipes/ffmpeg/all/conanfile.py +++ b/recipes/ffmpeg/all/conanfile.py @@ -154,7 +154,7 @@ class FFMpegConan(ConanFile): "with_coreimage": True, "with_audiotoolbox": True, "with_videotoolbox": True, - "with_programs": False, + "with_programs": True, "with_libsvtav1": True, "with_libaom": True, "with_libdav1d": True, @@ -367,15 +367,15 @@ class FFMpegConan(ConanFile): def build_requirements(self): if self.settings.arch in ("x86", "x86_64"): - #if Version(self.version) >= "7.0": + # if Version(self.version) >= "7.0": # INFO: FFmpeg 7.0+ added avcodec vvc_mc.asm which fails to assemble with yasm 1.3.0 # src/libavcodec/x86/vvc/vvc_mc.asm:55: error: operand 1: expression is not simple or relocatable - # self.tool_requires("nasm/2.16.01") - #else: - #self.tool_requires("yasm/1.3.0") self.tool_requires("nasm/[>=2.16.01]") - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/[>=2.1.0]") + # else: + # self.tool_requires("yasm/1.3.0") + if self.settings.os != "Linux" and not self.conf.get("tools.gnu:pkg_config", check_type=str): + # See https://github.com/conan-io/conan-center-index/pull/26447#discussion_r1926682155 + self.tool_requires("pkgconf/[>=2.1 <3]") if self._settings_build.os == "Windows": self.win_bash = True if not self.conf.get("tools.microsoft.bash:path", check_type=str): @@ -643,11 +643,12 @@ class FFMpegConan(ConanFile): ranlib = buildenv_vars.get("RANLIB") if ranlib: args.append(f"--ranlib={unix_path(self, ranlib)}") - # for some reason pkgconf from conan can't find .pc files on Linux in the context of ffmpeg configure... - if self._settings_build.os != "Linux": - pkg_config = self.conf.get("tools.gnu:pkg_config", default=buildenv_vars.get("PKG_CONFIG"), check_type=str) - if pkg_config: - args.append(f"--pkg-config={unix_path(self, pkg_config)}") + pkg_config = self.conf.get("tools.gnu:pkg_config", default=buildenv_vars.get("PKG_CONFIG"), check_type=str) + if pkg_config: + # the ffmpeg configure script hardcodes the name of the executable, + # unlike other tools that use the PKG_CONFIG environment variable + # if we are aware the user has requested a specific pkg-config, we pass it to the configure script + args.append(f"--pkg-config={unix_path(self, pkg_config)}") if is_msvc(self): args.append("--toolchain=msvc") if not check_min_vs(self, "190", raise_invalid=False): diff --git a/recipes/fontconfig/all/conandata.yml b/recipes/fontconfig/all/conandata.yml new file mode 100644 index 0000000..25ac420 --- /dev/null +++ b/recipes/fontconfig/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "2.15.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-freedesktop_org/software/fontconfig/release/fontconfig-2.15.0.tar.xz" + sha256: "63a0658d0e06e0fa886106452b58ef04f21f58202ea02a94c39de0d3335d7c0e" + "2.14.2": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-freedesktop_org/software/fontconfig/release/fontconfig-2.14.2.tar.xz" + sha256: "dba695b57bce15023d2ceedef82062c2b925e51f5d4cc4aef736cf13f60a468b" + "2.13.93": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-freedesktop_org/software/fontconfig/release/fontconfig-2.13.93.tar.gz" + sha256: "0f302a18ee52dde0793fe38b266bf269dfe6e0c0ae140e30d72c6cca5dc08db5" +patches: + "2.13.93": + - patch_file: "patches/0001-meson-win32.patch" + patch_type: "portability" + patch_source: "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/commit/7bfbaecf819a8b1630dfc8f56126e31f985d5fb3" + patch_description: "Windows: Fix symlink privilege error detection" diff --git a/recipes/fontconfig/all/conanfile.py b/recipes/fontconfig/all/conanfile.py new file mode 100644 index 0000000..1ce4892 --- /dev/null +++ b/recipes/fontconfig/all/conanfile.py @@ -0,0 +1,132 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv +from conan.tools.files import ( + apply_conandata_patches, copy, export_conandata_patches, get, + rm, rmdir +) +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain + +import os + +required_conan_version = ">=1.64.0 <2 || >=2.2.0" + + +class FontconfigConan(ConanFile): + name = "fontconfig" + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "Fontconfig is a library for configuring and customizing font access" + homepage = "https://gitlab.freedesktop.org/fontconfig/fontconfig" + topics = ("fonts", "freedesktop") + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("freetype/2.13.2") + self.requires("expat/[>=2.6.2 <3]") + + def build_requirements(self): + self.tool_requires("gperf/3.1") +# self.tool_requires("meson/1.4.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.1.0]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + deps = PkgConfigDeps(self) + deps.generate() + + tc = MesonToolchain(self) + tc.project_options.update({ + "doc": "disabled", + "nls": "disabled", + "tests": "disabled", + "tools": "disabled", + "sysconfdir": os.path.join("res", "etc"), + "datadir": os.path.join("res", "share"), + }) + tc.generate() + + def _patch_files(self): + apply_conandata_patches(self) + + def build(self): + self._patch_files() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "COPYING", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rm(self, "*.pdb", self.package_folder, recursive=True) + rm(self, "*.conf", os.path.join(self.package_folder, "res", "etc", "fonts", "conf.d")) + rm(self, "*.def", os.path.join(self.package_folder, "lib")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + fix_msvc_libname(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "Fontconfig") + self.cpp_info.set_property("cmake_target_name", "Fontconfig::Fontconfig") + self.cpp_info.set_property("pkg_config_name", "fontconfig") + self.cpp_info.libs = ["fontconfig"] + if self.settings.os in ("Linux", "FreeBSD"): + self.cpp_info.system_libs.extend(["m", "pthread"]) + + fontconfig_path = os.path.join(self.package_folder, "res", "etc", "fonts") + self.runenv_info.append_path("FONTCONFIG_PATH", fontconfig_path) + + # TODO: to remove in conan v2 + self.cpp_info.names["cmake_find_package"] = "Fontconfig" + self.cpp_info.names["cmake_find_package_multi"] = "Fontconfig" + self.env_info.FONTCONFIG_PATH = fontconfig_path + +def fix_msvc_libname(conanfile, remove_lib_prefix=True): + """remove lib prefix & change extension to .lib in case of cl like compiler""" + if not conanfile.settings.get_safe("compiler.runtime"): + return + from conan.tools.files import rename + import glob + libdirs = getattr(conanfile.cpp.package, "libdirs") + for libdir in libdirs: + for ext in [".dll.a", ".dll.lib", ".a"]: + full_folder = os.path.join(conanfile.package_folder, libdir) + for filepath in glob.glob(os.path.join(full_folder, f"*{ext}")): + libname = os.path.basename(filepath)[0:-len(ext)] + if remove_lib_prefix and libname[0:3] == "lib": + libname = libname[3:] + rename(conanfile, filepath, os.path.join(os.path.dirname(filepath), f"{libname}.lib")) diff --git a/recipes/fontconfig/all/patches/0001-meson-win32.patch b/recipes/fontconfig/all/patches/0001-meson-win32.patch new file mode 100644 index 0000000..c8a4911 --- /dev/null +++ b/recipes/fontconfig/all/patches/0001-meson-win32.patch @@ -0,0 +1,19 @@ +--- conf.d/link_confs.py ++++ conf.d/link_confs.py +@@ -3,6 +3,7 @@ + import os + import sys + import argparse ++import platform + + if __name__=='__main__': + parser = argparse.ArgumentParser() +@@ -26,7 +27,7 @@ if __name__=='__main__': + break + except OSError as e: + # Symlink privileges are not available +- if len(e.args) == 1 and 'privilege' in e.args[0]: ++ if platform.system().lower() == 'windows' and e.winerror == 1314: + break + raise + except FileExistsError: diff --git a/recipes/fontconfig/all/test_package/CMakeLists.txt b/recipes/fontconfig/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..5def13d --- /dev/null +++ b/recipes/fontconfig/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.14) +project(test_package LANGUAGES C) + +find_package(Fontconfig REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE Fontconfig::Fontconfig) +target_compile_features(${PROJECT_NAME} PRIVATE c_std_99) diff --git a/recipes/fontconfig/all/test_package/CMakeUserPresets.json b/recipes/fontconfig/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/fontconfig/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/fontconfig/all/test_package/conanfile.py b/recipes/fontconfig/all/test_package/conanfile.py new file mode 100644 index 0000000..42aa9d1 --- /dev/null +++ b/recipes/fontconfig/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/fontconfig/all/test_package/test_package.c b/recipes/fontconfig/all/test_package/test_package.c new file mode 100644 index 0000000..7703ab6 --- /dev/null +++ b/recipes/fontconfig/all/test_package/test_package.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int main() { + FcConfig* config = FcInitLoadConfigAndFonts(); + FcPattern* pat = FcNameParse((const FcChar8*)"Arial"); + FcConfigSubstitute(config, pat, FcMatchPattern); + FcDefaultSubstitute(pat); + char* fontFile; + FcResult result; + FcPattern* font = FcFontMatch(config, pat, &result); + if (font) { + FcChar8* file = NULL; + if (FcPatternGetString(font, FC_FILE, 0, &file) == FcResultMatch) { + fontFile = (char*)file; + printf("%s\n",fontFile); + } + } else { + printf("Ops! I can't find any font!\n"); + } + FcPatternDestroy(pat); + return EXIT_SUCCESS; +} diff --git a/recipes/fontconfig/all/test_v1_package/CMakeLists.txt b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..9e65290 --- /dev/null +++ b/recipes/fontconfig/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/ +) diff --git a/recipes/fontconfig/all/test_v1_package/conanfile.py b/recipes/fontconfig/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..19e6a0c --- /dev/null +++ b/recipes/fontconfig/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/fontconfig/config.yml b/recipes/fontconfig/config.yml new file mode 100644 index 0000000..1d4c62b --- /dev/null +++ b/recipes/fontconfig/config.yml @@ -0,0 +1,7 @@ +versions: + "2.15.0": + folder: all + "2.14.2": + folder: all + "2.13.93": + folder: all diff --git a/recipes/gperf/all/conandata.yml b/recipes/gperf/all/conandata.yml new file mode 100644 index 0000000..4c812ff --- /dev/null +++ b/recipes/gperf/all/conandata.yml @@ -0,0 +1,7 @@ +sources: + "3.1": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_gnu_org/pub/gnu/gperf/gperf-3.1.tar.gz" + sha256: "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2" +patches: + "3.1": + - patch_file: "patches/0001-remove-register-keyword.patch" diff --git a/recipes/gperf/all/conanfile.py b/recipes/gperf/all/conanfile.py new file mode 100644 index 0000000..0ed1afd --- /dev/null +++ b/recipes/gperf/all/conanfile.py @@ -0,0 +1,99 @@ +from conan import ConanFile +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, check_min_vs, unix_path +import os + +required_conan_version = ">=1.57.0" + + +class GperfConan(ConanFile): + name = "gperf" + license = "GPL-3.0-or-later" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.gnu.org/software/gperf" + description = "GNU gperf is a perfect hash function generator" + topics = ("hash-generator", "hash") + + settings = "os", "arch", "compiler", "build_type" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def layout(self): + basic_layout(self, src_folder="src") + self.folders.build = self.folders.source + + def package_id(self): + del self.info.settings.compiler + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + # gperf makefile relies on GNU Make behaviour + if self._settings_build.os == "FreeBSD": + self.tool_requires("make/4.4.1") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + destination=self.source_folder, strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if is_msvc(self) and check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + tc.generate() + + if is_msvc(self): + env = Environment() + compile_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "compile")) + ar_wrapper = unix_path(self, os.path.join(self.source_folder, "build-aux", "ar-lib")) + env.define("CC", f"{compile_wrapper} cl -nologo") + env.define("CXX", f"{compile_wrapper} cl -nologo") + env.append("CPPFLAGS", "-D_WIN32_WINNT=_WIN32_WINNT_WIN8") + env.define("LD", "link -nologo") + env.define("AR", f"{ar_wrapper} \"lib -nologo\"") + env.define("NM", "dumpbin -symbols") + env.define("OBJDUMP", ":") + env.define("RANLIB", ":") + env.define("STRIP", ":") + + #Prevent msys2 from performing erroneous path conversions for C++ files + # when invoking cl.exe as this is already handled by the compile wrapper. + env.define("MSYS2_ARG_CONV_EXCL", "-Tp") + env.vars(self).save_script("conanbuild_gperf_msvc") + + def build(self): + apply_conandata_patches(self) + autotools = Autotools(self) + with chdir(self, self.source_folder): + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + with chdir(self, self.source_folder): + # TODO: replace by autotools.install() once https://github.com/conan-io/conan/issues/12153 fixed + autotools.install(args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/gperf/all/patches/0001-remove-register-keyword.patch b/recipes/gperf/all/patches/0001-remove-register-keyword.patch new file mode 100644 index 0000000..8af6642 --- /dev/null +++ b/recipes/gperf/all/patches/0001-remove-register-keyword.patch @@ -0,0 +1,13 @@ +diff --git a/lib/getline.cc b/lib/getline.cc +index ecc3e85..2d97644 100644 (file) +--- a/lib/getline.cc ++++ b/lib/getline.cc +@@ -55,7 +55,7 @@ getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset) + + for (;;) + { +- register int c = getc (stream); ++ int c = getc (stream); + + /* We always want at least one char left in the buffer, since we + always (unless we get an error while reading the first char) diff --git a/recipes/gperf/all/test_package/conanbuild.sh b/recipes/gperf/all/test_package/conanbuild.sh new file mode 100644 index 0000000..06b2fc3 --- /dev/null +++ b/recipes/gperf/all/test_package/conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package/conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/gperf/all/test_package/conanbuildenv-release-x86_64.sh b/recipes/gperf/all/test_package/conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..82983df --- /dev/null +++ b/recipes/gperf/all/test_package/conanbuildenv-release-x86_64.sh @@ -0,0 +1,19 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package" +echo "echo Restoring environment" > "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" +for v in CXX CC CONAN_V2_MODE PATH +do + is_defined="true" + value=$(printenv $v) || is_defined="" || true + if [ -n "$value" ] || [ -n "$is_defined" ] + then + echo export "$v='$value'" >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" + else + echo unset $v >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" + fi +done + + +export CXX="x86_64-linux-gnu-g++-12" +export CC="x86_64-linux-gnu-gcc-12" +export CONAN_V2_MODE="true" +export PATH="/home/aleksandr.vodyanov/.conan2/p/b/gperfac47c59da1cc9/p/bin:$PATH" \ No newline at end of file diff --git a/recipes/gperf/all/test_package/conanfile.py b/recipes/gperf/all/test_package/conanfile.py new file mode 100644 index 0000000..619bde1 --- /dev/null +++ b/recipes/gperf/all/test_package/conanfile.py @@ -0,0 +1,13 @@ +from conan import ConanFile + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "VirtualBuildEnv" + test_type = "explicit" + + def build_requirements(self): + self.tool_requires(self.tested_reference_str) + + def test(self): + self.run("gperf --version") diff --git a/recipes/gperf/all/test_package/conanrun.sh b/recipes/gperf/all/test_package/conanrun.sh new file mode 100644 index 0000000..846cfea --- /dev/null +++ b/recipes/gperf/all/test_package/conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package/conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/gperf/all/test_package/conanrunenv-release-x86_64.sh b/recipes/gperf/all/test_package/conanrunenv-release-x86_64.sh new file mode 100644 index 0000000..20abea5 --- /dev/null +++ b/recipes/gperf/all/test_package/conanrunenv-release-x86_64.sh @@ -0,0 +1,14 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package" +echo "echo Restoring environment" > "$script_folder/deactivate_conanrunenv-release-x86_64.sh" +for v in +do + is_defined="true" + value=$(printenv $v) || is_defined="" || true + if [ -n "$value" ] || [ -n "$is_defined" ] + then + echo export "$v='$value'" >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh" + else + echo unset $v >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh" + fi +done + diff --git a/recipes/gperf/all/test_package/deactivate_conanbuild.sh b/recipes/gperf/all/test_package/deactivate_conanbuild.sh new file mode 100644 index 0000000..b7bfe21 --- /dev/null +++ b/recipes/gperf/all/test_package/deactivate_conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package/deactivate_conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/gperf/all/test_package/deactivate_conanbuildenv-release-x86_64.sh b/recipes/gperf/all/test_package/deactivate_conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..d1299ce --- /dev/null +++ b/recipes/gperf/all/test_package/deactivate_conanbuildenv-release-x86_64.sh @@ -0,0 +1,5 @@ +echo Restoring environment +unset CXX +unset CC +unset CONAN_V2_MODE +export PATH='/home/aleksandr.vodyanov/Documents/Avroid/Conan/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/aleksandr.vodyanov/.fzf/bin' diff --git a/recipes/gperf/all/test_package/deactivate_conanrun.sh b/recipes/gperf/all/test_package/deactivate_conanrun.sh new file mode 100644 index 0000000..1b21d31 --- /dev/null +++ b/recipes/gperf/all/test_package/deactivate_conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/gperf/all/test_package/deactivate_conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/gperf/config.yml b/recipes/gperf/config.yml new file mode 100644 index 0000000..10cce9d --- /dev/null +++ b/recipes/gperf/config.yml @@ -0,0 +1,3 @@ +versions: + "3.1": + folder: "all" diff --git a/recipes/icu/all/conandata.yml b/recipes/icu/all/conandata.yml new file mode 100644 index 0000000..dc217e6 --- /dev/null +++ b/recipes/icu/all/conandata.yml @@ -0,0 +1,49 @@ +sources: + "76.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-src.tgz" + sha256: "dfacb46bfe4747410472ce3e1144bf28a102feeaa4e3875bac9b4c6cf30f4f3e" + "75.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-75-1/icu4c-75_1-src.tgz" + sha256: "cb968df3e4d2e87e8b11c49a5d01c787bd13b9545280fc6642f826527618caef" + "74.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-74-2/icu4c-74_2-src.tgz" + sha256: "68db082212a96d6f53e35d60f47d38b962e9f9d207a74cfac78029ae8ff5e08c" + "74.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-src.tgz" + sha256: "86ce8e60681972e60e4dcb2490c697463fcec60dd400a5f9bffba26d0b52b8d0" + "73.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz" + sha256: "818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1" + "73.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz" + sha256: "a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45" +patches: + "76.1": + - patch_file: "patches/0001-76.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + + "75.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "74.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + - patch_file: "patches/0002-74.2-fix-emscripten.patch" + patch_description: "Add config file for wasm-emscripten platform" + patch_type: "portability" + patch_source: "https://gerrit.libreoffice.org/c/core/+/111130/9/external/icu/icu4c-emscripten-cross.patch.1" + "74.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "73.2": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" + "73.1": + - patch_file: "patches/0001-69.1-fix-mingw.patch" + patch_description: "support mingw" + patch_type: "portability" diff --git a/recipes/icu/all/conanfile.py b/recipes/icu/all/conanfile.py new file mode 100644 index 0000000..75b503c --- /dev/null +++ b/recipes/icu/all/conanfile.py @@ -0,0 +1,374 @@ +import glob +import hashlib +import os +import shutil + +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, stdcpp_library, check_min_cppstd +from conan.tools.env import Environment, VirtualBuildEnv +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, mkdir, rename, replace_in_file, rm, rmdir, save +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +from conan.tools.microsoft import check_min_vs, is_msvc, unix_path +from conan.tools.scm import Version + +required_conan_version = ">=1.57.0" + + +class ICUConan(ConanFile): + name = "icu" + homepage = "http://site.icu-project.org" + license = "ICU" + description = "ICU is a mature, widely used set of C/C++ and Java libraries " \ + "providing Unicode and Globalization support for software applications." + url = "https://github.com/conan-io/conan-center-index" + topics = ("icu4c", "i see you", "unicode") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "data_packaging": ["files", "archive", "library", "static"], + "with_dyload": [True, False], + "dat_package_file": [None, "ANY"], + "with_icuio": [True, False], + "with_extras": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "data_packaging": "archive", + "with_dyload": True, + "dat_package_file": None, + "with_icuio": True, + "with_extras": False, + } + + @property + def _min_cppstd(self): + return 17 + + @property + def _compilers_minimum_version(self): + return { + "gcc": "8", + "clang": "7", + "apple-clang": "12", + "Visual Studio": "16", + "msvc": "192", + } + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _enable_icu_tools(self): + return self.settings.os not in ["iOS", "tvOS", "watchOS", "Emscripten"] + + @property + def _with_unit_tests(self): + return not self.conf.get("tools.build:skip_test", default=True, check_type=bool) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + del self.options.data_packaging + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + if Version(self.version) >= "74.1": + self.license = "Unicode-3.0" + + def validate(self): + if self.options.dat_package_file: + if not os.path.exists(str(self.options.dat_package_file)): + raise ConanInvalidConfiguration("Non-existent dat_package_file specified") + if Version(self.version) >= "75.1": + if self.settings.compiler.cppstd: + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) + + def layout(self): + basic_layout(self, src_folder="src") + + @staticmethod + def _sha256sum(file_path): + m = hashlib.sha256() + with open(file_path, "rb") as fh: + for data in iter(lambda: fh.read(8192), b""): + m.update(data) + return m.hexdigest() + + def package_id(self): + if self.info.options.dat_package_file: + self.info.options.dat_package_file = self._sha256sum(str(self.info.options.dat_package_file)) + + def build_requirements(self): + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + if cross_building(self) and hasattr(self, "settings_build"): + self.tool_requires(str(self.ref)) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + + tc = AutotoolsToolchain(self) + if check_min_vs(self, "180", raise_invalid=False): + tc.extra_cflags.append("-FS") + tc.extra_cxxflags.append("-FS") + if Version(self.version) >= "75.1" and not self.settings.compiler.cppstd and is_msvc(self): + tc.extra_cxxflags.append(f"-std:c++{self._min_cppstd}") + if not self.options.shared: + tc.extra_defines.append("U_STATIC_IMPLEMENTATION") + if is_apple_os(self): + tc.extra_defines.append("_DARWIN_C_SOURCE") + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + "--datarootdir=${prefix}/lib", # do not use share + f"--enable-release={yes_no(self.settings.build_type != 'Debug')}", + f"--enable-debug={yes_no(self.settings.build_type == 'Debug')}", + f"--enable-dyload={yes_no(self.options.with_dyload)}", + f"--enable-extras={yes_no(self.options.with_extras)}", + f"--enable-icuio={yes_no(self.options.with_icuio)}", + "--disable-layoutex", + "--disable-layout", + f"--enable-tools={yes_no(self._enable_icu_tools)}", + f"--enable-tests={yes_no(self._with_unit_tests)}", + "--disable-samples", + ]) + if cross_building(self): + base_path = unix_path(self, self.dependencies.build["icu"].package_folder) + tc.configure_args.append(f"--with-cross-build={base_path}") + if self.settings.os in ["iOS", "tvOS", "watchOS"]: + # ICU build scripts interpret all Apple platforms as 'darwin'. + # Since this can coincide with the `build` triple, we need to tweak + # the build triple to avoid the collision and ensure the scripts + # know we are cross-building. + host_triplet = f"{str(self.settings.arch)}-apple-darwin" + build_triplet = f"{str(self._settings_build.arch)}-apple" + tc.update_configure_args({"--host": host_triplet, + "--build": build_triplet}) + else: + arch64 = ["x86_64", "sparcv9", "ppc64", "ppc64le", "armv8", "armv8.3", "mips64"] + bits = "64" if self.settings.arch in arch64 else "32" + tc.configure_args.append(f"--with-library-bits={bits}") + if self.settings.os != "Windows": + # http://userguide.icu-project.org/icudata + # This is the only directly supported behavior on Windows builds. + tc.configure_args.append(f"--with-data-packaging={self.options.data_packaging}") + tc.generate() + + if is_msvc(self): + env = Environment() + env.define("CC", "cl -nologo") + env.define("CXX", "cl -nologo") + if cross_building(self): + env.define("icu_cv_host_frag", "mh-msys-msvc") + env.vars(self).save_script("conanbuild_icu_msvc") + + def _patch_sources(self): + apply_conandata_patches(self) + + if not self._with_unit_tests: + # Prevent any call to python during configuration, it's only needed for unit tests + replace_in_file( + self, + os.path.join(self.source_folder, "source", "configure"), + "if test -z \"$PYTHON\"", + "if true", + ) + + if self._settings_build.os == "Windows": + # https://unicode-org.atlassian.net/projects/ICU/issues/ICU-20545 + makeconv_cpp = os.path.join(self.source_folder, "source", "tools", "makeconv", "makeconv.cpp") + replace_in_file(self, makeconv_cpp, + "pathBuf.appendPathPart(arg, localError);", + "pathBuf.append(\"/\", localError); pathBuf.append(arg, localError);") + + # relocatable shared libs on macOS + mh_darwin = os.path.join(self.source_folder, "source", "config", "mh-darwin") + replace_in_file(self, mh_darwin, "-install_name $(libdir)/$(notdir", "-install_name @rpath/$(notdir") + replace_in_file(self, + mh_darwin, + "-install_name $(notdir $(MIDDLE_SO_TARGET)) $(PKGDATA_TRAILING_SPACE)", + "-install_name @rpath/$(notdir $(MIDDLE_SO_TARGET))", + ) + + # workaround for https://unicode-org.atlassian.net/browse/ICU-20531 + mkdir(self, os.path.join(self.build_folder, "data", "out", "tmp")) + + # workaround for "No rule to make target 'out/tmp/dirs.timestamp'" + save(self, os.path.join(self.build_folder, "data", "out", "tmp", "dirs.timestamp"), "") + + def build(self): + self._patch_sources() + + if self.options.dat_package_file: + dat_package_file = glob.glob(os.path.join(self.source_folder, "source", "data", "in", "*.dat")) + if dat_package_file: + shutil.copy(str(self.options.dat_package_file), dat_package_file[0]) + + autotools = Autotools(self) + autotools.configure(build_script_folder=os.path.join(self.source_folder, "source")) + autotools.make() + if self._with_unit_tests: + autotools.make(target="check") + + @property + def _data_filename(self): + vtag = Version(self.version).major + return f"icudt{vtag}l.dat" + + @property + def _data_path(self): + data_dir_name = "icu" + if self.settings.os == "Windows" and self.settings.build_type == "Debug": + data_dir_name += "d" + data_dir = os.path.join(self.package_folder, "lib", data_dir_name, str(self.version)) + return os.path.join(data_dir, self._data_filename) + + def package(self): + copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + + dll_files = glob.glob(os.path.join(self.package_folder, "lib", "*.dll")) + if dll_files: + bin_dir = os.path.join(self.package_folder, "bin") + mkdir(self, bin_dir) + for dll in dll_files: + dll_name = os.path.basename(dll) + rm(self, dll_name, bin_dir) + rename(self, src=dll, dst=os.path.join(bin_dir, dll_name)) + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + mkdir(self, os.path.join(self.package_folder, "res")) + rename(self, src=self._data_path, dst=os.path.join(self.package_folder, "res", self._data_filename)) + + # Copy some files required for cross-compiling + config_dir = os.path.join(self.package_folder, "config") + copy(self, "icucross.mk", src=os.path.join(self.build_folder, "config"), dst=config_dir) + copy(self, "icucross.inc", src=os.path.join(self.build_folder, "config"), dst=config_dir) + + rmdir(self, os.path.join(self.package_folder, "lib", "icu")) + rmdir(self, os.path.join(self.package_folder, "lib", "man")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ICU") + + prefix = "s" if self.settings.os == "Windows" and not self.options.shared else "" + suffix = "d" if self.settings.os == "Windows" and self.settings.build_type == "Debug" else "" + + # icudata + self.cpp_info.components["icu-data"].set_property("cmake_target_name", "ICU::data") + icudata_libname = "icudt" if self.settings.os == "Windows" else "icudata" + self.cpp_info.components["icu-data"].libs = [f"{prefix}{icudata_libname}{suffix}"] + if not self.options.shared: + self.cpp_info.components["icu-data"].defines.append("U_STATIC_IMPLEMENTATION") + # icu uses c++, so add the c++ runtime + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.components["icu-data"].system_libs.append(libcxx) + + # Alias of data CMake component + self.cpp_info.components["icu-data-alias"].set_property("cmake_target_name", "ICU::dt") + self.cpp_info.components["icu-data-alias"].requires = ["icu-data"] + + # icuuc + self.cpp_info.components["icu-uc"].set_property("cmake_target_name", "ICU::uc") + self.cpp_info.components["icu-uc"].set_property("pkg_config_name", "icu-uc") + self.cpp_info.components["icu-uc"].libs = [f"{prefix}icuuc{suffix}"] + self.cpp_info.components["icu-uc"].requires = ["icu-data"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-uc"].system_libs = ["m", "pthread"] + if self.options.with_dyload: + self.cpp_info.components["icu-uc"].system_libs.append("dl") + elif self.settings.os == "Windows": + self.cpp_info.components["icu-uc"].system_libs = ["advapi32"] + + # icui18n + self.cpp_info.components["icu-i18n"].set_property("cmake_target_name", "ICU::i18n") + self.cpp_info.components["icu-i18n"].set_property("pkg_config_name", "icu-i18n") + icui18n_libname = "icuin" if self.settings.os == "Windows" else "icui18n" + self.cpp_info.components["icu-i18n"].libs = [f"{prefix}{icui18n_libname}{suffix}"] + self.cpp_info.components["icu-i18n"].requires = ["icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-i18n"].system_libs = ["m"] + + # Alias of i18n CMake component + self.cpp_info.components["icu-i18n-alias"].set_property("cmake_target_name", "ICU::in") + self.cpp_info.components["icu-i18n-alias"].requires = ["icu-i18n"] + + # icuio + if self.options.with_icuio: + self.cpp_info.components["icu-io"].set_property("cmake_target_name", "ICU::io") + self.cpp_info.components["icu-io"].set_property("pkg_config_name", "icu-io") + self.cpp_info.components["icu-io"].libs = [f"{prefix}icuio{suffix}"] + self.cpp_info.components["icu-io"].requires = ["icu-i18n", "icu-uc"] + + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.cpp_info.components["icu-data"].resdirs = ["res"] + data_path = os.path.join(self.package_folder, "res", self._data_filename).replace("\\", "/") + self.runenv_info.prepend_path("ICU_DATA", data_path) + if self._enable_icu_tools or self.options.with_extras: + self.buildenv_info.prepend_path("ICU_DATA", data_path) + + if self._enable_icu_tools: + # icutu + self.cpp_info.components["icu-tu"].set_property("cmake_target_name", "ICU::tu") + self.cpp_info.components["icu-tu"].libs = [f"{prefix}icutu{suffix}"] + self.cpp_info.components["icu-tu"].requires = ["icu-i18n", "icu-uc"] + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["icu-tu"].system_libs = ["pthread"] + + # icutest + self.cpp_info.components["icu-test"].set_property("cmake_target_name", "ICU::test") + self.cpp_info.components["icu-test"].libs = [f"{prefix}icutest{suffix}"] + self.cpp_info.components["icu-test"].requires = ["icu-tu", "icu-uc"] + + # TODO: to remove after conan v2 + self.cpp_info.names["cmake_find_package"] = "ICU" + self.cpp_info.names["cmake_find_package_multi"] = "ICU" + self.cpp_info.components["icu-data"].names["cmake_find_package"] = "data" + self.cpp_info.components["icu-data"].names["cmake_find_package_multi"] = "data" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package"] = "dt" + self.cpp_info.components["icu-data-alias"].names["cmake_find_package_multi"] = "dt" + self.cpp_info.components["icu-uc"].names["cmake_find_package"] = "uc" + self.cpp_info.components["icu-uc"].names["cmake_find_package_multi"] = "uc" + self.cpp_info.components["icu-i18n"].names["cmake_find_package"] = "i18n" + self.cpp_info.components["icu-i18n"].names["cmake_find_package_multi"] = "i18n" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package"] = "in" + self.cpp_info.components["icu-i18n-alias"].names["cmake_find_package_multi"] = "in" + if self.options.with_icuio: + self.cpp_info.components["icu-io"].names["cmake_find_package"] = "io" + self.cpp_info.components["icu-io"].names["cmake_find_package_multi"] = "io" + if self.settings.os != "Windows" and self.options.data_packaging in ["files", "archive"]: + self.env_info.ICU_DATA.append(data_path) + if self._enable_icu_tools: + self.cpp_info.components["icu-tu"].names["cmake_find_package"] = "tu" + self.cpp_info.components["icu-tu"].names["cmake_find_package_multi"] = "tu" + self.cpp_info.components["icu-test"].names["cmake_find_package"] = "test" + self.cpp_info.components["icu-test"].names["cmake_find_package_multi"] = "test" + if self._enable_icu_tools or self.options.with_extras: + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/icu/all/patches/0001-69.1-fix-mingw.patch b/recipes/icu/all/patches/0001-69.1-fix-mingw.patch new file mode 100644 index 0000000..61d3b8f --- /dev/null +++ b/recipes/icu/all/patches/0001-69.1-fix-mingw.patch @@ -0,0 +1,43 @@ +--- source/config/mh-mingw64 ++++ source/config/mh-mingw64 +@@ -94,7 +94,7 @@ + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)"" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +--- source/data/Makefile.in ++++ source/data/Makefile.in +@@ -207,7 +207,7 @@ + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/recipes/icu/all/patches/0001-76.1-fix-mingw.patch b/recipes/icu/all/patches/0001-76.1-fix-mingw.patch new file mode 100644 index 0000000..f7169b0 --- /dev/null +++ b/recipes/icu/all/patches/0001-76.1-fix-mingw.patch @@ -0,0 +1,47 @@ +diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64 +index fb64c56..ff8922c 100644 +--- a/source/config/mh-mingw64 ++++ b/source/config/mh-mingw64 +@@ -94,7 +94,7 @@ LIBPREFIX= + # This is also for backwards compatibility. + DATA_STUBNAME = dt + I18N_STUBNAME = in +-LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) ++#LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + + #SH### copied from Makefile.inc + #SH## for icu-config to test with +@@ -102,13 +102,13 @@ LIBICU = $(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX) + #SH#ICULIBS_COMMON_LIB_NAME_A="${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}" + + #SH#ICULIBS_DATA="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" +-ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" ++#ICULIBS_DT="-l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_I18N="-l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_LX="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_IO="-l$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_UC="-l$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_CTESTFW="-l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)" ++#ICULIBS_TOOLUTIL="-l$(ICUPREFIX)tu$(ICULIBSUFFIX)" + #SH# + #SH## ICULIBS is the set of libraries your application should link + #SH## with usually. Many applications will want to add ${ICULIBS_I18N} as well. +diff --git a/source/data/Makefile.in b/source/data/Makefile.in +index 266ad7a..8e3be4f 100644 +--- a/source/data/Makefile.in ++++ b/source/data/Makefile.in +@@ -193,7 +193,7 @@ endif + ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) + # For MinGW, do we want the DLL to go in the bin location? + ifeq ($(MINGW_MOVEDLLSTOBINDIR),YES) +- $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(DESTDIR)$(bindir) ++ $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + else + $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR) + endif diff --git a/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch b/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch new file mode 100644 index 0000000..9c7748f --- /dev/null +++ b/recipes/icu/all/patches/0002-74.2-fix-emscripten.patch @@ -0,0 +1,109 @@ +--- a/source/acinclude.m4 ++++ b/source/acinclude.m4 +@@ -85,6 +85,7 @@ powerpc*-apple-darwin*) icu_cv_host_frag=mh-darwin-ppc ;; + *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; + *-*-nto*) icu_cv_host_frag=mh-qnx ;; + *-ncr-*) icu_cv_host_frag=mh-mpras ;; ++wasm*-*-emscripten*) icu_cv_host_frag=mh-emscripten ;; + *) icu_cv_host_frag=mh-unknown ;; + esac + ] +--- /dev/null ++++ b/source/config/mh-emscripten +@@ -0,0 +1,86 @@ ++## Emscripten-specific setup ++## Copyright (c) 1999-2013, International Business Machines Corporation and ++## others. All Rights Reserved. ++## Commands to generate dependency files ++GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) ++GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) ++ ++## Flags for position independent code ++SHAREDLIBCFLAGS = -fPIC ++SHAREDLIBCXXFLAGS = -fPIC ++SHAREDLIBCPPFLAGS = -DPIC ++ ++## Additional flags when building libraries and with threads ++THREADSCPPFLAGS = -D_REENTRANT ++LIBCPPFLAGS = ++ ++## Compiler switch to embed a runtime search path ++LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN ++LD_RPATH_PRE = -Wl,-rpath, ++ ++## Force RPATH=$ORIGIN to locate own dependencies w/o need for LD_LIBRARY_PATH: ++ENABLE_RPATH=YES ++RPATHLDFLAGS=${LD_RPATH_PRE}'$$ORIGIN' ++ ++## These are the library specific LDFLAGS ++#LDFLAGSICUDT=-nodefaultlibs -nostdlib ++# Debian change: linking icudata as data only causes too many problems. ++LDFLAGSICUDT= ++ ++## Compiler switch to embed a library name ++# The initial tab in the next line is to prevent icu-config from reading it. ++ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) ++#SH# # We can't depend on MIDDLE_SO_TARGET being set. ++#SH# LD_SONAME= ++ ++## Shared library options ++LD_SOOPTIONS= -Wl,-Bsymbolic-functions ++ ++## Shared object suffix ++SO = so ++## Non-shared intermediate object suffix ++STATIC_O = o ++ ++## Compilation rules ++# WASM needs -pthread for atomics support ++%.$(STATIC_O): $(srcdir)/%.c ++ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -pthread -o $@ $<) ++ ++%.$(STATIC_O): $(srcdir)/%.cpp ++ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -pthread -o $@ $<) ++ ++ ++## Dependency rules ++%.d: $(srcdir)/%.c ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.c) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++%.d: $(srcdir)/%.cpp ++ $(call ICU_MSG,(deps)) $< ++ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ ++ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ ++ [ -s $@ ] || rm -f $@' ++ ++## Versioned libraries rules ++ ++%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) ++ $(RM) $@ && ln -s ${ +#define U_DEFINE_FALSE_AND_TRUE 1 +#include "unicode/utypes.h" +#include "unicode/uchar.h" +#include "unicode/locid.h" +#include "unicode/ustring.h" +#include "unicode/ucnv.h" +#include "unicode/unistr.h" + +#ifndef UPRV_LENGTHOF +#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#endif + +// helper functions -------------------------------------------------------- *** + +// default converter for the platform encoding +static UConverter *cnv=NULL; + +using namespace icu; + +static void +printUString(const char *announce, const UChar *s, int32_t length) { + static char out[200]; + UChar32 c; + int32_t i; + UErrorCode errorCode=U_ZERO_ERROR; + + /* + * Convert to the "platform encoding". See notes in printUnicodeString(). + * ucnv_fromUChars(), like most ICU APIs understands length==-1 + * to mean that the string is NUL-terminated. + */ + ucnv_fromUChars(cnv, out, sizeof(out), s, length, &errorCode); + if(U_FAILURE(errorCode) || errorCode==U_STRING_NOT_TERMINATED_WARNING) { + printf("%sproblem converting string from Unicode: %s\n", announce, u_errorName(errorCode)); + return; + } + + printf("%s%s {", announce, out); + + /* output the code points (not code units) */ + if(length>=0) { + /* s is not NUL-terminated */ + for(i=0; i0; /* U16_PREV pre-decrements */) { + U16_PREV(input, 0, i, c); + /* Iterating backwards + Codepoint at offset 5: U+0062 + Codepoint at offset 3: U+10ffff + Codepoint at offset 2: U+dc00 -- unpaired surrogate because lead surr. overwritten + Codepoint at offset 1: U+0062 -- by this BMP code point + Codepoint at offset 0: U+0061 + */ + printf("Codepoint at offset %d: U+%04x\n", i, c); + } +} + +// sample code for Unicode strings in C ------------------------------------ *** + +static void demo_C_Unicode_strings() { + printf("\n* demo_C_Unicode_strings() --------- ***\n\n"); + + static const UChar text[]={ 0x41, 0x42, 0x43, 0 }; /* "ABC" */ + static const UChar appendText[]={ 0x61, 0x62, 0x63, 0 }; /* "abc" */ + static const UChar cmpText[]={ 0x61, 0x53, 0x73, 0x43, 0 }; /* "aSsC" */ + UChar buffer[32]; + int32_t compare; + int32_t length=u_strlen(text); /* length=3 */ + + /* simple ANSI C-style functions */ + buffer[0]=0; /* empty, NUL-terminated string */ + u_strncat(buffer, text, 1); /* append just n=1 character ('A') */ + u_strcat(buffer, appendText); /* buffer=="Aabc" */ + length=u_strlen(buffer); /* length=4 */ + printUString("should be \"Aabc\": ", buffer, -1); + + /* bitwise comparing buffer with text */ + compare=u_strcmp(buffer, text); + if(compare<=0) { + printf("String comparison error, expected \"Aabc\" > \"ABC\"\n"); + } + + /* Build "AC" in the buffer... */ + u_strcpy(buffer, text); + buffer[1]=0xdf; /* sharp s, case-compares equal to "ss" */ + printUString("should be \"AC\": ", buffer, -1); + + /* Compare two strings case-insensitively using full case folding */ + compare=u_strcasecmp(buffer, cmpText, U_FOLD_CASE_DEFAULT); + if(compare!=0) { + printf("String case insensitive comparison error, expected \"AbC\" to be equal to \"ABC\"\n"); + } +} + +// sample code for case mappings with C APIs -------------------------------- *** + +static void demoCaseMapInC() { + /* + * input= + * "aB" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + UChar buffer[32]; + + UErrorCode errorCode; + UChar32 c; + int32_t i, j, length; + UBool isError; + + printf("\n* demoCaseMapInC() ----------------- ***\n\n"); + + /* + * First, use simple case mapping functions which provide + * 1:1 code point mappings without context/locale ID. + * + * Note that some mappings will not be "right" because some "real" + * case mappings require context, depend on the locale ID, + * and/or result in a change in the number of code points. + */ + printUString("input string: ", input, -1); + + /* uppercase */ + isError=FALSE; + for(i=j=0; j" + * "iI " + * " " + * "" + */ + static const UChar input[]={ + 0x61, 0x42, 0x3a3, + 0x69, 0x49, 0x131, 0x130, 0x20, + 0xdf, 0x20, 0xfb03, + 0x3c2, 0x3c3, 0x3a3, 0 + }; + + printf("\n* demoCaseMapInCPlusPlus() --------- ***\n\n"); + + UnicodeString s(input), t; + const Locale &en=Locale::getEnglish(); + Locale tr("tr"); + + /* + * Full case mappings as in demoCaseMapInC(), using UnicodeString functions. + * These functions modify the string object itself. + * Since we want to keep the input string around, we copy it each time + * and case-map the copy. + */ + printUnicodeString("input string: ", s); + + /* lowercase/English */ + printUnicodeString("full-lowercased/en: ", (t=s).toLower(en)); + /* lowercase/Turkish */ + printUnicodeString("full-lowercased/tr: ", (t=s).toLower(tr)); + /* uppercase/English */ + printUnicodeString("full-uppercased/en: ", (t=s).toUpper(en)); + /* uppercase/Turkish */ + printUnicodeString("full-uppercased/tr: ", (t=s).toUpper(tr)); + /* titlecase/English */ + printUnicodeString("full-titlecased/en: ", (t=s).toTitle(NULL, en)); + /* titlecase/Turkish */ + printUnicodeString("full-titlecased/tr: ", (t=s).toTitle(NULL, tr)); + /* case-folde/default */ + printUnicodeString("full-case-folded/default: ", (t=s).foldCase(U_FOLD_CASE_DEFAULT)); + /* case-folde/Turkic */ + printUnicodeString("full-case-folded/Turkic: ", (t=s).foldCase(U_FOLD_CASE_EXCLUDE_SPECIAL_I)); +} + +// sample code for UnicodeString storage models ----------------------------- *** + +static const UChar readonly[]={ + 0x61, 0x31, 0x20ac +}; +static UChar writeable[]={ + 0x62, 0x32, 0xdbc0, 0xdc01 // includes a surrogate pair for a supplementary code point +}; +static char out[100]; + +static void +demoUnicodeStringStorage() { + // These sample code lines illustrate how to use UnicodeString, and the + // comments tell what happens internally. There are no APIs to observe + // most of this programmatically, except for stepping into the code + // with a debugger. + // This is by design to hide such details from the user. + int32_t i; + + printf("\n* demoUnicodeStringStorage() ------- ***\n\n"); + + // * UnicodeString with internally stored contents + // instantiate a UnicodeString from a single code point + // the few (2) UChars will be stored in the object itself + UnicodeString one((UChar32)0x24001); + // this copies the few UChars into the "two" object + UnicodeString two=one; + printf("length of short string copy: %d\n", two.length()); + // set "one" to contain the 3 UChars from readonly + // this setTo() variant copies the characters + one.setTo(readonly, UPRV_LENGTHOF(readonly)); + + // * UnicodeString with allocated contents + // build a longer string that will not fit into the object's buffer + one+=UnicodeString(writeable, UPRV_LENGTHOF(writeable)); + one+=one; + one+=one; + printf("length of longer string: %d\n", one.length()); + // copying will use the same allocated buffer and increment the reference + // counter + two=one; + printf("length of longer string copy: %d\n", two.length()); + + // * UnicodeString using readonly-alias to a const UChar array + // construct a string that aliases a readonly buffer + UnicodeString three(FALSE, readonly, UPRV_LENGTHOF(readonly)); + printUnicodeString("readonly-alias string: ", three); + // copy-on-write: any modification to the string results in + // a copy to either the internal buffer or to a newly allocated one + three.setCharAt(1, 0x39); + printUnicodeString("readonly-aliasing string after modification: ", three); + // the aliased array is not modified + for(i=0; i UChar * -> char * with only " + "invariant characters: \"%s\"\n", + cs2); + + // initialize a UnicodeString from a string literal that contains + // escape sequences written with invariant characters + // do not forget to duplicate the backslashes for ICU to see them + // then, count each double backslash only once! + UnicodeString german=UNICODE_STRING( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", 64). + unescape(); + printUnicodeString("german UnicodeString from unescaping:\n ", german); + + /* + * C: convert and unescape a char * string with only invariant + * characters to fill a UChar * string + */ + UChar buffer[200]; + int32_t length; + length=u_unescape( + "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n", + buffer, UPRV_LENGTHOF(buffer)); + printf("german C Unicode string from char * unescaping: (length %d)\n ", length); + printUnicodeString("", UnicodeString(buffer)); +} + +extern int +main(int argc, const char *argv[]) { + UErrorCode errorCode=U_ZERO_ERROR; + + // Note: Using a global variable for any object is not exactly thread-safe... + + // You can change this call to e.g. ucnv_open("UTF-8", &errorCode) if you pipe + // the output to a file and look at it with a Unicode-capable editor. + // This will currently affect only the printUString() function, see the code above. + // printUnicodeString() could use this, too, by changing to an extract() overload + // that takes a UConverter argument. + cnv=ucnv_open(NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s opening the default converter\n", u_errorName(errorCode)); + return errorCode; + } + + ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_C, NULL, NULL, &errorCode); + if(U_FAILURE(errorCode)) { + fprintf(stderr, "error %s setting the escape callback in the default converter\n", u_errorName(errorCode)); + ucnv_close(cnv); + return errorCode; + } + + demo_utf_h_macros(); + demo_C_Unicode_strings(); + demoCaseMapInC(); + demoCaseMapInCPlusPlus(); + demoUnicodeStringStorage(); + demoUnicodeStringInit(); + + ucnv_close(cnv); + return 0; +} diff --git a/recipes/icu/config.yml b/recipes/icu/config.yml new file mode 100644 index 0000000..780ca52 --- /dev/null +++ b/recipes/icu/config.yml @@ -0,0 +1,13 @@ +versions: + "76.1": + folder: all + "75.1": + folder: all + "74.2": + folder: all + "74.1": + folder: all + "73.2": + folder: all + "73.1": + folder: all diff --git a/recipes/libmysqlclient/all/conandata.yml b/recipes/libmysqlclient/all/conandata.yml new file mode 100644 index 0000000..78b5ed9 --- /dev/null +++ b/recipes/libmysqlclient/all/conandata.yml @@ -0,0 +1,40 @@ +sources: + "8.1.0": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.1/mysql-8.1.0.tar.gz" + sha256: "3dd017a940734aa90796a4c65e125e6712f64bbbbe3388d36469deaa87b599eb" + "8.0.34": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.34.tar.gz" + sha256: "e65d03a3c42618b5fbf99042aed33209402e9b27aa62c7c8743ffd4788d8db1d" + "8.0.31": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.31.tar.gz" + sha256: "67bb8cba75b28e95c7f7948563f01fb84528fcbb1a35dba839d4ce44fe019baa" + "8.0.30": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.30.tar.gz" + sha256: "c988d5c6ba9a56692a6cd6e9813465b5fc9368ed4b461df97059a2fc160c8b84" + "8.0.25": + url: "https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.25.tar.gz" + sha256: "c16aa9cf621bc028efba2bb11f3c36a323b125fa0d108ff92fab60e46309206e" +patches: + "8.1.0": + - patch_file: "patches/0006-fix-cpp20-build-8.1.0.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.34": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.31": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.30": + - patch_file: "patches/0006-fix-cpp20-build-8.0.29.patch" + patch_description: "Fix C++20 compilation" + patch_type: "portability" + "8.0.25": + - patch_file: "patches/0004-fix-805-cpp17-build.patch" + patch_description: "Fix C++17 compilation" + patch_type: "portability" + - patch_file: "patches/0005-fix-macos-12.0.x-version-detection.patch" + patch_description: "Fix macOS 12.0 version detection" + patch_type: "bugfix" diff --git a/recipes/libmysqlclient/all/conanfile.py b/recipes/libmysqlclient/all/conanfile.py new file mode 100644 index 0000000..deb9135 --- /dev/null +++ b/recipes/libmysqlclient/all/conanfile.py @@ -0,0 +1,287 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, cross_building, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout +from conan.tools.env import VirtualRunEnv, VirtualBuildEnv +from conan.tools.files import rename, get, apply_conandata_patches, replace_in_file, rmdir, rm, export_conandata_patches, mkdir +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version +import os + +required_conan_version = ">=1.55.0" + + +class LibMysqlClientCConan(ConanFile): + name = "libmysqlclient" + description = "A MySQL client library for C development." + license = "GPL-2.0" + url = "https://github.com/conan-io/conan-center-index" + topics = ("mysql", "sql", "connector", "database") + homepage = "https://dev.mysql.com/downloads/mysql/" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + package_type = "library" + short_paths = True + + @property + def _min_cppstd(self): + return "17" if Version(self.version) >= "8.0.27" else "11" + + @property + def _compilers_minimum_version(self): + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "7" if Version(self.version) >= "8.0.27" else "5.3", + "clang": "6", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if Version(self.version) < "8.0.30": + self.requires("openssl/1.1.1w") + else: + self.requires("openssl/[>=1.1 <4]") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/1.5.5") + self.requires("lz4/1.9.4") + if self.settings.os == "FreeBSD": + self.requires("libunwind/1.7.2") + + def validate_build(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compilation not yet supported by the recipe. Contributions are welcomed.") + + def validate(self): + def loose_lt_semver(v1, v2): + lv1 = [int(v) for v in v1.split(".")] + lv2 = [int(v) for v in v2.split(".")] + min_length = min(len(lv1), len(lv2)) + return lv1[:min_length] < lv2[:min_length] + + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version): + raise ConanInvalidConfiguration(f"{self.ref} requires {self.settings.compiler} {minimum_version} or newer") + + # mysql < 8.0.29 uses `requires` in source code. It is the reserved keyword in C++20. + # https://github.com/mysql/mysql-server/blob/mysql-8.0.0/include/mysql/components/services/dynamic_loader.h#L270 + if self.settings.compiler.get_safe("cppstd") == "20" and Version(self.version) < "8.0.29": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support C++20") + + def build_requirements(self): + if is_apple_os(self): + self.tool_requires("cmake/[>=3.18 <4]") + if self.settings.os == "FreeBSD" and not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/2.0.3") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def _patch_sources(self): + apply_conandata_patches(self) + + libs_to_remove = ["icu", "libevent", "re2", "rapidjson", "protobuf", "libedit"] + for lib in libs_to_remove: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"MYSQL_CHECK_{lib.upper()}()\n", + "", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"INCLUDE({lib})\n", + "", + strict=False) + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + f"# WARN_MISSING_SYSTEM_{lib.upper()}({lib.upper()}_WARN_GIVEN)", + strict=False) + + if lib != "libevent" or Version(self.version) < "8.0.34": + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"SET({lib.upper()}_WARN_GIVEN)", + f"# SET({lib.upper()}_WARN_GIVEN)", + strict=False) + + for folder in ["client", "man", "mysql-test", "libbinlogstandalone"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"ADD_SUBDIRECTORY({folder})\n", + "", + strict=False) + rmdir(self, os.path.join(self.source_folder, "storage", "ndb")) + for t in ["INCLUDE(cmake/boost.cmake)\n", "MYSQL_CHECK_EDITLINE()\n"]: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + t, + "", + strict=False) + + # Upstream does not actually load lz4 directories for system, force it to + if Version(self.version) < "8.0.34": + replace_in_file(self, os.path.join(self.source_folder, "libbinlogevents", "CMakeLists.txt"), + "INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)", + "MY_INCLUDE_SYSTEM_DIRECTORIES(LZ4)\nINCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/libbinlogevents/include)") + + replace_in_file(self, os.path.join(self.source_folder, "cmake", "zstd.cmake"), + "NAMES zstd", + f"NAMES zstd {self.dependencies['zstd'].cpp_info.aggregated_components().libs[0]}") + + # Fix discovery & link to OpenSSL + ssl_cmake = os.path.join(self.source_folder, "cmake", "ssl.cmake") + replace_in_file(self, ssl_cmake, + "NAMES ssl", + f"NAMES ssl {self.dependencies['openssl'].cpp_info.components['ssl'].libs[0]}") + + replace_in_file(self, ssl_cmake, + "NAMES crypto", + f"NAMES crypto {self.dependencies['openssl'].cpp_info.components['crypto'].libs[0]}") + + replace_in_file(self, ssl_cmake, + "IF(NOT OPENSSL_APPLINK_C)\n", + "IF(FALSE AND NOT OPENSSL_APPLINK_C)\n", + strict=False) + + replace_in_file(self, ssl_cmake, + "SET(SSL_LIBRARIES ${MY_OPENSSL_LIBRARY} ${MY_CRYPTO_LIBRARY})", + "find_package(OpenSSL REQUIRED MODULE)\nset(SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)") + + # And do not merge OpenSSL libs into mysqlclient lib + replace_in_file(self, os.path.join(self.source_folder, "cmake", "libutils.cmake"), + 'IF(WIN32 AND ${TARGET} STREQUAL "mysqlclient")', + "if(0)") + + # Do not copy shared libs of dependencies to package folder + deps_shared = ["SSL", "KERBEROS", "SASL", "LDAP", "PROTOBUF"] + if Version(self.version) < "8.0.34": + deps_shared.append("CURL") + for dep in deps_shared: + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + f"MYSQL_CHECK_{dep}_DLLS()", + "") + + if self.settings.os == "Macos": + replace_in_file(self, os.path.join(self.source_folder, "libmysql", "CMakeLists.txt"), + f"COMMAND {'libmysql_api_test'}", + f"COMMAND DYLD_LIBRARY_PATH={os.path.join(self.build_folder, 'library_output_directory')} {os.path.join(self.build_folder, 'runtime_output_directory', 'libmysql_api_test')}") + replace_in_file(self, os.path.join(self.source_folder, "cmake", "install_macros.cmake"), + " INSTALL_DEBUG_SYMBOLS(", + " # INSTALL_DEBUG_SYMBOLS(") + + def generate(self): + vbenv = VirtualBuildEnv(self) + vbenv.generate() + + if not cross_building(self): + vrenv = VirtualRunEnv(self) + vrenv.generate(scope="build") + + tc = CMakeToolchain(self) + # Not used anywhere in the CMakeLists + tc.cache_variables["DISABLE_SHARED"] = not self.options.shared + tc.cache_variables["STACK_DIRECTION"] = "-1" # stack grows downwards, on very few platforms stack grows upwards + tc.cache_variables["WITHOUT_SERVER"] = True + tc.cache_variables["WITH_UNIT_TESTS"] = False + tc.cache_variables["ENABLED_PROFILING"] = False + tc.cache_variables["MYSQL_MAINTAINER_MODE"] = False + tc.cache_variables["WIX_DIR"] = False + # Disable additional Linux distro-specific compiler checks. + # The recipe already checks for minimum versions of supported + # compilers. + tc.cache_variables["FORCE_UNSUPPORTED_COMPILER"] = True + + tc.cache_variables["WITH_LZ4"] = "system" + + tc.cache_variables["WITH_ZSTD"] = "system" + tc.cache_variables["ZSTD_INCLUDE_DIR"] = self.dependencies["zstd"].cpp_info.aggregated_components().includedirs[0].replace("\\", "/") + + if is_msvc(self): + tc.cache_variables["WINDOWS_RUNTIME_MD"] = not is_msvc_static_runtime(self) + + tc.cache_variables["WITH_SSL"] = self.dependencies["openssl"].package_folder.replace("\\", "/") + + tc.cache_variables["WITH_ZLIB"] = "system" + + # Remove to ensure reproducible build, this only affects docs generation + tc.cache_variables["CMAKE_DISABLE_FIND_PACKAGE_Doxygen"] = True + tc.generate() + + deps = CMakeDeps(self) + deps.generate() + + if self.settings.os == "FreeBSD": + deps = PkgConfigDeps(self) + deps.generate() + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + mkdir(self, os.path.join(self.package_folder, "licenses")) + rename(self, os.path.join(self.package_folder, "LICENSE"), os.path.join(self.package_folder, "licenses", "LICENSE")) + rm(self, "README", self.package_folder) + rm(self, "*.pdb", self.package_folder, recursive=True) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "plugin")) + rmdir(self, os.path.join(self.package_folder, "docs")) + rmdir(self, os.path.join(self.package_folder, "share")) + if self.settings.os == "Windows": + if self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libmysql.dll"), + os.path.join(self.package_folder, "bin", "libmysql.dll")) + rm(self, "*mysqlclient.*", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dll", os.path.join(self.package_folder, "lib")) + rm(self, "*libmysql.*", os.path.join(self.package_folder, "lib")) + else: + if self.options.shared: + rm(self, "*.a", os.path.join(self.package_folder, "lib")) + else: + rm(self, "*.dylib", os.path.join(self.package_folder, "lib")) + rm(self, "*.so*", os.path.join(self.package_folder, "lib")) + + def package_info(self): + self.cpp_info.set_property("pkg_config_name", "mysqlclient") + self.cpp_info.libs = ["libmysql" if self.settings.os == "Windows" and self.options.shared else "mysqlclient"] + self.cpp_info.includedirs.append(os.path.join("include", "mysql")) + if not self.options.shared: + stdcpplib = stdcpp_library(self) + if stdcpplib: + self.cpp_info.system_libs.append(stdcpplib) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["m", "resolv"]) + if self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["dnsapi", "secur32"]) + + # TODO: There is no official FindMySQL.cmake, but it's a common Find files in many projects + # do we want to support it in CMakeDeps? + self.cpp_info.names["cmake_find_package"] = "MySQL" + self.cpp_info.names["cmake_find_package_multi"] = "MySQL" diff --git a/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch b/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch new file mode 100644 index 0000000..883a39e --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0004-fix-805-cpp17-build.patch @@ -0,0 +1,13 @@ +diff --git a/mysys/my_default.cc b/mysys/my_default.cc +--- a/mysys/my_default.cc ++++ b/mysys/my_default.cc +@@ -1180,7 +1180,7 @@ static mysql_file_getline_ret mysql_file_getline(char *buff, int size, + + /* If the supplied buff/size is enough to store the line, then we return the + * buff itself. In this case, we use this noop deleter */ +- static auto noop_free = [](void *) {}; ++ static auto noop_free = [](void *) noexcept {}; + + if (is_login_file) { + if (mysql_file_ftell(file) == 0) { + diff --git a/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch b/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch new file mode 100644 index 0000000..ee385c3 --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0005-fix-macos-12.0.x-version-detection.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake +index 192035dd..dedc59c6 100644 +--- a/cmake/package_name.cmake ++++ b/cmake/package_name.cmake +@@ -94,7 +94,7 @@ MACRO(GET_PACKAGE_FILE_NAME Var) + + STRING(REGEX MATCH + "ProductVersion:[\n\t ]*([0-9]+)\\.([0-9]+)" UNUSED ${SW_VERS_PRODUCTVERSION}) +- IF(NOT CMAKE_MATCH_1 OR NOT CMAKE_MATCH_2) ++ IF(CMAKE_MATCH_1 STREQUAL "" OR CMAKE_MATCH_2 STREQUAL "") + MESSAGE(FATAL_ERROR "Could not run sw_vers") + ENDIF() + diff --git a/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch new file mode 100644 index 0000000..b7c82d9 --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.0.29.patch @@ -0,0 +1,17 @@ +diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h +index a03d754..381216d 100644 +--- a/sql/sql_bitmap.h ++++ b/sql/sql_bitmap.h +@@ -138,10 +138,10 @@ class Bitmap<64> { + ulonglong map; + + public: +- Bitmap<64>() { init(); } ++ Bitmap() { init(); } + enum { ALL_BITS = 64 }; + +- explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } ++ explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); } + void init() { clear_all(); } + void init(uint prefix_to_set) { set_prefix(prefix_to_set); } + uint length() const { return 64; } diff --git a/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch new file mode 100644 index 0000000..ebaba58 --- /dev/null +++ b/recipes/libmysqlclient/all/patches/0006-fix-cpp20-build-8.1.0.patch @@ -0,0 +1,17 @@ +diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h +index 0f4a540..bd81a40 100644 +--- a/sql/sql_bitmap.h ++++ b/sql/sql_bitmap.h +@@ -145,10 +145,10 @@ class Bitmap<64> { + ulonglong map; + + public: +- Bitmap<64>() { init(); } ++ Bitmap() { init(); } + enum { ALL_BITS = 64 }; + +- explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } ++ explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); } + void init() { clear_all(); } + void init(uint prefix_to_set) { set_prefix(prefix_to_set); } + uint length() const { return 64; } diff --git a/recipes/libmysqlclient/all/test_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..9151a7e --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libmysqlclient REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE libmysqlclient::libmysqlclient) diff --git a/recipes/libmysqlclient/all/test_package/conanfile.py b/recipes/libmysqlclient/all/test_package/conanfile.py new file mode 100644 index 0000000..98ab558 --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libmysqlclient/all/test_package/test_package.c b/recipes/libmysqlclient/all/test_package/test_package.c new file mode 100644 index 0000000..382117a --- /dev/null +++ b/recipes/libmysqlclient/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include +#include + +int main(int argc, char **argv) +{ + printf("MySQL client version: %s\n", mysql_get_client_info()); + return 0; +} diff --git a/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt b/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..8d83bec --- /dev/null +++ b/recipes/libmysqlclient/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +find_package(MySQL REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE MySQL::MySQL) diff --git a/recipes/libmysqlclient/all/test_v1_package/conanfile.py b/recipes/libmysqlclient/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..2490acf --- /dev/null +++ b/recipes/libmysqlclient/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libmysqlclient/config.yml b/recipes/libmysqlclient/config.yml new file mode 100644 index 0000000..1b61785 --- /dev/null +++ b/recipes/libmysqlclient/config.yml @@ -0,0 +1,11 @@ +versions: + "8.1.0": + folder: all + "8.0.34": + folder: all + "8.0.31": + folder: all + "8.0.30": + folder: all + "8.0.25": + folder: all diff --git a/recipes/libpq/all/conandata.yml b/recipes/libpq/all/conandata.yml new file mode 100644 index 0000000..59a8975 --- /dev/null +++ b/recipes/libpq/all/conandata.yml @@ -0,0 +1,39 @@ +sources: + "15.5": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_postgresql_org/pub/source/v15.5/postgresql-15.5.tar.bz2" + sha256: "8f53aa95d78eb8e82536ea46b68187793b42bba3b4f65aa342f540b23c9b10a6" + "15.4": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_postgresql_org/pub/source/v15.4/postgresql-15.4.tar.bz2" + sha256: "baec5a4bdc4437336653b6cb5d9ed89be5bd5c0c58b94e0becee0a999e63c8f9" + "15.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_postgresql_org/pub/source/v15.3/postgresql-15.3.tar.bz2" + sha256: "ffc7d4891f00ffbf5c3f4eab7fbbced8460b8c0ee63c5a5167133b9e6599d932" + "14.9": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-ftp_postgresql_org/pub/source/v14.9/postgresql-14.9.tar.bz2" + sha256: "b1fe3ba9b1a7f3a9637dd1656dfdad2889016073fd4d35f13b50143cbbb6a8ef" +patches: + "15.5": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + - patch_file: "patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "15.4": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + - patch_file: "patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "15.3": + - patch_file: "patches/15/001-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" + - patch_file: "patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch" + patch_description: "Fix libpq w/ openssl >=3.2.x" + patch_type: "backport" + "14.9": + - patch_file: "patches/14/002-mingw-build-static-libraries.patch" + patch_description: "port MinGW: Enable building static libraries in MinGW." + patch_type: "portability" diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py new file mode 100644 index 0000000..1573938 --- /dev/null +++ b/recipes/libpq/all/conanfile.py @@ -0,0 +1,288 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import apply_conandata_patches, chdir, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, VCVars +from conan.tools.scm import Version +import glob +import os + +required_conan_version = ">=1.54.0" + + +class LibpqConan(ConanFile): + name = "libpq" + description = "The library used by all the standard PostgreSQL tools." + topics = ("postgresql", "database", "db") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.postgresql.org/docs/current/static/libpq.html" + license = "PostgreSQL" + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_openssl": [True, False], + "disable_rpath": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_openssl": False, + "disable_rpath": False, + } + + @property + def _is_clang8_x86(self): + return self.settings.os == "Linux" and \ + self.settings.compiler == "clang" and \ + self.settings.compiler.version == "8" and \ + self.settings.arch == "x86" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + self.options.rm_safe("fPIC") + self.options.rm_safe("disable_rpath") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.with_openssl: + self.requires("openssl/[>=1.1 <4]") + + def build_requirements(self): + if is_msvc(self): + self.tool_requires("strawberryperl/5.32.1.1") + elif self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if is_msvc(self): + vcvars = VCVars(self) + vcvars.generate() + config = "DEBUG" if self.settings.build_type == "Debug" else "RELEASE" + env = Environment() + env.define("CONFIG", config) + env.vars(self).save_script("conanbuild_msvc") + else: + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + tc = AutotoolsToolchain(self) + tc.configure_args.append('--without-readline') + tc.configure_args.append('--without-zlib') + tc.configure_args.append('--with-openssl' if self.options.with_openssl else '--without-openssl') + if cross_building(self) and not self.options.with_openssl: + tc.configure_args.append("--disable-strong-random") + if cross_building(self, skip_x64_x86=True): + tc.configure_args.append("USE_DEV_URANDOM=1") + if self.settings.os != "Windows" and self.options.disable_rpath: + tc.configure_args.append('--disable-rpath') + if self._is_clang8_x86: + tc.extra_cflags.append("-msse2") + tc.make_args.append(f"DESTDIR={unix_path(self, self.package_folder)}") + if self.settings.os == "Windows": + tc.make_args.append("MAKE_DLL={}".format(str(self.options.shared).lower())) + tc.generate() + AutotoolsDeps(self).generate() + + def _patch_sources(self): + if is_msvc(self): + # https://www.postgresql.org/docs/8.3/install-win32-libpq.html + # https://github.com/postgres/postgres/blob/master/src/tools/msvc/README + if not self.options.shared: + replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "MKvcbuild.pm"), + "$libpq = $solution->AddProject('libpq', 'dll', 'interfaces',", + "$libpq = $solution->AddProject('libpq', 'lib', 'interfaces',") + host_deps = [dep for _, dep in self.dependencies.host.items()] + system_libs = [] + for dep in host_deps: + system_libs.extend(dep.cpp_info.aggregated_components().system_libs) + + linked_system_libs = ", ".join(["'{}.lib'".format(lib) for lib in system_libs]) + replace_in_file(self,os.path.join(self.source_folder, "src", "tools", "msvc", "Project.pm"), + "libraries => [],", + "libraries => [{}],".format(linked_system_libs)) + runtime = { + "MT": "MultiThreaded", + "MTd": "MultiThreadedDebug", + "MD": "MultiThreadedDLL", + "MDd": "MultiThreadedDebugDLL", + }.get(msvc_runtime_flag(self)) + msbuild_project_pm = os.path.join(self.source_folder, "src", "tools", "msvc", "MSBuildProject.pm") + replace_in_file(self,msbuild_project_pm, "", """ + + $targetmachine + """) + replace_in_file(self,msbuild_project_pm, "'MultiThreadedDebugDLL'", "'%s'" % runtime) + replace_in_file(self,msbuild_project_pm, "'MultiThreadedDLL'", "'%s'" % runtime) + config_default_pl = os.path.join(self.source_folder, "src", "tools", "msvc", "config_default.pl") + solution_pm = os.path.join(self.source_folder, "src", "tools", "msvc", "Solution.pm") + if self.options.with_openssl: + openssl = self.dependencies["openssl"] + for ssl in ["VC\\libssl32", "VC\\libssl64", "libssl"]: + replace_in_file(self,solution_pm, + "%s.lib" % ssl, + "%s.lib" % openssl.cpp_info.components["ssl"].libs[0]) + for crypto in ["VC\\libcrypto32", "VC\\libcrypto64", "libcrypto"]: + replace_in_file(self,solution_pm, + "%s.lib" % crypto, + "%s.lib" % openssl.cpp_info.components["crypto"].libs[0]) + replace_in_file(self,config_default_pl, + "openssl => undef", + "openssl => '%s'" % openssl.package_folder.replace("\\", "/")) + elif self.settings.os == "Windows": + if self.settings.get_safe("compiler.threads") == "posix": + # Use MinGW pthread library + replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), + "ifeq ($(enable_thread_safety), yes)\nOBJS += pthread-win32.o\nendif", + "") + # When linking to static openssl, it comes with static pthread library too, failing with: + # libpq.so.5.15: U pthread_exit@GLIBC_2.2.5: libpq must not be calling any function which invokes exit + # https://www.postgresql.org/message-id/20210703001639.GB2374652%40rfd.leadboat.com + if Version(self.version) >= "15": + replace_in_file(self, os.path.join(self.source_folder, "src", "interfaces", "libpq", "Makefile"), + "-v __cxa_atexit", + "-v __cxa_atexit -e pthread_exit") + + def build(self): + apply_conandata_patches(self) + self._patch_sources() + if is_msvc(self): + with chdir(self, os.path.join(self.source_folder, "src", "tools", "msvc")): + self.run("perl build.pl libpq") + if not self.options.shared: + self.run("perl build.pl libpgport") + else: + autotools = Autotools(self) + with chdir(self, os.path.join(self.build_folder)): + autotools.configure() + with chdir(self, os.path.join(self.build_folder, "src", "backend")): + autotools.make(target="generated-headers") + with chdir(self, os.path.join(self.build_folder, "src", "common")): + autotools.make() + with chdir(self, os.path.join(self.build_folder, "src", "include")): + autotools.make() + with chdir(self, os.path.join(self.build_folder, "src", "interfaces", "libpq")): + autotools.make() + if Version(self.version) >= 12: + with chdir(self, os.path.join(self.build_folder, "src", "port")): + autotools.make() + with chdir(self, os.path.join(self.build_folder, "src", "bin", "pg_config")): + autotools.make() + + def _remove_unused_libraries_from_package(self): + bin_folder = os.path.join(self.package_folder, "bin") + lib_folder = os.path.join(self.package_folder, "lib") + rm(self, "*.dll", lib_folder) + if self.options.shared: + for lib in glob.glob(os.path.join(lib_folder, "*.a")): + if not (self.settings.os == "Windows" and os.path.basename(lib) == "libpq.dll.a"): + os.remove(lib) + else: + rm(self, "*.dll", bin_folder) + rm(self, "*.dll.a", lib_folder) + rm(self, "*.so*", lib_folder) + rm(self, "*.dylib", lib_folder) + + def package(self): + copy(self, "COPYRIGHT", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + if is_msvc(self): + copy(self, pattern="*postgres_ext.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*pg_config.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*pg_config_ext.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*libpq-fe.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*libpq-events.h", dst=os.path.join(self.package_folder, "include"), src=self.source_folder, keep_path=False) + copy(self, pattern="*.h", src=os.path.join(self.source_folder, "src", "include", "libpq"), + dst=os.path.join(self.package_folder, "include", "libpq"), + keep_path=False) + copy(self, pattern="*genbki.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "catalog"), keep_path=False) + copy(self, pattern="*pg_type.h", src=self.source_folder, dst=os.path.join(self.package_folder, "include", "catalog"), keep_path=False) + if self.options.shared: + copy(self, pattern="**/libpq.dll", dst=os.path.join(self.package_folder, "bin"), src=self.source_folder, keep_path=False) + copy(self, pattern="**/libpq.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + else: + copy(self, pattern="*.lib", dst=os.path.join(self.package_folder, "lib"), src=self.source_folder, keep_path=False) + else: + autotools = Autotools(self) + with chdir(self, os.path.join(self.build_folder, "src", "common")): + autotools.install() + with chdir(self, os.path.join(self.build_folder, "src", "include")): + autotools.install() + with chdir(self, os.path.join(self.build_folder, "src", "interfaces", "libpq")): + autotools.install() + if Version(self.version) >= 12: + with chdir(self, os.path.join(self.build_folder, "src", "port")): + autotools.install() + with chdir(self, os.path.join(self.build_folder, "src", "bin", "pg_config")): + autotools.install() + copy(self, "*.h", src=os.path.join(self.source_folder, "src", "include", "catalog"), + dst=os.path.join(self.package_folder, "include", "catalog")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "include", "postgresql", "server")) + self._remove_unused_libraries_from_package() + fix_apple_shared_install_name(self) + copy(self, "*.h", src=os.path.join(self.source_folder, "src", "backend", "catalog"), + dst=os.path.join(self.package_folder, "include", "catalog")) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "PostgreSQL") + self.cpp_info.set_property("cmake_target_name", "PostgreSQL::PostgreSQL") + self.cpp_info.set_property("pkg_config_name", "libpq") + + self.env_info.PostgreSQL_ROOT = self.package_folder + + self.cpp_info.components["pq"].libs = [f"{'lib' if is_msvc(self) else ''}pq"] + + if self.options.with_openssl: + self.cpp_info.components["pq"].requires.append("openssl::openssl") + + if not self.options.shared: + if is_msvc(self): + self.cpp_info.components["pgport"].libs = ["libpgport"] + self.cpp_info.components["pq"].requires.append("pgport") + self.cpp_info.components["pgcommon"].libs = ["libpgcommon"] + self.cpp_info.components["pq"].requires.append("pgcommon") + else: + self.cpp_info.components["pgcommon"].libs = ["pgcommon"] + self.cpp_info.components["pq"].requires.append("pgcommon") + self.cpp_info.components["pgcommon"].libs.append("pgcommon_shlib") + self.cpp_info.components["pgport"].libs = ["pgport", "pgport_shlib"] + if self.settings.os == "Windows": + self.cpp_info.components["pgport"].system_libs = ["ws2_32"] + self.cpp_info.components["pgcommon"].requires.append("pgport") + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["pq"].system_libs = ["pthread"] + elif self.settings.os == "Windows": + self.cpp_info.components["pq"].system_libs = ["ws2_32", "secur32", "advapi32", "shell32", "crypt32", "wldap32"] + + self.cpp_info.names["cmake_find_package"] = "PostgreSQL" + self.cpp_info.names["cmake_find_package_multi"] = "PostgreSQL" diff --git a/recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch new file mode 100644 index 0000000..ce58850 --- /dev/null +++ b/recipes/libpq/all/patches/14/002-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -358,7 +358,10 @@ else + # Win32 case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + # XXX A backend that loads a module linked with libgcc_s_dw2-1.dll will exit +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -452,6 +455,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch b/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch new file mode 100644 index 0000000..03514f3 --- /dev/null +++ b/recipes/libpq/all/patches/15.5/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch @@ -0,0 +1,193 @@ +From 672103a67aaf0dae5be6c5adcc5ce19e5b6d7676 Mon Sep 17 00:00:00 2001 +From: Tristan Partin +Date: Mon, 27 Nov 2023 11:49:52 -0600 +Subject: [PATCH v1] Use BIO_{get,set}_app_data() instead of + BIO_{get,set}_data() + +Compiling Postgres against OpenSSL 3.2 exposed a regression: + +$ psql "postgresql://$DB?sslmode=require" +psql: error: connection to server at "redacted" (redacted), port 5432 failed: ERROR: Parameter 'user' is missing in startup packet. +double free or corruption (out) +Aborted (core dumped) + +Analyzing the backtrace, openssl was overwriting heap-allocated data in +our PGconn struct because it thought BIO::ptr was a struct bss_sock_st +*. OpenSSL then called a memset() on a member of that struct, and we +zeroed out data in our PGconn struct. + +BIO_get_data(3) says the following: + +> These functions are mainly useful when implementing a custom BIO. +> +> The BIO_set_data() function associates the custom data pointed to by ptr +> with the BIO a. This data can subsequently be retrieved via a call to +> BIO_get_data(). This can be used by custom BIOs for storing +> implementation specific information. + +If you take a look at my_BIO_s_socket(), we create a partially custom +BIO, but for the most part are defaulting to the methods defined by +BIO_s_socket(). We need to set application-specific data and not BIO +private data, so that the BIO implementation we rely on, can properly +assert that its private data is what it expects. + +Rebased against libpq15 + +Co-authored-by: Bo Andreson +--- + src/backend/libpq/be-secure-openssl.c | 11 +++-------- + src/include/pg_config.h.in | 3 --- + src/interfaces/libpq/fe-secure-openssl.c | 20 +++----------------- + src/tools/msvc/Solution.pm | 2 -- + 4 files changed, 6 insertions(+), 30 deletions(-) + +diff --git a/configure b/configure +index d83a402ea1..d55440cd6a 100755 +--- a/configure ++++ b/configure +@@ -13239,7 +13239,7 @@ done + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free ++ for ac_func in OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +diff --git a/configure.ac b/configure.ac +index 570daced81..2bc752ca1a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1347,7 +1347,7 @@ if test "$with_ssl" = openssl ; then + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) ++ AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) + # OpenSSL versions before 1.1.0 required setting callback functions, for + # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock() + # function was removed. +diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c +index f5c5ed210e..aed8a75345 100644 +--- a/src/backend/libpq/be-secure-openssl.c ++++ b/src/backend/libpq/be-secure-openssl.c +@@ -839,11 +839,6 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods = NULL; + + static int +@@ -853,7 +848,7 @@ my_sock_read(BIO *h, char *buf, int size) + + if (buf != NULL) + { +- res = secure_raw_read(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_read(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -873,7 +868,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res = 0; + +- res = secure_raw_write(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_write(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -949,7 +944,7 @@ my_SSL_set_fd(Port *port, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, port); ++ BIO_set_app_data(bio, port); + + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(port->ssl, bio, bio); +diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in +index d09e9f9a1c..768e3d719c 100644 +--- a/src/include/pg_config.h.in ++++ b/src/include/pg_config.h.in +@@ -77,9 +77,6 @@ + /* Define to 1 if you have the `backtrace_symbols' function. */ + #undef HAVE_BACKTRACE_SYMBOLS + +-/* Define to 1 if you have the `BIO_get_data' function. */ +-#undef HAVE_BIO_GET_DATA +- + /* Define to 1 if you have the `BIO_meth_new' function. */ + #undef HAVE_BIO_METH_NEW + +diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c +index af59ff49f7..8d68d023e9 100644 +--- a/src/interfaces/libpq/fe-secure-openssl.c ++++ b/src/interfaces/libpq/fe-secure-openssl.c +@@ -1800,11 +1800,6 @@ PQsslAttribute(PGconn *conn, const char *attribute_name) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods; + + static int +@@ -1812,7 +1807,7 @@ my_sock_read(BIO *h, char *buf, int size) + { + int res; + +- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1842,7 +1837,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res; + +- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1933,7 +1928,7 @@ my_SSL_set_fd(PGconn *conn, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, conn); ++ BIO_set_app_data(bio, conn); + + SSL_set_bio(conn->ssl, bio, bio); + BIO_set_fd(bio, fd, BIO_NOCLOSE); +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 790f03b05e..a53239fa28 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -226,7 +226,6 @@ sub GenerateFiles + HAVE_ATOMICS => 1, + HAVE_ATOMIC_H => undef, + HAVE_BACKTRACE_SYMBOLS => undef, +- HAVE_BIO_GET_DATA => undef, + HAVE_BIO_METH_NEW => undef, + HAVE_CLOCK_GETTIME => undef, + HAVE_COMPUTED_GOTO => undef, +@@ -566,7 +565,6 @@ sub GenerateFiles + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) + { + $define{HAVE_ASN1_STRING_GET0_DATA} = 1; +- $define{HAVE_BIO_GET_DATA} = 1; + $define{HAVE_BIO_METH_NEW} = 1; + $define{HAVE_HMAC_CTX_FREE} = 1; + $define{HAVE_HMAC_CTX_NEW} = 1; +-- +Tristan Partin +Neon (https://neon.tech) + diff --git a/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch b/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch new file mode 100644 index 0000000..31cf4e8 --- /dev/null +++ b/recipes/libpq/all/patches/15/0001-Use-BIO_-get-set-_app_data-instead-of-BIO_-get-se.patch @@ -0,0 +1,193 @@ +From 672103a67aaf0dae5be6c5adcc5ce19e5b6d7676 Mon Sep 17 00:00:00 2001 +From: Tristan Partin +Date: Mon, 27 Nov 2023 11:49:52 -0600 +Subject: [PATCH v1] Use BIO_{get,set}_app_data() instead of + BIO_{get,set}_data() + +Compiling Postgres against OpenSSL 3.2 exposed a regression: + +$ psql "postgresql://$DB?sslmode=require" +psql: error: connection to server at "redacted" (redacted), port 5432 failed: ERROR: Parameter 'user' is missing in startup packet. +double free or corruption (out) +Aborted (core dumped) + +Analyzing the backtrace, openssl was overwriting heap-allocated data in +our PGconn struct because it thought BIO::ptr was a struct bss_sock_st +*. OpenSSL then called a memset() on a member of that struct, and we +zeroed out data in our PGconn struct. + +BIO_get_data(3) says the following: + +> These functions are mainly useful when implementing a custom BIO. +> +> The BIO_set_data() function associates the custom data pointed to by ptr +> with the BIO a. This data can subsequently be retrieved via a call to +> BIO_get_data(). This can be used by custom BIOs for storing +> implementation specific information. + +If you take a look at my_BIO_s_socket(), we create a partially custom +BIO, but for the most part are defaulting to the methods defined by +BIO_s_socket(). We need to set application-specific data and not BIO +private data, so that the BIO implementation we rely on, can properly +assert that its private data is what it expects. + +Rebased against libpq15 + +Co-authored-by: Bo Andreson +--- + src/backend/libpq/be-secure-openssl.c | 11 +++-------- + src/include/pg_config.h.in | 3 --- + src/interfaces/libpq/fe-secure-openssl.c | 20 +++----------------- + src/tools/msvc/Solution.pm | 2 -- + 4 files changed, 6 insertions(+), 30 deletions(-) + +diff --git a/configure b/configure +index d733a59..c13ad3d 100755 +--- a/configure ++++ b/configure +@@ -13237,7 +13237,7 @@ done + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- for ac_func in OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free ++ for ac_func in OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +diff --git a/configure.ac b/configure.ac +index 44868ba..77e59a2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1347,7 +1347,7 @@ if test "$with_ssl" = openssl ; then + # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it + # doesn't have these OpenSSL 1.1.0 functions. So check for individual + # functions. +- AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_get_data BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) ++ AC_CHECK_FUNCS([OPENSSL_init_ssl BIO_meth_new ASN1_STRING_get0_data HMAC_CTX_new HMAC_CTX_free]) + # OpenSSL versions before 1.1.0 required setting callback functions, for + # thread-safety. In 1.1.0, it's no longer required, and CRYPTO_lock() + # function was removed. +diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c +index 8f9b81c..9abee50 100644 +--- a/src/backend/libpq/be-secure-openssl.c ++++ b/src/backend/libpq/be-secure-openssl.c +@@ -830,11 +830,6 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods = NULL; + + static int +@@ -844,7 +839,7 @@ my_sock_read(BIO *h, char *buf, int size) + + if (buf != NULL) + { +- res = secure_raw_read(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_read(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -864,7 +859,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res = 0; + +- res = secure_raw_write(((Port *) BIO_get_data(h)), buf, size); ++ res = secure_raw_write(((Port *) BIO_get_app_data(h)), buf, size); + BIO_clear_retry_flags(h); + if (res <= 0) + { +@@ -940,7 +935,7 @@ my_SSL_set_fd(Port *port, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, port); ++ BIO_set_app_data(bio, port); + + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(port->ssl, bio, bio); +diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in +index d09e9f9..768e3d7 100644 +--- a/src/include/pg_config.h.in ++++ b/src/include/pg_config.h.in +@@ -77,9 +77,6 @@ + /* Define to 1 if you have the `backtrace_symbols' function. */ + #undef HAVE_BACKTRACE_SYMBOLS + +-/* Define to 1 if you have the `BIO_get_data' function. */ +-#undef HAVE_BIO_GET_DATA +- + /* Define to 1 if you have the `BIO_meth_new' function. */ + #undef HAVE_BIO_METH_NEW + +diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c +index af59ff4..8d68d02 100644 +--- a/src/interfaces/libpq/fe-secure-openssl.c ++++ b/src/interfaces/libpq/fe-secure-openssl.c +@@ -1800,11 +1800,6 @@ PQsslAttribute(PGconn *conn, const char *attribute_name) + * to retry; do we need to adopt their logic for that? + */ + +-#ifndef HAVE_BIO_GET_DATA +-#define BIO_get_data(bio) (bio->ptr) +-#define BIO_set_data(bio, data) (bio->ptr = data) +-#endif +- + static BIO_METHOD *my_bio_methods; + + static int +@@ -1812,7 +1807,7 @@ my_sock_read(BIO *h, char *buf, int size) + { + int res; + +- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1842,7 +1837,7 @@ my_sock_write(BIO *h, const char *buf, int size) + { + int res; + +- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size); ++ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size); + BIO_clear_retry_flags(h); + if (res < 0) + { +@@ -1933,7 +1928,7 @@ my_SSL_set_fd(PGconn *conn, int fd) + SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB); + goto err; + } +- BIO_set_data(bio, conn); ++ BIO_set_app_data(bio, conn); + + SSL_set_bio(conn->ssl, bio, bio); + BIO_set_fd(bio, fd, BIO_NOCLOSE); +diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm +index 790f03b..a53239f 100644 +--- a/src/tools/msvc/Solution.pm ++++ b/src/tools/msvc/Solution.pm +@@ -226,7 +226,6 @@ sub GenerateFiles + HAVE_ATOMICS => 1, + HAVE_ATOMIC_H => undef, + HAVE_BACKTRACE_SYMBOLS => undef, +- HAVE_BIO_GET_DATA => undef, + HAVE_BIO_METH_NEW => undef, + HAVE_CLOCK_GETTIME => undef, + HAVE_COMPUTED_GOTO => undef, +@@ -566,7 +565,6 @@ sub GenerateFiles + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) + { + $define{HAVE_ASN1_STRING_GET0_DATA} = 1; +- $define{HAVE_BIO_GET_DATA} = 1; + $define{HAVE_BIO_METH_NEW} = 1; + $define{HAVE_HMAC_CTX_FREE} = 1; + $define{HAVE_HMAC_CTX_NEW} = 1; +-- +Tristan Partin +Neon (https://neon.tech) + diff --git a/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch b/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch new file mode 100644 index 0000000..8bbd59c --- /dev/null +++ b/recipes/libpq/all/patches/15/001-mingw-build-static-libraries.patch @@ -0,0 +1,39 @@ +--- a/src/Makefile.shlib ++++ b/src/Makefile.shlib +@@ -322,7 +322,10 @@ else # PORTNAME == aix + # AIX case + + # See notes in src/backend/parser/Makefile about the following two rules +-$(stlib): $(shlib) ++$(stlib): $(OBJS) | $(SHLIB_PREREQS) ++ rm -f $@ ++ $(LINK.static) $@ $^ ++ $(RANLIB) $@ + touch $@ + + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +@@ -371,12 +374,12 @@ $(stlib): $(shlib) + # Else we just use --export-all-symbols. + ifeq (,$(SHLIB_EXPORTS)) + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--export-all-symbols -Wl,--out-implib=lib$(NAME).dll.a + else + DLL_DEFFILE = lib$(NAME)dll.def + + $(shlib): $(OBJS) $(DLL_DEFFILE) | $(SHLIB_PREREQS) +- $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=$(stlib) ++ $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $(OBJS) $(DLL_DEFFILE) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK) $(LIBS) -Wl,--out-implib=lib$(NAME).dll.a + + UC_NAME = $(shell echo $(NAME) | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') + +@@ -457,6 +460,9 @@ endif # not aix + ifneq (,$(findstring $(PORTNAME),win32 cygwin)) + $(INSTALL_SHLIB) $< '$(DESTDIR)$(bindir)/$(shlib)' + endif ++ifneq (,$(findstring $(PORTNAME),win32)) ++ $(INSTALL_SHLIB) $< '$(DESTDIR)$(libdir)/lib$(NAME).dll.a' ++endif + else # no soname + $(INSTALL_SHLIB) $< '$(DESTDIR)$(pkglibdir)/$(shlib)' + endif diff --git a/recipes/libpq/all/test_package/CMakeLists.txt b/recipes/libpq/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..b9f4d7a --- /dev/null +++ b/recipes/libpq/all/test_package/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) +find_package(PostgreSQL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL) diff --git a/recipes/libpq/all/test_package/CMakeUserPresets.json b/recipes/libpq/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/libpq/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libpq/all/test_package/conanfile.py b/recipes/libpq/all/test_package/conanfile.py new file mode 100644 index 0000000..e845ae7 --- /dev/null +++ b/recipes/libpq/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libpq/all/test_package/test_package.c b/recipes/libpq/all/test_package/test_package.c new file mode 100644 index 0000000..4214d8b --- /dev/null +++ b/recipes/libpq/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include "libpq-fe.h" + +#include +#include + + +int main() { + PGconn *conn = NULL; + const int version = PQlibVersion(); + printf("PQlibVersion: %d\n", version); + + conn = PQconnectdb("dbname = postgres"); + PQstatus(conn); + + PQfinish(conn); + return EXIT_SUCCESS; +} diff --git a/recipes/libpq/all/test_v1_package/CMakeLists.txt b/recipes/libpq/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..2f11d9b --- /dev/null +++ b/recipes/libpq/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libpq/all/test_v1_package/conanfile.py b/recipes/libpq/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..5f9efeb --- /dev/null +++ b/recipes/libpq/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libpq/config.yml b/recipes/libpq/config.yml new file mode 100644 index 0000000..19b1302 --- /dev/null +++ b/recipes/libpq/config.yml @@ -0,0 +1,9 @@ +versions: + "15.5": + folder: all + "15.4": + folder: all + "15.3": + folder: all + "14.9": + folder: all diff --git a/recipes/libxml2/all/conandata.yml b/recipes/libxml2/all/conandata.yml new file mode 100644 index 0000000..1ef6773 --- /dev/null +++ b/recipes/libxml2/all/conandata.yml @@ -0,0 +1,37 @@ +sources: + "2.13.4": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.13/libxml2-2.13.4.tar.xz" + sha256: "65d042e1c8010243e617efb02afda20b85c2160acdbfbcb5b26b80cec6515650" + "2.12.9": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.12/libxml2-2.12.9.tar.xz" + sha256: "59912db536ab56a3996489ea0299768c7bcffe57169f0235e7f962a91f483590" + "2.12.4": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.12/libxml2-2.12.4.tar.xz" + sha256: "497360e423cf0bd99eacdb7c6215dea92e6d6e89ee940393c2bae0e77cb9b7d0" + "2.12.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.12/libxml2-2.12.3.tar.xz" + sha256: "8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa" + "2.11.9": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.11/libxml2-2.11.9.tar.xz" + sha256: "780157a1efdb57188ec474dca87acaee67a3a839c2525b2214d318228451809f" + "2.11.6": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.11/libxml2-2.11.6.tar.xz" + sha256: "c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300" + "2.11.4": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.11/libxml2-2.11.4.tar.xz" + sha256: "737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7" + "2.10.4": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.10/libxml2-2.10.4.tar.xz" + sha256: "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45" + "2.10.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.10/libxml2-2.10.3.tar.xz" + sha256: "5d2cc3d78bec3dbe212a9d7fa629ada25a7da928af432c93060ff5c17ee28a9c" + "2.9.14": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz" + sha256: "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee" + "2.9.12": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.9/libxml2-2.9.12.tar.xz" + sha256: "28a92f6ab1f311acf5e478564c49088ef0ac77090d9c719bbc5d518f1fe62eb9" + "2.9.10": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-download_gnome_org/sources/libxml2/2.9/libxml2-2.9.10.tar.xz" + sha256: "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" diff --git a/recipes/libxml2/all/conanfile.py b/recipes/libxml2/all/conanfile.py new file mode 100644 index 0000000..884db79 --- /dev/null +++ b/recipes/libxml2/all/conanfile.py @@ -0,0 +1,414 @@ +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.build import cross_building, build_jobs +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, rename, rm, rmdir, replace_in_file, save, chdir, mkdir +from conan.tools.gnu import Autotools, AutotoolsToolchain, AutotoolsDeps, PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, unix_path, NMakeDeps, NMakeToolchain +from conan.tools.scm import Version +import os + +import itertools +import textwrap + +required_conan_version = ">=1.55.0" + + +class Libxml2Conan(ConanFile): + name = "libxml2" + package_type = "library" + url = "https://github.com/conan-io/conan-center-index" + description = "libxml2 is a software library for parsing XML documents" + topics = "xml", "parser", "validation" + homepage = "https://gitlab.gnome.org/GNOME/libxml2/-/wikis/" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + # from ./configure and ./win32/configure.js + default_options = { + "shared": False, + "fPIC": True, + "include_utils": True, + "c14n": True, + "catalog": True, + "docbook": True, # dropped after 2.10.3 + "ftp": True, + "http": True, + "html": True, + "iconv": True, + "icu": False, + "iso8859x": True, + "legacy": True, + "mem-debug": False, + "output": True, + "pattern": True, + "push": True, + "python": False, + "reader": True, + "regexps": True, + "run-debug": False, + "sax1": True, + "schemas": True, + "schematron": True, + "threads": True, + "tree": True, + "valid": True, + "writer": True, + "xinclude": True, + "xpath": True, + "xptr": True, + "zlib": True, + "lzma": False, + } + + options = {name: [True, False] for name in default_options.keys()} + + @property + def _configure_option_names(self): + return [name for name in self.default_options.keys() if (name in self.options) + and (name not in ["shared", "fPIC", "include_utils"])] + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _is_mingw_windows(self): + return self.settings.compiler == "gcc" and self.settings.os == "Windows" and self._settings_build.os == "Windows" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + if Version(self.version) >= "2.10.3": + del self.options.docbook + if Version(self.version) >= "2.11.0": + self.options.rm_safe("run-debug") + if Version(self.version) >= "2.13.0": + self.options.rm_safe("mem-debug") + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.libcxx") + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + if self.options.zlib: + self.requires("zlib/[>=1.2.11 <2]") + if self.options.lzma: + self.requires("xz_utils/5.4.5") + if self.options.iconv: + self.requires("libiconv/1.17", transitive_headers=True, transitive_libs=True) + if self.options.icu: + self.requires("icu/73.2") + + def build_requirements(self): + if not (is_msvc(self) or self._is_mingw_windows): + if self.options.zlib or self.options.lzma or self.options.icu: + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.1.0]") + if self._settings_build.os == "Windows": + self.win_bash = True + if not self.conf.get("tools.microsoft.bash:path", check_type=str): + self.tool_requires("msys2/cci.latest") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + if is_msvc(self): + tc = NMakeToolchain(self) + tc.generate() + deps = NMakeDeps(self) + deps.generate() + elif self._is_mingw_windows: + pass # nothing to do for mingw? it calls mingw-make directly + else: + env = VirtualBuildEnv(self) + env.generate() + + if not cross_building(self): + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = AutotoolsToolchain(self) + + yes_no = lambda v: "yes" if v else "no" + tc.configure_args.extend([ + f"--enable-shared={yes_no(self.options.shared)}", + f"--enable-static={yes_no(not self.options.shared)}", + ]) + for option_name in self._configure_option_names: + option_value = getattr(self.options, option_name) + tc.configure_args.append(f"--with-{option_name}={yes_no(option_value)}") + + tc.generate() + + tc = PkgConfigDeps(self) + tc.generate() + + tc = AutotoolsDeps(self) + tc.generate() + + def _build_msvc(self): + with chdir(self, os.path.join(self.source_folder, 'win32')): + debug = "yes" if self.settings.build_type == "Debug" else "no" + static = "no" if self.options.shared else "yes" + + args = [ + "cscript", + "configure.js", + "compiler=msvc", + f"prefix={self.package_folder}", + f"cruntime=/{msvc_runtime_flag(self)}", + f"debug={debug}", + f"static={static}", + ] + + incdirs = [incdir for dep in self.dependencies.values() for incdir in dep.cpp_info.includedirs] + libdirs = [libdir for dep in self.dependencies.values() for libdir in dep.cpp_info.libdirs] + args.append(f"include=\"{';'.join(incdirs)}\"") + args.append(f"lib=\"{';'.join(libdirs)}\"") + + for name in self._configure_option_names: + cname = {"mem-debug": "mem_debug", + "run-debug": "run_debug", + "docbook": "docb"}.get(name, name) + value = getattr(self.options, name) + value = "yes" if value else "no" + args.append(f"{cname}={value}") + + configure_command = ' '.join(args) + self.output.info(configure_command) + self.run(configure_command) + + # Fix library names because they can be not just zlib.lib + def fix_library(option, package, old_libname): + if option: + libs = [] + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + for lib in itertools.chain(aggregated_cpp_info.libs, aggregated_cpp_info.system_libs): + libname = lib + if not libname.endswith('.lib'): + libname += '.lib' + libs.append(libname) + replace_in_file(self, "Makefile.msvc", + f"LIBS = $(LIBS) {old_libname}", + f"LIBS = $(LIBS) {' '.join(libs)}") + + fix_library(self.options.zlib, 'zlib', 'zlib.lib') + fix_library(self.options.lzma, "xz_utils", "liblzma.lib") + fix_library(self.options.iconv, 'libiconv', 'iconv.lib') + fix_library(self.options.icu, 'icu', 'advapi32.lib sicuuc.lib sicuin.lib sicudt.lib') + fix_library(self.options.icu, 'icu', 'icuuc.lib icuin.lib icudt.lib') + + self.run("nmake /f Makefile.msvc libxml libxmla libxmladll") + + if self.options.include_utils: + self.run("nmake /f Makefile.msvc utils") + + def _package_msvc(self): + with chdir(self, os.path.join(self.source_folder, 'win32')): + self.run("nmake /f Makefile.msvc install-libs") + + if self.options.include_utils: + self.run("nmake /f Makefile.msvc install-dist") + + def _build_mingw(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + # configuration + yes_no = lambda v: "yes" if v else "no" + args = [ + "cscript", + "configure.js", + "compiler=mingw", + f"prefix={self.package_folder}", + f"debug={yes_no(self.settings.build_type == 'Debug')}", + f"static={yes_no(not self.options.shared)}", + ] + + incdirs = [incdir for dep in self.dependencies.values() for incdir in dep.cpp_info.includedirs] + libdirs = [libdir for dep in self.dependencies.values() for libdir in dep.cpp_info.libdirs] + args.append(f"include=\"{' -I'.join(incdirs)}\"") + args.append(f"lib=\"{' -L'.join(libdirs)}\"") + + for name in self._configure_option_names: + cname = { + "mem-debug": "mem_debug", + "run-debug": "run_debug", + "docbook": "docb", + }.get(name, name) + args.append(f"{cname}={yes_no(getattr(self.options, name))}") + configure_command = " ".join(args) + self.output.info(configure_command) + self.run(configure_command) + + # build + def fix_library(option, package, old_libname): + if option: + aggregated_cpp_info = self.dependencies[package].cpp_info.aggregated_components() + replace_in_file(self, + "Makefile.mingw", + f"LIBS += -l{old_libname}", + f"LIBS += -l{' -l'.join(aggregated_cpp_info.libs)}", + ) + + fix_library(self.options.iconv, "libiconv", "iconv") + fix_library(self.options.zlib, "zlib", "z") + fix_library(self.options.lzma, "xz_utils", "lzma") + + self.run(f"mingw32-make -j{build_jobs(self)} -f Makefile.mingw libxml libxmla") + if self.options.include_utils: + self.run(f"mingw32-make -j{build_jobs(self)} -f Makefile.mingw utils") + + def _package_mingw(self): + with chdir(self, os.path.join(self.source_folder, "win32")): + mkdir(self, os.path.join(self.package_folder, "include", "libxml2")) + self.run("mingw32-make -f Makefile.mingw install-libs") + if self.options.include_utils: + self.run("mingw32-make -f Makefile.mingw install-dist") + + def _patch_sources(self): + # Break dependency of install on build + for makefile in ("Makefile.mingw", "Makefile.msvc"): + replace_in_file(self, os.path.join(self.source_folder, "win32", makefile), + "install-libs : all", + "install-libs :") + + def build(self): + self._patch_sources() + if is_msvc(self): + self._build_msvc() + elif self._is_mingw_windows: + self._build_mingw() + else: + autotools = Autotools(self) + autotools.configure() + autotools.make("libxml2.la") + + if self.options.include_utils: + for target in ["xmllint", "xmlcatalog", "xml2-config"]: + autotools.make(target) + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + copy(self, "Copyright", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"), ignore_case=True, keep_path=False) + if is_msvc(self): + self._package_msvc() + # remove redundant libraries to avoid confusion + if not self.options.shared: + rm(self, "libxml2.dll", os.path.join(self.package_folder, "bin")) + rm(self, "libxml2_a_dll.lib", os.path.join(self.package_folder, "lib")) + rm(self, "libxml2_a.lib" if self.options.shared else "libxml2.lib", os.path.join(self.package_folder, "lib")) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) + elif self._is_mingw_windows: + self._package_mingw() + if self.options.shared: + rm(self, "libxml2.a", os.path.join(self.package_folder, "lib")) + rename(self, os.path.join(self.package_folder, "lib", "libxml2.lib"), + os.path.join(self.package_folder, "lib", "libxml2.dll.a")) + else: + rm(self, "libxml2.dll", os.path.join(self.package_folder, "bin")) + rm(self, "libxml2.lib", os.path.join(self.package_folder, "lib")) + else: + autotools = Autotools(self) + + for target in ["install-libLTLIBRARIES", "install-data"]: + autotools.make(target=target, args=[f"DESTDIR={unix_path(self, self.package_folder)}"]) + + if self.options.include_utils: + autotools.install() + + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + rm(self, "*.sh", os.path.join(self.package_folder, "lib")) + rm(self, "run*", os.path.join(self.package_folder, "bin")) + rm(self, "test*", os.path.join(self.package_folder, "bin")) + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + for header in ["win32config.h", "wsockcompat.h"]: + copy(self, pattern=header, src=os.path.join(self.source_folder, "include"), + dst=os.path.join(self.package_folder, "include", "libxml2"), keep_path=False) + + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + # FIXME: also define LIBXML2_XMLLINT_EXECUTABLE variable + content = textwrap.dedent(f"""\ + set(LibXml2_FOUND TRUE) + set(LIBXML2_FOUND TRUE) + if(DEFINED LibXml2_INCLUDE_DIRS) + set(LIBXML2_INCLUDE_DIR ${{LibXml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIRS ${{LibXml2_INCLUDE_DIRS}}) + elseif(DEFINED libxml2_INCLUDE_DIRS) + set(LIBXML2_INCLUDE_DIR ${{libxml2_INCLUDE_DIRS}}) + set(LIBXML2_INCLUDE_DIRS ${{libxml2_INCLUDE_DIRS}}) + endif() + if(DEFINED LibXml2_LIBRARIES) + set(LIBXML2_LIBRARIES ${{LibXml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{LibXml2_LIBRARIES}}) + elseif(DEFINED libxml2_LIBRARIES) + set(LIBXML2_LIBRARIES ${{libxml2_LIBRARIES}}) + set(LIBXML2_LIBRARY ${{libxml2_LIBRARIES}}) + endif() + if(DEFINED LibXml2_DEFINITIONS) + set(LIBXML2_DEFINITIONS ${{LibXml2_DEFINITIONS}}) + elseif(DEFINED libxml2_DEFINITIONS) + set(LIBXML2_DEFINITIONS ${{libxml2_DEFINITIONS}}) + else() + set(LIBXML2_DEFINITIONS "") + endif() + set(LIBXML2_VERSION_STRING "{self.version}") + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + # FIXME: Provide LibXml2::xmllint & LibXml2::xmlcatalog imported target for executables + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_module_file_name", "LibXml2") + self.cpp_info.set_property("cmake_file_name", "libxml2") + self.cpp_info.set_property("cmake_target_name", "LibXml2::LibXml2") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "libxml-2.0") + prefix = "lib" if is_msvc(self) else "" + suffix = "_a" if is_msvc(self) and not self.options.shared else "" + self.cpp_info.libs = [f"{prefix}xml2{suffix}"] + self.cpp_info.includedirs.append(os.path.join("include", "libxml2")) + if not self.options.shared: + self.cpp_info.defines = ["LIBXML_STATIC"] + if self.options.include_utils: + bindir = os.path.join(self.package_folder, "bin") + self.output.info(f"Appending PATH environment variable: {bindir}") + self.env_info.PATH.append(bindir) + if self.settings.os in ["Linux", "FreeBSD", "Android"]: + self.cpp_info.system_libs.append("m") + if self.options.threads and self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("pthread") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.append("dl") + elif self.settings.os == "Windows": + if self.options.ftp or self.options.http: + self.cpp_info.system_libs.extend(["ws2_32", "wsock32"]) + if Version(self.version) >= "2.13.4": + # https://gitlab.gnome.org/GNOME/libxml2/-/issues/791 + # https://gitlab.gnome.org/GNOME/libxml2/-/blob/2.13/win32/Makefile.msvc?ref_type=heads#L84 + self.cpp_info.system_libs.append("bcrypt") + + # TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "LibXml2" + self.cpp_info.filenames["cmake_find_package_multi"] = "libxml2" + self.cpp_info.names["cmake_find_package"] = "LibXml2" + self.cpp_info.names["cmake_find_package_multi"] = "LibXml2" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + self.cpp_info.names["pkg_config"] = "libxml-2.0" diff --git a/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000..de25548 --- /dev/null +++ b/recipes/libxml2/all/test_cmake_module_package/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.12) +project(test_package LANGUAGES C) + +find_package(LibXml2 REQUIRED MODULE) + +add_executable(${PROJECT_NAME} ../test_package/test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindLibXml2.html +# are properly defined in conan generators +set(_custom_vars + LibXml2_FOUND # since CMake 3.14 + LIBXML2_FOUND # until CMake 3.14 + LIBXML2_INCLUDE_DIR + LIBXML2_INCLUDE_DIRS + LIBXML2_LIBRARIES + LIBXML2_DEFINITIONS + LIBXML2_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/libxml2/all/test_cmake_module_package/conanfile.py b/recipes/libxml2/all/test_cmake_module_package/conanfile.py new file mode 100644 index 0000000..20481a7 --- /dev/null +++ b/recipes/libxml2/all/test_cmake_module_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/libxml2/all/test_package/CMakeLists.txt b/recipes/libxml2/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..9d8bc30 --- /dev/null +++ b/recipes/libxml2/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(libxml2 REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE LibXml2::LibXml2) diff --git a/recipes/libxml2/all/test_package/CMakeUserPresets.json b/recipes/libxml2/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/libxml2/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/libxml2/all/test_package/books.xml b/recipes/libxml2/all/test_package/books.xml new file mode 100644 index 0000000..7c254f1 --- /dev/null +++ b/recipes/libxml2/all/test_package/books.xml @@ -0,0 +1,120 @@ + + + + Gambardella, Matthew + XML Developer's Guide + Computer + 44.95 + 2000-10-01 + An in-depth look at creating applications + with XML. + + + Ralls, Kim + Midnight Rain + Fantasy + 5.95 + 2000-12-16 + A former architect battles corporate zombies, + an evil sorceress, and her own childhood to become queen + of the world. + + + Corets, Eva + Maeve Ascendant + Fantasy + 5.95 + 2000-11-17 + After the collapse of a nanotechnology + society in England, the young survivors lay the + foundation for a new society. + + + Corets, Eva + Oberon's Legacy + Fantasy + 5.95 + 2001-03-10 + In post-apocalypse England, the mysterious + agent known only as Oberon helps to create a new life + for the inhabitants of London. Sequel to Maeve + Ascendant. + + + Corets, Eva + The Sundered Grail + Fantasy + 5.95 + 2001-09-10 + The two daughters of Maeve, half-sisters, + battle one another for control of England. Sequel to + Oberon's Legacy. + + + Randall, Cynthia + Lover Birds + Romance + 4.95 + 2000-09-02 + When Carla meets Paul at an ornithology + conference, tempers fly as feathers get ruffled. + + + Thurman, Paula + Splish Splash + Romance + 4.95 + 2000-11-02 + A deep sea diver finds true love twenty + thousand leagues beneath the sea. + + + Knorr, Stefan + Creepy Crawlies + Horror + 4.95 + 2000-12-06 + An anthology of horror stories about roaches, + centipedes, scorpions and other insects. + + + Kress, Peter + Paradox Lost + Science Fiction + 6.95 + 2000-11-02 + After an inadvertant trip through a Heisenberg + Uncertainty Device, James Salway discovers the problems + of being quantum. + + + O'Brien, Tim + Microsoft .NET: The Programming Bible + Computer + 36.95 + 2000-12-09 + Microsoft's .NET initiative is explored in + detail in this deep programmer's reference. + + + O'Brien, Tim + MSXML3: A Comprehensive Guide + Computer + 36.95 + 2000-12-01 + The Microsoft MSXML3 parser is covered in + detail, with attention to XML DOM interfaces, XSLT processing, + SAX and more. + + + Galos, Mike + Visual Studio 7: A Comprehensive Guide + Computer + 49.95 + 2001-04-16 + Microsoft Visual Studio 7 is explored in depth, + looking at how Visual Basic, Visual C++, C#, and ASP+ are + integrated into a comprehensive development + environment. + + diff --git a/recipes/libxml2/all/test_package/conanfile.py b/recipes/libxml2/all/test_package/conanfile.py new file mode 100644 index 0000000..dc536a8 --- /dev/null +++ b/recipes/libxml2/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + xml_path = os.path.join(self.source_folder, "books.xml") + self.run(f"{bin_path} {xml_path}", env="conanrun") diff --git a/recipes/libxml2/all/test_package/test_package.c b/recipes/libxml2/all/test_package/test_package.c new file mode 100644 index 0000000..01dc455 --- /dev/null +++ b/recipes/libxml2/all/test_package/test_package.c @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include + +static void print_element_names(xmlNode *a_node) +{ + xmlNode *cur_node = NULL; + for (cur_node = a_node; cur_node; cur_node = cur_node->next) + { + if (cur_node->type == XML_ELEMENT_NODE) + { + printf("node type: Element, name: %s\n", cur_node->name); + } + print_element_names(cur_node->children); + } +} + +int main(int argc, char **argv) +{ + xmlDoc *doc = NULL; + xmlNode *root_element = NULL; + + if (argc != 2) + return (1); + + LIBXML_TEST_VERSION + + /*parse the file and get the DOM */ + doc = xmlReadFile(argv[1], NULL, 0); + + if (doc == NULL) + { + printf("error: could not parse file %s\n", argv[1]); + exit(-1); + } + + /*Get the root element node */ + root_element = xmlDocGetRootElement(doc); + print_element_names(root_element); + xmlFreeDoc(doc); // free document + xmlCleanupParser(); // Free globals + return 0; +} diff --git a/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000..1de7a7e --- /dev/null +++ b/recipes/libxml2/all/test_v1_cmake_module_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_cmake_module_package + ${CMAKE_CURRENT_BINARY_DIR}/test_cmake_module_package) diff --git a/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py b/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py new file mode 100644 index 0000000..ca3b4e2 --- /dev/null +++ b/recipes/libxml2/all/test_v1_cmake_module_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/libxml2/all/test_v1_package/CMakeLists.txt b/recipes/libxml2/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/recipes/libxml2/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/libxml2/all/test_v1_package/conanfile.py b/recipes/libxml2/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..ae0f76f --- /dev/null +++ b/recipes/libxml2/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + xml_path = os.path.join(self.source_folder, os.pardir, "test_package", "books.xml") + self.run(f"{bin_path} {xml_path}", run_environment=True) diff --git a/recipes/libxml2/config.yml b/recipes/libxml2/config.yml new file mode 100644 index 0000000..bf2c99b --- /dev/null +++ b/recipes/libxml2/config.yml @@ -0,0 +1,25 @@ +versions: + "2.13.4": + folder: all + "2.12.9": + folder: all + "2.12.4": + folder: all + "2.12.3": + folder: all + "2.11.9": + folder: all + "2.11.6": + folder: all + "2.11.4": + folder: all + "2.10.4": + folder: all + "2.10.3": + folder: all + "2.9.14": + folder: all + "2.9.12": + folder: all + "2.9.10": + folder: all diff --git a/recipes/md4c/all/conandata.yml b/recipes/md4c/all/conandata.yml new file mode 100644 index 0000000..8a963d9 --- /dev/null +++ b/recipes/md4c/all/conandata.yml @@ -0,0 +1,23 @@ +sources: + "0.5.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/mity/md4c/archive/refs/tags/release-0.5.2.tar.gz" + sha256: "55d0111d48fb11883aaee91465e642b8b640775a4d6993c2d0e7a8092758ef21" + "0.5.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/mity/md4c/archive/refs/tags/release-0.5.1.tar.gz" + sha256: "2dca17c6175a7f11182943079c2a4f9adb5071433e3d3d05ba801ff794993f34" + "0.4.8": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/mity/md4c/archive/refs/tags/release-0.4.8.tar.gz" + sha256: "4a457df853425b6bb6e3457aa1d1a13bccec587a04c38c622b1013a0da41439f" +patches: + "0.5.2": + - patch_file: "patches/0.5.2-0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" + patch_type: "conan" + "0.5.1": + - patch_file: "patches/0.5.1-0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" + patch_type: "conan" + "0.4.8": + - patch_file: "patches/0.4.8-0001-honor-vc-runtime.patch" + patch_description: "Honor msvc runtime from profile" + patch_type: "conan" diff --git a/recipes/md4c/all/conanfile.py b/recipes/md4c/all/conanfile.py new file mode 100644 index 0000000..4033350 --- /dev/null +++ b/recipes/md4c/all/conanfile.py @@ -0,0 +1,115 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir + +import os + +required_conan_version = ">=1.54.0" + + +class Md4cConan(ConanFile): + name = "md4c" + description = "C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification." + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mity/md4c" + topics = ("markdown-parser", "markdown") + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "md2html": [True, False], + "encoding": ["utf-8", "utf-16", "ascii"], + } + default_options = { + "shared": False, + "fPIC": True, + "md2html": True, + "encoding": "utf-8", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self, src_folder="src") + + def validate(self): + if self.settings.os != "Windows" and self.options.encoding == "utf-16": + raise ConanInvalidConfiguration(f"{self.ref} doesn't support utf-16 options on non-Windows platforms") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["BUILD_MD2HTML_EXECUTABLE"] = self.options.md2html + if self.options.encoding == "utf-8": + tc.preprocessor_definitions["MD4C_USE_UTF8"] = "1" + elif self.options.encoding == "utf-16": + tc.preprocessor_definitions["MD4C_USE_UTF16"] = "1" + elif self.options.encoding == "ascii": + tc.preprocessor_definitions["MD4C_USE_ASCII"] = "1" + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # Honor encoding option + replace_in_file( + self, + os.path.join(self.source_folder, "src", "CMakeLists.txt"), + "COMPILE_FLAGS \"-DMD4C_USE_UTF8\"", + "", + ) + + def build(self): + self._patch_sources() + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, pattern="LICENSE.md", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "share")) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "md4c") + + self.cpp_info.components["_md4c"].set_property("cmake_target_name", "md4c::md4c") + self.cpp_info.components["_md4c"].set_property("pkg_config_name", "md4c") + self.cpp_info.components["_md4c"].libs = ["md4c"] + if self.settings.os == "Windows" and self.options.encoding == "utf-16": + self.cpp_info.components["_md4c"].defines.append("MD4C_USE_UTF16") + + self.cpp_info.components["md4c_html"].set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.components["md4c_html"].set_property("pkg_config_name", "md4c-html") + self.cpp_info.components["md4c_html"].libs = ["md4c-html"] + self.cpp_info.components["md4c_html"].requires = ["_md4c"] + + # workaround so that global target & pkgconfig file have all components while avoiding + # to create unofficial target or pkgconfig file + self.cpp_info.set_property("cmake_target_name", "md4c::md4c-html") + self.cpp_info.set_property("pkg_config_name", "md4c-html") + + # TODO: to remove in conan v2 + self.cpp_info.components["_md4c"].names["cmake_find_package"] = "md4c" + self.cpp_info.components["_md4c"].names["cmake_find_package_multi"] = "md4c" + self.cpp_info.components["md4c_html"].names["cmake_find_package"] = "md4c-html" + self.cpp_info.components["md4c_html"].names["cmake_find_package_multi"] = "md4c-html" + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch new file mode 100644 index 0000000..a20b07a --- /dev/null +++ b/recipes/md4c/all/patches/0.4.8-0001-honor-vc-runtime.patch @@ -0,0 +1,18 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,15 +42,6 @@ elseif(MSVC) + # Disable warnings about the so-called unsecured functions: + add_definitions(/D_CRT_SECURE_NO_WARNINGS) + +- # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch new file mode 100644 index 0000000..a6ad624 --- /dev/null +++ b/recipes/md4c/all/patches/0.5.1-0001-honor-vc-runtime.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be781e5..c60da0a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -46,15 +46,15 @@ elseif(MSVC) + # Disable warnings about the so-called unsecured functions: + add_definitions(/D_CRT_SECURE_NO_WARNINGS /W3) + +- # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") ++# # Specify proper C runtime library: ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") ++# string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") ++# set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") ++# set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") ++# set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") ++# set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch b/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch new file mode 100644 index 0000000..5e8fb99 --- /dev/null +++ b/recipes/md4c/all/patches/0.5.2-0001-honor-vc-runtime.patch @@ -0,0 +1,27 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index aec8293..f24e654 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -53,14 +53,14 @@ elseif(MSVC) + add_compile_options(/W3) + + # Specify proper C runtime library: +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") +- string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") +- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") +- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") +- set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_RELWITHDEBINFO "{$CMAKE_C_FLAGS_RELWITHDEBINFO}") ++ # string(REGEX REPLACE "/M[DT]d?" "" CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}") ++ # set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") ++ # set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} /MT") ++ # set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELEASE} /MT") + endif() + + include(GNUInstallDirs) diff --git a/recipes/md4c/all/test_package/CMakeLists.txt b/recipes/md4c/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..afe8788 --- /dev/null +++ b/recipes/md4c/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(md4c CONFIG REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(test_package PRIVATE md4c::md4c) diff --git a/recipes/md4c/all/test_package/CMakeUserPresets.json b/recipes/md4c/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/md4c/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/md4c/all/test_package/conanfile.py b/recipes/md4c/all/test_package/conanfile.py new file mode 100644 index 0000000..a9fb966 --- /dev/null +++ b/recipes/md4c/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/md4c/all/test_package/test_package.c b/recipes/md4c/all/test_package/test_package.c new file mode 100644 index 0000000..0bea1fd --- /dev/null +++ b/recipes/md4c/all/test_package/test_package.c @@ -0,0 +1,57 @@ +#include "md4c.h" + +#include +#include + +int enter_block(MD_BLOCKTYPE type, void* detail, void* userdata) { + printf("enter block\n"); + return 0; +} + +int leave_block(MD_BLOCKTYPE type, void* detail, void* userdata) { + printf("leave block\n"); + return 0; +} + +int enter_span(MD_SPANTYPE type, void* detail, void* userdata) { + printf("enter span\n"); + return 0; +} + +int leave_span(MD_SPANTYPE type, void* detail, void* userdata) { + printf("leave span\n"); + return 0; +} + +int text_block(MD_TEXTTYPE type, const MD_CHAR* text, MD_SIZE size, void* usrdata) { + printf("text block\n"); + return 0; +} + +int main() { + const char DATA[] = + "# title\n" + "\n" + "example1\n" + "`example2`\n" + "\n" + "> example3\n" + "\n" + ; + + printf("%s\n", DATA); + + MD_PARSER parser; + + parser.abi_version = 0; + parser.flags = MD_FLAG_TABLES; + parser.enter_block = enter_block; + parser.leave_block = leave_block; + parser.enter_span = enter_span; + parser.leave_span = leave_span; + parser.text = text_block; + + md_parse(DATA, strlen(DATA), &parser, NULL); + + return 0; +} diff --git a/recipes/md4c/config.yml b/recipes/md4c/config.yml new file mode 100644 index 0000000..684aad3 --- /dev/null +++ b/recipes/md4c/config.yml @@ -0,0 +1,7 @@ +versions: + "0.5.2": + folder: all + "0.5.1": + folder: all + "0.4.8": + folder: all diff --git a/recipes/odbc/all/conandata.yml b/recipes/odbc/all/conandata.yml new file mode 100644 index 0000000..2387171 --- /dev/null +++ b/recipes/odbc/all/conandata.yml @@ -0,0 +1,18 @@ +sources: + "2.3.11": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-unixodbc_org/unixODBC-2.3.11.tar.gz" + sha256: "d9e55c8e7118347e3c66c87338856dad1516b490fb7c756c1562a2c267c73b5c" + "2.3.9": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-unixodbc_org/unixODBC-2.3.9.tar.gz" + sha256: "52833eac3d681c8b0c9a5a65f2ebd745b3a964f208fc748f977e44015a31b207" + "2.3.7": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-unixodbc_org/unixODBC-2.3.7.tar.gz" + sha256: "45f169ba1f454a72b8fcbb82abd832630a3bf93baa84731cf2949f449e1e3e77" +patches: + "2.3.11": + - patch_file: "patches/0001-duplicated-get-connection.patch" + "2.3.9": + - patch_file: "patches/0001-duplicated-get-connection.patch" + "2.3.7": + - patch_file: "patches/0001-duplicated-get-connection.patch" + - patch_file: "patches/0002-missing-declarations.patch" diff --git a/recipes/odbc/all/conanfile.py b/recipes/odbc/all/conanfile.py new file mode 100644 index 0000000..8b05f57 --- /dev/null +++ b/recipes/odbc/all/conanfile.py @@ -0,0 +1,149 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rm, rmdir +from conan.tools.gnu import Autotools, AutotoolsToolchain +from conan.tools.layout import basic_layout +import os + +required_conan_version = ">=1.53.0" + + +class OdbcConan(ConanFile): + name = "odbc" + package_type = "library" + description = "Package providing unixODBC" + topics = ("odbc", "database", "dbms", "data-access") + url = "https://github.com/conan-io/conan-center-index" + homepage = "http://www.unixodbc.org" + license = ("LGPL-2.1", "GPL-2.1") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libiconv": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libiconv": True, + } + + def export_sources(self): + export_conandata_patches(self) + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + #self.requires("libtool/2.4.7") + if self.options.with_libiconv: + self.requires("libiconv/1.17") + + def validate(self): + if self.settings.os == "Windows": + raise ConanInvalidConfiguration("odbc is a system lib on Windows") + +# def build_requirements(self): +# self.tool_requires("gnu-config/cci.20210814") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = AutotoolsToolchain(self) + yes_no = lambda v: "yes" if v else "no" + #libtool_cppinfo = self.dependencies["libtool"].cpp_info.aggregated_components() + tc.configure_args.extend([ + #"--without-included-ltdl", + #f"--with-ltdl-include={libtool_cppinfo.includedirs[0]}", + #f"--with-ltdl-lib={libtool_cppinfo.libdirs[0]}", + #"--disable-ltdl-install", + f"--enable-iconv={yes_no(self.options.with_libiconv)}", + "--sysconfdir=/etc", + ]) + if self.options.with_libiconv: + libiconv_prefix = self.dependencies["libiconv"].package_folder + tc.configure_args.append(f"--with-libiconv-prefix={libiconv_prefix}") + tc.generate() + + def _patch_sources(self): + apply_conandata_patches(self) + # support more triplets + for gnu_config in [ + self.conf.get("user.gnu-config:config_guess", check_type=str), + self.conf.get("user.gnu-config:config_sub", check_type=str), + ]: + if gnu_config: + copy(self, os.path.basename(gnu_config), src=os.path.dirname(gnu_config), dst=self.source_folder) + # allow external libtdl (in libtool recipe) + replace_in_file( + self, + os.path.join(self.source_folder, "configure"), + "if test -f \"$with_ltdl_lib/libltdl.la\";", + "if true;", + ) + #libtool_system_libs = self.dependencies["libtool"].cpp_info.aggregated_components().system_libs + #if libtool_system_libs: + # replace_in_file( + # self, + # os.path.join(self.source_folder, "configure"), + # "-L$with_ltdl_lib -lltdl", + # "-L$with_ltdl_lib -lltdl -l{}".format(" -l".join(libtool_system_libs)), + # ) + + def build(self): + self._patch_sources() + autotools = Autotools(self) + autotools.configure() + autotools.make() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + autotools = Autotools(self) + autotools.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "etc")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rm(self, "*.la", os.path.join(self.package_folder, "lib")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "ODBC") + self.cpp_info.set_property("cmake_target_name", "ODBC::ODBC") + # to avoid conflict with pkgconfig file of _odbc component + self.cpp_info.set_property("pkg_config_name", "odbc_full_package") + + self.cpp_info.names["cmake_find_package"] = "ODBC" + self.cpp_info.names["cmake_find_package_multi"] = "ODBC" + + # odbc + self.cpp_info.components["_odbc"].set_property("pkg_config_name", "odbc") + self.cpp_info.components["_odbc"].libs = ["odbc"] + #self.cpp_info.components["_odbc"].requires = ["libtool::libtool"] + if self.options.with_libiconv: + self.cpp_info.components["_odbc"].requires.append("libiconv::libiconv") + + # odbcinst + self.cpp_info.components["odbcinst"].set_property("pkg_config_name", "odbcinst") + self.cpp_info.components["odbcinst"].libs = ["odbcinst"] + #self.cpp_info.components["odbcinst"].requires = ["libtool::libtool"] + + # odbccr + self.cpp_info.components["odbccr"].set_property("pkg_config_name", "odbccr") + self.cpp_info.components["odbccr"].libs = ["odbccr"] + + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["_odbc"].system_libs = ["pthread"] + self.cpp_info.components["odbcinst"].system_libs = ["pthread"] + + # TODO: to remove in conan v2 + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) diff --git a/recipes/odbc/all/patches/0001-duplicated-get-connection.patch b/recipes/odbc/all/patches/0001-duplicated-get-connection.patch new file mode 100644 index 0000000..4357214 --- /dev/null +++ b/recipes/odbc/all/patches/0001-duplicated-get-connection.patch @@ -0,0 +1,11 @@ +--- a/cur/SQLGetDiagRec.c ++++ b/cur/SQLGetDiagRec.c +@@ -101,8 +101,4 @@ SQLRETURN CLGetDiagRec( SQLSMALLINT handle_type, + text_length_ptr); + } + +-DMHDBC __get_connection( EHEAD * head ) +-{ +- return 0; +-} + diff --git a/recipes/odbc/all/patches/0002-missing-declarations.patch b/recipes/odbc/all/patches/0002-missing-declarations.patch new file mode 100644 index 0000000..f6bac91 --- /dev/null +++ b/recipes/odbc/all/patches/0002-missing-declarations.patch @@ -0,0 +1,53 @@ +--- a/DriverManager/SQLError.c ++++ b/DriverManager/SQLError.c +@@ -184,7 +184,7 @@ + + static char const rcsid[]= "$RCSfile: SQLError.c,v $ $Revision: 1.11 $"; + +-static SQLRETURN extract_sql_error( EHEAD *head, ++static SQLRETURN cci_extract_sql_error( EHEAD *head, + SQLCHAR *sqlstate, + SQLINTEGER *native_error, + SQLCHAR *message_text, +@@ -440,7 +440,7 @@ SQLRETURN SQLError( SQLHENV environment_handle, + herror->ret_code_deferred = 0; + } + +- ret = extract_sql_error( herror, ++ ret = cci_extract_sql_error( herror, + sqlstate, + native_error, + message_text, +--- a/DriverManager/SQLErrorW.c ++++ b/DriverManager/SQLErrorW.c +@@ -173,7 +173,7 @@ SQLRETURN extract_parent_handle_err( int handle_type, + * unicode mapping function + */ + +-static SQLRETURN extract_sql_error_w( EHEAD *head, ++static SQLRETURN cci_extract_sql_error_w( EHEAD *head, + SQLWCHAR *sqlstate, + SQLINTEGER *native_error, + SQLWCHAR *message_text, +@@ -391,7 +391,7 @@ SQLRETURN SQLErrorW( SQLHENV environment_handle, + herror->ret_code_deferred = 0; + } + +- ret = extract_sql_error_w( herror, ++ ret = cci_extract_sql_error_w( herror, + sqlstate, + native_error, + message_text, +--- a/DriverManager/drivermanager.h ++++ b/DriverManager/drivermanager.h +@@ -707,6 +707,10 @@ int function_return_ex( int level, void * handle, int ret_code, int save_to_diag + void function_entry( void *handle ); + void setup_error_head( EHEAD *error_header, void *handle, int handle_type ); + void clear_error_head( EHEAD *error_header ); ++void extract_diag_error( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ); ++void extract_sql_error( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ); ++void extract_diag_error_w( int htype, DRV_SQLHANDLE handle, DMHDBC connection, EHEAD *head, int return_code, int save_to_diag ); ++void extract_sql_error_w( DRV_SQLHANDLE henv, DRV_SQLHANDLE hdbc, DRV_SQLHANDLE hstmt, DMHDBC connection, EHEAD *head, int return_code ); + SQLWCHAR *ansi_to_unicode_copy( SQLWCHAR * dest, char *src, SQLINTEGER buffer_len, DMHDBC connection, int *wlen ); + SQLWCHAR *ansi_to_unicode_alloc( SQLCHAR *str, SQLINTEGER len, DMHDBC connection, int *wlen ); + char *unicode_to_ansi_copy( char* dest, int dest_len, SQLWCHAR *src, SQLINTEGER len, DMHDBC connection, int *clen ); diff --git a/recipes/odbc/all/test_package/CMakeLists.txt b/recipes/odbc/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..7079bef --- /dev/null +++ b/recipes/odbc/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(ODBC REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE ODBC::ODBC) diff --git a/recipes/odbc/all/test_package/CMakeUserPresets.json b/recipes/odbc/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/odbc/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/odbc/all/test_package/conanfile.py b/recipes/odbc/all/test_package/conanfile.py new file mode 100644 index 0000000..a0bef6b --- /dev/null +++ b/recipes/odbc/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=True) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + self.run("odbcinst --version", env="conanrun") diff --git a/recipes/odbc/all/test_package/test_package.c b/recipes/odbc/all/test_package/test_package.c new file mode 100644 index 0000000..14079f2 --- /dev/null +++ b/recipes/odbc/all/test_package/test_package.c @@ -0,0 +1,17 @@ +#include +#include + +#include + +int main() { + printf("Type of SQL_CHAR is %i\n", SQL_CHAR); + return 0; +} + +SQLRETURN driver_connect() { + SQLHDBC dbc; + SQLCHAR *connect_string = (unsigned char *)"DSN=mydsn;"; + + return SQLDriverConnect(dbc, NULL, connect_string, SQL_NTS, + NULL, 0, NULL, SQL_DRIVER_COMPLETE); +} diff --git a/recipes/odbc/config.yml b/recipes/odbc/config.yml new file mode 100644 index 0000000..2237b57 --- /dev/null +++ b/recipes/odbc/config.yml @@ -0,0 +1,7 @@ +versions: + "2.3.11": + folder: all + "2.3.9": + folder: all + "2.3.7": + folder: all diff --git a/recipes/openal-soft/all/conandata.yml b/recipes/openal-soft/all/conandata.yml new file mode 100644 index 0000000..0b5af1f --- /dev/null +++ b/recipes/openal-soft/all/conandata.yml @@ -0,0 +1,12 @@ +sources: + "1.23.1": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1.tar.bz2" + sha256: "796f4b89134c4e57270b7f0d755f0fa3435b90da437b745160a49bd41c845b21" + "1.22.2": + url: "https://nexus.avroid.tech/repository/devops-raw-proxy-github/kcat/openal-soft/releases/download/1.22.2/openal-soft-1.22.2.tar.bz2" + sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20" +patches: + "1.22.2": + - patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch" + patch_source: "https://github.com/kcat/openal-soft/commit/650a6d49e9a511d005171940761f6dd6b440ee66" + - patch_file: "patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch" diff --git a/recipes/openal-soft/all/conanfile.py b/recipes/openal-soft/all/conanfile.py new file mode 100644 index 0000000..885d854 --- /dev/null +++ b/recipes/openal-soft/all/conanfile.py @@ -0,0 +1,158 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os +from conan.tools.build import check_min_cppstd, stdcpp_library +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, collect_libs, export_conandata_patches, copy, get, rmdir, save +from conan.tools.scm import Version +import os +import textwrap + +required_conan_version = ">=1.54.0" + + +class OpenALSoftConan(ConanFile): + name = "openal-soft" + description = "OpenAL Soft is a software implementation of the OpenAL 3D audio API." + topics = ("openal", "audio", "api") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://openal-soft.org/" + license = "LGPL-2.0-or-later" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + @property + def _min_cppstd(self): + return 14 + + @property + def _minimum_compilers_version(self): + return { + "Visual Studio": "15", + "msvc": "191", + "gcc": "6", + "clang": "5", + } + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + # OpenAL's API is pure C, thus the c++ standard does not matter + # Because the backend is C++, the C++ STL matters + self.settings.rm_safe("compiler.cppstd") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + if self.settings.os == "Linux": + self.requires("libalsa/1.2.10") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, self._min_cppstd) + + compiler = self.settings.compiler + + minimum_version = self._minimum_compilers_version.get(str(compiler), False) + if minimum_version and Version(compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.", + ) + + if compiler == "clang" and Version(compiler.version) < "9" and \ + compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"): + raise ConanInvalidConfiguration( + f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime", + ) + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["LIBTYPE"] = "SHARED" if self.options.shared else "STATIC" + tc.variables["ALSOFT_UTILS"] = False + tc.variables["ALSOFT_EXAMPLES"] = False + tc.variables["ALSOFT_TESTS"] = False + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_SoundIO"] = True + tc.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + self._create_cmake_module_variables( + os.path.join(self.package_folder, self._module_file_rel_path) + ) + + def _create_cmake_module_variables(self, module_file): + content = textwrap.dedent(f"""\ + set(OPENAL_FOUND TRUE) + if(DEFINED OpenAL_INCLUDE_DIR) + set(OPENAL_INCLUDE_DIR ${{OpenAL_INCLUDE_DIR}}) + endif() + if(DEFINED OpenAL_LIBRARIES) + set(OPENAL_LIBRARY ${{OpenAL_LIBRARIES}}) + endif() + set(OPENAL_VERSION_STRING {self.version}) + """) + save(self, module_file, content) + + @property + def _module_file_rel_path(self): + return os.path.join("lib", "cmake", f"conan-official-{self.name}-variables.cmake") + + def package_info(self): + self.cpp_info.set_property("cmake_find_mode", "both") + self.cpp_info.set_property("cmake_file_name", "OpenAL") + self.cpp_info.set_property("cmake_target_name", "OpenAL::OpenAL") + self.cpp_info.set_property("cmake_build_modules", [self._module_file_rel_path]) + self.cpp_info.set_property("pkg_config_name", "openal") + + self.cpp_info.names["cmake_find_package"] = "OpenAL" + self.cpp_info.names["cmake_find_package_multi"] = "OpenAL" + self.cpp_info.build_modules["cmake_find_package"] = [self._module_file_rel_path] + + self.cpp_info.libs = collect_libs(self) + self.cpp_info.includedirs.append(os.path.join("include", "AL")) + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.system_libs.extend(["dl", "m"]) + elif is_apple_os(self): + self.cpp_info.frameworks.extend(["AudioToolbox", "AudioUnit", "CoreAudio", "CoreFoundation"]) + if self.settings.os == "Macos": + self.cpp_info.frameworks.append("ApplicationServices") + elif self.settings.os == "Windows": + self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "user32"]) + if not self.options.shared: + libcxx = stdcpp_library(self) + if libcxx: + self.cpp_info.system_libs.append(libcxx) + if not self.options.shared: + self.cpp_info.defines.append("AL_LIBTYPE_STATIC") + if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]: + self.cpp_info.system_libs.append("atomic") diff --git a/recipes/openal-soft/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch b/recipes/openal-soft/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch new file mode 100644 index 0000000..6e0e4aa --- /dev/null +++ b/recipes/openal-soft/all/patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch @@ -0,0 +1,47 @@ +From 650a6d49e9a511d005171940761f6dd6b440ee66 Mon Sep 17 00:00:00 2001 +From: Chris Robinson +Date: Mon, 18 Jul 2022 11:10:27 -0700 +Subject: [PATCH] Declare variables closer to where they're used + +--- + alc/backends/alsa.cpp | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp +index 9c78b6c6a..b6efeaba1 100644 +--- a/alc/backends/alsa.cpp ++++ b/alc/backends/alsa.cpp +@@ -623,7 +623,6 @@ int AlsaPlayback::mixerNoMMapProc() + + void AlsaPlayback::open(const char *name) + { +- al::optional driveropt; + const char *driver{"default"}; + if(name) + { +@@ -640,7 +639,7 @@ void AlsaPlayback::open(const char *name) + else + { + name = alsaDevice; +- if(bool{driveropt = ConfigValueStr(nullptr, "alsa", "device")}) ++ if(auto driveropt = ConfigValueStr(nullptr, "alsa", "device")) + driver = driveropt->c_str(); + } + TRACE("Opening device \"%s\"\n", driver); +@@ -896,7 +895,6 @@ AlsaCapture::~AlsaCapture() + + void AlsaCapture::open(const char *name) + { +- al::optional driveropt; + const char *driver{"default"}; + if(name) + { +@@ -913,7 +911,7 @@ void AlsaCapture::open(const char *name) + else + { + name = alsaDevice; +- if(bool{driveropt = ConfigValueStr(nullptr, "alsa", "capture")}) ++ if(auto driveropt = ConfigValueStr(nullptr, "alsa", "capture")) + driver = driveropt->c_str(); + } + diff --git a/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch b/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch new file mode 100644 index 0000000..ff97aae --- /dev/null +++ b/recipes/openal-soft/all/patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1984ac9..75e904d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1051,8 +1051,8 @@ if(PULSEAUDIO_FOUND) + set(HAVE_PULSEAUDIO 1) + set(BACKENDS "${BACKENDS} PulseAudio${IS_LINKED},") + set(ALC_OBJS ${ALC_OBJS} alc/backends/pulseaudio.cpp alc/backends/pulseaudio.h) +- add_backend_libs(${PULSEAUDIO_LIBRARIES}) +- set(INC_PATHS ${INC_PATHS} ${PULSEAUDIO_INCLUDE_DIRS}) ++ add_backend_libs(${PULSEAUDIO_LIBRARY}) ++ set(INC_PATHS ${INC_PATHS} ${PULSEAUDIO_INCLUDE_DIR}) + endif() + endif() + if(ALSOFT_REQUIRE_PULSEAUDIO AND NOT HAVE_PULSEAUDIO) diff --git a/recipes/openal-soft/all/test_package/CMakeLists.txt b/recipes/openal-soft/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..6822e99 --- /dev/null +++ b/recipes/openal-soft/all/test_package/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES C) + +find_package(OpenAL REQUIRED) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenAL::OpenAL) + +# Test whether variables from https://cmake.org/cmake/help/latest/module/FindOpenAL.html are properly defined +set(_custom_vars + OPENAL_FOUND + OPENAL_INCLUDE_DIR + OPENAL_LIBRARY + OPENAL_VERSION_STRING +) +foreach(_custom_var ${_custom_vars}) + if(DEFINED ${_custom_var}) + message(STATUS "${_custom_var}: ${${_custom_var}}") + else() + message(FATAL_ERROR "${_custom_var} not defined") + endif() +endforeach() diff --git a/recipes/openal-soft/all/test_package/CMakeUserPresets.json b/recipes/openal-soft/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/openal-soft/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/openal-soft/all/test_package/conanfile.py b/recipes/openal-soft/all/test_package/conanfile.py new file mode 100644 index 0000000..0a6bc68 --- /dev/null +++ b/recipes/openal-soft/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/openal-soft/all/test_package/test_package.c b/recipes/openal-soft/all/test_package/test_package.c new file mode 100644 index 0000000..23fe4c1 --- /dev/null +++ b/recipes/openal-soft/all/test_package/test_package.c @@ -0,0 +1,134 @@ +#include "alc.h" +#include "al.h" +#include "alext.h" + +#include +#include + +static ALenum checkALErrors(int linenum) +{ + ALenum err = alGetError(); + if(err != AL_NO_ERROR) + printf("OpenAL Error: %s (0x%x), @ %d\n", alGetString(err), err, linenum); + return err; +} +#define checkALErrors() checkALErrors(__LINE__) + +static ALCenum checkALCErrors(ALCdevice *device, int linenum) +{ + ALCenum err = alcGetError(device); + if(err != ALC_NO_ERROR) + printf("ALC Error: %s (0x%x), @ %d\n", alcGetString(device, err), err, linenum); + return err; +} +#define checkALCErrors(x) checkALCErrors((x),__LINE__) + +#define MAX_WIDTH 80 + +static void printList(const char *list, char separator) +{ + size_t col = MAX_WIDTH, len; + const char *indent = " "; + const char *next; + + if(!list || *list == '\0') + { + fprintf(stdout, "\n%s!!! none !!!\n", indent); + return; + } + + do { + next = strchr(list, separator); + if(next) + { + len = next-list; + do { + next++; + } while(*next == separator); + } + else + len = strlen(list); + + if(len + col + 2 >= MAX_WIDTH) + { + fprintf(stdout, "\n%s", indent); + col = strlen(indent); + } + else + { + fputc(' ', stdout); + col++; + } + + len = fwrite(list, 1, len, stdout); + col += len; + + if(!next || *next == '\0') + break; + fputc(',', stdout); + col++; + + list = next; + } while(1); + fputc('\n', stdout); +} + +static void printALCInfo(ALCdevice *device) +{ + ALCint major, minor; + + if(device) + { + const ALCchar *devname = NULL; + printf("\n"); + if(alcIsExtensionPresent(device, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE) + devname = alcGetString(device, ALC_ALL_DEVICES_SPECIFIER); + if(checkALCErrors(device) != ALC_NO_ERROR || !devname) + devname = alcGetString(device, ALC_DEVICE_SPECIFIER); + printf("** Info for device \"%s\" **\n", devname); + } + alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major); + alcGetIntegerv(device, ALC_MINOR_VERSION, 1, &minor); + if(checkALCErrors(device) == ALC_NO_ERROR) + printf("ALC version: %d.%d\n", major, minor); + if(device) + { + printf("ALC extensions:"); + printList(alcGetString(device, ALC_EXTENSIONS), ' '); + checkALCErrors(device); + } +} + +static void printDeviceList(const char *list) +{ + if(!list || *list == '\0') + printf(" !!! none !!!\n"); + else do { + printf(" %s\n", list); + list += strlen(list) + 1; + } while(*list != '\0'); +} + +int main(int argc, char **argv) +{ + printf("Available playback devices:\n"); + if(alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE) + printDeviceList(alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER)); + else + printDeviceList(alcGetString(NULL, ALC_DEVICE_SPECIFIER)); + printf("Available capture devices:\n"); + printDeviceList(alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER)); + + if(alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE) + printf("Default playback device: %s\n", + alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER)); + else + printf("Default playback device: %s\n", + alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER)); + printf("Default capture device: %s\n", + alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER)); + + printALCInfo(NULL); + + return 0; +} diff --git a/recipes/openal-soft/config.yml b/recipes/openal-soft/config.yml new file mode 100644 index 0000000..a3a476f --- /dev/null +++ b/recipes/openal-soft/config.yml @@ -0,0 +1,5 @@ +versions: + "1.23.1": + folder: all + "1.22.2": + folder: all diff --git a/recipes/opengl/all/conanfile.py b/recipes/opengl/all/conanfile.py new file mode 100644 index 0000000..ca99bba --- /dev/null +++ b/recipes/opengl/all/conanfile.py @@ -0,0 +1,68 @@ +from conan import ConanFile +from conan.tools.system import package_manager +from conan.tools.gnu import PkgConfig + +required_conan_version = ">=1.50.0" + + +class SysConfigOpenGLConan(ConanFile): + name = "opengl" + version = "system" + description = "cross-platform virtual conan package for the OpenGL support" + topics = ("opengl", "gl") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.opengl.org/" + license = "MIT" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def package_id(self): + self.info.clear() + + def system_requirements(self): + if self.settings.os not in ["Linux", "FreeBSD", "SunOS"]: + return + + dnf = package_manager.Dnf(self) + dnf.install_substitutes(["libglvnd-devel"], ["mesa-libGL-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libGL-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install_substitutes(["libgl-dev"], ["libgl1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["libglvnd"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install_substitutes(["Mesa-libGL-devel", "glproto-devel"], + ["Mesa-libGL-devel", "xorgproto-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libglvnd"], update=True, check=True) + + pkg_util = package_manager.PkgUtil(self) + pkg_util.install(["mesalibs"], update=True, check=True) + + def package_info(self): + # TODO: Workaround for #2311 until a better solution can be found + self.cpp_info.filenames["cmake_find_package"] = "opengl_system" + self.cpp_info.filenames["cmake_find_package_multi"] = "opengl_system" + + self.cpp_info.set_property("cmake_file_name", "opengl_system") + + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + if self.settings.os == "Macos": + self.cpp_info.defines.append("GL_SILENCE_DEPRECATION=1") + self.cpp_info.frameworks.append("OpenGL") + elif self.settings.os == "Windows": + self.cpp_info.system_libs = ["opengl32"] + elif self.settings.os in ["Linux", "FreeBSD", "SunOS"]: + pkg_config = PkgConfig(self, 'gl') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt b/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000..9c1b23a --- /dev/null +++ b/recipes/opengl/all/test_cmake_module_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package) + +find_package(OpenGL REQUIRED) + +set(SOURCES ../test_package/test_package.cpp) + +if(WIN32) + list(APPEND SOURCES ../test_package/win.cpp) +endif() + +if(APPLE) + list(APPEND SOURCES ../test_package/osx.mm) + set_source_files_properties(../test_package/osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") + + list(APPEND PLATFORM_LIBS "objc") + + find_library(APPKIT_LIBRARY AppKit) + find_library(FOUNDATION_LIBRARY Foundation) + + if(APPKIT_LIBRARY) + list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) + endif() + + if(FOUNDATION_LIBRARY) + list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) + endif() +endif() + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_cmake_module_package/conanfile.py b/recipes/opengl/all/test_cmake_module_package/conanfile.py new file mode 100644 index 0000000..3a91c94 --- /dev/null +++ b/recipes/opengl/all/test_cmake_module_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opengl/all/test_package/CMakeLists.txt b/recipes/opengl/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..cedabff --- /dev/null +++ b/recipes/opengl/all/test_package/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10) +project(test_package) + +find_package(opengl_system REQUIRED CONFIG) + +set(SOURCES test_package.cpp) + +if(WIN32) + list(APPEND SOURCES win.cpp) +endif() + +if(APPLE) + list(APPEND SOURCES osx.mm) + set_source_files_properties(osx.mm PROPERTIES COMPILE_FLAGS "-x objective-c++") + + list(APPEND PLATFORM_LIBS "objc") + + find_library(APPKIT_LIBRARY AppKit) + find_library(FOUNDATION_LIBRARY Foundation) + + if(APPKIT_LIBRARY) + list(APPEND PLATFORM_LIBS ${APPKIT_LIBRARY}) + endif() + + if(FOUNDATION_LIBRARY) + list(APPEND PLATFORM_LIBS ${FOUNDATION_LIBRARY}) + endif() +endif() + +add_executable(${PROJECT_NAME} ${SOURCES}) +target_link_libraries(${PROJECT_NAME} PRIVATE opengl::opengl ${PLATFORM_LIBS}) diff --git a/recipes/opengl/all/test_package/CMakeUserPresets.json b/recipes/opengl/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..6045161 --- /dev/null +++ b/recipes/opengl/all/test_package/CMakeUserPresets.json @@ -0,0 +1,10 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json", + "build/gcc-11.5-x86_64-17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/opengl/all/test_package/conanfile.py b/recipes/opengl/all/test_package/conanfile.py new file mode 100644 index 0000000..3a91c94 --- /dev/null +++ b/recipes/opengl/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/opengl/all/test_package/osx.mm b/recipes/opengl/all/test_package/osx.mm new file mode 100644 index 0000000..256e570 --- /dev/null +++ b/recipes/opengl/all/test_package/osx.mm @@ -0,0 +1,31 @@ +#include "TargetConditionals.h" + +#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE +#else +#import +#import +#endif + +bool init_context() +{ +#if TARGET_OS_TV || TARGET_OS_WATCH || TARGET_OS_IPHONE + return true; +#else + NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = + { + NSOpenGLPFAColorSize, 24, + NSOpenGLPFAAlphaSize, 8, + NSOpenGLPFADoubleBuffer, + 0 + }; + NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; + if (!pixelFormat) + return false; + + NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil]; + if (!context) + return false; + [context makeCurrentContext]; + return true; +#endif +} diff --git a/recipes/opengl/all/test_package/test_package.cpp b/recipes/opengl/all/test_package/test_package.cpp new file mode 100644 index 0000000..201c2a3 --- /dev/null +++ b/recipes/opengl/all/test_package/test_package.cpp @@ -0,0 +1,47 @@ +#include + +#ifdef __APPLE__ + +#include + +#else + +#ifdef _WIN32 +#include +#endif + +#if defined(__linux__) or defined(__FreeBSD__) + +bool init_context() { return true; } + +#endif + +#include + +#endif + +bool init_context(); + +int main() +{ + if (!init_context()) + { + // std::cerr << "failed to initialize OpenGL context!" << std::endl; + // return -1; + + // Don't fail if we can't init the context - won't work on a headless CI + // Instead, if we made it this far, then we were able to #include and link, + // count that as a success! + std::cout << "Linked test, but failed to initialize OpenGL context (headless platform?)" << std::endl; + return 0; + } + const char * gl_vendor = (const char *) glGetString(GL_VENDOR); + const char * gl_renderer = (const char *) glGetString(GL_RENDERER); + const char * gl_version = (const char *) glGetString(GL_VERSION); + const char * gl_extensions = (const char *) glGetString(GL_EXTENSIONS); + std::cout << "GL_VENDOR: " << (gl_vendor ? gl_vendor : "(null)") << std::endl; + std::cout << "GL_RENDERER: " << (gl_renderer ? gl_renderer : "(null)") << std::endl; + std::cout << "GL_VERSION: " << (gl_version ? gl_version : "(null)") << std::endl; + std::cout << "GL_EXTENSIONS: " << (gl_extensions ? gl_extensions : "(null)") << std::endl; + return 0; +} diff --git a/recipes/opengl/all/test_package/win.cpp b/recipes/opengl/all/test_package/win.cpp new file mode 100644 index 0000000..7b95bab --- /dev/null +++ b/recipes/opengl/all/test_package/win.cpp @@ -0,0 +1,58 @@ +#include + +static LRESULT CALLBACK WndProc(HWND hwnd, + UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT res = 1; + switch (uMsg) + { + case WM_DESTROY: + ::PostQuitMessage (0); + break; + default: + res = ::DefWindowProc(hwnd, uMsg, wParam, lParam); + } + return res; +} + +bool init_context() +{ + static const wchar_t * class_name = L"ConanOpenGL"; + static const wchar_t * window_name = L"Conan OpenGL"; + WNDCLASSEXW wc = {0}; + wc.cbSize = sizeof(WNDCLASSEXW); + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = WndProc; + wc.hInstance = ::GetModuleHandle(NULL); + wc.hIcon = ::LoadIcon(0, IDI_APPLICATION); + wc.hCursor = ::LoadCursor(0, IDC_ARROW); + wc.hbrBackground = (HBRUSH) ::GetStockObject(WHITE_BRUSH); + wc.lpszClassName = class_name; + if (!::RegisterClassExW(&wc)) + return false; + HWND hWnd = ::CreateWindowExW(0, class_name, window_name, + WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, wc.hInstance, NULL); + if (!hWnd) + return false; + HDC hDC = ::GetDC(hWnd); + if (!hDC) + return false; + PIXELFORMATDESCRIPTOR pfd = {0}; + pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.dwLayerMask = PFD_MAIN_PLANE; + pfd.cColorBits = 32; + pfd.cDepthBits = 16; + int pixel_format = ::ChoosePixelFormat(hDC, &pfd); + if(0 == pixel_format) + return false; + if (!::SetPixelFormat(hDC, pixel_format, &pfd)) + return false; + HGLRC hGLRC = ::wglCreateContext(hDC); + if (!hGLRC) + return false; + ::wglMakeCurrent(hDC, hGLRC); + return true; +} diff --git a/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt b/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt new file mode 100644 index 0000000..1de7a7e --- /dev/null +++ b/recipes/opengl/all/test_v1_cmake_module_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_cmake_module_package + ${CMAKE_CURRENT_BINARY_DIR}/test_cmake_module_package) diff --git a/recipes/opengl/all/test_v1_cmake_module_package/conanfile.py b/recipes/opengl/all/test_v1_cmake_module_package/conanfile.py new file mode 100644 index 0000000..19e6a0c --- /dev/null +++ b/recipes/opengl/all/test_v1_cmake_module_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/opengl/all/test_v1_package/CMakeLists.txt b/recipes/opengl/all/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..0d20897 --- /dev/null +++ b/recipes/opengl/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/opengl/all/test_v1_package/conanfile.py b/recipes/opengl/all/test_v1_package/conanfile.py new file mode 100644 index 0000000..38f4483 --- /dev/null +++ b/recipes/opengl/all/test_v1_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not tools.cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/opengl/config.yml b/recipes/opengl/config.yml new file mode 100644 index 0000000..0594dfd --- /dev/null +++ b/recipes/opengl/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: all diff --git a/recipes/qt/5.x.x/conandata.yml b/recipes/qt/5.x.x/conandata.yml new file mode 100644 index 0000000..65ef3c2 --- /dev/null +++ b/recipes/qt/5.x.x/conandata.yml @@ -0,0 +1,48 @@ +sources: + "5.15.16": + url: + - "https://nexus.avroid.tech/repository/all-raw-proxy-mirror_netcologne_de/qtproject/archive/qt/5.15/5.15.16/single/qt-everywhere-opensource-src-5.15.16.tar.xz" + sha256: "efa99827027782974356aceff8a52bd3d2a8a93a54dd0db4cca41b5e35f1041c" + "5.15.14": + url: + - "https://nexus.avroid.tech/repository/all-raw-proxy-mirror_netcologne_de/qtproject/archive/qt/5.15/5.15.14/single/qt-everywhere-opensource-src-5.15.14.tar.xz" + sha256: "fdd3a4f197d2c800ee0085c721f4bef60951cbda9e9c46e525d1412f74264ed7" +patches: + "5.15.16": + - "base_path": "qt5/qtbase" + "patch_file": "patches/aa2a39dea5.diff" + - "base_path": "qt5/qtwebengine" + "patch_file": "patches/c72097e.diff" + - "base_path": "qt5/qtdeclarative" + "patch_file": "patches/qtdeclarative-1-fixes.patch" + - "base_path": "qt5/qttools" + "patch_file": "patches/qttools-1-fixes.patch" + - "base_path": "qt5/qtconnectivity" + "patch_file": "patches/qtconnectivity-1-fixes.patch" + - "base_path": "qt5/qtlocation" + "patch_file": "patches/qtlocation-1.patch" + - "base_path": "qt5/qtmultimedia" + "patch_file": "patches/qtmultimedia-1.patch" + - "base_path": "qt5/qttools" + "patch_file": "patches/fix-macdeployqt.diff" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_file": "patches/0001-Find-fontconfig-using-pkg-config.patch" + - "base_path": "qt5/qtbase" + "patch_file": "patches/android-openssl.diff" + - "base_path": "qt5/qtwebengine" + "patch_description": "qtwebengine don't use rpath-link on macOS" + "patch_file": "patches/5.15.14-macos-qtwebengine-rpath-link.patch" + - "base_path": "qt5/qtlocation" + "patch_description": "qtlocation missing utility header" + "patch_file": "patches/5.15.14-macos-qtlocation-utility-header.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_description": "qtwebengine fix missing headers" + "patch_file": "patches/5.15.14-qtwebengine-missing-deps.patch" + - "base_path": "qt5/qtwebengine/src/3rdparty" + "patch_description": "macos fix chromium build in newer macos SDKs" + "patch_file": "patches/5.15.14-macos-chromium-newer-sdks.patch" + - "base_path": "qt5/qtwebengine" + "patch_description": "Fix build error with binutils >= 2.41" + "patch_file": "patches/ffmpeg-x86-optimization.patch" + "patch_source": "https://packages.ubuntu.com/source/focal-updates/qtwebengine-opensource-src" + "patch_type": "portability" diff --git a/recipes/qt/5.x.x/conanfile.py b/recipes/qt/5.x.x/conanfile.py new file mode 100644 index 0000000..1c31ad0 --- /dev/null +++ b/recipes/qt/5.x.x/conanfile.py @@ -0,0 +1,1591 @@ +from conan import ConanFile, conan_version +from conan.errors import ConanException, ConanInvalidConfiguration +from conan.tools.android import android_abi +from conan.tools.apple import is_apple_os +from conan.tools.build import build_jobs, check_min_cppstd, cross_building +from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import chdir, copy, get, load, replace_in_file, rm, rmdir, save, export_conandata_patches, apply_conandata_patches +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import is_msvc, msvc_runtime_flag, is_msvc_static_runtime, VCVars +from conan.tools.scm import Version +import configparser +import glob +from io import StringIO +import itertools +import os +import textwrap +import shutil + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + + +class QtConan(ConanFile): + _submodules = ["qtsvg", "qtdeclarative", "qtactiveqt", "qtmultimedia", "qttools", "qtxmlpatterns", "qtwayland", "qtwebchannel", "qtscript", "qtdoc", + "qttranslations", "qtlocation", "qtsensors", "qtconnectivity", + "qt3d", "qtimageformats", "qtgraphicaleffects", "qtquickcontrols", "qtserialbus", "qtserialport", "qtx11extras", + "qtmacextras", "qtandroidextras", "qtwinextras", "qtwebengine", "qtwebsockets", "qtwebview", + "qtquickcontrols2", "qtpurchasing", "qtcharts", "qtdatavis3d", "qtvirtualkeyboard", "qtgamepad", "qtscxml", + "qtspeech", "qtnetworkauth", "qtremoteobjects", "qtwebglplugin", "qtlottie", "qtquicktimeline", "qtquick3d", + "qtknx", "qtmqtt", "qtcoap", "qtopcua"] + + _module_statuses = ["essential", "addon", "deprecated", "preview"] + + name = "qt" + description = "Qt is a cross-platform framework for graphical user interfaces." + topics = ("ui", "framework") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.qt.io" + license = "LGPL-3.0-only" + package_type = "library" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "commercial": [True, False], + + "opengl": ["no", "es2", "desktop", "dynamic"], + "with_vulkan": [True, False], + "openssl": [True, False], + "with_pcre2": [True, False], + "with_glib": [True, False], + # "with_libiconv": [True, False], # QTBUG-84708 Qt tests failure "invalid conversion from const char** to char**" + "with_doubleconversion": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_icu": [True, False], + "with_harfbuzz": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], + "with_libpng": [True, False], + "with_sqlite3": [True, False], + "with_mysql": [True, False], + "with_pq": [True, False], + "with_odbc": [True, False], + "with_libalsa": [True, False], + "with_openal": [True, False], + "with_zstd": [True, False], + "with_gstreamer": [True, False], + "with_pulseaudio": [True, False], + "with_dbus": [True, False], + "with_gssapi": [True, False], + "with_atspi": [True, False], + "with_md4c": [True, False], + "with_x11": [True, False], + + "gui": [True, False], + "widgets": [True, False], + + "android_sdk": [None, "ANY"], + "device": [None, "ANY"], + "cross_compile": [None, "ANY"], + "sysroot": [None, "ANY"], + "config": [None, "ANY"], + "multiconfiguration": [True, False] + } + options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) + + default_options = { + "shared": False, + "commercial": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": False, + # "with_libiconv": True, # QTBUG-84708 + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": False, + "with_libjpeg": "libjpeg-turbo", + "with_libpng": True, + "with_sqlite3": True, + "with_mysql": True, + "with_pq": True, + "with_odbc": True, + "with_libalsa": False, + "with_openal": True, + "with_zstd": True, + "with_gstreamer": False, + "with_pulseaudio": False, + "with_dbus": False, + "with_gssapi": False, + "with_atspi": False, + "with_md4c": True, + "with_x11": True, + + "gui": True, + "widgets": True, + + "android_sdk": None, + "device": None, + "cross_compile": None, + "sysroot": None, + "config": None, + "multiconfiguration": False, + } + # essential_modules, addon_modules, deprecated_modules, preview_modules: + # these are only provided for convenience, set to False by default + default_options.update({f"{status}_modules": False for status in _module_statuses}) + + no_copy_source = True + short_paths = True + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def export(self): + copy(self, f"qtmodules{self.version}.conf", self.recipe_folder, self.export_folder) + + def export_sources(self): + export_conandata_patches(self) + + def validate_build(self): + if self.options.qtwebengine: + # Check if a valid python2 is available in PATH or it will failflex + # Start by checking if python2 can be found + python_exe = shutil.which("python2") + if not python_exe: + # Fall back on regular python + python_exe = shutil.which("python") + + if not python_exe: + msg = ("Python2 must be available in PATH " + "in order to build Qt WebEngine") + raise ConanInvalidConfiguration(msg) + + # In any case, check its actual version for compatibility + command_output = StringIO() + cmd_v = f"\"{python_exe}\" -c \"import platform;print(platform.python_version())\"" + self.run(cmd_v, command_output) + verstr = command_output.getvalue().strip() + version = Version(verstr) + # >= 2.7.5 & < 3 + v_min = "2.7.5" + v_max = "3.0.0" + if (version >= v_min) and (version < v_max): + msg = ("Found valid Python 2 required for QtWebengine:" + f" version={verstr}, path={python_exe}") + self.output.success(msg) + else: + msg = (f"Found Python 2 in path, but with invalid version {verstr}" + f" (QtWebEngine requires >= {v_min} & < {v_max})\n" + "If you have both Python 2 and 3 installed, copy the python 2 executable to" + "python2(.exe)") + raise ConanInvalidConfiguration(msg) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_icu + del self.options.with_fontconfig + del self.options.with_libalsa + del self.options.with_x11 + del self.options.qtx11extras + if self.settings.compiler == "apple-clang": + if Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") + if self.settings.compiler in ["gcc", "clang"]: + if Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0") + if self.settings.compiler in ["gcc", "clang"] and Version(self.settings.compiler.version) < "5.3": + del self.options.with_mysql + if self.settings.os == "Windows": + self.options.with_mysql = False + if not cross_building(self): + self.options.opengl = "dynamic" + del self.options.with_gssapi + if self.settings.os != "Linux": + self.options.qtwayland = False + self.options.with_atspi = False + + if self.settings.os != "Windows": + del self.options.qtwinextras + del self.options.qtactiveqt + + if self.settings.os != "Macos": + del self.options.qtmacextras + + if self.settings.os != "Android": + del self.options.android_sdk + + def _debug_output(self, message): + if Version(conan_version) >= "2": + self.output.debug(message) + + def configure(self): + # if self.settings.os != "Linux": + # self.options.with_libiconv = False # QTBUG-84708 + + if not self.options.gui: + self.options.rm_safe("opengl") + self.options.rm_safe("with_vulkan") + self.options.rm_safe("with_freetype") + self.options.rm_safe("with_fontconfig") + self.options.rm_safe("with_harfbuzz") + self.options.rm_safe("with_libjpeg") + self.options.rm_safe("with_libpng") + self.options.rm_safe("with_md4c") + self.options.rm_safe("with_x11") + + if not self.options.with_dbus: + self.options.rm_safe("with_atspi") + + if self.options.multiconfiguration: + del self.settings.build_type + + config = configparser.ConfigParser() + config.read(os.path.join(self.recipe_folder, f"qtmodules{self.version}.conf")) + submodules_tree = {} + assert config.sections(), f"no qtmodules.conf file for version {self.version}" + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + status = str(config.get(section, "status")) + if status not in ("obsolete", "ignore"): + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") + submodules_tree[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + + for m in submodules_tree: + assert m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules, "module %s is not present in recipe options : (%s)" % (m, ",".join(self._submodules)) + + for module in self._submodules: + if module not in submodules_tree: + self._debug_output(f"qt5: removing {module} from options as it is not an option for this version, or it is ignored or obsolete") + self.options.rm_safe(module) + + # Requested modules: + # - any module for non-removed options that have 'True' value + # - any enabled via `xxx_modules` that does not have a 'False' value + # Note that at this point, the submodule options dont have a value unless one is given externally + # to the recipe (e.g. via the command line, a profile, or a consumer) + requested_modules = set([module for module in self._submodules if self.options.get_safe(module)]) + for module in [m for m in self._submodules if m in submodules_tree]: + status = submodules_tree[module]['status'] + is_disabled = self.options.get_safe(module) == False + if self.options.get_safe(f"{status}_modules"): + if not is_disabled: + requested_modules.add(module) + else: + self.output.warning(f"qt5: {module} requested because {status}_modules=True" + f" but it has been explicitly disabled with {module}=False") + + self.output.info(f"qt5: requested modules {list(requested_modules)}") + + required_modules = {} + for module in requested_modules: + deps = submodules_tree[module]["depends"] + for dep in deps: + required_modules.setdefault(dep,[]).append(module) + + required_but_disabled = [m for m in required_modules.keys() if self.options.get_safe(m) == False] + if required_modules: + self._debug_output(f"qt5: required_modules modules {list(required_modules.keys())}") + if required_but_disabled: + required_by = set() + for m in required_but_disabled: + required_by.update(required_modules[m]) + raise ConanInvalidConfiguration(f"Modules {required_but_disabled} are explicitly disabled, " + f"but are required by {list(required_by)}, enabled by other options") + + enabled_modules = requested_modules.union(set(required_modules.keys())) + enabled_modules.discard("qtbase") + + for module in list(enabled_modules): + setattr(self.options, module, True) + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + setattr(self.options, module, False) + + if not self.options.qtmultimedia: + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.qtwebengine: + self.options.with_fontconfig = True + + for status in self._module_statuses: + # These are convenience only, should not affect package_id + option_name = f"{status}_modules" + self._debug_output(f"qt5 removing convenience option: {option_name}," + f" see individual module options") + self.options.rm_safe(option_name) + + for option in self.options.items(): + self._debug_output(f"qt5 option {option[0]}={option[1]}") + + def validate(self): + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, "11") + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + + if self.options.qtwebengine: + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") + + if not (self.options.gui and self.options.qtdeclarative and self.options.qtlocation and self.options.qtwebchannel): + raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative, qt:qtlocation and qt:qtwebchannel") + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5": + raise ConanInvalidConfiguration("Compiling Qt WebEngine with gcc < 5 is not supported") + + if self.settings.os == "Android": + if self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android. Consider using OpenGL es2") + if not self.options.get_safe("android_sdk", ""): + raise ConanInvalidConfiguration("Path to Android SDK is required to build Qt") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if not self.options.with_doubleconversion and str(self.settings.compiler.libcxx) != "libc++": + raise ConanInvalidConfiguration("Qt without libc++ needs qt:with_doubleconversion. " + "Either enable qt:with_doubleconversion or switch to libc++") + + if is_msvc_static_runtime(self) and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + if self.settings.compiler == "apple-clang": + if Version(self.settings.compiler.version) < "10.0": + raise ConanInvalidConfiguration("Old versions of apple sdk are not supported by Qt (QTBUG-76777)") + if self.settings.compiler in ["gcc", "clang"]: + if Version(self.settings.compiler.version) < "5.0": + raise ConanInvalidConfiguration("qt 5.15.X does not support GCC or clang before 5.0") + + if self.options.get_safe("with_pulseaudio", default=False) and not self.dependencies["pulseaudio"].options.with_glib: + # https://bugreports.qt.io/browse/QTBUG-95952 + raise ConanInvalidConfiguration("Pulseaudio needs to be built with glib option or qt's configure script won't detect it") + + if self.settings.os in ['Linux', 'FreeBSD']: + if self.options.with_gssapi: + raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed") + + if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11: + raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled") + if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: + raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") + + if cross_building(self) and self.options.cross_compile == "None" and not is_apple_os(self) and self.settings.os != "Android": + raise ConanInvalidConfiguration("option cross_compile must be set for cross compilation " + "cf https://doc.qt.io/qt-5/configure-options.html#cross-compilation-options") + + if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: + raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_pcre2: + self.requires("pcre2/[>=10.42]") + if self.options.get_safe("with_vulkan"): + self.requires("vulkan-loader/1.3.268.0") + if is_apple_os(self): + self.requires("moltenvk/1.2.2") + if self.options.with_glib: + self.requires("glib/2.78.3") + # if self.options.with_libiconv: # QTBUG-84708 + # self.requires("libiconv/1.16")# QTBUG-84708 + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.3.0") + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: + self.requires("freetype/2.13.2") + if self.options.get_safe("with_fontconfig", False): + self.requires("fontconfig/2.15.0") + if self.options.get_safe("with_icu", False): + self.requires("icu/74.2") + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + self.requires("harfbuzz/8.3.0") + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/[>=3.0 <3.1]") + else: + self.requires("libjpeg/9e") + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_sqlite3 and not self.options.multiconfiguration: + self.requires("sqlite3/[>=3.45.0 <4]") + if self.options.get_safe("with_mysql", False): + self.requires("libmysqlclient/8.1.0") + if self.options.with_pq: + self.requires("libpq/15.4") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("with_openal", False): + self.requires("openal-soft/1.22.2") + if self.options.get_safe("with_libalsa", False): + self.requires("libalsa/1.2.10") + if self.options.get_safe("with_x11"): + self.requires("xorg/system") + if self.options.get_safe("with_x11") or self.options.qtwayland: + self.requires("xkbcommon/1.5.0") + if self.options.get_safe("opengl", "no") != "no": + self.requires("opengl/system") + if self.options.with_zstd: + self.requires("zstd/[>=1.5.5]") + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: + self.requires("expat/[>=2.6.2 <3]") + self.requires("opus/1.4") + if not self.options.qtwayland: + self.requires("xorg-proto/2022.2") + self.requires("libxshmfence/1.3") + self.requires("nss/3.93") + self.requires("libdrm/2.4.119") + self.requires("egl/system") + if self.options.get_safe("with_gstreamer", False): + self.requires("gst-plugins-base/1.19.2") + if self.options.get_safe("with_pulseaudio", False): + self.requires("pulseaudio/14.2") + if self.options.with_dbus: + self.requires("dbus/1.15.8") + if self.options.qtwayland: + self.requires("wayland/1.22.0") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 + if self.options.get_safe("with_atspi"): + self.requires("at-spi2-core/2.51.0") + if self.options.get_safe("with_md4c", False): + self.requires("md4c/0.4.8") + + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + if self.info.options.multiconfiguration: + if self.info.settings.compiler == "Visual Studio": + if "MD" in self.info.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" + elif self.info.settings.compiler == "msvc": + self.info.settings.compiler.runtime_type = "Release/Debug" + if self.info.settings.os == "Android": + del self.info.options.android_sdk + + def build_requirements(self): + if self._settings_build.os == "Windows" and is_msvc(self): + self.tool_requires("jom/[>=1.1 <2]") + if self.options.qtwebengine: + self.tool_requires("ninja/[>=1.12 <2]") + self.tool_requires("nodejs/18.15.0") + self.tool_requires("gperf/3.1") + # gperf, bison, flex, python >= 2.7.5 & < 3 + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + if self.options.qtwayland: + self.tool_requires("wayland/") + + @property + def angle_path(self): + return os.path.join(self.source_folder, "angle") + + def source(self): + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination="qt5") + + apply_conandata_patches(self) + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) + replace_in_file(self, os.path.join(self.source_folder, "qt5", "qtbase", "configure.json"), + "-ldbus-1d", + "-ldbus-1" + ) + save(self, os.path.join(self.source_folder, "qt5", "qtbase", "mkspecs", "features", "uikit", "bitcode.prf"), "") + + # shorten the path to ANGLE to avoid the following error: + # C:\J2\w\prod-v2\bsr@4\104220\ebfcf\p\qtde01f793a6074\s\qt5\qtbase\src\3rdparty\angle\src\libANGLE\renderer\d3d\d3d11\texture_format_table_autogen.cpp : fatal error C1083: Cannot open compiler generated file: '': Invalid argument + copy(self, "*", os.path.join(self.source_folder, "qt5", "qtbase", "src", "3rdparty", "angle"), self.angle_path) + + def generate(self): + pc = PkgConfigDeps(self) + pc.generate() + ms = VCVars(self) + ms.generate() + vbe = VirtualBuildEnv(self) + vbe.generate() + if not cross_building(self): + vre = VirtualRunEnv(self) + vre.generate(scope="build") + env = Environment() + env.define("MAKEFLAGS", f"j{build_jobs(self)}") + env.define("ANGLE_DIR", self.angle_path) + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + if self.settings.os == "Windows": + env.prepend_path("PATH", os.path.join(self.source_folder, "qt5", "gnuwin32", "bin")) + env.vars(self).save_script("conan_qt_env_file") + + def _make_program(self): + if is_msvc(self): + return "jom" + elif self._settings_build.os == "Windows": + return "mingw32-make" + else: + return "make -j20" + + def _xplatform(self): + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + return {"x86": "linux-g++-32", + "armv6": "linux-arm-gnueabi-g++", + "armv7": "linux-arm-gnueabi-g++", + "armv7hf": "linux-arm-gnueabi-g++", + "armv8": "linux-aarch64-gnu-g++"}.get(str(self.settings.arch), "linux-g++") + elif self.settings.compiler == "clang": + if self.settings.arch == "x86": + return "linux-clang-libc++-32" if self.settings.compiler.libcxx == "libc++" else "linux-clang-32" + elif self.settings.arch == "x86_64": + return "linux-clang-libc++" if self.settings.compiler.libcxx == "libc++" else "linux-clang" + + elif self.settings.os == "Macos": + return {"clang": "macx-clang", + "apple-clang": "macx-clang", + "gcc": "macx-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "iOS": + if self.settings.compiler == "apple-clang": + return "macx-ios-clang" + + elif self.settings.os == "watchOS": + if self.settings.compiler == "apple-clang": + return "macx-watchos-clang" + + elif self.settings.os == "tvOS": + if self.settings.compiler == "apple-clang": + return "macx-tvos-clang" + + elif self.settings.os == "Android": + if self.settings.compiler == "clang": + return "android-clang" + + elif self.settings.os == "Windows": + return { + "Visual Studio": "win32-msvc", + "msvc": "win32-msvc", + "gcc": "win32-g++", + "clang": "win32-clang-g++", + }.get(str(self.settings.compiler)) + + elif self.settings.os == "WindowsStore": + if is_msvc(self): + if str(self.settings.compiler) == "Visual Studio": + msvc_version = str(self.settings.compiler.version) + else: + msvc_version = { + "190": "14", + "191": "15", + "192": "16", + }.get(str(self.settings.compiler.version)) + return { + "14": { + "armv7": "winrt-arm-msvc2015", + "x86": "winrt-x86-msvc2015", + "x86_64": "winrt-x64-msvc2015", + }, + "15": { + "armv7": "winrt-arm-msvc2017", + "x86": "winrt-x86-msvc2017", + "x86_64": "winrt-x64-msvc2017", + }, + "16": { + "armv7": "winrt-arm-msvc2019", + "x86": "winrt-x86-msvc2019", + "x86_64": "winrt-x64-msvc2019", + } + }.get(msvc_version).get(str(self.settings.arch)) + + elif self.settings.os == "FreeBSD": + return {"clang": "freebsd-clang", + "gcc": "freebsd-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "SunOS": + if self.settings.compiler == "sun-cc": + if self.settings.arch == "sparc": + return "solaris-cc-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc" + elif self.settings.arch == "sparcv9": + return "solaris-cc64-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc64" + elif self.settings.compiler == "gcc": + return {"sparc": "solaris-g++", + "sparcv9": "solaris-g++-64"}.get(str(self.settings.arch)) + elif self.settings.os == "Neutrino" and self.settings.compiler == "qcc": + return {"armv8": "qnx-aarch64le-qcc", + "armv8.3": "qnx-aarch64le-qcc", + "armv7": "qnx-armle-v7-qcc", + "armv7hf": "qnx-armle-v7-qcc", + "armv7s": "qnx-armle-v7-qcc", + "armv7k": "qnx-armle-v7-qcc", + "x86": "qnx-x86-qcc", + "x86_64": "qnx-x86-64-qcc"}.get(str(self.settings.arch)) + elif self.settings.os == "Emscripten" and self.settings.arch == "wasm": + return "wasm-emscripten" + + return None + + def build(self): + args = ["-confirm-license", "-silent", "-nomake examples", "-nomake tests", + f"-prefix {self.package_folder}"] + if cross_building(self): + args.append(f"-extprefix {self.package_folder}") + args.append("-v") + if self.options.commercial: + args.append("-commercial") + else: + args.append("-opensource") + if not self.options.gui: + args.append("-no-gui") + if not self.options.widgets: + args.append("-no-widgets") + if not self.options.shared: + args.insert(0, "-static") + if is_msvc(self) and "MT" in msvc_runtime_flag(self): + args.append("-static-runtime") + else: + args.insert(0, "-shared") + if self.options.multiconfiguration: + args.append("-debug-and-release") + elif self.settings.build_type == "Debug": + args.append("-debug") + elif self.settings.build_type == "Release": + args.append("-release") + elif self.settings.build_type == "RelWithDebInfo": + args.append("-release") + args.append("-force-debug-info") + elif self.settings.build_type == "MinSizeRel": + args.append("-release") + args.append("-optimize-size") + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + args.append("-skip " + module) + + args.append("--zlib=system") + + # openGL + opengl = self.options.get_safe("opengl", "no") + if opengl == "no": + args += ["-no-opengl"] + elif opengl == "es2": + args += ["-opengl es2"] + elif opengl == "desktop": + args += ["-opengl desktop"] + elif opengl == "dynamic": + args += ["-opengl dynamic"] + + if self.options.get_safe("with_vulkan", False): + args.append("-vulkan") + else: + args.append("-no-vulkan") + + # openSSL + if not self.options.openssl: + args += ["-no-openssl"] + else: + if self.dependencies["openssl"].options.shared: + args += ["-openssl-runtime"] + else: + args += ["-openssl-linked"] + + # args.append("--iconv=" + ("gnu" if self.options.with_libiconv else "no"))# QTBUG-84708 + + args.append("--glib=" + ("yes" if self.options.with_glib else "no")) + args.append("--pcre=" + ("system" if self.options.with_pcre2 else "qt")) + args.append("--fontconfig=" + ("yes" if self.options.get_safe("with_fontconfig", False) else "no")) + args.append("--icu=" + ("yes" if self.options.get_safe("with_icu", False) else "no")) + args.append("--sql-mysql=" + ("yes" if self.options.get_safe("with_mysql", False) else "no")) + args.append("--sql-psql=" + ("yes" if self.options.with_pq else "no")) + args.append("--sql-odbc=" + ("yes" if self.options.with_odbc else "no")) + args.append("--zstd=" + ("yes" if self.options.with_zstd else "no")) + + if self.options.qtmultimedia: + args.append("--alsa=" + ("yes" if self.options.get_safe("with_libalsa", False) else "no")) + args.append("--gstreamer" if self.options.get_safe("with_gstreamer", False) else "--no-gstreamer") + args.append("--pulseaudio" if self.options.get_safe("with_pulseaudio", False) else "--no-pulseaudio") + + if self.options.with_dbus: + args.append("-dbus-linked") + else: + args.append("-no-dbus") + + args.append("-feature-gssapi" if self.options.get_safe("with_gssapi", False) else "-no-feature-gssapi") + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_sqlite3", "sqlite"), + ("with_md4c", "libmd4c")]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + args += ["-qt-" + conf_arg] + else: + args += ["-system-" + conf_arg] + else: + args += ["-no-" + conf_arg] + + libmap = [("zlib", "ZLIB"), + ("openssl", "OPENSSL"), + ("pcre2", "PCRE2"), + ("glib", "GLIB"), + # ("libiconv", "ICONV"),# QTBUG-84708 + ("double-conversion", "DOUBLECONVERSION"), + ("freetype", "FREETYPE"), + ("fontconfig", "FONTCONFIG"), + ("icu", "ICU"), + ("harfbuzz", "HARFBUZZ"), + ("libjpeg", "LIBJPEG"), + ("libjpeg-turbo", "LIBJPEG"), + ("libpng", "LIBPNG"), + ("sqlite3", "SQLITE"), + ("libmysqlclient", "MYSQL"), + ("libpq", "PSQL"), + ("odbc", "ODBC"), + ("sdl2", "SDL2"), + ("openal-soft", "OPENAL"), + ("zstd", "ZSTD"), + ("libalsa", "ALSA"), + ("xkbcommon", "XKBCOMMON"), + ("md4c", "LIBMD4C")] + for package, var in libmap: + if package in [d.ref.name for d in self.dependencies.direct_host.values()]: + p = self.dependencies[package] + if package == "freetype": + args.append("\"%s_INCDIR=%s\"" % (var, p.cpp_info.aggregated_components().includedirs[-1])) + args.append("\"%s_LIBS=%s\"" % (var, " ".join(self._gather_libs(p)))) + + for dependency in self.dependencies.direct_host.values(): + args += [f"-I \"{s}\"" for s in dependency.cpp_info.aggregated_components().includedirs] + args += [f"-D {s}" for s in dependency.cpp_info.aggregated_components().defines] + + libdirs = [l for dependency in self.dependencies.host.values() for l in dependency.cpp_info.aggregated_components().libdirs] + args.append("QMAKE_LIBDIR+=\"%s\"" % " ".join(libdirs)) + if not is_msvc(self): + args.append("QMAKE_RPATHLINKDIR+=\"%s\"" % ":".join(libdirs)) + + if "libmysqlclient" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-mysql_config \"%s\"" % os.path.join(self.dependencies["libmysqlclient"].package_folder, "bin", "mysql_config")) + if "libpq" in [d.ref.name for d in self.dependencies.direct_host.values()]: + args.append("-psql_config \"%s\"" % os.path.join(self.dependencies["libpq"].package_folder, "bin", "pg_config")) + if self.settings.os == "Macos": + args += ["-no-framework"] + if self.settings.arch == "armv8": + args.append('QMAKE_APPLE_DEVICE_ARCHS="arm64"') + elif self.settings.os == "Android": + args += [f"-android-ndk-platform android-{self.settings.os.api_level}"] + args += [f"-android-abis {android_abi(self)}"] + + if self.settings.get_safe("compiler.libcxx") == "libstdc++": + args += ["-D_GLIBCXX_USE_CXX11_ABI=0"] + elif self.settings.get_safe("compiler.libcxx") == "libstdc++11": + args += ["-D_GLIBCXX_USE_CXX11_ABI=1"] + + if self.options.get_safe("android_sdk", ""): + args += [f"-android-sdk {self.options.android_sdk}"] + if self.options.sysroot: + args += [f"-sysroot {self.options.sysroot}"] + + if self.options.device: + args += [f"-device {self.options.device}"] + else: + xplatform_val = self._xplatform() + if xplatform_val: + if not cross_building(self, skip_x64_x86=True): + args += [f"-platform {xplatform_val}"] + else: + args += [f"-xplatform {xplatform_val}"] + else: + self.output.warn("host not supported: %s %s %s %s" % + (self.settings.os, self.settings.compiler, + self.settings.compiler.version, self.settings.arch)) + if self.options.cross_compile: + args += [f"-device-option CROSS_COMPILE={self.options.cross_compile}"] + + def _getenvpath(var): + val = os.getenv(var) + if val and self._settings_build.os == "Windows": + val = val.replace("\\", "/") + os.environ[var] = val + return val + + if not is_msvc(self): + value = _getenvpath("CC") + if value: + args += ['QMAKE_CC="' + value + '"', + 'QMAKE_LINK_C="' + value + '"', + 'QMAKE_LINK_C_SHLIB="' + value + '"'] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX="' + value + '"', + 'QMAKE_LINK="' + value + '"', + 'QMAKE_LINK_SHLIB="' + value + '"'] + + if self._settings_build.os == "Linux" and self.settings.compiler == "clang": + args += ['QMAKE_CXXFLAGS+="-ftemplate-depth=1024"'] + + if self._settings_build.os == "Macos": + # On macOS, SIP resets DYLD_LIBRARY_PATH injected by VirtualBuildEnv & VirtualRunEnv. + # Qt builds several executables (moc etc) which are called later on during build of + # libraries, and these executables link to several external dependencies in requirements(). + # If these external libs are shared, moc calls fail because its dylib dependencies + # are not found (unless they can be accidentally found in system paths). + # So the workaround is to add libdirs of these external dependencies to LC_RPATH + # of runtime artifacts. + if not cross_building(self): + for libpath in VirtualRunEnv(self).vars().get("DYLD_LIBRARY_PATH", "").split(":"): + # see https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpathdir + args += [f"QMAKE_RPATHDIR+=\"{libpath}\""] + + if self.settings.compiler == "apple-clang" and self.options.qtmultimedia: + # XCode 14.3 finally removes std::unary_function, so compilation fails + # when using newer SDKs when using C++17 or higher. + # This macro re-enables them. Should be safe to pass this macro even + # in earlier versions, as it would have no effect. + args += ['QMAKE_CXXFLAGS+="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION=1"'] + + if self.options.qtwebengine and self.settings.os in ["Linux", "FreeBSD"]: + args += ["-qt-webengine-ffmpeg", + "-system-webengine-opus", + "-webengine-jumbo-build 0"] + + if self.options.config: + args.append(str(self.options.config)) + + os.mkdir("build_folder") + with chdir(self, "build_folder"): + if self._settings_build.os == "Macos": + save(self, ".qmake.stash" , "") + save(self, ".qmake.super" , "") + + self.run("%s %s" % (os.path.join(self.source_folder, "qt5", "configure"), " ".join(args))) + self.run("make -j16") + + @property + def _cmake_core_extras_file(self): + return os.path.join("lib", "cmake", "Qt5Core", "conan_qt_core_extras.cmake") + + def _cmake_qt5_private_file(self, module): + return os.path.join("lib", "cmake", f"Qt5{module}", f"conan_qt_qt5_{module.lower()}private.cmake") + + def package(self): + with chdir(self, "build_folder"): + self.run(f"{self._make_program()} install") + save(self, os.path.join(self.package_folder, "bin", "qt.conf"), """[Paths] +Prefix = ..""") + copy(self, "*LICENSE*", os.path.join(self.source_folder, "qt5/"), os.path.join(self.package_folder, "licenses"), + excludes="qtbase/examples/*") + for module in self._submodules: + if not self.options.get_safe(module): + rmdir(self, os.path.join(self.package_folder, "licenses", module)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: + rm(self, mask, self.package_folder, recursive=True) + rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) + rm(self, "*.pdb*", os.path.join(self.package_folder, "lib"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "bin"), recursive=True) + rm(self, "*.pdb", os.path.join(self.package_folder, "plugins"), recursive=True) + # "Qt5Bootstrap" is internal Qt library - removing it to avoid linking error, since it contains + # symbols that are also in "Qt5Core.lib". It looks like there is no "Qt5Bootstrap.dll". + for fl in glob.glob(os.path.join(self.package_folder, "lib", "*Qt5Bootstrap*")): + os.remove(fl) + + for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): + module = os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake") + if not os.path.isfile(module): + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m)) + + extension = "" + if self._settings_build.os == "Windows": + extension = ".exe" + v = Version(self.version) + filecontents = textwrap.dedent(f"""\ + set(QT_CMAKE_EXPORT_NAMESPACE Qt5) + set(QT_VERSION_MAJOR {v.major}) + set(QT_VERSION_MINOR {v.minor}) + set(QT_VERSION_PATCH {v.patch}) + """) + targets = {} + targets["Core"] = ["moc", "rcc", "qmake"] + targets["DBus"] = ["qdbuscpp2xml", "qdbusxml2cpp"] + if self.options.widgets: + targets["Widgets"] = ["uic"] + if self.options.qttools: + targets["Tools"] = ["qhelpgenerator", "qcollectiongenerator", "qdoc", "qtattributionsscanner"] + targets[""] = ["lconvert", "lrelease", "lupdate"] + if self.options.qtremoteobjects: + targets["RemoteObjects"] = ["repc"] + if self.options.qtscxml: + targets["Scxml"] = ["qscxmlc"] + for namespace, targets in targets.items(): + for target in targets: + filecontents += textwrap.dedent("""\ + if(NOT TARGET ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + add_executable(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} IMPORTED) + set_target_properties(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} PROPERTIES IMPORTED_LOCATION ${{CMAKE_CURRENT_LIST_DIR}}/../../../bin/{target}{ext}) + set(Qt5{namespace}_{uppercase_target}_EXECUTABLE ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + endif() + """.format(target=target, ext=extension, namespace=namespace, uppercase_target=target.upper())) + + if self.settings.os == "Windows": + filecontents += textwrap.dedent("""\ + set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain) + if (NOT Qt5_NO_LINK_QTMAIN) + set(_isExe $,EXECUTABLE>) + set(_isWin32 $>) + set(_isNotExcluded $>>) + set(_isPolicyNEW $) + set_property(TARGET Qt5::Core APPEND PROPERTY + INTERFACE_LINK_LIBRARIES + $<$:Qt5::WinMain> + ) + unset(_isExe) + unset(_isWin32) + unset(_isNotExcluded) + unset(_isPolicyNEW) + endif() + """) + + filecontents += textwrap.dedent(f"""\ + if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION) + set(QT_DEFAULT_MAJOR_VERSION {v.major}) + endif() + """) + filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n' + save(self, os.path.join(self.package_folder, self._cmake_core_extras_file), filecontents) + + def _create_private_module(module, dependencies=[]): + if "Core" not in dependencies: + dependencies.append("Core") + dependencies_string = ';'.join(f'Qt5::{dependency}' for dependency in dependencies) + contents = textwrap.dedent("""\ + if(NOT TARGET Qt5::{0}Private) + add_library(Qt5::{0}Private INTERFACE IMPORTED) + set_target_properties(Qt5::{0}Private PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1};${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{0}/{1}/Qt{0}" + INTERFACE_LINK_LIBRARIES "{2}" + ) + + add_library(Qt::{0}Private INTERFACE IMPORTED) + set_target_properties(Qt::{0}Private PROPERTIES + INTERFACE_LINK_LIBRARIES "Qt5::{0}Private" + _qt_is_versionless_target "TRUE" + ) + endif()""".format(module, self.version, dependencies_string)) + + save(self, os.path.join(self.package_folder, self._cmake_qt5_private_file(module)), contents) + + _create_private_module("Core") + + if self.options.gui: + _create_private_module("Gui", ["CorePrivate", "Gui"]) + + if self.options.widgets: + _create_private_module("Widgets", ["CorePrivate", "Gui", "GuiPrivate"]) + + if self.options.qtdeclarative: + _create_private_module("Qml", ["CorePrivate", "Qml"]) + if self.options.gui: + _create_private_module("Quick", ["CorePrivate", "GuiPrivate", "QmlPrivate", "Quick"]) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Qt5") + self.cpp_info.set_property("pkg_config_name", "qt5") + + self.cpp_info.names["cmake_find_package"] = "Qt5" + self.cpp_info.names["cmake_find_package_multi"] = "Qt5" + + build_modules = {} + + def _add_build_module(component, module): + if component not in build_modules: + build_modules[component] = [] + build_modules[component].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package"].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append(module) + + libsuffix = "" + if self.settings.os == "Android": + libsuffix = f"_{android_abi(self)}" + if not self.options.multiconfiguration: + if self.settings.build_type == "Debug": + if self.settings.os == "Windows" and is_msvc(self): + libsuffix = "d" + elif is_apple_os(self): + libsuffix = "_debug" + + def _get_corrected_reqs(requires): + reqs = [] + for r in requires: + if "::" in r: + corrected_req = r + else: + corrected_req = f"qt{r}" + assert corrected_req in self.cpp_info.components, f"{corrected_req} required but not yet present in self.cpp_info.components" + reqs.append(corrected_req) + return reqs + + def _create_module(module, requires=[], has_include_dir=True): + componentname = f"qt{module}" + assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}") + self.cpp_info.components[componentname].set_property("pkg_config_name", f"Qt5{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + if module.endswith("Private"): + libname = module[:-7] + else: + libname = module + self.cpp_info.components[componentname].libs = [f"Qt5{libname}{libsuffix}"] + if has_include_dir: + self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] + define = module.upper() + if define == "TEST": + define = "TESTLIB" + elif define == "XCBQPA": + define = "XCB_QPA_LIB" + elif define.endswith("SUPPORT"): + define = define.replace("SUPPORT", "_SUPPORT") + self.cpp_info.components[componentname].defines = [f"QT_{define}_LIB"] + if module != "Core" and "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + def _create_plugin(pluginname, libname, plugintype, requires): + componentname = f"qt{pluginname}" + assert componentname not in self.cpp_info.components, f"Plugin {pluginname} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{pluginname}") + self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname + if not self.options.shared: + self.cpp_info.components[componentname].libs = [libname + libsuffix] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] + self.cpp_info.components[componentname].includedirs = [] + if "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + core_reqs = ["zlib::zlib"] + if self.options.with_pcre2: + core_reqs.append("pcre2::pcre2") + if self.options.with_doubleconversion: + core_reqs.append("double-conversion::double-conversion") + if self.options.get_safe("with_icu", False): + core_reqs.append("icu::icu") + if self.options.with_zstd: + core_reqs.append("zstd::zstd") + if self.options.with_glib: + core_reqs.append("glib::glib-2.0") + + _create_module("Core", core_reqs) + pkg_config_vars = [ + "host_bins=${prefix}/bin", + "exec_prefix=${prefix}", + ] + self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + + if self.settings.os == "Windows": + module = "WinMain" + componentname = f"qt{module}" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt5::{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + self.cpp_info.components[componentname].libs = [f"qtmain{libsuffix}"] + self.cpp_info.components[componentname].includedirs = [] + self.cpp_info.components[componentname].defines = [] + + if self.options.with_dbus: + _create_module("DBus", ["dbus::dbus"]) + if self.options.gui: + gui_reqs = [] + if self.options.with_dbus: + gui_reqs.append("DBus") + if self.options.with_freetype: + gui_reqs.append("freetype::freetype") + if self.options.with_libpng: + gui_reqs.append("libpng::libpng") + if self.options.get_safe("with_fontconfig", False): + gui_reqs.append("fontconfig::fontconfig") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.qtwayland or self.options.get_safe("with_x11", False): + gui_reqs.append("xkbcommon::xkbcommon") + if self.options.get_safe("with_x11", False): + gui_reqs.append("xorg::xorg") + if self.options.get_safe("opengl", "no") != "no": + gui_reqs.append("opengl::opengl") + if self.options.get_safe("with_vulkan", False): + gui_reqs.append("vulkan-loader::vulkan-loader") + if is_apple_os(self): + gui_reqs.append("moltenvk::moltenvk") + if self.options.with_harfbuzz: + gui_reqs.append("harfbuzz::harfbuzz") + if self.options.with_libjpeg == "libjpeg-turbo": + gui_reqs.append("libjpeg-turbo::libjpeg-turbo") + if self.options.with_libjpeg == "libjpeg": + gui_reqs.append("libjpeg::libjpeg") + if self.options.with_md4c: + gui_reqs.append("md4c::md4c") + _create_module("Gui", gui_reqs) + _add_build_module("qtGui", self._cmake_qt5_private_file("Gui")) + + event_dispatcher_reqs = ["Core", "Gui"] + if self.options.with_glib: + event_dispatcher_reqs.append("glib::glib") + _create_module("EventDispatcherSupport", event_dispatcher_reqs) + _create_module("FontDatabaseSupport", ["Core", "Gui"]) + if self.settings.os == "Windows": + self.cpp_info.components["qtFontDatabaseSupport"].system_libs.extend(["advapi32", "ole32", "user32", "gdi32"]) + elif is_apple_os(self): + self.cpp_info.components["qtFontDatabaseSupport"].frameworks.extend(["CoreFoundation", "CoreGraphics", "CoreText","Foundation"]) + self.cpp_info.components["qtFontDatabaseSupport"].frameworks.append("AppKit" if self.settings.os == "Macos" else "UIKit") + if self.options.get_safe("with_fontconfig"): + self.cpp_info.components["qtFontDatabaseSupport"].requires.append("fontconfig::fontconfig") + if self.options.get_safe("with_freetype"): + self.cpp_info.components["qtFontDatabaseSupport"].requires.append("freetype::freetype") + + + _create_module("ThemeSupport", ["Core", "Gui"]) + _create_module("AccessibilitySupport", ["Core", "Gui"]) + if self.options.get_safe("with_vulkan"): + _create_module("VulkanSupport", ["Core", "Gui"]) + + if self.options.widgets: + _create_module("Widgets", ["Gui"]) + _add_build_module("qtWidgets", self._cmake_qt5_private_file("Widgets")) + if self.settings.os not in ["iOS", "watchOS", "tvOS"]: + _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.settings.os == "Macos" and not self.options.shared: + self.cpp_info.components["qtPrintSupport"].system_libs.append("cups") + + if is_apple_os(self): + _create_module("ClipboardSupport", ["Core", "Gui"]) + self.cpp_info.components["qtClipboardSupport"].frameworks = ["ImageIO"] + if self.settings.os == "Macos": + self.cpp_info.components["qtClipboardSupport"].frameworks.append("AppKit") + _create_module("GraphicsSupport", ["Core", "Gui"]) + + if self.settings.os in ["Android", "Emscripten"]: + _create_module("EglSupport", ["Core", "Gui"]) + + if self.settings.os == "Windows": + windows_reqs = ["Core", "Gui"] + windows_reqs.extend(["EventDispatcherSupport", "FontDatabaseSupport", "ThemeSupport", "AccessibilitySupport"]) + _create_module("WindowsUIAutomationSupport", ["Core", "Gui"]) + windows_reqs.append("WindowsUIAutomationSupport") + if self.options.get_safe("with_vulkan"): + windows_reqs.append("VulkanSupport") + _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", windows_reqs) + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", windows_reqs) + self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs = ["advapi32", "dwmapi", "gdi32", "imm32", + "ole32", "oleaut32", "shell32", "shlwapi", "user32", "winmm", "winspool", "wtsapi32"] + elif self.settings.os == "Android": + android_reqs = ["Core", "Gui", "EventDispatcherSupport", "AccessibilitySupport", "FontDatabaseSupport", "EglSupport"] + if self.options.get_safe("with_vulkan"): + android_reqs.append("VulkanSupport") + _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", android_reqs) + self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] + elif self.settings.os == "Macos": + cocoa_reqs = ["Core", "Gui", "ClipboardSupport", "ThemeSupport", "FontDatabaseSupport", "GraphicsSupport", "AccessibilitySupport"] + if self.options.get_safe("with_vulkan"): + cocoa_reqs.append("VulkanSupport") + if self.options.widgets: + cocoa_reqs.append("PrintSupport") + _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", cocoa_reqs) + _create_plugin("QMacStylePlugin", "qmacstyle", "styles", cocoa_reqs) + self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = ["AppKit", "Carbon", "CoreServices", "CoreVideo", + "IOKit", "IOSurface", "Metal", "QuartzCore"] + elif self.settings.os in ["iOS", "tvOS"]: + _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", ["ClipboardSupport", "FontDatabaseSupport", "GraphicsSupport"]) + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = ["AudioToolbox", "Foundation", "Metal", + "MobileCoreServices", "OpenGLES", "QuartzCore", "UIKit"] + elif self.settings.os == "watchOS": + _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", ["EventDispatcherSupport", "FontDatabaseSupport"]) + elif self.settings.os == "Emscripten": + _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui", "EventDispatcherSupport", "FontDatabaseSupport", "EglSupport"]) + elif self.settings.os in ["Linux", "FreeBSD"]: + service_support_reqs = ["Core", "Gui"] + if self.options.with_dbus: + service_support_reqs.append("DBus") + _create_module("ServiceSupport", service_support_reqs) + _create_module("EdidSupport") + if self.options.get_safe("with_x11", False): + _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon-x11"]) + xcb_qpa_reqs = ["Core", "Gui", "ServiceSupport", "ThemeSupport", "FontDatabaseSupport", "EdidSupport", "XkbCommonSupport", "xorg::xorg"] + elif self.options.qtwayland: + _create_module("XkbCommonSupport", ["Core", "Gui", "xkbcommon::libxkbcommon"]) + if self.options.with_dbus and self.options.with_atspi: + _create_module("LinuxAccessibilitySupport", ["Core", "DBus", "Gui", "AccessibilitySupport", "at-spi2-core::at-spi2-core"]) + xcb_qpa_reqs.append("LinuxAccessibilitySupport") + if self.options.get_safe("with_vulkan"): + xcb_qpa_reqs.append("VulkanSupport") + if self.options.get_safe("with_x11", False): + _create_module("XcbQpa", xcb_qpa_reqs, has_include_dir=False) + _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpa"]) + + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_pq: + _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) + if self.options.get_safe("with_mysql", False): + _create_plugin("QMySQLDriverPlugin", "qsqlmysql", "sqldrivers", ["libmysqlclient::libmysqlclient"]) + if self.options.with_odbc: + if self.settings.os != "Windows": + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", ["odbc::odbc"]) + networkReqs = [] + if self.options.openssl: + networkReqs.append("openssl::openssl") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + networkReqs.append("krb5::krb5-gssapi") + _create_module("Network", networkReqs) + _create_module("Sql") + _create_module("Test") + if self.options.get_safe("opengl", "no") != "no" and self.options.gui: + _create_module("OpenGL", ["Gui"]) + if self.options.widgets and self.options.get_safe("opengl", "no") != "no": + _create_module("OpenGLExtensions", ["Gui"]) + _create_module("Concurrent") + _create_module("Xml") + + if self.options.qtdeclarative: + _create_module("Qml", ["Network"]) + _add_build_module("qtQml", self._cmake_qt5_private_file("Qml")) + _create_module("QmlModels", ["Qml"]) + self.cpp_info.components["qtQmlImportScanner"].set_property("cmake_target_name", "Qt5::QmlImportScanner") + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" + self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) + if self.options.gui: + _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + _add_build_module("qtQuick", self._cmake_qt5_private_file("Quick")) + if self.options.widgets: + _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) + _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QmlWorkerScript", ["Qml"]) + _create_module("QuickTest", ["Test"]) + + if self.options.qttools and self.options.gui and self.options.widgets: + self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt5::LinguistTools") + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools" + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools" + _create_module("UiPlugin", ["Gui", "Widgets"]) + self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only + self.cpp_info.components["qtUiPlugin"].libdirs = [] + _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) + if not cross_building(self): + _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) + _create_module("Help", ["Gui", "Sql", "Widgets"]) + + if self.options.qtquick3d and self.options.gui: + _create_module("Quick3DUtils", ["Gui"]) + _create_module("Quick3DRender", ["Quick3DUtils", "Quick"]) + _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DRender", "Quick3DUtils"]) + _create_module("Quick3DRuntimeRender", ["Quick3DRender", "Quick3DAssetImport", "Quick3DUtils"]) + _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) + + if self.options.qtquickcontrols2 and self.options.gui: + _create_module("QuickControls2", ["Gui", "Quick"]) + _create_module("QuickTemplates2", ["Gui", "Quick"]) + + if self.options.qtsvg and self.options.gui: + _create_module("Svg", ["Gui"]) + _create_plugin("QSvgIconPlugin", "qsvgicon", "iconengines", []) + _create_plugin("QSvgPlugin", "qsvg", "imageformats", []) + + if self.options.qtwayland and self.options.gui: + _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) + _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + + if self.options.qtlocation: + _create_module("Positioning") + _create_module("Location", ["Gui", "Quick"]) + _create_plugin("QGeoServiceProviderFactoryMapbox", "qtgeoservices_mapbox", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryMapboxGL", "qtgeoservices_mapboxgl", "geoservices", []) + _create_plugin("GeoServiceProviderFactoryEsri", "qtgeoservices_esri", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryItemsOverlay", "qtgeoservices_itemsoverlay", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryNokia", "qtgeoservices_nokia", "geoservices", []) + _create_plugin("QGeoServiceProviderFactoryOsm", "qtgeoservices_osm", "geoservices", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue", "qtposition_geoclue", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) + _create_plugin("QGeoPositionInfoSourceFactorySerialNmea", "qtposition_serialnmea", "position", []) + + if self.options.qtwebchannel: + _create_module("WebChannel", ["Qml"]) + + if self.options.qtwebengine: + webenginereqs = ["Gui", "Quick", "WebChannel", "Positioning"] + if self.settings.os in ["Linux", "FreeBSD"]: + webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ + "nss::nss", "libdrm::libdrm", "egl::egl"]) + _create_module("WebEngineCore", webenginereqs) + if self.settings.os != "Windows": + self.cpp_info.components["WebEngineCore"].system_libs.append("resolv") + _create_module("WebEngine", ["WebEngineCore"]) + _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) + + if self.options.qtserialport: + _create_module("SerialPort") + + if self.options.qtserialbus: + _create_module("SerialBus", ["SerialPort"] if self.options.get_safe("qtserialport") else []) + _create_plugin("PassThruCanBusPlugin", "qtpassthrucanbus", "canbus", []) + _create_plugin("PeakCanBusPlugin", "qtpeakcanbus", "canbus", []) + _create_plugin("SocketCanBusPlugin", "qtsocketcanbus", "canbus", []) + _create_plugin("TinyCanBusPlugin", "qttinycanbus", "canbus", []) + _create_plugin("VirtualCanBusPlugin", "qtvirtualcanbus", "canbus", []) + + if self.options.qtsensors: + _create_module("Sensors") + _create_plugin("genericSensorPlugin", "qtsensors_generic", "sensors", []) + _create_plugin("IIOSensorProxySensorPlugin", "qtsensors_iio-sensor-proxy", "sensors", []) + if self.settings.os == "Linux": + _create_plugin("LinuxSensorPlugin", "qtsensors_linuxsys", "sensors", []) + _create_plugin("QtSensorGesturePlugin", "qtsensorgestures_plugin", "sensorgestures", []) + _create_plugin("QShakeSensorGesturePlugin", "qtsensorgestures_shakeplugin", "sensorgestures", []) + + if self.options.qtscxml: + _create_module("Scxml", ["Qml"]) + + if self.options.qtpurchasing: + _create_module("Purchasing") + + if self.options.qtcharts: + _create_module("Charts", ["Gui", "Widgets"]) + + if self.options.qtgamepad: + _create_module("Gamepad", ["Gui"]) + if self.settings.os == "Linux": + _create_plugin("QEvdevGamepadBackendPlugin", "evdevgamepad", "gamepads", []) + if self.settings.os == "Macos": + _create_plugin("QDarwinGamepadBackendPlugin", "darwingamepad", "gamepads", []) + if self.settings.os =="Windows": + _create_plugin("QXInputGamepadBackendPlugin", "xinputgamepad", "gamepads", []) + + if self.options.qt3d: + _create_module("3DCore", ["Gui", "Network"]) + + _create_module("3DRender", ["3DCore"]) + _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", []) + _create_plugin("GLTFGeometryLoaderPlugin", "gltfgeometryloader", "geometryloaders", []) + _create_plugin("GLTFSceneExportPlugin", "gltfsceneexport", "sceneparsers", []) + _create_plugin("GLTFSceneImportPlugin", "gltfsceneimport", "sceneparsers", []) + _create_plugin("OpenGLRendererPlugin", "openglrenderer", "renderers", []) + _create_plugin("Scene2DPlugin", "scene2d", "renderplugins", []) + + _create_module("3DAnimation", ["3DRender", "3DCore", "Gui"]) + _create_module("3DInput", ["3DCore", "Gui"] + (["Gamepad"] if self.options.qtgamepad else [])) + _create_module("3DLogic", ["3DCore", "Gui"]) + _create_module("3DExtras", ["3DRender", "3DInput", "3DLogic", "3DCore", "Gui"]) + _create_module("3DQuick", ["3DCore", "Quick", "Gui", "Qml"]) + _create_module("3DQuickAnimation", ["3DAnimation", "3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickExtras", ["3DExtras", "3DInput", "3DQuick", "3DRender", "3DLogic", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickInput", ["3DInput", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickRender", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + _create_module("3DQuickScene2D", ["3DRender", "3DQuick", "3DCore", "Gui", "Qml"]) + + if self.options.qtmultimedia: + multimedia_reqs = ["Network", "Gui"] + if self.options.get_safe("with_libalsa", False): + multimedia_reqs.append("libalsa::libalsa") + if self.options.with_openal: + multimedia_reqs.append("openal-soft::openal-soft") + if self.options.get_safe("with_pulseaudio", False): + multimedia_reqs.append("pulseaudio::pulse") + _create_module("Multimedia", multimedia_reqs) + _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) + if self.options.qtdeclarative and self.options.gui: + _create_module("MultimediaQuick", ["Multimedia", "Quick"]) + _create_plugin("QM3uPlaylistPlugin", "qtmultimedia_m3u", "playlistformats", []) + if self.options.with_gstreamer: + _create_module("MultimediaGstTools", ["Multimedia", "MultimediaWidgets", "Gui", "gst-plugins-base::gst-plugins-base"]) + _create_plugin("QGstreamerAudioDecoderServicePlugin", "gstaudiodecoder", "mediaservice", []) + _create_plugin("QGstreamerCaptureServicePlugin", "gstmediacapture", "mediaservice", []) + _create_plugin("QGstreamerPlayerServicePlugin", "gstmediaplayer", "mediaservice", []) + if self.settings.os == "Linux": + if self.options.with_gstreamer: + _create_plugin("CameraBinServicePlugin", "gstcamerabin", "mediaservice", []) + if self.options.get_safe("with_libalsa", False): + _create_plugin("QAlsaPlugin", "qtaudio_alsa", "audio", []) + if self.settings.os == "Windows": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("DSServicePlugin", "dsengine", "mediaservice", []) + _create_plugin("QWindowsAudioPlugin", "qtaudio_windows", "audio", []) + if self.settings.os == "Macos": + _create_plugin("AudioCaptureServicePlugin", "qtmedia_audioengine", "mediaservice", []) + _create_plugin("AVFMediaPlayerServicePlugin", "qavfmediaplayer", "mediaservice", []) + _create_plugin("AVFServicePlugin", "qavfcamera", "mediaservice", []) + _create_plugin("CoreAudioPlugin", "qtaudio_coreaudio", "audio", []) + + if self.options.qtwebsockets: + _create_module("WebSockets", ["Network"]) + + if self.options.qtconnectivity: + _create_module("Bluetooth", ["Network"]) + _create_module("Nfc", []) + + if self.options.qtdatavis3d: + _create_module("DataVisualization", ["Gui"]) + + if self.options.qtnetworkauth: + _create_module("NetworkAuth", ["Network"]) + + if self.settings.os != "Windows": + self.cpp_info.components["qtCore"].cxxflags.append("-fPIC") + + if self.options.get_safe("qtx11extras"): + _create_module("X11Extras") + + if self.options.qtremoteobjects: + _create_module("RemoteObjects") + + if self.options.get_safe("qtwinextras"): + _create_module("WinExtras") + + if self.options.get_safe("qtmacextras"): + _create_module("MacExtras") + + if self.options.qtxmlpatterns: + _create_module("XmlPatterns", ["Network"]) + + if self.options.get_safe("qtactiveqt"): + _create_module("AxBase", ["Gui", "Widgets"]) + self.cpp_info.components["qtAxBase"].includedirs = ["include", os.path.join("include", "ActiveQt")] + self.cpp_info.components["qtAxBase"].system_libs.extend(["ole32", "oleaut32", "user32", "gdi32", "advapi32"]) + if self.settings.compiler == "gcc": + self.cpp_info.components["qtAxBase"].system_libs.append("uuid") + _create_module("AxContainer", ["Core", "Gui", "Widgets", "AxBase"]) + self.cpp_info.components["qtAxContainer"].includedirs = [os.path.join("include", "ActiveQt")] + _create_module("AxServer", ["Core", "Gui", "Widgets", "AxBase"]) + self.cpp_info.components["qtAxServer"].includedirs = [os.path.join("include", "ActiveQt")] + self.cpp_info.components["qtAxServer"].system_libs.append("shell32") + + if self.options.qtscript: + _create_module("Script") + if self.options.widgets: + _create_module("ScriptTools", ["Gui", "Widgets", "Script"]) + + if self.options.qtandroidextras: + _create_module("AndroidExtras") + + if self.options.qtwebview: + _create_module("WebView", ["Gui", "Quick"]) + + if self.options.qtvirtualkeyboard: + _create_module("VirtualKeyboard", ["Qml", "Quick", "Gui"]) + + if self.options.qtspeech: + _create_module("TextToSpeech") + + if not self.options.shared: + if self.settings.os == "Windows": + self.cpp_info.components["qtCore"].system_libs.append("version") # qtcore requires "GetFileVersionInfoW" and "VerQueryValueW" which are in "Version.lib" library + self.cpp_info.components["qtCore"].system_libs.append("winmm") # qtcore requires "__imp_timeSetEvent" which is in "Winmm.lib" library + self.cpp_info.components["qtCore"].system_libs.append("netapi32") # qtcore requires "NetApiBufferFree" which is in "Netapi32.lib" library + self.cpp_info.components["qtCore"].system_libs.append("userenv") # qtcore requires "__imp_GetUserProfileDirectoryW " which is in "UserEnv.Lib" library + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") # qtcore requires "WSAStartup " which is in "Ws2_32.Lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") # qtnetwork from qtbase requires "DnsFree" which is in "Dnsapi.lib" library + self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi") + if self.options.widgets: + self.cpp_info.components["qtWidgets"].system_libs.append("uxtheme") + self.cpp_info.components["qtWidgets"].system_libs.append("dwmapi") + if self.options.get_safe("qtwinextras"): + self.cpp_info.components["qtWinExtras"].system_libs.append("dwmapi") # qtwinextras requires "DwmGetColorizationColor" which is in "dwmapi.lib" library + + if is_apple_os(self): + self.cpp_info.components["qtCore"].frameworks.append("CoreServices" if self.settings.os == "Macos" else "MobileCoreServices") + self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") + if self.options.with_gssapi: + self.cpp_info.components["qtNetwork"].frameworks.append("GSS") + if not self.options.openssl: # with SecureTransport + self.cpp_info.components["qtNetwork"].frameworks.append("Security") + if self.settings.os == "Macos" or (self.settings.os == "iOS" and Version(self.settings.compiler.version) >= "14.0"): + self.cpp_info.components["qtCore"].frameworks.append("IOKit") # qtcore requires "_IORegistryEntryCreateCFProperty", "_IOServiceGetMatchingService" and much more which are in "IOKit" framework + if self.settings.os == "Macos": + self.cpp_info.components["qtCore"].frameworks.append("Cocoa") # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework + self.cpp_info.components["qtCore"].frameworks.append("Security") # qtcore requires "_SecRequirementCreateWithString" and more, which are in "Security" framework + + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) + _add_build_module("qtCore", self._cmake_core_extras_file) + _add_build_module("qtCore", self._cmake_qt5_private_file("Core")) + + for m in os.listdir(os.path.join("lib", "cmake")): + module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") + component_name = m.replace("Qt5", "qt") + if os.path.isfile(module): + _add_build_module(component_name, module) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + + qt5core_config_extras_mkspec_dir_cmake = load(self, + os.path.join("lib", "cmake", "Qt5Core", "Qt5CoreConfigExtrasMkspecDir.cmake")) + mkspecs_dir_begin = qt5core_config_extras_mkspec_dir_cmake.find("mkspecs/") + mkspecs_dir_end = qt5core_config_extras_mkspec_dir_cmake.find("\"", mkspecs_dir_begin) + mkspecs_path = qt5core_config_extras_mkspec_dir_cmake[mkspecs_dir_begin:mkspecs_dir_end] + assert os.path.exists(mkspecs_path) + self.cpp_info.components["qtCore"].includedirs.append(mkspecs_path) + + objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) + for object_dir in objects_dirs: + for m in os.listdir(object_dir): + component = "qt" + m[:m.find("_")] + if component not in self.cpp_info.components: + continue + submodules_dir = os.path.join(object_dir, m) + for sub_dir in os.listdir(submodules_dir): + submodule_dir = os.path.join(submodules_dir, sub_dir) + obj_files = [os.path.join(submodule_dir, file) for file in os.listdir(submodule_dir)] + self.cpp_info.components[component].exelinkflags.extend(obj_files) + self.cpp_info.components[component].sharedlinkflags.extend(obj_files) + + build_modules_list = [] + + def _add_build_modules_for_component(component): + for req in self.cpp_info.components[component].requires: + if "::" in req: # not a qt component + continue + _add_build_modules_for_component(req) + build_modules_list.extend(build_modules.pop(component, [])) + + for c in self.cpp_info.components: + _add_build_modules_for_component(c) + + self.cpp_info.set_property("cmake_build_modules", build_modules_list) + + @staticmethod + def _remove_duplicate(l): + seen = set() + seen_add = seen.add + for element in itertools.filterfalse(seen.__contains__, l): + seen_add(element) + yield element + + def _gather_libs(self, p): + libs = ["-l" + i for i in p.cpp_info.aggregated_components().libs + p.cpp_info.aggregated_components().system_libs] + if is_apple_os(self): + libs += ["-framework " + i for i in p.cpp_info.aggregated_components().frameworks] + libs += p.cpp_info.aggregated_components().sharedlinkflags + for dep in p.dependencies.direct_host.values(): + libs += self._gather_libs(dep) + return self._remove_duplicate(libs) diff --git a/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch b/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch new file mode 100644 index 0000000..8169220 --- /dev/null +++ b/recipes/qt/5.x.x/patches/0001-Find-fontconfig-using-pkg-config.patch @@ -0,0 +1,56 @@ +From fb103459151fcf02706dd5abda95c716a934d610 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Mon, 9 May 2022 10:32:24 +0200 +Subject: [PATCH] Find fontconfig using pkg-config + +We already verify that it can be found like that during configure + +Task-number: QTBUG-61158 +Change-Id: I569590e96a490c4ed6e6dc560fbd110d86d77956 +Reviewed-by: Michal Klocek +(cherry picked from commit 357dcbf7d9510b5282a18e8211e2494f353b4e5e) +Reviewed-by: Qt Cherry-pick Bot +(cherry picked from commit 43329f9d7f38a5092a9c054c5d450072b236c6f8) +--- + chromium/components/services/font/BUILD.gn | 1 + + chromium/third_party/fontconfig/BUILD.gn | 5 +++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git chromium/components/services/font/BUILD.gn chromium/components/services/font/BUILD.gn +index b065131e035..f3e544ed29f 100644 +--- chromium/components/services/font/BUILD.gn ++++ chromium/components/services/font/BUILD.gn +@@ -42,6 +42,7 @@ if ((is_linux || is_chromeos) && enable_plugins) { + "//base:base", + "//ppapi/buildflags:buildflags", + "//ppapi/c", ++ "//third_party/fontconfig", + ] + } + } +diff --git chromium/third_party/fontconfig/BUILD.gn chromium/third_party/fontconfig/BUILD.gn +index 1bee7acb6b9..4cc32d62774 100644 +--- chromium/third_party/fontconfig/BUILD.gn ++++ chromium/third_party/fontconfig/BUILD.gn +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/sanitizers/sanitizers.gni") ++import("//build/config/linux/pkg_config.gni") + import("//third_party/fontconfig/fontconfig.gni") + + assert(is_linux || is_chromeos) +@@ -110,8 +111,8 @@ if (use_bundled_fontconfig) { + } + } + } else { +- config("fontconfig_config") { +- libs = [ "fontconfig" ] ++ pkg_config("fontconfig_config") { ++ packages = [ "fontconfig" ] + } + + group("fontconfig") { +-- +2.36.1 + diff --git a/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch new file mode 100644 index 0000000..053e6af --- /dev/null +++ b/recipes/qt/5.x.x/patches/337f28c9ab-5.15.8.patch @@ -0,0 +1,39 @@ +From 337f28c9abb12f28538cfe2f49e5afc460578b32 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= +Date: Tue, 5 Jul 2022 15:38:33 +0200 +Subject: Darwin: Replace deprecated symbol kIOMasterPortDefault with + equivalent + +We can't use the replacement kIOMainPortDefault yet, as it's not +available in operating system versions we still support, but the +kIOMasterPortDefault documentation explicitly says that passing +NULL as a port argument indicates "use the default". + +As the underlying type of a mach_port_t is potentially either +a pointer or an unsigned int, we initialize the default to 0. + +Pick-to: 6.2 6.3 6.4 5.15 +Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0 +Reviewed-by: Alexandru Croitor +--- + src/corelib/global/qglobal.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +(limited to 'src/corelib/global/qglobal.cpp') + +diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp +index 738e39658f..c894471ad6 100644 +--- a/src/corelib/global/qglobal.cpp ++++ b/src/corelib/global/qglobal.cpp +@@ -3077,7 +3077,8 @@ QByteArray QSysInfo::machineUniqueId() + { + #if defined(Q_OS_DARWIN) && __has_include() + char uuid[UuidStringLen + 1]; +- io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); ++ static const mach_port_t defaultPort = 0; // Effectively kIOMasterPortDefault/kIOMainPortDefault ++ io_service_t service = IOServiceGetMatchingService(defaultPort, IOServiceMatching("IOPlatformExpertDevice")); + QCFString stringRef = (CFStringRef)IORegistryEntryCreateCFProperty(service, CFSTR(kIOPlatformUUIDKey), kCFAllocatorDefault, 0); + CFStringGetCString(stringRef, uuid, sizeof(uuid), kCFStringEncodingMacRoman); + return QByteArray(uuid); +-- +cgit v1.2.1 diff --git a/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 0000000..21112d5 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.10-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1050,16 +1050,22 @@ + # endif // !_HAS_CONSTEXPR + # endif // !__GLIBCXX__ && !_LIBCPP_VERSION + # endif // Q_OS_QNX +-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) ++# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) ++# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) + // Apple has not updated libstdc++ since 2007, which means it does not have + // or std::move. Let's disable these features +-# undef Q_COMPILER_INITIALIZER_LISTS +-# undef Q_COMPILER_RVALUE_REFS +-# undef Q_COMPILER_REF_QUALIFIERS ++# undef Q_COMPILER_INITIALIZER_LISTS ++# undef Q_COMPILER_RVALUE_REFS ++# undef Q_COMPILER_REF_QUALIFIERS + // Also disable , since it's clearly not there +-# undef Q_COMPILER_ATOMICS +-# endif ++# undef Q_COMPILER_ATOMICS ++# endif ++# if defined(__cpp_lib_memory_resource) \ ++ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ ++ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) ++# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 ++# endif ++# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) + # if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 + // ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode + // (probably because libc++'s on OS X failed to compile), but they're missing some +--- a/src/corelib/tools/qduplicatetracker_p.h ++++ b/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L + # include + # include + #else diff --git a/recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 0000000..96fc7fd --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.12-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1055,16 +1055,22 @@ + # endif // !_HAS_CONSTEXPR + # endif // !__GLIBCXX__ && !_LIBCPP_VERSION + # endif // Q_OS_QNX +-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) ++# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) ++# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) + // Apple has not updated libstdc++ since 2007, which means it does not have + // or std::move. Let's disable these features +-# undef Q_COMPILER_INITIALIZER_LISTS +-# undef Q_COMPILER_RVALUE_REFS +-# undef Q_COMPILER_REF_QUALIFIERS ++# undef Q_COMPILER_INITIALIZER_LISTS ++# undef Q_COMPILER_RVALUE_REFS ++# undef Q_COMPILER_REF_QUALIFIERS + // Also disable , since it's clearly not there +-# undef Q_COMPILER_ATOMICS +-# endif ++# undef Q_COMPILER_ATOMICS ++# endif ++# if defined(__cpp_lib_memory_resource) \ ++ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ ++ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) ++# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 ++# endif ++# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) + # if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 + // ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode + // (probably because libc++'s on OS X failed to compile), but they're missing some +--- a/src/corelib/tools/qduplicatetracker_p.h ++++ b/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L + # include + # include + #else diff --git a/recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch new file mode 100644 index 0000000..cb5ec1f --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-chromium-newer-sdks.patch @@ -0,0 +1,13 @@ +diff --git a/chromium/base/strings/utf_string_conversions.cc b/chromium/base/strings/utf_string_conversions.cc +index 12ed1f3e0..004ac6855 100644 +--- a/chromium/base/strings/utf_string_conversions.cc ++++ b/chromium/base/strings/utf_string_conversions.cc +@@ -15,7 +15,7 @@ + #include "base/third_party/icu/icu_utf.h" + #include "build/build_config.h" + +-#if defined(OS_MAC) ++#if defined(OS_MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 120300 + namespace std { + inline namespace __1 { + template class basic_string; diff --git a/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch new file mode 100644 index 0000000..000965f --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-qtlocation-utility-header.patch @@ -0,0 +1,13 @@ +diff --git a/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp b/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp +index c7dc8b38e..d9e3709b1 100644 +--- a/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp ++++ b/src/3rdparty/mapbox-gl-native/include/mbgl/util/unique_any.hpp +@@ -3,6 +3,8 @@ + #include + #include + #include ++#include ++ + namespace mbgl { + namespace util { + \ No newline at end of file diff --git a/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch b/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch new file mode 100644 index 0000000..2fb28c9 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-macos-qtwebengine-rpath-link.patch @@ -0,0 +1,13 @@ +diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf +index 306e58db1..a42059e82 100644 +--- a/mkspecs/features/gn_generator.prf ++++ b/mkspecs/features/gn_generator.prf +@@ -166,7 +166,7 @@ for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\"," + unix:!macos: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\"," + } + } +-!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," ++!isEmpty(QMAKE_LFLAGS_RPATHLINK):!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\"," + GN_CONTENTS += " ]" + + GN_CONTENTS += " lib_dirs = [" diff --git a/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch b/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch new file mode 100644 index 0000000..fafd465 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.14-qtwebengine-missing-deps.patch @@ -0,0 +1,12 @@ +diff --git a/chromium/content/public/browser/BUILD.gn b/chromium/content/public/browser/BUILD.gn +index 7cf82a4..0e0dda2 100644 +--- a/chromium/content/public/browser/BUILD.gn ++++ b/chromium/content/public/browser/BUILD.gn +@@ -469,6 +469,7 @@ jumbo_source_set("browser_sources") { + "//build:chromeos_buildflags", + "//cc", + "//components/viz/host", ++ "//components/spellcheck:buildflags", + "//content/browser", # Must not be public_deps! + "//device/fido", + "//gpu", diff --git a/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch b/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch new file mode 100644 index 0000000..2eb73ac --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.7-fix-macos-cpp-lib-memory-resource.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/global/qcompilerdetection.h ++++ b/src/corelib/global/qcompilerdetection.h +@@ -1041,16 +1041,22 @@ + # endif // !_HAS_CONSTEXPR + # endif // !__GLIBCXX__ && !_LIBCPP_VERSION + # endif // Q_OS_QNX +-# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +- && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) ++# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) ++# if defined(__GNUC_LIBSTD__) && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) + // Apple has not updated libstdc++ since 2007, which means it does not have + // or std::move. Let's disable these features +-# undef Q_COMPILER_INITIALIZER_LISTS +-# undef Q_COMPILER_RVALUE_REFS +-# undef Q_COMPILER_REF_QUALIFIERS ++# undef Q_COMPILER_INITIALIZER_LISTS ++# undef Q_COMPILER_RVALUE_REFS ++# undef Q_COMPILER_REF_QUALIFIERS + // Also disable , since it's clearly not there +-# undef Q_COMPILER_ATOMICS +-# endif ++# undef Q_COMPILER_ATOMICS ++# endif ++# if defined(__cpp_lib_memory_resource) \ ++ && ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 140000) \ ++ || (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < 170000)) ++# undef __cpp_lib_memory_resource // Only supported on macOS 14 and iOS 17 ++# endif ++# endif // (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) + # if defined(Q_CC_CLANG) && defined(Q_CC_INTEL) && Q_CC_INTEL >= 1500 + // ICC 15.x and 16.0 have their own implementation of std::atomic, which is activated when in Clang mode + // (probably because libc++'s on OS X failed to compile), but they're missing some +--- a/src/corelib/tools/qduplicatetracker_p.h ++++ b/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#if defined(__cpp_lib_memory_resource) && __cplusplus > 201402L + # include + # include + #else diff --git a/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch b/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch new file mode 100644 index 0000000..a058fb5 --- /dev/null +++ b/recipes/qt/5.x.x/patches/5.15.8-fix-qmake-default-libdirs-apple-clang-15.patch @@ -0,0 +1,26 @@ +--- a/mkspecs/features/toolchain.prf ++++ b/mkspecs/features/toolchain.prf +@@ -288,9 +288,12 @@ isEmpty($${target_prefix}.INCDIRS) { + } + } + } +- isEmpty(QMAKE_DEFAULT_LIBDIRS)|isEmpty(QMAKE_DEFAULT_INCDIRS): \ ++ isEmpty(QMAKE_DEFAULT_INCDIRS): \ + !integrity: \ +- error("failed to parse default search paths from compiler output") ++ error("failed to parse default include paths from compiler output") ++ isEmpty(QMAKE_DEFAULT_LIBDIRS): \ ++ !integrity:!darwin: \ ++ error("failed to parse default library paths from compiler output") + QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS) + } else: ghs { + cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp +@@ -412,7 +415,7 @@ isEmpty($${target_prefix}.INCDIRS) { + QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) + } + +- unix:if(!cross_compile|host_build) { ++ unix:!darwin:if(!cross_compile|host_build) { + isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include + isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib + } diff --git a/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch new file mode 100644 index 0000000..abd82e1 --- /dev/null +++ b/recipes/qt/5.x.x/patches/Fix-errors-and-warnings-for-perfetto.patch @@ -0,0 +1,101 @@ +From 851cd7c7a079fa5da63770c49724036e8338e813 Mon Sep 17 00:00:00 2001 +From: Michal Klocek +Date: Wed, 20 Sep 2023 07:45:29 +0200 +Subject: [PATCH] Fix errors and warnings for perfetto +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +It seems newest msvc compiler does not like perfetto circualar queue +const iterator, which ends in issues with std::swap of std::sort. +Make sure it is non const. + +Fix warnings. + +Deals with: "error C2672: 'swap': no matching overloaded function +found." + +Fixes: QTBUG-117073 +Change-Id: I02901e61a1bb8863d72ca02a0ccd841e54309d6e +Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/505412 +Reviewed-by: Martin Negyokru +Reviewed-by: Michael Brüning +--- + .../perfetto/include/perfetto/ext/base/circular_queue.h | 9 ++------- + .../third_party/perfetto/src/trace_processor/storage/metadata.h | 2 ++ + .../third_party/perfetto/src/trace_processor/storage/stats.h | 2 ++ + .../perfetto/src/trace_processor/tables/macros_internal.h | 2 ++ + 4 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +index 18ca7702614..ec46e69f817 100644 +--- a/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h ++++ b/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h +@@ -67,19 +67,14 @@ class CircularQueue { + ignore_result(generation); + } + +- T* operator->() { ++ T* operator->() const { + #if PERFETTO_DCHECK_IS_ON() + PERFETTO_DCHECK(generation_ == queue_->generation()); + #endif + return queue_->Get(pos_); + } + +- const T* operator->() const { +- return const_cast::Iterator*>(this)->operator->(); +- } +- +- T& operator*() { return *(operator->()); } +- const T& operator*() const { return *(operator->()); } ++ T& operator*() const { return *(operator->()); } + + value_type& operator[](difference_type i) { return *(*this + i); } + +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +index 4796ae4edcd..30e534b216b 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/metadata.h +@@ -59,8 +59,10 @@ namespace metadata { + F(kMulti, "multi") + // clang-format + ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + // Ignore GCC warning about a missing argument for a variadic macro parameter. + #pragma GCC system_header ++#endif + + #define PERFETTO_TP_META_TYPE_ENUM(varname, ...) varname + enum class KeyType : size_t { +diff --git a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +index 7f14803244e..30b56c62544 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/storage/stats.h ++++ b/chromium/third_party/perfetto/src/trace_processor/storage/stats.h +@@ -189,7 +189,9 @@ enum Source { + }; + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Declares an enum of literals (one for each stat). The enum values of each + // literal corresponds to the string index in the arrays below. +diff --git a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +index 875efd62e0d..1ca5068cc32 100644 +--- a/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h ++++ b/chromium/third_party/perfetto/src/trace_processor/tables/macros_internal.h +@@ -140,7 +140,9 @@ class MacroTable : public Table { + } // namespace macros_internal + + // Ignore GCC warning about a missing argument for a variadic macro parameter. ++#if PERFETTO_BUILDFLAG(PERFETTO_COMPILER_GCC) + #pragma GCC system_header ++#endif + + // Basic helper macros. + #define PERFETTO_TP_NOOP(...) +-- +2.16.3 + diff --git a/recipes/qt/5.x.x/patches/aa2a39dea5.diff b/recipes/qt/5.x.x/patches/aa2a39dea5.diff new file mode 100644 index 0000000..3fe3827 --- /dev/null +++ b/recipes/qt/5.x.x/patches/aa2a39dea5.diff @@ -0,0 +1,29 @@ +From aa2a39dea5918c63045310b0d2a7e34ce9934e0c Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 26 Nov 2019 12:47:47 +0100 +Subject: [PATCH] add inline source detection to glib + +this allows to use static version of glib (pkg-config only works with shared libraries) + +Change-Id: If9b0054985b87b8da43269425b32c2e4ffb65f5a +--- + src/corelib/configure.json | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/corelib/configure.json b/src/corelib/configure.json +index ae360239c6..998687dc4e 100644 +--- a/src/corelib/configure.json ++++ b/src/corelib/configure.json +@@ -45,7 +45,8 @@ + }, + "headers": "glib.h", + "sources": [ +- { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ++ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }, ++ "-lgthread-2.0 -lglib-2.0" + ] + }, + "posix_iconv": { +-- +2.23.0.windows.1 + diff --git a/recipes/qt/5.x.x/patches/android-backtrace.diff b/recipes/qt/5.x.x/patches/android-backtrace.diff new file mode 100644 index 0000000..0fba728 --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-backtrace.diff @@ -0,0 +1,19 @@ +diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp +index 89f49324c..dedf78fe5 100644 +--- a/src/corelib/global/qlogging.cpp ++++ b/src/corelib/global/qlogging.cpp +@@ -107,7 +107,13 @@ + # define QLOGGING_HAVE_BACKTRACE + # endif + # elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include() && __has_include()) +-# define QLOGGING_HAVE_BACKTRACE ++# ifdef __ANDROID_API__ ++# if __ANDROID_API__ >= 33 ++# define QLOGGING_HAVE_BACKTRACE ++# endif ++# else ++# define QLOGGING_HAVE_BACKTRACE ++# endif + # endif + #endif + diff --git a/recipes/qt/5.x.x/patches/android-new-ndk.diff b/recipes/qt/5.x.x/patches/android-new-ndk.diff new file mode 100644 index 0000000..44b38b6 --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-new-ndk.diff @@ -0,0 +1,27 @@ +From 49f62e8c5a8aef4c0b7fd6867a30e653d2f5dd98 Mon Sep 17 00:00:00 2001 +From: Alexey Edelev +Date: Mon, 21 Nov 2022 15:03:17 +0100 +Subject: [PATCH] Remove QMAKE_RANLIB and QMAKE_LINK_SHLIB from android/default_pre.prf + +The values should come from android-clang mkspecs. The hardcoded +values don't work correctly with recent Android NDKs. + +Pick-to: 6.4 6.2 5.15 +Fixes: QTBUG-108662 +Change-Id: Ie153a50ee0c49bd4f0704b588a4e2c87a05c1063 +Reviewed-by: Assam Boudjelthia +--- + +diff --git a/mkspecs/features/android/default_pre.prf b/mkspecs/features/android/default_pre.prf +index 9f90dcb..2328b72 100644 +--- a/mkspecs/features/android/default_pre.prf ++++ b/mkspecs/features/android/default_pre.prf +@@ -76,8 +76,6 @@ + else: equals(QT_ARCH, arm64-v8a): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/aarch64-linux-android- + else: CROSS_COMPILE = $$NDK_LLVM_PATH/bin/arm-linux-androideabi- + +-QMAKE_RANLIB = $${CROSS_COMPILE}ranlib +-QMAKE_LINK_SHLIB = $$QMAKE_LINK + QMAKE_LFLAGS = + + QMAKE_LIBS_PRIVATE = -llog -lz -lm -ldl -lc diff --git a/recipes/qt/5.x.x/patches/android-openssl.diff b/recipes/qt/5.x.x/patches/android-openssl.diff new file mode 100644 index 0000000..6091b9f --- /dev/null +++ b/recipes/qt/5.x.x/patches/android-openssl.diff @@ -0,0 +1,13 @@ +diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri +index 230c45c26..d7527949e 100644 +--- a/src/network/ssl/ssl.pri ++++ b/src/network/ssl/ssl.pri +@@ -117,7 +117,7 @@ qtConfig(ssl) { + + qtConfig(openssl-linked): { + android { +- build_pass|single_android_abi: LIBS_PRIVATE += -lssl_$${QT_ARCH} -lcrypto_$${QT_ARCH} ++ build_pass|single_android_abi: LIBS_PRIVATE += -lssl -lcrypto + } else: QMAKE_USE_FOR_PRIVATE += openssl + } else: \ + QMAKE_USE_FOR_PRIVATE += openssl/nolink diff --git a/recipes/qt/5.x.x/patches/c72097e.diff b/recipes/qt/5.x.x/patches/c72097e.diff new file mode 100644 index 0000000..56b2679 --- /dev/null +++ b/recipes/qt/5.x.x/patches/c72097e.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tools/gn/ninja_action_target_writer.cc +@@ -119,9 +119,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch b/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch new file mode 100644 index 0000000..0538804 --- /dev/null +++ b/recipes/qt/5.x.x/patches/chromium-skia-missing-iterator-include.patch @@ -0,0 +1,10 @@ +diff --git a/chromium/third_party/skia/src/utils/SkParseColor.cpp b/chromium/third_party/skia/src/utils/SkParseColor.cpp +index 7260365b2c6..96f46dd67f9 100644 +--- a/chromium/third_party/skia/src/utils/SkParseColor.cpp ++++ b/chromium/third_party/skia/src/utils/SkParseColor.cpp +@@ -9,3 +0,5 @@ + #include "include/utils/SkParse.h" + ++#include // std::lower_bound ++ + static constexpr const char* gColorNames[] = { diff --git a/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch b/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch new file mode 100644 index 0000000..c373947 --- /dev/null +++ b/recipes/qt/5.x.x/patches/chromium-v8-missing-constexpr.patch @@ -0,0 +1,46 @@ +From a5cea1bfc38ceafc74f4baddd6ab94ea13757ef8 Mon Sep 17 00:00:00 2001 +From: Lei Zhang +Date: Fri, 21 May 2021 10:55:53 -0700 +Subject: [PATCH] Mark Node::opcode() and Operator::opcode() as constexpr. + +Without the explicit constexpr keyword, Clang seems to be able to treat +these methods as constexpr, whereas MSVC will not. + +Bug: v8:11760 +Change-Id: I9f6492f38fb50dcaf7a4f09da0bd79c0da6a50eb +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2912916 +Reviewed-by: Clemens Backes +Reviewed-by: Maya Lekova +Commit-Queue: Lei Zhang +Cr-Commit-Position: refs/heads/master@{#74791} +--- + src/compiler/node.h | 2 +- + src/compiler/operator.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/compiler/node.h b/src/compiler/node.h +index 37b45c403f1..57d49fe1ac0 100644 +--- a/src/compiler/node.h ++++ b/src/compiler/node.h +@@ -50,7 +50,7 @@ class V8_EXPORT_PRIVATE Node final { + + const Operator* op() const { return op_; } + +- IrOpcode::Value opcode() const { ++ constexpr IrOpcode::Value opcode() const { + DCHECK_GE(IrOpcode::kLast, op_->opcode()); + return static_cast(op_->opcode()); + } +diff --git a/src/compiler/operator.h b/src/compiler/operator.h +index 4206e753f1e..f641394eb1f 100644 +--- a/src/compiler/operator.h ++++ b/src/compiler/operator.h +@@ -69,7 +69,7 @@ class V8_EXPORT_PRIVATE Operator : public NON_EXPORTED_BASE(ZoneObject) { + // A small integer unique to all instances of a particular kind of operator, + // useful for quick matching for specific kinds of operators. For fast access + // the opcode is stored directly in the operator object. +- Opcode opcode() const { return opcode_; } ++ constexpr Opcode opcode() const { return opcode_; } + + // Returns a constant string representing the mnemonic of the operator, + // without the static parameters. Useful for debugging. diff --git a/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch b/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch new file mode 100644 index 0000000..cff8df9 --- /dev/null +++ b/recipes/qt/5.x.x/patches/ffmpeg-x86-optimization.patch @@ -0,0 +1,64 @@ +Description: avcodec/x86/mathops: clip constants used with shift instructions within inline assembly + Fixes assembling with gas from binutils >= 2.41. +Origin: upstream, https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/effadce6c756247e +Bug: https://bugs.debian.org/1038132 +Last-Update: 2023-07-21 + +--- a/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h ++++ b/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + diff --git a/recipes/qt/5.x.x/patches/fix-macdeployqt.diff b/recipes/qt/5.x.x/patches/fix-macdeployqt.diff new file mode 100644 index 0000000..a6e5f96 --- /dev/null +++ b/recipes/qt/5.x.x/patches/fix-macdeployqt.diff @@ -0,0 +1,66 @@ +From 03abcbabbd4caa11048d19d95b23f165cd7a5361 Mon Sep 17 00:00:00 2001 +From: Seth Parker +Date: Wed, 31 Mar 2021 15:34:10 -0400 +Subject: [PATCH] macdeployqt: Fix plugin resolution bugs for non-standard + installs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Uses QLibraryInfo to resolve plugins at installed locations. + +[ChangeLog][macOS][macdeployqt] Uses QLibraryInfo to resolve plugins at install locations. + +Fixes: QTBUG-91644 +Change-Id: Ie309061024abd7a58ea62d707716342c99897c26 +Reviewed-by: Morten Johan Sørvig +--- + src/macdeployqt/macdeployqt/main.cpp | 30 ++++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 6 deletions(-) + +diff --git a/src/macdeployqt/macdeployqt/main.cpp b/src/macdeployqt/macdeployqt/main.cpp +index 8914e835b..628a71378 100644 +--- a/src/macdeployqt/macdeployqt/main.cpp ++++ b/src/macdeployqt/macdeployqt/main.cpp +@@ -27,6 +27,7 @@ + ****************************************************************************/ + #include + #include ++#include + + #include "../shared/shared.h" + +@@ -236,10 +237,28 @@ int main(int argc, char **argv) + } + +- if (plugins && !deploymentInfo.qtPath.isEmpty()) { +- deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins"; +- LogNormal(); +- deployPlugins(appBundlePath, deploymentInfo, useDebugLibs); +- createQtConf(appBundlePath); ++ // Handle plugins ++ if (plugins) { ++ // Set the plugins search directory ++ deploymentInfo.pluginPath = QLibraryInfo::location(QLibraryInfo::PluginsPath); ++ ++ // Sanity checks ++ if (deploymentInfo.pluginPath.isEmpty()) { ++ LogError() << "Missing Qt plugins path\n"; ++ return 1; ++ } ++ ++ if (!QDir(deploymentInfo.pluginPath).exists()) { ++ LogError() << "Plugins path does not exist" << deploymentInfo.pluginPath << "\n"; ++ return 1; ++ } ++ ++ // Deploy plugins ++ Q_ASSERT(!deploymentInfo.pluginPath.isEmpty()); ++ if (!deploymentInfo.pluginPath.isEmpty()) { ++ LogNormal(); ++ deployPlugins(appBundlePath, deploymentInfo, useDebugLibs); ++ createQtConf(appBundlePath); ++ } + } + + if (runStripEnabled) diff --git a/recipes/qt/5.x.x/patches/qtconnectivity-1-fixes.patch b/recipes/qt/5.x.x/patches/qtconnectivity-1-fixes.patch new file mode 100644 index 0000000..a0bae96 --- /dev/null +++ b/recipes/qt/5.x.x/patches/qtconnectivity-1-fixes.patch @@ -0,0 +1,45 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Mon, 4 Nov 2024 15:34:31 +0100 +Subject: [PATCH 1/1] fix + + +diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp +index 1111111..2222222 100644 +--- a/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp ++++ b/src/bluetooth/qbluetoothservicediscoveryagent_win.cpp +@@ -50,15 +50,7 @@ + #include + #include + +-#if defined(Q_CC_MINGW) +-// Workaround for MinGW headers declaring BluetoothSdpGetElementData incorrectly. +-# define BluetoothSdpGetElementData _BluetoothSdpGetElementData_notok +-# include +-# undef BluetoothSdpGetElementData +- extern "C" DWORD WINAPI BluetoothSdpGetElementData(LPBYTE, ULONG, PSDP_ELEMENT_DATA); +-#else +-# include +-#endif ++#include + + #include + #include +@@ -206,12 +198,7 @@ static QList spdContainerToVariantList(LPBYTE containerStream, ULONG c + return sequence; + } + +-#if defined(Q_CC_MINGW) +-# define SDP_CALLBACK +-#else +-# define SDP_CALLBACK QT_WIN_CALLBACK +-#endif +-static BOOL SDP_CALLBACK bluetoothSdpCallback(ULONG attributeId, LPBYTE valueStream, ULONG streamSize, LPVOID param) ++static BOOL QT_WIN_CALLBACK bluetoothSdpCallback(ULONG attributeId, LPBYTE valueStream, ULONG streamSize, LPVOID param) + { + QBluetoothServiceInfo *result = static_cast(param); + diff --git a/recipes/qt/5.x.x/patches/qtdeclarative-1-fixes.patch b/recipes/qt/5.x.x/patches/qtdeclarative-1-fixes.patch new file mode 100644 index 0000000..be75114 --- /dev/null +++ b/recipes/qt/5.x.x/patches/qtdeclarative-1-fixes.patch @@ -0,0 +1,94 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Fri, 20 Nov 2020 18:32:31 +0100 +Subject: [PATCH 1/2] Disable d3d12 requiring fxc.exe + +* fxc.exe is not provided by WINE or mingw-w64 and hence not available + in our build environment +* The version from https://github.com/mozilla/fxc2 builds but it does + not support all CLI options required by Qt's build system +* The build error looks like this: + ``` + make[5]: Entering directory '/build/mingw-w64-qt5-declarative/src/qtdeclarative-everywhere-src-5.15.2/build-i686-w64-mingw32-shared/src/plugins/scenegraph/d3d12' + fxc.exe /nologo /E VS_VertexColor /T vs_5_0 /Fh vs_vertexcolor.hlslh /build/mingw-w64-qt5-declarative/src/qtdeclarative-everywhere-src-5.15.2/src/plugins/scenegraph/d3d12/shaders/vertexcolor.hlsl + make[5]: fxc.exe: No such file or directory + make[5]: *** [Makefile.Release:233: vs_vertexcolor.hlslh] Error 127 + ``` +taken from: +https://aur.archlinux.org/cgit/aur.git/tree/0003-Disable-d3d12-requiring-fxc.exe.patch?h=mingw-w64-qt5-declarative + +diff --git a/src/3rdparty/masm/yarr/Yarr.h b/src/3rdparty/masm/yarr/Yarr.h +index 1111111..2222222 100644 +--- a/src/3rdparty/masm/yarr/Yarr.h ++++ b/src/3rdparty/masm/yarr/Yarr.h +@@ -27,6 +27,8 @@ + + #pragma once + ++#include ++ + #include + #include + #include "YarrErrorCode.h" +diff --git a/src/plugins/scenegraph/scenegraph.pro b/src/plugins/scenegraph/scenegraph.pro +index 1111111..2222222 100644 +--- a/src/plugins/scenegraph/scenegraph.pro ++++ b/src/plugins/scenegraph/scenegraph.pro +@@ -1,5 +1,4 @@ + TEMPLATE = subdirs + QT_FOR_CONFIG += quick +-qtConfig(d3d12): SUBDIRS += d3d12 + qtConfig(openvg): SUBDIRS += openvg + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Allan Sandfeld Jensen +Date: Wed, 19 Jun 2019 12:54:43 +0200 +Subject: [PATCH 2/2] Update hovered on disabled QQuickItems + +Changes handling of hovered so that the property is still updated on +disabled items, so that other items can bind to it. This is in +particular useful for tooltips. + +[ChangeLog][Behavior Changes] QQuickItem::hovered will now update even +when the item is disabled. + +Fixes: QTBUG-30801 +Pick-to: 6.0 +Change-Id: Id17298f657d7631b0e5019138ba33a7d5f863475 +Reviewed-by: Fabian Kosmale +Reviewed-by: Allan Sandfeld Jensen +Reviewed-by: Shawn Rutledge + +diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp +index 1111111..2222222 100644 +--- a/src/quick/items/qquickwindow.cpp ++++ b/src/quick/items/qquickwindow.cpp +@@ -2110,7 +2110,9 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce + QList children = itemPrivate->paintOrderChildItems(); + for (int ii = children.count() - 1; ii >= 0; --ii) { + QQuickItem *child = children.at(ii); +- if (!child->isVisible() || !child->isEnabled() || QQuickItemPrivate::get(child)->culled) ++ if (!child->isVisible() || QQuickItemPrivate::get(child)->culled) ++ continue; ++ if (!child->isEnabled() && !QQuickItemPrivate::get(child)->subtreeHoverEnabled) + continue; + if (deliverHoverEvent(child, scenePos, lastScenePos, modifiers, timestamp, accepted)) + return true; +diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp +index 1111111..2222222 100644 +--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp ++++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp +@@ -1657,7 +1657,7 @@ void tst_qquickitem::hoverEvent() + sendMouseMove(window, inside); + sendMouseMove(window, outside); + +- const bool shouldReceiveHoverEvents = visible && enabled && acceptHoverEvents; ++ const bool shouldReceiveHoverEvents = visible && acceptHoverEvents; + if (shouldReceiveHoverEvents) { + QCOMPARE(item->hoverEnterCount, 1); + QCOMPARE(item->hoverMoveCount, 2); diff --git a/recipes/qt/5.x.x/patches/qtlocation-1.patch b/recipes/qt/5.x.x/patches/qtlocation-1.patch new file mode 100644 index 0000000..23cc2fc --- /dev/null +++ b/recipes/qt/5.x.x/patches/qtlocation-1.patch @@ -0,0 +1,23 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Fri, 2 Jun 2017 18:23:20 +0200 +Subject: [PATCH 1/1] disable mapboxgl for MXE + + +diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro +index 1111111..2222222 100644 +--- a/src/plugins/geoservices/geoservices.pro ++++ b/src/plugins/geoservices/geoservices.pro +@@ -12,7 +12,8 @@ qtConfig(geoservices_mapboxgl) { + !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { + warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") + } else { +- SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native +- mapboxgl.depends = ../../3rdparty/mapbox-gl-native ++# SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native ++# mapboxgl.depends = ../../3rdparty/mapbox-gl-native ++ message(MXE: mapboxgl disabled) + } + } diff --git a/recipes/qt/5.x.x/patches/qtmultimedia-1.patch b/recipes/qt/5.x.x/patches/qtmultimedia-1.patch new file mode 100644 index 0000000..5f9ae99 --- /dev/null +++ b/recipes/qt/5.x.x/patches/qtmultimedia-1.patch @@ -0,0 +1,22 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +From 0000000000000000000000000000000000000000 Thu May 27 00:00:00 2021 +From: Adrian Jaekel +Date: Thu, 27 May 2021 14:03:20 +0200 +Subject: [PATCH 1/1] disable wmf plugin for MXE + + +diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro +index 1111111..2222222 100644 +--- a/src/plugins/plugins.pro ++++ b/src/plugins/plugins.pro +@@ -35,7 +35,8 @@ win32:!winrt { + windowsaudio + + qtConfig(directshow): SUBDIRS += directshow +- qtConfig(wmf): SUBDIRS += wmf ++# qtConfig(wmf): SUBDIRS += wmf ++ message(MXE: wmf disabled) + } + + diff --git a/recipes/qt/5.x.x/patches/qttools-1-fixes.patch b/recipes/qt/5.x.x/patches/qttools-1-fixes.patch new file mode 100644 index 0000000..5e0e4b4 --- /dev/null +++ b/recipes/qt/5.x.x/patches/qttools-1-fixes.patch @@ -0,0 +1,94 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Sun, 28 Apr 2019 23:07:09 +1000 +Subject: [PATCH 1/2] disable windeployqt (MXE specific) + + +diff --git a/src/src.pro b/src/src.pro +index 1111111..2222222 100644 +--- a/src/src.pro ++++ b/src/src.pro +@@ -36,7 +36,7 @@ macos { + + qtHaveModule(dbus): SUBDIRS += qdbus + +-win32|winrt:SUBDIRS += windeployqt ++#win32|winrt:SUBDIRS += windeployqt + winrt:SUBDIRS += winrtrunner + qtHaveModule(gui):!wasm:!android:!uikit:!qnx:!winrt: SUBDIRS += qtdiag + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Tony Theodore +Date: Sun, 28 Apr 2019 23:12:41 +1000 +Subject: [PATCH 2/2] disable qdoc (MXE specific - requires libclang-devel) + + +diff --git a/src/assistant/help/Qt5HelpConfigExtras.cmake.in b/src/assistant/help/Qt5HelpConfigExtras.cmake.in +deleted file mode 100644 +index 1f7544b..0000000 +--- a/src/assistant/help/Qt5HelpConfigExtras.cmake.in ++++ /dev/null +@@ -1,41 +0,0 @@ +- +-if (NOT TARGET Qt5::qcollectiongenerator) +- add_executable(Qt5::qcollectiongenerator IMPORTED) +- +-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) +- set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\") +-!!ELSE +- set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\") +-!!ENDIF +- _qt5_Help_check_file_exists(${imported_location}) +- +- set_target_properties(Qt5::qcollectiongenerator PROPERTIES +- IMPORTED_LOCATION ${imported_location} +- ) +-endif() +- +-if (NOT TARGET Qt5::qhelpgenerator) +- add_executable(Qt5::qhelpgenerator IMPORTED) +- +-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) +- set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\") +-!!ELSE +- set(imported_location \"$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\") +-!!ENDIF +- _qt5_Help_check_file_exists(${imported_location}) +- +- set_target_properties(Qt5::qhelpgenerator PROPERTIES +- IMPORTED_LOCATION ${imported_location} +- ) +-endif() +- +-# Create versionless tool targets. +-foreach(__qt_tool qcollectiongenerator qhelpgenerator) +- if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::${__qt_tool} +- AND TARGET Qt5::${__qt_tool}) +- add_executable(Qt::${__qt_tool} IMPORTED) +- get_target_property(__qt_imported_location Qt5::${__qt_tool} IMPORTED_LOCATION) +- set_target_properties(Qt::${__qt_tool} +- PROPERTIES IMPORTED_LOCATION \"${__qt_imported_location}\") +- endif() +-endforeach() +diff --git a/src/src.pro b/src/src.pro +index 1111111..2222222 100644 +--- a/src/src.pro ++++ b/src/src.pro +@@ -24,9 +24,9 @@ qtConfig(library) { + !android|android_app: SUBDIRS += qtplugininfo + } + +-include($$OUT_PWD/qdoc/qtqdoc-config.pri) +-QT_FOR_CONFIG += qdoc-private +-qtConfig(qdoc): qtConfig(thread): SUBDIRS += qdoc ++#include($$OUT_PWD/qdoc/qtqdoc-config.pri) ++#QT_FOR_CONFIG += qdoc-private ++#qtConfig(qdoc): qtConfig(thread): SUBDIRS += qdoc + + !android|android_app: SUBDIRS += qtpaths + diff --git a/recipes/qt/5.x.x/patches/skia-cd397f3.diff b/recipes/qt/5.x.x/patches/skia-cd397f3.diff new file mode 100644 index 0000000..ae4ccdd --- /dev/null +++ b/recipes/qt/5.x.x/patches/skia-cd397f3.diff @@ -0,0 +1,25 @@ +From cd397f3c4738beb61cfd1c611544d096a6f4fa36 Mon Sep 17 00:00:00 2001 +From: Jordan Williams +Date: Tue, 26 Apr 2022 11:44:31 -0500 +Subject: [PATCH] Add missing include for std::begin and std::end in SkParseColor.cpp + +Change-Id: I51f6766271cfcc2dff7fc30e3f7439c4580cbb6a +Reviewed-on: https://skia-review.googlesource.com/c/skia/+/533981 +Reviewed-by: Brian Salomon +Commit-Queue: Brian Salomon +--- + + # Trusted service accounts. + Recipe roller SA +diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp +index 3164650..0dc3497 100644 +--- a/src/utils/SkParseColor.cpp ++++ b/src/utils/SkParseColor.cpp +@@ -9,6 +9,7 @@ + #include "include/utils/SkParse.h" + + #include // std::lower_bound ++#include + + static constexpr const char* gColorNames[] = { + "aliceblue", diff --git a/recipes/qt/5.x.x/qtmodules5.15.10.conf b/recipes/qt/5.x.x/qtmodules5.15.10.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.10.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.11.conf b/recipes/qt/5.x.x/qtmodules5.15.11.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.11.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.12.conf b/recipes/qt/5.x.x/qtmodules5.15.12.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.12.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.13.conf b/recipes/qt/5.x.x/qtmodules5.15.13.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.13.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.14.conf b/recipes/qt/5.x.x/qtmodules5.15.14.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.14.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.16.conf b/recipes/qt/5.x.x/qtmodules5.15.16.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.16.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/qtmodules5.15.9.conf b/recipes/qt/5.x.x/qtmodules5.15.9.conf new file mode 100644 index 0000000..4522336 --- /dev/null +++ b/recipes/qt/5.x.x/qtmodules5.15.9.conf @@ -0,0 +1,326 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 5.15 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 5.15 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtsvg + path = qtdeclarative + url = ../qtdeclarative.git + branch = 5.15 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 5.15 + status = addon +[submodule "qtscript"] + depends = qtbase + recommends = qttools + path = qtscript + url = ../qtscript.git + branch = 5.15 + status = deprecated +[submodule "qtmultimedia"] + depends = qtbase + recommends = qtdeclarative + path = qtmultimedia + url = ../qtmultimedia.git + branch = 5.15 + status = essential +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 5.15 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = 5.15 + status = deprecated +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 5.15 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtquickcontrols qtquickcontrols2 + path = qtdoc + url = ../qtdoc.git + branch = 5.15 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = master + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase + recommends = qtdeclarative qtquickcontrols qtquickcontrols2 qtserialport + path = qtlocation + url = ../qtlocation.git + branch = 5.15 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 5.15 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtdocgallery"] + depends = qtdeclarative + path = qtdocgallery + url = ../qtdocgallery.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtconnectivity + url = ../qtconnectivity.git + branch = 5.15 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 5.15 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtimageformats qtgamepad + path = qt3d + url = ../qt3d.git + branch = 5.15 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 5.15 + status = addon +[submodule "qtgraphicaleffects"] + depends = qtdeclarative + path = qtgraphicaleffects + url = ../qtgraphicaleffects.git + branch = 5.15 + status = essential +[submodule "qtquickcontrols"] + depends = qtdeclarative + recommends = qtgraphicaleffects + path = qtquickcontrols + url = ../qtquickcontrols.git + branch = 5.15 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 5.15 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 5.15 + status = addon +[submodule "qtx11extras"] + depends = qtbase + path = qtx11extras + url = ../qtx11extras.git + branch = 5.15 + status = addon +[submodule "qtmacextras"] + depends = qtbase + path = qtmacextras + url = ../qtmacextras.git + branch = 5.15 + status = addon +[submodule "qtwinextras"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtwinextras + url = ../qtwinextras.git + branch = 5.15 + status = addon +[submodule "qtandroidextras"] + depends = qtbase + path = qtandroidextras + url = ../qtandroidextras.git + branch = 5.15 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 5.15 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 5.15 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtquickcontrols qtquickcontrols2 qtlocation qtwebchannel qttools + path = qtwebengine + url = ../qtwebengine.git + branch = 5.15 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 5.15 + status = addon +[submodule "qtquickcontrols2"] + depends = qtgraphicaleffects + recommends = qtimageformats + path = qtquickcontrols2 + url = ../qtquickcontrols2.git + branch = 5.15 + status = essential +[submodule "qtpurchasing"] + depends = qtbase + recommends = qtdeclarative qtandroidextras + path = qtpurchasing + url = ../qtpurchasing.git + branch = 5.15 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 5.15 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 5.15 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia qtquickcontrols + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 5.15 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = 5.15 + status = addon +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 5.15 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 5.15 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 5.15 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 5.15 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = 5.15 + status = addon +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 5.15 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 5.15 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative + path = qtquick3d + url = ../qtquick3d.git + branch = 5.15 + status = addon diff --git a/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..a56d8c5 --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.1.0) + +set(CMAKE_CXX_STANDARD 11) + +project(test_package) + +cmake_policy(SET CMP0020 NEW) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(Qt5 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(SOURCES ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +add_executable(${PROJECT_NAME} ${SOURCES}) + +target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network Qt5::Sql Qt5::Concurrent Qt5::Xml) diff --git a/recipes/qt/5.x.x/test_v1_package/conanfile.py b/recipes/qt/5.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..45d17b4 --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/conanfile.py @@ -0,0 +1,134 @@ +import os +import shutil + +from conan import ConanFile +from conans import tools, Meson, RunEnvironment, CMake +from conan.tools.build import cross_building +from conan.tools.files import save +from conan.errors import ConanInvalidConfiguration + + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "qmake" + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + def build_requirements(self): + if self._settings_build.os == "Windows" and self.settings.compiler == "Visual Studio": + self.build_requires("jom/1.1.3") + if self._meson_supported(): + self.build_requires("meson/1.1.1") + + def generate(self): + save(self, "qt.conf", """[Paths] +Prefix = {}""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return self.options["qt"].shared and\ + not cross_building(self) and\ + not tools.os_info.is_macos and\ + not self._is_mingw() + + def _qmake_supported(self): + return self.options["qt"].shared + + def _build_with_qmake(self): + if not self._qmake_supported(): + return + tools.mkdir("qmake_folder") + with tools.chdir("qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if self.settings.compiler == "Visual Studio" else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath("CC") + if value: + args += ['QMAKE_CC="' + value + '"', + 'QMAKE_LINK_C="' + value + '"', + 'QMAKE_LINK_C_SHLIB="' + value + '"'] + + value = _getenvpath('CXX') + if value: + args += ['QMAKE_CXX="' + value + '"', + 'QMAKE_LINK="' + value + '"', + 'QMAKE_LINK_SHLIB="' + value + '"'] + + self.run("qmake %s" % " ".join(args), run_environment=True) + if tools.os_info.is_windows: + if self.settings.compiler == "Visual Studio": + self.run("jom", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + tools.mkdir("meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanInvalidConfiguration: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.14' + + cmake.configure() + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake_find_package_multi() + + def _test_with_qmake(self): + if not self._qmake_supported(): + return + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if tools.os_info.is_macos: + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy(os.path.join(self.generators_folder, "qt.conf"), "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) + + def test(self): + if not cross_building(self, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake_find_package_multi() diff --git a/recipes/qt/5.x.x/test_v1_package/meson.build b/recipes/qt/5.x.x/test_v1_package/meson.build new file mode 100644 index 0000000..cc717d4 --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/meson.build @@ -0,0 +1,6 @@ +project('test_package', 'cpp') +qt5 = import('qt5') +qt5_dep = dependency('qt5', modules: ['Core', 'Network', 'Sql', 'Concurrent', 'Xml']) +moc_files = qt5.preprocess(moc_headers : '../test_package/greeter.h', qresources : '../test_package/example.qrc') +executable('test_package', '../test_package/test_package.cpp', moc_files, + dependencies : qt5_dep) diff --git a/recipes/qt/5.x.x/test_v1_package/test_package.pro b/recipes/qt/5.x.x/test_v1_package/test_package.pro new file mode 100644 index 0000000..3b3ce9c --- /dev/null +++ b/recipes/qt/5.x.x/test_v1_package/test_package.pro @@ -0,0 +1,14 @@ +SOURCES += ../test_package/test_package.cpp + +HEADERS += ../test_package/greeter.h + +RESOURCES = ../test_package/example.qrc + +QT -= gui +QT += network sql concurrent xml + +CONFIG += console + +CONFIG += conan_basic_setup +include($$OUT_PWD/../conanbuildinfo.pri) +LIBS -= $$CONAN_LIBS_QT diff --git a/recipes/qt/6.x.x/conandata.yml b/recipes/qt/6.x.x/conandata.yml new file mode 100644 index 0000000..13ed2f8 --- /dev/null +++ b/recipes/qt/6.x.x/conandata.yml @@ -0,0 +1,95 @@ +sources: + "6.7.3": + url: + - "https://download.qt.io/official_releases/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://download.qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirror.bjtu.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz" + sha256: "a3f1d257cbb14c6536585ffccf7c203ce7017418e1a0c2ed7c316c20c729c801" + "6.6.3": + url: + - "https://download.qt.io/official_releases/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://download.qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.icm.edu.pl/packages/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sau.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.ustc.edu.cn/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.6/6.6.3/single/qt-everywhere-src-6.6.3.tar.xz" + sha256: "69d0348fef415da98aa890a34651e9cfb232f1bffcee289b7b4e21386bf36104" + "6.5.3": + url: + - "https://download.qt.io/official_releases/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://download.qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.20i.com/pub/qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.ukfast.co.uk/sites/qt.io/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.nluug.nl/languages/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirror.netcologne.de/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qt-mirror.dannhauer.de/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.fau.de/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.dotsrc.org/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.acc.umu.se/mirror/qt.io/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirror.web4africa.ng/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qtproject.mirror.liquidtelecom.com/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://qt.mirror.constant.com/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.cloud.tencent.com/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://mirrors.sjtug.sjtu.edu.cn/qt/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.jaist.ac.jp/pub/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + - "https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/archive/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz" + sha256: "7cda4d119aad27a3887329cfc285f2aba5da85601212bcb0aea27bd6b7b544cb" +patches: + "6.7.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.6.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e_6.6.0.diff" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + "patch_type": "bugfix" + "6.5.3": + - "base_path": "qtwebengine" + "patch_description": "Workaround for too long .rps file name" + "patch_file": "patches/c72097e.diff" + "patch_type": "bugfix" + "patch_source": "https://codereview.qt-project.org/c/yocto/meta-qt5/+/192172" + - "base_path": "qtbase" + "patch_description": "Fix build error with lambda on GCC 9.2" + "patch_file": "patches/32fa63f_6.5.0.patch" + "patch_type": "bugfix" + "patch_source": "https://bugreports.qt.io/browse/QTBUG-112920" + - "base_path": "qtbase" + "patch_description": "Use absolute path in the generated header files to avoid relative path longer than 250 characters (not supported on by msvc compiler)" + "patch_file": "patches/fix-long-path-on-windows_6.5.3.patch" + "patch_type": "bugfix" + "patch_source": "https://code.qt.io/cgit/qt/qtbase.git/commit/?id=b4246a5c28472de3c4b6a85a3daf4a1d578894ab" diff --git a/recipes/qt/6.x.x/conanfile.py b/recipes/qt/6.x.x/conanfile.py new file mode 100644 index 0000000..508b43c --- /dev/null +++ b/recipes/qt/6.x.x/conanfile.py @@ -0,0 +1,1619 @@ +import configparser +import glob +import os +import platform +import textwrap + +from conan import ConanFile, conan_version +from conan.tools.apple import is_apple_os +from conan.tools.build import cross_building, check_min_cppstd, default_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv, Environment +from conan.tools.files import copy, get, replace_in_file, apply_conandata_patches, save, rm, rmdir, export_conandata_patches +from conan.tools.gnu import PkgConfigDeps +from conan.tools.microsoft import msvc_runtime_flag, is_msvc +from conan.tools.scm import Version +from conan.errors import ConanException, ConanInvalidConfiguration + +required_conan_version = ">=1.55.0" + + +class QtConan(ConanFile): + _submodules = ["qtsvg", "qtdeclarative", "qttools", "qttranslations", "qtdoc", + "qtwayland", "qtquickcontrols2", "qtquicktimeline", "qtquick3d", "qtshadertools", "qt5compat", + "qtactiveqt", "qtcharts", "qtdatavis3d", "qtlottie", "qtscxml", "qtvirtualkeyboard", + "qt3d", "qtimageformats", "qtnetworkauth", "qtcoap", "qtmqtt", "qtopcua", + "qtmultimedia", "qtlocation", "qtsensors", "qtconnectivity", "qtserialbus", + "qtserialport", "qtwebsockets", "qtwebchannel", "qtwebengine", "qtwebview", + "qtremoteobjects", "qtpositioning", "qtlanguageserver", + "qtspeech", "qthttpserver", "qtquick3dphysics", "qtgrpc", "qtquickeffectmaker"] + _submodules += ["qtgraphs"] # new modules for qt 6.6.0 + + _module_statuses = ["essential", "addon", "deprecated", "preview"] + + name = "qt" + description = "Qt is a cross-platform framework for graphical user interfaces." + topics = ("framework", "ui") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://www.qt.io" + license = "LGPL-3.0-only" + settings = "os", "arch", "compiler", "build_type" + + options = { + "shared": [True, False], + "opengl": ["no", "desktop", "dynamic"], + "with_vulkan": [True, False], + "openssl": [True, False], + "with_pcre2": [True, False], + "with_glib": [True, False], + "with_doubleconversion": [True, False], + "with_freetype": [True, False], + "with_fontconfig": [True, False], + "with_icu": [True, False], + "with_harfbuzz": [True, False], + "with_libjpeg": ["libjpeg", "libjpeg-turbo", False], + "with_libpng": [True, False], + "with_sqlite3": [True, False], + "with_mysql": [True, False], + "with_pq": [True, False], + "with_odbc": [True, False], + "with_zstd": [True, False], + "with_brotli": [True, False], + "with_dbus": [True, False], + "with_libalsa": [True, False], + "with_openal": [True, False], + "with_gstreamer": [True, False], + "with_pulseaudio": [True, False], + "with_gssapi": [True, False], + "with_md4c": [True, False], + "with_x11": [True, False], + "with_egl": [True, False], + + "gui": [True, False], + "widgets": [True, False], + + "device": [None, "ANY"], + "cross_compile": [None, "ANY"], + "sysroot": [None, "ANY"], + "multiconfiguration": [True, False], + "disabled_features": [None, "ANY"], + } + options.update({module: [True, False] for module in _submodules}) + options.update({f"{status}_modules": [True, False] for status in _module_statuses}) + + # this significantly speeds up windows builds + no_copy_source = True + + default_options = { + "shared": False, + "opengl": "desktop", + "with_vulkan": False, + "openssl": True, + "with_pcre2": True, + "with_glib": False, + "with_doubleconversion": True, + "with_freetype": True, + "with_fontconfig": True, + "with_icu": True, + "with_harfbuzz": True, + "with_libjpeg": False, + "with_libpng": True, + "with_sqlite3": True, + "with_mysql": False, + "with_pq": True, + "with_odbc": True, + "with_zstd": False, + "with_brotli": True, + "with_dbus": False, + "with_libalsa": False, + "with_openal": True, + "with_gstreamer": False, + "with_pulseaudio": False, + "with_gssapi": False, + "with_md4c": True, + "with_x11": True, + "with_egl": False, + + "gui": True, + "widgets": True, + + "device": None, + "cross_compile": None, + "sysroot": None, + "multiconfiguration": False, + "disabled_features": "", + } + # essential_modules, addon_modules, deprecated_modules, preview_modules: + # these are only provided for convenience, set to False by default + default_options.update({f"{status}_modules": False for status in _module_statuses}) + + short_paths = True + + _submodules_tree = None + + @property + def _settings_build(self): + return getattr(self, "settings_build", self.settings) + + @property + def _get_module_tree(self): + if self._submodules_tree: + return self._submodules_tree + config = configparser.ConfigParser() + config.read(os.path.join(self.recipe_folder, f"qtmodules{self.version}.conf")) + self._submodules_tree = {} + assert config.sections(), f"no qtmodules.conf file for version {self.version}" + for s in config.sections(): + section = str(s) + assert section.startswith("submodule ") + assert section.count('"') == 2 + modulename = section[section.find('"') + 1: section.rfind('"')] + if modulename in ["qtbase", "qtqa", "qtrepotools"]: + continue + status = str(config.get(section, "status")) + if status not in ["obsolete", "ignore", "additionalLibrary"]: + if status not in self._module_statuses: + raise ConanException(f"module {modulename} has status {status} which is not in self._module_statuses {self._module_statuses}") + assert modulename in self._submodules, f"module {modulename} not in self._submodules" + self._submodules_tree[modulename] = {"status": status, + "path": str(config.get(section, "path")), "depends": []} + if config.has_option(section, "depends"): + self._submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] + + return self._submodules_tree + + def export_sources(self): + export_conandata_patches(self) + + def export(self): + copy(self, f"qtmodules{self.version}.conf", self.recipe_folder, self.export_folder) + + def config_options(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + del self.options.with_icu + del self.options.with_fontconfig + self.options.with_glib = False + del self.options.with_libalsa + del self.options.with_x11 + del self.options.with_egl + + if self.settings.os == "Windows": + self.options.opengl = "dynamic" + del self.options.with_gssapi + if self.settings.os != "Linux": + self.options.qtwayland = False + + for submodule in self._submodules: + if submodule not in self._get_module_tree: + self._debug_output(f"Qt6: Removing {submodule} option as it is not in the module tree for this version, or is marked as obsolete or ignore") + self.options.rm_safe(submodule) + + @property + def _minimum_compilers_version(self): + # Qt6 requires C++17 + return { + "Visual Studio": "16", + "msvc": "192", + "gcc": "8", + "clang": "9", + "apple-clang": "12" if Version(self.version) >= "6.5.0" else "11" + } + + def _debug_output(self, message): + if Version(conan_version) >= "2": + self.output.debug(message) + + def configure(self): + if not self.options.gui: + del self.options.opengl + del self.options.with_vulkan + del self.options.with_freetype + self.options.rm_safe("with_fontconfig") + del self.options.with_harfbuzz + del self.options.with_libjpeg + del self.options.with_libpng + del self.options.with_md4c + self.options.rm_safe("with_x11") + self.options.rm_safe("with_egl") + + if self.options.multiconfiguration: + del self.settings.build_type + + # Requested modules: + # - any module for non-removed options that have 'True' value + # - any enabled via `xxx_modules` that does not have a 'False' value + # Note that at this point, the submodule options dont have a value unless one is given externally + # to the recipe (e.g. via the command line, a profile, or a consumer) + requested_modules = set([module for module in self._submodules if self.options.get_safe(module)]) + for module in [m for m in self._submodules if m in self._get_module_tree]: + status = self._get_module_tree[module]['status'] + is_disabled = self.options.get_safe(module) == False + if self.options.get_safe(f"{status}_modules"): + if not is_disabled: + requested_modules.add(module) + else: + self.output.warning(f"qt6: {module} requested because {status}_modules=True" + f" but it has been explicitly disabled with {module}=False") + + self.output.info(f"qt6: requested modules {list(requested_modules)}") + + required_modules = {} + for module in requested_modules: + deps = self._get_module_tree[module]["depends"] + for dep in deps: + required_modules.setdefault(dep,[]).append(module) + + required_but_disabled = [m for m in required_modules.keys() if self.options.get_safe(m) == False] + if required_modules: + self._debug_output(f"qt6: required_modules modules {list(required_modules.keys())}") + if required_but_disabled: + required_by = set() + for m in required_but_disabled: + required_by.update(required_modules[m]) + raise ConanInvalidConfiguration(f"Modules {required_but_disabled} are explicitly disabled, " + f"but are required by {list(required_by)}, enabled by other options") + + enabled_modules = requested_modules.union(set(required_modules.keys())) + enabled_modules.discard("qtbase") + + for module in list(enabled_modules): + setattr(self.options, module, True) + + for module in self._submodules: + if module in self.options and not self.options.get_safe(module): + setattr(self.options, module, False) + + if not self.options.get_safe("qtmultimedia"): + self.options.rm_safe("with_libalsa") + del self.options.with_openal + del self.options.with_gstreamer + del self.options.with_pulseaudio + + if self.settings.os in ("FreeBSD", "Linux"): + if self.options.get_safe("qtwebengine"): + self.options.with_fontconfig = True + + for status in self._module_statuses: + # These are convenience only, should not affect package_id + option_name = f"{status}_modules" + self._debug_output(f"qt6 removing convenience option: {option_name}," + f" see individual module options") + self.options.rm_safe(option_name) + + for option in self.options.items(): + self._debug_output(f"qt6 option: {option}") + + def validate(self): + if os.getenv('CONAN_CENTER_BUILD_SERVICE') is not None: + if self.info.settings.compiler == "gcc" and Version(self.info.settings.compiler.version) >= "11" or \ + self.info.settings.compiler == "clang" and Version(self.info.settings.compiler.version) >= "12": + raise ConanInvalidConfiguration("qt is not supported on gcc11 and clang >= 12 on C3I until conan-io/conan-center-index#13472 is fixed") + + # C++ minimum standard required + if self.settings.compiler.get_safe("cppstd"): + check_min_cppstd(self, 17) + minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) + if not minimum_version: + self.output.warning("C++17 support required. Your compiler is unknown. Assuming it supports C++17.") + elif Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.") + + if Version(self.version) >= "6.4.0" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "12": + raise ConanInvalidConfiguration("apple-clang >= 12 required by qt >= 6.4.0") + + if Version(self.version) >= "6.6.1" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "13.1": + raise ConanInvalidConfiguration("apple-clang >= 13.1 is required by qt >= 6.6.1 cf QTBUG-119490") + + if self.options.get_safe("qtwebengine"): + if not self.options.shared: + raise ConanInvalidConfiguration("Static builds of Qt WebEngine are not supported") + + if not (self.options.gui and self.options.qtdeclarative and self.options.qtwebchannel): + raise ConanInvalidConfiguration("option qt:qtwebengine requires also qt:gui, qt:qtdeclarative and qt:qtwebchannel") + if not self.options.with_dbus and self.settings.os == "Linux": + raise ConanInvalidConfiguration("option qt:webengine requires also qt:with_dbus on Linux") + + if hasattr(self, "settings_build") and cross_building(self, skip_x64_x86=True): + raise ConanInvalidConfiguration("Cross compiling Qt WebEngine is not supported") + + if self.options.widgets and not self.options.gui: + raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " + "You can either disable qt:widgets or enable qt:gui") + if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": + raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android.") + + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": + raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") + + if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): + raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") + + if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: + raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") + + if self.options.get_safe("with_pulseaudio", False) or self.options.get_safe("with_libalsa", False): + raise ConanInvalidConfiguration("alsa and pulseaudio are not supported (QTBUG-95116), please disable them.") + if not self.options.with_pcre2: + raise ConanInvalidConfiguration("pcre2 is actually required by qt (QTBUG-92454). please use option qt:with_pcre2=True") + + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + raise ConanInvalidConfiguration("gssapi cannot be enabled until conan-io/conan-center-index#4102 is closed") + + if self.options.get_safe("with_x11", False) and not self.dependencies.direct_host["xkbcommon"].options.with_x11: + raise ConanInvalidConfiguration("The 'with_x11' option for the 'xkbcommon' package must be enabled when the 'with_x11' option is enabled") + if self.options.get_safe("qtwayland", False) and not self.dependencies.direct_host["xkbcommon"].options.with_wayland: + raise ConanInvalidConfiguration("The 'with_wayland' option for the 'xkbcommon' package must be enabled when the 'qtwayland' option is enabled") + + if cross_building(self): + raise ConanInvalidConfiguration("cross compiling qt 6 is not yet supported. Contributions are welcome") + + if self.options.with_sqlite3 and not self.dependencies["sqlite3"].options.enable_column_metadata: + raise ConanInvalidConfiguration("sqlite3 option enable_column_metadata must be enabled for qt") + + if self.options.get_safe("qtspeech") and not self.options.qtdeclarative: + raise ConanInvalidConfiguration("qtspeech requires qtdeclarative, cf QTBUG-108381") + + def layout(self): + cmake_layout(self, src_folder="src") + + def requirements(self): + self.requires("zlib/[>=1.2.11 <2]") + if self.options.openssl: + self.requires("openssl/[>=1.1 <4]") + if self.options.with_pcre2: + self.requires("pcre2/10.42") + if self.options.get_safe("with_vulkan"): + # Note: the versions of vulkan-loader and moltenvk + # must be exactly part of the same Vulkan SDK version + # do not update either without checking both + # require exactly the same version of vulkan-headers + self.requires("vulkan-loader/1.3.239.0") + self.requires("vulkan-headers/1.3.239.0", transitive_headers=True) + if is_apple_os(self): + self.requires("moltenvk/1.2.2") + if self.options.with_glib: + self.requires("glib/2.78.3") + if self.options.with_doubleconversion and not self.options.multiconfiguration: + self.requires("double-conversion/3.3.0") + if self.options.get_safe("with_freetype", False) and not self.options.multiconfiguration: + self.requires("freetype/2.13.2") + if self.options.get_safe("with_fontconfig", False): + self.requires("fontconfig/2.15.0") + if self.options.get_safe("with_icu", False): + self.requires("icu/74.2") + if self.options.get_safe("with_harfbuzz", False) and not self.options.multiconfiguration: + self.requires("harfbuzz/8.3.0") + if self.options.get_safe("with_libjpeg", False) and not self.options.multiconfiguration: + if self.options.with_libjpeg == "libjpeg-turbo": + self.requires("libjpeg-turbo/[>=3.0 <3.1]") + else: + self.requires("libjpeg/9e") + if self.options.get_safe("with_libpng", False) and not self.options.multiconfiguration: + self.requires("libpng/[>=1.6 <2]") + if self.options.with_sqlite3 and not self.options.multiconfiguration: + self.requires("sqlite3/[>=3.45.0 <4]") + if self.options.get_safe("with_mysql", False): + self.requires("libmysqlclient/8.1.0") + if self.options.with_pq: + self.requires("libpq/15.4") + if self.options.with_odbc: + if self.settings.os != "Windows": + self.requires("odbc/2.3.11") + if self.options.get_safe("with_openal", False): + self.requires("openal-soft/1.22.2") + if self.options.get_safe("with_libalsa", False): + self.requires("libalsa/1.2.10") + if self.options.get_safe("with_x11") or self.options.qtwayland: + self.requires("xkbcommon/1.5.0") + if self.options.get_safe("with_x11", False): + self.requires("xorg/system") + if self.options.get_safe("with_egl"): + self.requires("egl/system") + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + self.requires("opengl/system") + if self.options.with_zstd: + self.requires("zstd/1.5.5") + if self.options.qtwayland: + self.requires("wayland/1.22.0") + if self.options.with_brotli: + self.requires("brotli/1.1.0") + if self.options.get_safe("qtwebengine") and self.settings.os == "Linux": + self.requires("expat/[>=2.6.2 <3]") + self.requires("opus/1.4") + self.requires("xorg-proto/2022.2") + self.requires("libxshmfence/1.3") + self.requires("nss/3.93") + self.requires("libdrm/2.4.119") + if self.options.get_safe("with_gstreamer", False): + self.requires("gstreamer/1.19.2") + self.requires("gst-plugins-base/1.19.2") + if self.options.get_safe("with_pulseaudio", False): + self.requires("pulseaudio/14.2") + if self.options.with_dbus: + self.requires("dbus/1.15.8") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + self.requires("krb5/1.18.3") # conan-io/conan-center-index#4102 + if self.options.get_safe("with_md4c", False): + self.requires("md4c/0.4.8") + + def build_requirements(self): + self.tool_requires("cmake/[>=3.21.1 <4]") + self.tool_requires("ninja/[>=1.12 <2]") + if not self.conf.get("tools.gnu:pkg_config", check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") + if self.settings.os == "Windows": + self.tool_requires('strawberryperl/5.32.1.1') + + if self.options.get_safe("qtwebengine"): + self.tool_requires("nodejs/18.15.0") + self.tool_requires("gperf/3.1") + # gperf, bison, flex, python >= 2.7.5 & < 3 + if self._settings_build.os == "Windows": + self.tool_requires("winflexbison/2.5.25") + else: + self.tool_requires("bison/3.8.2") + self.tool_requires("flex/2.6.4") + + if self.options.qtwayland: + self.tool_requires("wayland/1.22.0") + if cross_building(self): + self.tool_requires(f"qt/{self.version}") + + def generate(self): + ms = VirtualBuildEnv(self) + ms.generate() + + tc = CMakeDeps(self) + tc.set_property("libdrm", "cmake_file_name", "Libdrm") + tc.set_property("libdrm::libdrm_libdrm", "cmake_target_name", "Libdrm::Libdrm") + tc.set_property("wayland", "cmake_file_name", "Wayland") + tc.set_property("wayland::wayland-client", "cmake_target_name", "Wayland::Client") + tc.set_property("wayland::wayland-server", "cmake_target_name", "Wayland::Server") + tc.set_property("wayland::wayland-cursor", "cmake_target_name", "Wayland::Cursor") + tc.set_property("wayland::wayland-egl", "cmake_target_name", "Wayland::Egl") + + # override https://github.com/qt/qtbase/blob/dev/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake + tc.set_property("egl", "cmake_file_name", "EGL") + tc.set_property("egl", "cmake_find_mode", "module") + tc.set_property("egl::egl", "cmake_target_name", "EGL::EGL") + + # don't override https://github.com/qt/qtmultimedia/blob/dev/cmake/FindGStreamer.cmake + tc.set_property("gstreamer", "cmake_file_name", "gstreamer_conan") + tc.set_property("gstreamer", "cmake_find_mode", "module") + + tc.generate() + + for f in glob.glob("*.cmake"): + replace_in_file(self, f, + " IMPORTED)\n", + " IMPORTED GLOBAL)\n", strict=False) + + pc = PkgConfigDeps(self) + pc.generate() + + vbe = VirtualBuildEnv(self) + vbe.generate() + if not cross_building(self): + vre = VirtualRunEnv(self) + vre.generate(scope="build") + # TODO: to remove when properly handled by conan (see https://github.com/conan-io/conan/issues/11962) + env = Environment() + env.unset("VCPKG_ROOT") + env.prepend_path("PKG_CONFIG_PATH", self.generators_folder) + env.vars(self).save_script("conanbuildenv_pkg_config_path") + if self._settings_build.os == "Macos": + # On macOS, SIP resets DYLD_LIBRARY_PATH injected by VirtualBuildEnv & VirtualRunEnv + dyld_library_path = "$DYLD_LIBRARY_PATH" + dyld_library_path_build = vbe.vars().get("DYLD_LIBRARY_PATH") + if dyld_library_path_build: + dyld_library_path = f"{dyld_library_path_build}:{dyld_library_path}" + if not cross_building(self): + dyld_library_path_host = vre.vars().get("DYLD_LIBRARY_PATH") + if dyld_library_path_host: + dyld_library_path = f"{dyld_library_path_host}:{dyld_library_path}" + save(self, "bash_env", f'export DYLD_LIBRARY_PATH="{dyld_library_path}"') + env.define_path("BASH_ENV", os.path.abspath("bash_env")) + + tc = CMakeToolchain(self, generator="Ninja") + + tc.absolute_paths = True + + tc.variables["QT_BUILD_TESTS"] = "OFF" + tc.variables["QT_BUILD_EXAMPLES"] = "OFF" + + if is_msvc(self) and "MT" in msvc_runtime_flag(self): + tc.variables["FEATURE_static_runtime"] = "ON" + + if self.options.multiconfiguration: + tc.variables["CMAKE_CONFIGURATION_TYPES"] = "Release;Debug" + tc.variables["FEATURE_optimize_size"] = ("ON" if self.settings.build_type == "MinSizeRel" else "OFF") + + for module in self._get_module_tree: + tc.variables[f"BUILD_{module}"] = ("ON" if getattr(self.options, module) else "OFF") + tc.variables["BUILD_qtqa"] = "OFF" + tc.variables["BUILD_qtrepotools"] = "OFF" + + tc.variables["FEATURE_system_zlib"] = "ON" + + tc.variables["INPUT_opengl"] = self.options.get_safe("opengl", "no") + + # openSSL + if not self.options.openssl: + tc.variables["INPUT_openssl"] = "no" + else: + tc.variables["HAVE_openssl"] = "ON" + if self.dependencies["openssl"].options.shared: + tc.variables["INPUT_openssl"] = "runtime" + tc.variables["QT_FEATURE_openssl_runtime"] = "ON" + else: + tc.variables["INPUT_openssl"] = "linked" + tc.variables["QT_FEATURE_openssl_linked"] = "ON" + + # TODO: Remove after fixing https://github.com/conan-io/conan/issues/12012 + if is_msvc(self): + tc.cache_variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) + + if self.options.with_dbus: + tc.variables["INPUT_dbus"] = "linked" + else: + tc.variables["FEATURE_dbus"] = "OFF" + tc.variables["CMAKE_FIND_DEBUG_MODE"] = "FALSE" + + if not self.options.with_zstd: + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapZSTD"] = "ON" + + if not self.options.get_safe("with_vulkan"): + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapVulkanHeaders"] = "ON" + + # Prevent finding LibClang from the system + # this is needed by the QDoc tool inside Qt Tools + # See: https://github.com/conan-io/conan-center-index/issues/24729#issuecomment-2255291495 + tc.variables["CMAKE_DISABLE_FIND_PACKAGE_WrapLibClang"] = "ON" + + for opt, conf_arg in [("with_glib", "glib"), + ("with_icu", "icu"), + ("with_fontconfig", "fontconfig"), + ("with_mysql", "sql_mysql"), + ("with_pq", "sql_psql"), + ("with_odbc", "sql_odbc"), + ("gui", "gui"), + ("widgets", "widgets"), + ("with_zstd", "zstd"), + ("with_vulkan", "vulkan"), + ("with_brotli", "brotli"), + ("with_gssapi", "gssapi"), + ("with_egl", "egl"), + ("with_gstreamer", "gstreamer")]: + tc.variables[f"FEATURE_{conf_arg}"] = ("ON" if self.options.get_safe(opt, False) else "OFF") + + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "jpeg"), + ("with_libpng", "png"), + ("with_sqlite3", "sqlite"), + ("with_pcre2", "pcre2"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables[f"FEATURE_{conf_arg}"] = "ON" + else: + tc.variables[f"FEATURE_system_{conf_arg}"] = "ON" + else: + tc.variables[f"FEATURE_{conf_arg}"] = "OFF" + tc.variables[f"FEATURE_system_{conf_arg}"] = "OFF" + + for opt, conf_arg in [ + ("with_doubleconversion", "doubleconversion"), + ("with_freetype", "freetype"), + ("with_harfbuzz", "harfbuzz"), + ("with_libjpeg", "libjpeg"), + ("with_libpng", "libpng"), + ("with_md4c", "libmd4c"), + ("with_pcre2", "pcre"),]: + if self.options.get_safe(opt, False): + if self.options.multiconfiguration: + tc.variables[f"INPUT_{conf_arg}"] = "qt" + else: + tc.variables[f"INPUT_{conf_arg}"] = "system" + else: + tc.variables[f"INPUT_{conf_arg}"] = "no" + + for feature in str(self.options.disabled_features).split(): + tc.variables[f"FEATURE_{feature}"] = "OFF" + + if self.settings.os == "Macos": + tc.variables["FEATURE_framework"] = "OFF" + elif self.settings.os == "Android": + tc.variables["CMAKE_ANDROID_NATIVE_API_LEVEL"] = self.settings.os.api_level + tc.variables["ANDROID_ABI"] = {"armv7": "armeabi-v7a", + "armv8": "arm64-v8a", + "x86": "x86", + "x86_64": "x86_64"}.get(str(self.settings.arch)) + + if self.options.sysroot: + tc.variables["CMAKE_SYSROOT"] = self.options.sysroot + + if self.options.device: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = f"devices/{self.options.device}" + else: + xplatform_val = self._xplatform() + if xplatform_val: + tc.variables["QT_QMAKE_TARGET_MKSPEC"] = xplatform_val + else: + self.output.warning(f"host not supported: {self.settings.os} {self.settings.compiler} {self.settings.compiler.version} {self.settings.arch}") + if self.options.cross_compile: + tc.variables["QT_QMAKE_DEVICE_OPTIONS"] = f"CROSS_COMPILE={self.options.cross_compile}" + if cross_building(self): + tc.variables["QT_HOST_PATH"] = self.dependencies.direct_build["qt"].package_folder + + tc.variables["FEATURE_pkg_config"] = "ON" + if self.settings.compiler == "gcc" and self.settings.build_type == "Debug" and not self.options.shared: + tc.variables["BUILD_WITH_PCH"] = "OFF" # disabling PCH to save disk space + + if self.settings.os == "Windows": + tc.variables["HOST_PERL"] = self.dependencies.build["strawberryperl"].conf_info.get("user.strawberryperl:perl", check_type=str) + #"set(QT_EXTRA_INCLUDEPATHS ${CONAN_INCLUDE_DIRS})\n" + #"set(QT_EXTRA_DEFINES ${CONAN_DEFINES})\n" + #"set(QT_EXTRA_LIBDIRS ${CONAN_LIB_DIRS})\n" + + current_cpp_std = self.settings.get_safe("compiler.cppstd", default_cppstd(self)) + current_cpp_std = str(current_cpp_std).replace("gnu", "") + cpp_std_map = { + 11: "FEATURE_cxx11", + 14: "FEATURE_cxx14", + 17: "FEATURE_cxx17", + 20: "FEATURE_cxx20" + } + if Version(self.version) >= "6.5.0": + cpp_std_map[23] = "FEATURE_cxx2b" + + for std, feature in cpp_std_map.items(): + tc.variables[feature] = "ON" if int(current_cpp_std) >= std else "OFF" + + tc.variables["QT_USE_VCPKG"] = False + tc.cache_variables["QT_USE_VCPKG"] = False + + tc.generate() + + def package_id(self): + del self.info.options.cross_compile + del self.info.options.sysroot + if self.info.options.multiconfiguration: + if self.info.settings.compiler == "Visual Studio": + if "MD" in self.info.settings.compiler.runtime: + self.info.settings.compiler.runtime = "MD/MDd" + else: + self.info.settings.compiler.runtime = "MT/MTd" + elif self.info.settings.compiler == "msvc": + self.info.settings.compiler.runtime_type = "Release/Debug" + if self.info.settings.os == "Android": + del self.info.options.android_sdk + + def source(self): + destination = self.source_folder + if platform.system() == "Windows": + # Don't use os.path.join, or it removes the \\?\ prefix, which enables long paths + destination = rf"\\?\{self.source_folder}" + get(self, **self.conan_data["sources"][self.version], + strip_root=True, destination=destination) + + # patching in source method because of no_copy_source attribute + apply_conandata_patches(self) + for f in ["renderer", os.path.join("renderer", "core"), os.path.join("renderer", "platform")]: + replace_in_file(self, os.path.join(self.source_folder, "qtwebengine", "src", "3rdparty", "chromium", "third_party", "blink", f, "BUILD.gn"), + " if (enable_precompiled_headers) {\n if (is_win) {", + " if (enable_precompiled_headers) {\n if (false) {" + ) + + for f in ["FindPostgreSQL.cmake"]: + file = os.path.join(self.source_folder, "qtbase", "cmake", f) + if os.path.isfile(file): + os.remove(file) + + # workaround QTBUG-94356 + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "FindWrapSystemZLIB.cmake"), '"-lz"', 'ZLIB::ZLIB') + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "configure.cmake"), + "set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)", + "") + if Version(self.version) <= "6.4.0": + # use official variable name https://cmake.org/cmake/help/latest/module/FindFontconfig.html + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "src", "gui", "configure.cmake"), "FONTCONFIG_FOUND", "Fontconfig_FOUND") + + replace_in_file(self, + os.path.join(self.source_folder, "qtbase", "cmake", "QtAutoDetect.cmake" if Version(self.version) < "6.6.2" else "QtAutoDetectHelpers.cmake"), + "qt_auto_detect_vcpkg()", + "# qt_auto_detect_vcpkg()") + + # Handle locating moltenvk headers when vulkan is enabled on macOS + replace_in_file(self, os.path.join(self.source_folder, "qtbase", "cmake", "FindWrapVulkanHeaders.cmake"), + "if(APPLE)", "if(APPLE)\n" + " find_package(moltenvk REQUIRED QUIET)\n" + " target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE ${moltenvk_INCLUDE_DIR})" + ) + + def _xplatform(self): + if self.settings.os == "Linux": + if self.settings.compiler == "gcc": + return {"x86": "linux-g++-32", + "armv6": "linux-arm-gnueabi-g++", + "armv7": "linux-arm-gnueabi-g++", + "armv7hf": "linux-arm-gnueabi-g++", + "armv8": "linux-aarch64-gnu-g++"}.get(str(self.settings.arch), "linux-g++") + if self.settings.compiler == "clang": + if self.settings.arch == "x86": + return "linux-clang-libc++-32" if self.settings.compiler.libcxx == "libc++" else "linux-clang-32" + if self.settings.arch == "x86_64": + return "linux-clang-libc++" if self.settings.compiler.libcxx == "libc++" else "linux-clang" + + elif self.settings.os == "Macos": + return {"clang": "macx-clang", + "apple-clang": "macx-clang", + "gcc": "macx-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "iOS": + if self.settings.compiler == "apple-clang": + return "macx-ios-clang" + + elif self.settings.os == "watchOS": + if self.settings.compiler == "apple-clang": + return "macx-watchos-clang" + + elif self.settings.os == "tvOS": + if self.settings.compiler == "apple-clang": + return "macx-tvos-clang" + + elif self.settings.os == "Android": + if self.settings.compiler == "clang": + return "android-clang" + + elif self.settings.os == "Windows": + return { + "Visual Studio": "win32-msvc", + "msvc": "win32-msvc", + "gcc": "win32-g++", + "clang": "win32-clang-g++", + }.get(str(self.settings.compiler)) + + elif self.settings.os == "WindowsStore": + if is_msvc(self): + if self.settings.compiler == "Visual Studio": + msvc_version = str(self.settings.compiler.version) + else: + msvc_version = { + "190": "14", + "191": "15", + "192": "16", + }.get(str(self.settings.compiler.version)) + return { + "14": { + "armv7": "winrt-arm-msvc2015", + "x86": "winrt-x86-msvc2015", + "x86_64": "winrt-x64-msvc2015", + }, + "15": { + "armv7": "winrt-arm-msvc2017", + "x86": "winrt-x86-msvc2017", + "x86_64": "winrt-x64-msvc2017", + }, + "16": { + "armv7": "winrt-arm-msvc2019", + "x86": "winrt-x86-msvc2019", + "x86_64": "winrt-x64-msvc2019", + } + }.get(msvc_version).get(str(self.settings.arch)) + + elif self.settings.os == "FreeBSD": + return {"clang": "freebsd-clang", + "gcc": "freebsd-g++"}.get(str(self.settings.compiler)) + + elif self.settings.os == "SunOS": + if self.settings.compiler == "sun-cc": + if self.settings.arch == "sparc": + return "solaris-cc-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc" + if self.settings.arch == "sparcv9": + return "solaris-cc64-stlport" if self.settings.compiler.libcxx == "libstlport" else "solaris-cc64" + elif self.settings.compiler == "gcc": + return {"sparc": "solaris-g++", + "sparcv9": "solaris-g++-64"}.get(str(self.settings.arch)) + elif self.settings.os == "Neutrino" and self.settings.compiler == "qcc": + return {"armv8": "qnx-aarch64le-qcc", + "armv8.3": "qnx-aarch64le-qcc", + "armv7": "qnx-armle-v7-qcc", + "armv7hf": "qnx-armle-v7-qcc", + "armv7s": "qnx-armle-v7-qcc", + "armv7k": "qnx-armle-v7-qcc", + "x86": "qnx-x86-qcc", + "x86_64": "qnx-x86-64-qcc"}.get(str(self.settings.arch)) + elif self.settings.os == "Emscripten" and self.settings.arch == "wasm": + return "wasm-emscripten" + + return None + + def build(self): + if self.settings.os == "Macos": + save(self, ".qmake.stash", "") + save(self, ".qmake.super", "") + cmake = CMake(self) + cmake.configure() + cmake.build() + + @property + def _cmake_executables_file(self): + return os.path.join("lib", "cmake", "Qt6Core", "conan_qt_executables_variables.cmake") + + @property + def _cmake_entry_point_file(self): + return os.path.join("lib", "cmake", "Qt6Core", "conan_qt_entry_point.cmake") + + def _cmake_qt6_private_file(self, module): + return os.path.join("lib", "cmake", f"Qt6{module}", f"conan_qt_qt6_{module.lower()}private.cmake") + + def package(self): + if self.settings.os == "Macos": + save(self, ".qmake.stash", "") + save(self, ".qmake.super", "") + cmake = CMake(self) + cmake.install() + copy(self, "*LICENSE*", self.source_folder, os.path.join(self.package_folder, "licenses"), + excludes="qtbase/examples/*") + for module in self._get_module_tree: + if not getattr(self.options, module): + rmdir(self, os.path.join(self.package_folder, "licenses", module)) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + for mask in ["Find*.cmake", "*Config.cmake", "*-config.cmake"]: + rm(self, mask, self.package_folder, recursive=True) + rm(self, "*.la*", os.path.join(self.package_folder, "lib"), recursive=True) + rm(self, "*.pdb*", self.package_folder, recursive=True) + rm(self, "ensure_pro_file.cmake", self.package_folder, recursive=True) + os.remove(os.path.join(self.package_folder, "libexec" if Version(self.version) >= "6.5.0" and self.settings.os != "Windows" else "bin", "qt-cmake-private-install.cmake")) + + for m in os.listdir(os.path.join(self.package_folder, "lib", "cmake")): + if os.path.isfile(os.path.join(self.package_folder, "lib", "cmake", m, f"{m}Macros.cmake")): + continue + if glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): + continue + if m.endswith("Tools"): + if os.path.isfile(os.path.join(self.package_folder, "lib", "cmake", m, f"{m[:-5]}Macros.cmake")): + continue + + rmdir(self, os.path.join(self.package_folder, "lib", "cmake", m)) + + extension = "" + if self.settings.os == "Windows": + extension = ".exe" + filecontents = "set(QT_CMAKE_EXPORT_NAMESPACE Qt6)\n" + ver = Version(self.version) + filecontents += f"set(QT_VERSION_MAJOR {ver.major})\n" + filecontents += f"set(QT_VERSION_MINOR {ver.minor})\n" + filecontents += f"set(QT_VERSION_PATCH {ver.patch})\n" + if self.settings.os == "Macos": + filecontents += 'set(__qt_internal_cmake_apple_support_files_path "${CMAKE_CURRENT_LIST_DIR}/../../../lib/cmake/Qt6/macos")\n' + targets = ["moc", "rcc", "tracegen", "cmake_automoc_parser", "qlalr", "qmake"] + if self.options.with_dbus: + targets.extend(["qdbuscpp2xml", "qdbusxml2cpp"]) + if self.options.gui: + targets.append("qvkgen") + if self.options.widgets: + targets.append("uic") + if self._settings_build.os == "Macos" and self.settings.os != "iOS": + targets.extend(["macdeployqt"]) + if self.settings.os == "Windows": + targets.extend(["windeployqt"]) + if self.options.qttools: + targets.extend(["qhelpgenerator", "qtattributionsscanner"]) + targets.extend(["lconvert", "lprodump", "lrelease", "lrelease-pro", "lupdate", "lupdate-pro"]) + if self.options.qtshadertools: + targets.append("qsb") + if self.options.qtdeclarative: + targets.extend(["qmltyperegistrar", "qmlcachegen", "qmllint", "qmlimportscanner"]) + targets.extend(["qmlformat", "qml", "qmlprofiler", "qmlpreview"]) + # Note: consider "qmltestrunner", see https://github.com/conan-io/conan-center-index/issues/24276 + if self.options.get_safe("qtremoteobjects"): + targets.append("repc") + if self.options.get_safe("qtscxml"): + targets.append("qscxmlc") + for target in targets: + exe_path = None + for path_ in [f"bin/{target}{extension}", + f"lib/{target}{extension}", + f"libexec/{target}{extension}"]: + if os.path.isfile(os.path.join(self.package_folder, path_)): + exe_path = path_ + break + else: + assert False, f"Could not find executable {target}{extension} in {self.package_folder}" + if not exe_path: + self.output.warning(f"Could not find path to {target}{extension}") + filecontents += textwrap.dedent(f"""\ + if(NOT TARGET ${{QT_CMAKE_EXPORT_NAMESPACE}}::{target}) + add_executable(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} IMPORTED) + set_target_properties(${{QT_CMAKE_EXPORT_NAMESPACE}}::{target} PROPERTIES IMPORTED_LOCATION ${{CMAKE_CURRENT_LIST_DIR}}/../../../{exe_path}) + endif() + """) + + filecontents += textwrap.dedent(f"""\ + if(NOT DEFINED QT_DEFAULT_MAJOR_VERSION) + set(QT_DEFAULT_MAJOR_VERSION {ver.major}) + endif() + """) + filecontents += 'set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_GADGET_EXPORT" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")\n' + save(self, os.path.join(self.package_folder, self._cmake_executables_file), filecontents) + + def _create_private_module(module, dependencies): + dependencies_string = ';'.join(f"Qt6::{dependency}" for dependency in dependencies) + contents = textwrap.dedent(f"""\ + if(NOT TARGET Qt6::{module}Private) + add_library(Qt6::{module}Private INTERFACE IMPORTED) + + set_target_properties(Qt6::{module}Private PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{module}/{self.version};${{CMAKE_CURRENT_LIST_DIR}}/../../../include/Qt{module}/{self.version}/Qt{module}" + INTERFACE_LINK_LIBRARIES "{dependencies_string}" + ) + + add_library(Qt::{module}Private INTERFACE IMPORTED) + set_target_properties(Qt::{module}Private PROPERTIES + INTERFACE_LINK_LIBRARIES "Qt6::{module}Private" + _qt_is_versionless_target "TRUE" + ) + endif()""") + + save(self, os.path.join(self.package_folder, self._cmake_qt6_private_file(module)), contents) + + _create_private_module("Core", ["Core"]) + + if self.options.gui: + _create_private_module("Gui", ["CorePrivate", "Gui"]) + + if self.options.widgets: + _create_private_module("Widgets", ["CorePrivate", "GuiPrivate", "Widgets"]) + + if self.options.qtdeclarative: + _create_private_module("Qml", ["CorePrivate", "Qml"]) + save(self, os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake"), textwrap.dedent("""\ + set(QT_KNOWN_POLICY_QTP0001 TRUE) + """)) + if self.options.gui and self.options.qtshadertools: + _create_private_module("Quick", ["CorePrivate", "GuiPrivate", "QmlPrivate", "Quick"]) + + if self.settings.os in ["Windows", "iOS"]: + contents = textwrap.dedent("""\ + set(entrypoint_conditions "$>>") + list(APPEND entrypoint_conditions "$,EXECUTABLE>") + if(WIN32) + list(APPEND entrypoint_conditions "$>") + endif() + list(JOIN entrypoint_conditions "," entrypoint_conditions) + set(entrypoint_conditions "$") + set_property( + TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::Core + APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<${entrypoint_conditions}:${QT_CMAKE_EXPORT_NAMESPACE}::EntryPointPrivate>" + )""") + save(self, os.path.join(self.package_folder, self._cmake_entry_point_file), contents) + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "Qt6") + self.cpp_info.set_property("pkg_config_name", "qt6") + + self.cpp_info.names["cmake_find_package"] = "Qt6" + self.cpp_info.names["cmake_find_package_multi"] = "Qt6" + + # consumers will need the QT_PLUGIN_PATH defined in runenv + self.runenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) + self.buildenv_info.define("QT_PLUGIN_PATH", os.path.join(self.package_folder, "plugins")) + + self.buildenv_info.define("QT_HOST_PATH", self.package_folder) + + build_modules = {} + def _add_build_module(component, module): + if component not in build_modules: + build_modules[component] = [] + build_modules[component].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package"].append(module) + self.cpp_info.components[component].build_modules["cmake_find_package_multi"].append(module) + + libsuffix = "" + if self.settings.build_type == "Debug": + if is_msvc(self): + libsuffix = "d" + if is_apple_os(self): + libsuffix = "_debug" + + def _get_corrected_reqs(requires): + reqs = [] + for r in requires: + if "::" in r: + corrected_req = r + else: + corrected_req = f"qt{r}" + assert corrected_req in self.cpp_info.components, f"{corrected_req} required but not yet present in self.cpp_info.components" + reqs.append(corrected_req) + return reqs + + def _create_module(module, requires, has_include_dir=True): + componentname = f"qt{module}" + assert componentname not in self.cpp_info.components, f"Module {module} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{module}") + self.cpp_info.components[componentname].set_property("pkg_config_name", f"Qt6{module}") + self.cpp_info.components[componentname].names["cmake_find_package"] = module + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = module + if module.endswith("Private"): + libname = module[:-7] + else: + libname = module + self.cpp_info.components[componentname].libs = [f"Qt6{libname}{libsuffix}"] + if has_include_dir: + self.cpp_info.components[componentname].includedirs = ["include", os.path.join("include", f"Qt{module}")] + self.cpp_info.components[componentname].defines = [f"QT_{module.upper()}_LIB"] + if module != "Core" and "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + def _create_plugin(pluginname, libname, plugintype, requires): + componentname = f"qt{pluginname}" + assert componentname not in self.cpp_info.components, f"Plugin {pluginname} already present in self.cpp_info.components" + self.cpp_info.components[componentname].set_property("cmake_target_name", f"Qt6::{pluginname}") + self.cpp_info.components[componentname].names["cmake_find_package"] = pluginname + self.cpp_info.components[componentname].names["cmake_find_package_multi"] = pluginname + if not self.options.shared: + self.cpp_info.components[componentname].libs = [libname + libsuffix] + self.cpp_info.components[componentname].libdirs = [os.path.join("plugins", plugintype)] + self.cpp_info.components[componentname].includedirs = [] + if "Core" not in requires: + requires.append("Core") + self.cpp_info.components[componentname].requires = _get_corrected_reqs(requires) + + core_reqs = ["zlib::zlib"] + if self.options.with_pcre2: + core_reqs.append("pcre2::pcre2") + if self.options.with_doubleconversion: + core_reqs.append("double-conversion::double-conversion") + if self.options.get_safe("with_icu", False): + core_reqs.append("icu::icu") + if self.options.with_zstd: + core_reqs.append("zstd::zstd") + if self.options.with_glib: + core_reqs.append("glib::glib") + if self.options.openssl: + core_reqs.append("openssl::openssl") # used by QCryptographicHash + + _create_module("Core", core_reqs) + pkg_config_vars = [ + "bindir=${prefix}/bin", + "libexecdir=${prefix}/libexec", + "exec_prefix=${prefix}", + ] + self.cpp_info.components["qtCore"].set_property("pkg_config_custom_content", "\n".join(pkg_config_vars)) + + if self.settings.build_type != "Debug": + self.cpp_info.components['qtCore'].defines.append('QT_NO_DEBUG') + if self.settings.os == "Windows": + self.cpp_info.components["qtCore"].system_libs.append("authz") + if is_msvc(self): + self.cpp_info.components["qtCore"].cxxflags.append("-permissive-") + self.cpp_info.components["qtCore"].cxxflags.append("-Zc:__cplusplus") + self.cpp_info.components["qtCore"].system_libs.append("synchronization") + self.cpp_info.components["qtCore"].system_libs.append("runtimeobject") + self.cpp_info.components["qtPlatform"].set_property("cmake_target_name", "Qt6::Platform") + self.cpp_info.components["qtPlatform"].names["cmake_find_package"] = "Platform" + self.cpp_info.components["qtPlatform"].names["cmake_find_package_multi"] = "Platform" + self.cpp_info.components["qtPlatform"].includedirs = [os.path.join("mkspecs", self._xplatform())] + if self.options.with_dbus: + _create_module("DBus", ["dbus::dbus"]) + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/dbus/CMakeLists.txt#L71-L77 + self.cpp_info.components["qtDBus"].system_libs.append("advapi32") + self.cpp_info.components["qtDBus"].system_libs.append("netapi32") + self.cpp_info.components["qtDBus"].system_libs.append("user32") + self.cpp_info.components["qtDBus"].system_libs.append("ws2_32") + if self.options.gui: + gui_reqs = [] + if self.options.with_dbus: + gui_reqs.append("DBus") + if self.options.with_freetype: + gui_reqs.append("freetype::freetype") + if self.options.with_libpng: + gui_reqs.append("libpng::libpng") + if self.options.get_safe("with_fontconfig", False): + gui_reqs.append("fontconfig::fontconfig") + if self.settings.os in ["Linux", "FreeBSD"]: + if self.options.qtwayland or self.options.get_safe("with_x11", False): + gui_reqs.append("xkbcommon::xkbcommon") + if self.options.get_safe("with_x11", False): + gui_reqs.append("xorg::xorg") + if self.options.get_safe("with_egl"): + gui_reqs.append("egl::egl") + if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") != "no": + gui_reqs.append("opengl::opengl") + if self.options.get_safe("with_vulkan", False): + gui_reqs.append("vulkan-loader::vulkan-loader") + gui_reqs.append("vulkan-headers::vulkan-headers") + if is_apple_os(self): + gui_reqs.append("moltenvk::moltenvk") + if self.options.with_harfbuzz: + gui_reqs.append("harfbuzz::harfbuzz") + if self.options.with_glib: + gui_reqs.append("glib::glib") + if self.options.with_md4c: + gui_reqs.append("md4c::md4c") + _create_module("Gui", gui_reqs) + + _add_build_module("qtGui", self._cmake_qt6_private_file("Gui")) + + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L419-L429 + self.cpp_info.components["qtGui"].system_libs += [ + "advapi32", "gdi32", "ole32", "shell32", "user32", "d3d11", "dxgi", "dxguid" + ] + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L729 + self.cpp_info.components["qtGui"].system_libs.append("d2d1") + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L732-L742 + self.cpp_info.components["qtGui"].system_libs.append("dwrite") + if self.settings.compiler == "gcc": + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L746 + self.cpp_info.components["qtGui"].system_libs.append("uuid") + if Version(self.version) >= "6.6.0": + # https://github.com/qt/qtbase/blob/v6.6.0/src/gui/CMakeLists.txt#L428 + self.cpp_info.components["qtGui"].system_libs.append("d3d12") + if Version(self.version) >= "6.7.0": + # https://github.com/qt/qtbase/blob/v6.7.0-beta1/src/gui/CMakeLists.txt#L430 + self.cpp_info.components["qtGui"].system_libs.append("uxtheme") + if self.settings.compiler == "gcc": + self.cpp_info.components["qtGui"].system_libs.append("uuid") + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/direct2d/CMakeLists.txt#L60-L82 + self.cpp_info.components["qtGui"].system_libs += [ + "advapi32", "d2d1", "d3d11", "dwmapi", "dwrite", "dxgi", "dxguid", "gdi32", "imm32", "ole32", + "oleaut32", "setupapi", "shell32", "shlwapi", "user32", "version", "winmm", "winspool", + "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" + ] + _create_plugin("QWindowsIntegrationPlugin", "qwindows", "platforms", ["Core", "Gui"]) + # https://github.com/qt/qtbase/commit/65d58e6c41e3c549c89ea4f05a8e467466e79ca3 + if Version(self.version) >= "6.7.0": + _create_plugin("QModernWindowsStylePlugin", "qmodernwindowsstyle", "styles", ["Core", "Gui"]) + else: + _create_plugin("QWindowsVistaStylePlugin", "qwindowsvistastyle", "styles", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/windows/CMakeLists.txt#L53-L69 + self.cpp_info.components["qtQWindowsIntegrationPlugin"].system_libs += [ + "advapi32", "dwmapi", "gdi32", "imm32", "ole32", "oleaut32", "setupapi", "shell32", "shlwapi", + "user32", "winmm", "winspool", "wtsapi32", "shcore", "comdlg32", "d3d9", "runtimeobject" + ] + elif self.settings.os == "Android": + _create_plugin("QAndroidIntegrationPlugin", "qtforandroid", "platforms", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/android/CMakeLists.txt#L68-L70 + self.cpp_info.components["qtQAndroidIntegrationPlugin"].system_libs = ["android", "jnigraphics"] + elif is_apple_os(self): + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L388-L394 + self.cpp_info.components["qtGui"].frameworks = ["CoreFoundation", "CoreGraphics", "CoreText", "Foundation", "ImageIO"] + if self.options.get_safe("opengl", "no") != "no": + # https://github.com/qt/qtbase/commit/2ed63e587eefb246dba9e69aa01fdb2abb2def13 + self.cpp_info.components["qtGui"].frameworks.append("AGL") + if self.settings.os == "Macos": + # https://github.com/qt/qtbase/blob/v6.6.1/src/gui/CMakeLists.txt#L362-L370 + self.cpp_info.components["qtGui"].frameworks += ["AppKit", "Carbon"] + _create_plugin("QCocoaIntegrationPlugin", "qcocoa", "platforms", ["Core", "Gui"]) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/cocoa/CMakeLists.txt#L51-L58 + self.cpp_info.components["QCocoaIntegrationPlugin"].frameworks = [ + "AppKit", "Carbon", "CoreServices", "CoreVideo", "IOKit", "IOSurface", "Metal", "QuartzCore" + ] + elif self.settings.os in ["iOS", "tvOS"]: + _create_plugin("QIOSIntegrationPlugin", "qios", "platforms", []) + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/ios/CMakeLists.txt#L32-L37 + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks = [ + "AudioToolbox", "Foundation", "Metal", "QuartzCore", "UIKit", "CoreGraphics" + ] + if self.settings.os != "tvOS": + # https://github.com/qt/qtbase/blob/v6.6.1/src/plugins/platforms/ios/CMakeLists.txt#L66-L68 + self.cpp_info.components["QIOSIntegrationPlugin"].frameworks += [ + "AssetsLibrary", "UniformTypeIdentifiers", "Photos", + ] + elif self.settings.os == "watchOS": + _create_plugin("QMinimalIntegrationPlugin", "qminimal", "platforms", []) + elif self.settings.os == "Emscripten": + _create_plugin("QWasmIntegrationPlugin", "qwasm", "platforms", ["Core", "Gui"]) + elif self.options.get_safe("with_x11", False): + _create_module("XcbQpaPrivate", ["xkbcommon::libxkbcommon-x11", "xorg::xorg"], has_include_dir=False) + _create_plugin("QXcbIntegrationPlugin", "qxcb", "platforms", ["Core", "Gui", "XcbQpaPrivate"]) + + _create_plugin("QGifPlugin", "qgif", "imageformats", ["Gui"]) + _create_plugin("QIcoPlugin", "qico", "imageformats", ["Gui"]) + if self.options.get_safe("with_libjpeg"): + jpeg_reqs = ["Gui"] + if self.options.with_libjpeg == "libjpeg-turbo": + jpeg_reqs.append("libjpeg-turbo::libjpeg-turbo") + if self.options.with_libjpeg == "libjpeg": + jpeg_reqs.append("libjpeg::libjpeg") + _create_plugin("QJpegPlugin", "qjpeg", "imageformats", jpeg_reqs) + + if self.options.with_sqlite3: + _create_plugin("QSQLiteDriverPlugin", "qsqlite", "sqldrivers", ["sqlite3::sqlite3"]) + if self.options.with_pq: + _create_plugin("QPSQLDriverPlugin", "qsqlpsql", "sqldrivers", ["libpq::libpq"]) + if self.options.with_odbc: + _create_plugin("QODBCDriverPlugin", "qsqlodbc", "sqldrivers", []) + if self.settings.os != "Windows": + self.cpp_info.components["QODBCDriverPlugin"].requires.append("odbc::odbc") + else: + self.cpp_info.components["QODBCDriverPlugin"].system_libs.append("odbc32") + networkReqs = [] + if self.options.openssl: + networkReqs.append("openssl::openssl") + if self.options.with_brotli: + networkReqs.append("brotli::brotli") + if self.settings.os in ['Linux', 'FreeBSD'] and self.options.with_gssapi: + networkReqs.append("krb5::krb5-gssapi") + _create_module("Network", networkReqs) + _create_module("Sql", []) + _create_module("Test", []) + if self.options.widgets: + _create_module("Widgets", ["Gui"]) + _add_build_module("qtWidgets", self._cmake_qt6_private_file("Widgets")) + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/widgets/CMakeLists.txt#L316-L321 + self.cpp_info.components["qtWidgets"].system_libs += [ + "dwmapi", "shell32", "uxtheme", + ] + if self.options.gui and self.options.widgets: + _create_module("PrintSupport", ["Gui", "Widgets"]) + if self.options.get_safe("opengl", "no") != "no" and self.options.gui: + _create_module("OpenGL", ["Gui"]) + if self.options.widgets and self.options.get_safe("opengl", "no") != "no": + _create_module("OpenGLWidgets", ["OpenGL", "Widgets"]) + _create_module("Concurrent", []) + _create_module("Xml", []) + + if self.options.qt5compat: + _create_module("Core5Compat", []) + + # since https://github.com/qt/qtdeclarative/commit/4fb84137f1c0a49d64b8bef66fef8a4384cc2a68 + qt_quick_enabled = self.options.gui and self.options.qtshadertools + + if self.options.qtdeclarative: + _create_module("Qml", ["Network"]) + _add_build_module("qtQml", self._cmake_qt6_private_file("Qml")) + _create_module("QmlModels", ["Qml"]) + self.cpp_info.components["qtQmlImportScanner"].set_property("cmake_target_name", "Qt6::QmlImportScanner") + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package"] = "QmlImportScanner" # this is an alias for Qml and there to integrate with existing consumers + self.cpp_info.components["qtQmlImportScanner"].names["cmake_find_package_multi"] = "QmlImportScanner" + self.cpp_info.components["qtQmlImportScanner"].requires = _get_corrected_reqs(["Qml"]) + if qt_quick_enabled: + _create_module("Quick", ["Gui", "Qml", "QmlModels"]) + _add_build_module("qtQuick", self._cmake_qt6_private_file("Quick")) + if self.options.widgets: + _create_module("QuickWidgets", ["Gui", "Qml", "Quick", "Widgets"]) + _create_module("QuickShapes", ["Gui", "Qml", "Quick"]) + _create_module("QuickTest", ["Test", "Quick"]) + _create_module("QmlWorkerScript", ["Qml"]) + + if self.options.qttools and self.options.gui and self.options.widgets: + self.cpp_info.components["qtLinguistTools"].set_property("cmake_target_name", "Qt6::LinguistTools") + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package"] = "LinguistTools" + self.cpp_info.components["qtLinguistTools"].names["cmake_find_package_multi"] = "LinguistTools" + _create_module("UiPlugin", ["Gui", "Widgets"]) + self.cpp_info.components["qtUiPlugin"].libs = [] # this is a collection of abstract classes, so this is header-only + self.cpp_info.components["qtUiPlugin"].libdirs = [] + _create_module("UiTools", ["UiPlugin", "Gui", "Widgets"]) + _create_module("Designer", ["Gui", "UiPlugin", "Widgets", "Xml"]) + _create_module("Help", ["Gui", "Sql", "Widgets"]) + + if self.options.qtshadertools and self.options.gui: + _create_module("ShaderTools", ["Gui"]) + + if self.options.qtquick3d and qt_quick_enabled: + _create_module("Quick3DUtils", ["Gui"]) + _create_module("Quick3DAssetImport", ["Gui", "Qml", "Quick3DUtils"]) + _create_module("Quick3DRuntimeRender", ["Gui", "Quick", "Quick3DAssetImport", "Quick3DUtils", "ShaderTools"]) + _create_module("Quick3D", ["Gui", "Qml", "Quick", "Quick3DRuntimeRender"]) + + if (self.options.get_safe("qtquickcontrols2") or self.options.qtdeclarative) and qt_quick_enabled: + _create_module("QuickControls2", ["Gui", "Quick"]) + _create_module("QuickTemplates2", ["Gui", "Quick"]) + + if self.options.qtsvg and self.options.gui: + _create_module("Svg", ["Gui"]) + _create_plugin("QSvgIconPlugin", "qsvgicon", "iconengines", []) + _create_plugin("QSvgPlugin", "qsvg", "imageformats", []) + if self.options.widgets: + _create_module("SvgWidgets", ["Gui", "Svg", "Widgets"]) + + if self.options.qtwayland and self.options.gui: + _create_module("WaylandClient", ["Gui", "wayland::wayland-client"]) + _create_module("WaylandCompositor", ["Gui", "wayland::wayland-server"]) + + if self.options.get_safe("qtactiveqt") and self.settings.os == "Windows": + _create_module("AxBase", ["Gui", "Widgets"]) + _create_module("AxServer", ["AxBase"]) + self.cpp_info.components["qtAxServer"].system_libs.append("shell32") + self.cpp_info.components["qtAxServer"].defines.append("QAXSERVER") + _create_module("AxContainer", ["AxBase"]) + if self.options.get_safe("qtcharts"): + _create_module("Charts", ["Gui", "Widgets"]) + if self.options.get_safe("qtdatavis3d") and qt_quick_enabled: + _create_module("DataVisualization", ["Gui", "OpenGL", "Qml", "Quick"]) + if self.options.get_safe("qtlottie"): + _create_module("Bodymovin", ["Gui"]) + if self.options.get_safe("qtscxml"): + _create_module("StateMachine", []) + _create_module("StateMachineQml", ["StateMachine", "Qml"]) + _create_module("Scxml", []) + _create_plugin("QScxmlEcmaScriptDataModelPlugin", "qscxmlecmascriptdatamodel", "scxmldatamodel", ["Scxml", "Qml"]) + _create_module("ScxmlQml", ["Scxml", "Qml"]) + if self.options.get_safe("qtvirtualkeyboard") and qt_quick_enabled: + _create_module("VirtualKeyboard", ["Gui", "Qml", "Quick"]) + _create_plugin("QVirtualKeyboardPlugin", "qtvirtualkeyboardplugin", "platforminputcontexts", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardHangulPlugin", "qtvirtualkeyboard_hangul", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardMyScriptPlugin", "qtvirtualkeyboard_myscript", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + _create_plugin("QtVirtualKeyboardThaiPlugin", "qtvirtualkeyboard_thai", "virtualkeyboard", ["Gui", "Qml", "VirtualKeyboard"]) + if self.options.get_safe("qt3d"): + _create_module("3DCore", ["Gui", "Network"]) + _create_module("3DRender", ["3DCore", "OpenGL"]) + _create_module("3DAnimation", ["3DCore", "3DRender", "Gui"]) + _create_module("3DInput", ["3DCore", "Gui"]) + _create_module("3DLogic", ["3DCore", "Gui"]) + _create_module("3DExtras", ["Gui", "3DCore", "3DInput", "3DLogic", "3DRender"]) + _create_plugin("DefaultGeometryLoaderPlugin", "defaultgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"]) + _create_plugin("fbxGeometryLoaderPlugin", "fbxgeometryloader", "geometryloaders", ["3DCore", "3DRender", "Gui"]) + if qt_quick_enabled: + _create_module("3DQuick", ["3DCore", "Gui", "Qml", "Quick"]) + _create_module("3DQuickAnimation", ["3DAnimation", "3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickExtras", ["3DCore", "3DExtras", "3DInput", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickInput", ["3DCore", "3DInput", "3DQuick", "Gui", "Qml"]) + _create_module("3DQuickRender", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + _create_module("3DQuickScene2D", ["3DCore", "3DQuick", "3DRender", "Gui", "Qml"]) + if self.options.get_safe("qtimageformats"): + _create_plugin("ICNSPlugin", "qicns", "imageformats", ["Gui"]) + _create_plugin("QJp2Plugin", "qjp2", "imageformats", ["Gui"]) + _create_plugin("QMacHeifPlugin", "qmacheif", "imageformats", ["Gui"]) + _create_plugin("QMacJp2Plugin", "qmacjp2", "imageformats", ["Gui"]) + _create_plugin("QMngPlugin", "qmng", "imageformats", ["Gui"]) + _create_plugin("QTgaPlugin", "qtga", "imageformats", ["Gui"]) + _create_plugin("QTiffPlugin", "qtiff", "imageformats", ["Gui"]) + _create_plugin("QWbmpPlugin", "qwbmp", "imageformats", ["Gui"]) + _create_plugin("QWebpPlugin", "qwebp", "imageformats", ["Gui"]) + if self.options.get_safe("qtnetworkauth"): + _create_module("NetworkAuth", ["Network"]) + if self.options.get_safe("qtcoap"): + _create_module("Coap", ["Network"]) + if self.options.get_safe("qtmqtt"): + _create_module("Mqtt", ["Network"]) + if self.options.get_safe("qtopcua"): + _create_module("OpcUa", ["Network"]) + _create_plugin("QOpen62541Plugin", "open62541_backend", "opcua", ["Network", "OpcUa"]) + _create_plugin("QUACppPlugin", "uacpp_backend", "opcua", ["Network", "OpcUa"]) + + if self.options.get_safe("qtmultimedia"): + multimedia_reqs = ["Network", "Gui"] + if self.options.get_safe("with_libalsa", False): + multimedia_reqs.append("libalsa::libalsa") + if self.options.with_openal: + multimedia_reqs.append("openal-soft::openal-soft") + if self.options.get_safe("with_pulseaudio", False): + multimedia_reqs.append("pulseaudio::pulse") + _create_module("Multimedia", multimedia_reqs) + _create_module("MultimediaWidgets", ["Multimedia", "Widgets", "Gui"]) + if self.options.qtdeclarative and qt_quick_enabled: + _create_module("MultimediaQuick", ["Multimedia", "Quick"]) + if self.options.with_gstreamer: + _create_plugin("QGstreamerMediaPlugin", "gstreamermediaplugin", "multimedia", [ + "gstreamer::gstreamer", + "gst-plugins-base::gst-plugins-base"]) + + if self.options.get_safe("qtpositioning"): + _create_module("Positioning", []) + _create_plugin("QGeoPositionInfoSourceFactoryGeoclue2", "qtposition_geoclue2", "position", []) + _create_plugin("QGeoPositionInfoSourceFactoryPoll", "qtposition_positionpoll", "position", []) + + if self.options.get_safe("qtsensors"): + _create_module("Sensors", []) + _create_plugin("genericSensorPlugin", "qtsensors_generic", "sensors", []) + _create_plugin("IIOSensorProxySensorPlugin", "qtsensors_iio-sensor-proxy", "sensors", []) + if self.settings.os == "Linux": + _create_plugin("LinuxSensorPlugin", "qtsensors_linuxsys", "sensors", []) + _create_plugin("QtSensorGesturePlugin", "qtsensorgestures_plugin", "sensorgestures", []) + _create_plugin("QShakeSensorGesturePlugin", "qtsensorgestures_shakeplugin", "sensorgestures", []) + + if self.options.get_safe("qtconnectivity"): + _create_module("Bluetooth", ["Network"]) + _create_module("Nfc", []) + + if self.options.get_safe("qtserialport"): + _create_module("SerialPort", []) + + if self.options.get_safe("qtserialbus"): + _create_module("SerialBus", ["SerialPort"] if self.options.get_safe("qtserialport") else []) + _create_plugin("PassThruCanBusPlugin", "qtpassthrucanbus", "canbus", []) + _create_plugin("PeakCanBusPlugin", "qtpeakcanbus", "canbus", []) + _create_plugin("SocketCanBusPlugin", "qtsocketcanbus", "canbus", []) + _create_plugin("TinyCanBusPlugin", "qttinycanbus", "canbus", []) + _create_plugin("VirtualCanBusPlugin", "qtvirtualcanbus", "canbus", []) + + if self.options.get_safe("qtwebsockets"): + _create_module("WebSockets", ["Network"]) + + if self.options.get_safe("qtwebchannel"): + _create_module("WebChannel", ["Qml"]) + + if self.options.get_safe("qtwebengine") and qt_quick_enabled: + webenginereqs = ["Gui", "Quick", "WebChannel"] + if self.options.get_safe("qtpositioning"): + webenginereqs.append("Positioning") + if self.settings.os == "Linux": + webenginereqs.extend(["expat::expat", "opus::libopus", "xorg-proto::xorg-proto", "libxshmfence::libxshmfence", \ + "nss::nss", "libdrm::libdrm"]) + _create_module("WebEngineCore", webenginereqs) + _create_module("WebEngineQuick", ["WebEngineCore"]) + _create_module("WebEngineWidgets", ["WebEngineCore", "Quick", "PrintSupport", "Widgets", "Gui", "Network"]) + + if self.options.get_safe("qtremoteobjects"): + _create_module("RemoteObjects", []) + + if self.options.get_safe("qtwebview"): + _create_module("WebView", ["Core", "Gui"]) + + if self.options.get_safe("qtspeech"): + _create_module("TextToSpeech", []) + + if self.options.get_safe("qthttpserver"): + http_server_deps = ["Core", "Network"] + if self.options.get_safe("qtwebsockets"): + http_server_deps.append("WebSockets") + _create_module("HttpServer", http_server_deps) + + if self.options.get_safe("qtgrpc"): + _create_module("Protobuf", []) + _create_module("Grpc", ["Core", "Protobuf", "Network"]) + + if self.settings.os in ["Windows", "iOS"]: + if self.settings.os == "Windows": + self.cpp_info.components["qtEntryPointImplementation"].set_property("cmake_target_name", "Qt6::EntryPointImplementation") + self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package"] = "EntryPointImplementation" + self.cpp_info.components["qtEntryPointImplementation"].names["cmake_find_package_multi"] = "EntryPointImplementation" + self.cpp_info.components["qtEntryPointImplementation"].libs = [f"Qt6EntryPoint{libsuffix}"] + self.cpp_info.components["qtEntryPointImplementation"].system_libs = ["shell32"] + + if self.settings.compiler == "gcc": + self.cpp_info.components["qtEntryPointMinGW32"].set_property("cmake_target_name", "Qt6::EntryPointMinGW32") + self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package"] = "EntryPointMinGW32" + self.cpp_info.components["qtEntryPointMinGW32"].names["cmake_find_package_multi"] = "EntryPointMinGW32" + self.cpp_info.components["qtEntryPointMinGW32"].system_libs = ["mingw32"] + self.cpp_info.components["qtEntryPointMinGW32"].requires = ["qtEntryPointImplementation"] + + self.cpp_info.components["qtEntryPointPrivate"].set_property("cmake_target_name", "Qt6::EntryPointPrivate") + self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package"] = "EntryPointPrivate" + self.cpp_info.components["qtEntryPointPrivate"].names["cmake_find_package_multi"] = "EntryPointPrivate" + if self.settings.os == "Windows": + if self.settings.compiler == "gcc": + self.cpp_info.components["qtEntryPointPrivate"].defines.append("QT_NEEDS_QMAIN") + self.cpp_info.components["qtEntryPointPrivate"].requires.append("qtEntryPointMinGW32") + else: + self.cpp_info.components["qtEntryPointPrivate"].requires.append("qtEntryPointImplementation") + if self.settings.os == "iOS": + self.cpp_info.components["qtEntryPointPrivate"].exelinkflags.append("-Wl,-e,_qt_main_wrapper") + + if self.settings.os != "Windows": + self.cpp_info.components["qtCore"].cxxflags.append("-fPIC") + + if not self.options.shared: + if self.settings.os == "Windows": + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L527-L541 + self.cpp_info.components["qtCore"].system_libs.append("advapi32") + self.cpp_info.components["qtCore"].system_libs.append("authz") + self.cpp_info.components["qtCore"].system_libs.append("kernel32") + self.cpp_info.components["qtCore"].system_libs.append("netapi32") + self.cpp_info.components["qtCore"].system_libs.append("ole32") + self.cpp_info.components["qtCore"].system_libs.append("shell32") + self.cpp_info.components["qtCore"].system_libs.append("user32") + self.cpp_info.components["qtCore"].system_libs.append("uuid") + self.cpp_info.components["qtCore"].system_libs.append("version") + self.cpp_info.components["qtCore"].system_libs.append("winmm") + self.cpp_info.components["qtCore"].system_libs.append("ws2_32") + self.cpp_info.components["qtCore"].system_libs.append("mpr") + self.cpp_info.components["qtCore"].system_libs.append("userenv") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L196-L200 + self.cpp_info.components["qtNetwork"].system_libs.append("advapi32") + self.cpp_info.components["qtNetwork"].system_libs.append("dnsapi") + self.cpp_info.components["qtNetwork"].system_libs.append("iphlpapi") + self.cpp_info.components["qtNetwork"].system_libs.append("secur32") + self.cpp_info.components["qtNetwork"].system_libs.append("winhttp") + # https://github.com/qt/qtbase/blob/v6.6.1/src/printsupport/CMakeLists.txt#L70-L75 + self.cpp_info.components["qtPrintSupport"].system_libs.append("gdi32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("user32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("comdlg32") + self.cpp_info.components["qtPrintSupport"].system_libs.append("winspool") + + if is_apple_os(self): + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L580-L584 + self.cpp_info.components["qtCore"].frameworks.append("CoreFoundation") + self.cpp_info.components["qtCore"].frameworks.append("Foundation") + self.cpp_info.components["qtCore"].frameworks.append("IOKit") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L205-L214 + self.cpp_info.components["qtNetwork"].frameworks.append("CFNetwork") + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L216-L221 + # qtcore requires "_OBJC_CLASS_$_NSApplication" and more, which are in "Cocoa" framework + self.cpp_info.components["qtCore"].frameworks.append("Cocoa") + self.cpp_info.components["qtNetwork"].system_libs.append("resolv") + if self.options.with_gssapi: + # https://github.com/qt/qtbase/blob/v6.6.1/src/network/CMakeLists.txt#L250C56-L253 + self.cpp_info.components["qtNetwork"].frameworks.append("GSS") + if self.options.gui and self.options.widgets: + # https://github.com/qt/qtbase/blob/v6.6.1/src/printsupport/CMakeLists.txt#L52-L63 + self.cpp_info.components["qtPrintSupport"].system_libs.append("cups") + self.cpp_info.components["qtPrintSupport"].frameworks.append("ApplicationServices") + if self.settings.os == "Macos": + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L598-L606 + self.cpp_info.components["qtCore"].frameworks.append("AppKit") + self.cpp_info.components["qtCore"].frameworks.append("ApplicationServices") + self.cpp_info.components["qtCore"].frameworks.append("CoreServices") + self.cpp_info.components["qtCore"].frameworks.append("CoreServices") + self.cpp_info.components["qtCore"].frameworks.append("Security") + self.cpp_info.components["qtCore"].frameworks.append("DiskArbitration") + else: + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L969-L972 + self.cpp_info.components["qtCore"].frameworks.append("MobileCoreServices") + if self.settings.os not in ["iOS", "tvOS"]: + self.cpp_info.components["qtNetwork"].frameworks.append("CoreServices") + self.cpp_info.components["qtNetwork"].frameworks.append("SystemConfiguration") + else: + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L1074-L1077 + self.cpp_info.components["qtCore"].frameworks.append("UIKit") + if self.settings.os == "watchOS": + # https://github.com/qt/qtbase/blob/v6.6.1/src/corelib/CMakeLists.txt#L1079-L1082 + self.cpp_info.components["qtCore"].frameworks.append("WatchKit") + + self.cpp_info.components["qtCore"].builddirs.append(os.path.join("bin")) + _add_build_module("qtCore", self._cmake_executables_file) + _add_build_module("qtCore", self._cmake_qt6_private_file("Core")) + if self.settings.os in ["Windows", "iOS"]: + _add_build_module("qtCore", self._cmake_entry_point_file) + + for m in os.listdir(os.path.join("lib", "cmake")): + component_name = m.replace("Qt6", "qt") + if component_name == "qt": + component_name = "qtCore" + + if component_name in self.cpp_info.components: + module = os.path.join("lib", "cmake", m, f"{m}Macros.cmake") + if os.path.isfile(module): + _add_build_module(component_name, module) + + module = os.path.join("lib", "cmake", m, f"{m}ConfigExtras.cmake") + if os.path.isfile(module): + _add_build_module(component_name, module) + + for helper_modules in glob.glob(os.path.join(self.package_folder, "lib", "cmake", m, "QtPublic*Helpers.cmake")): + _add_build_module(component_name, helper_modules) + self.cpp_info.components[component_name].builddirs.append(os.path.join("lib", "cmake", m)) + + elif component_name.endswith("Tools") and component_name[:-5] in self.cpp_info.components: + module = os.path.join("lib", "cmake", f"{m}", f"{m[:-5]}Macros.cmake") + if os.path.isfile(module): + _add_build_module(component_name[:-5], module) + self.cpp_info.components[component_name[:-5]].builddirs.append(os.path.join("lib", "cmake", m)) + + objects_dirs = glob.glob(os.path.join(self.package_folder, "lib", "objects-*/")) + for object_dir in objects_dirs: + for m in os.listdir(object_dir): + component = "qt" + m[:m.find("_")] + if component not in self.cpp_info.components: + continue + for root, _, files in os.walk(os.path.join(object_dir, m)): + obj_files = [os.path.join(root, file) for file in files] + self.cpp_info.components[component].exelinkflags.extend(obj_files) + self.cpp_info.components[component].sharedlinkflags.extend(obj_files) + + build_modules_list = [] + + if self.options.qtdeclarative: + build_modules_list.append(os.path.join(self.package_folder, "lib", "cmake", "Qt6Qml", "conan_qt_qt6_policies.cmake")) + + def _add_build_modules_for_component(component): + for req in self.cpp_info.components[component].requires: + if "::" in req: # not a qt component + continue + _add_build_modules_for_component(req) + build_modules_list.extend(build_modules.pop(component, [])) + + for c in self.cpp_info.components: + _add_build_modules_for_component(c) + + self.cpp_info.set_property("cmake_build_modules", build_modules_list) diff --git a/recipes/qt/6.x.x/patches/32fa63f.patch b/recipes/qt/6.x.x/patches/32fa63f.patch new file mode 100644 index 0000000..733b0c1 --- /dev/null +++ b/recipes/qt/6.x.x/patches/32fa63f.patch @@ -0,0 +1,28 @@ +From b404930e122013e76ba8fe165f3432288c051438 Mon Sep 17 00:00:00 2001 +From: shjiu +Date: Fri, 17 Nov 2023 09:41:31 +0900 +Subject: [PATCH] Fix build error with lambda on GCC 9.2 + +This patch is specific to the return type of updatePtrSimd function as boolean to avoid the bug of GCC 9.2. + +Fixes: QTBUG-112920 +Pick-to: 6.7 6.6 6.5 +Change-Id: I21cb1f6dda34448b2290ab72ec280b6b2a3732c9 +Reviewed-by: Volker Hilsheimer +--- + src/corelib/text/qstring.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp +index 2dc415584f3..d9e89f8e5bb 100644 +--- a/src/corelib/text/qstring.cpp ++++ b/src/corelib/text/qstring.cpp +@@ -471,7 +471,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval) + if constexpr (UseSse4_1) { + # ifndef Q_OS_QNX // compiler fails in the code below + __m128i mask; +- auto updatePtrSimd = [&](__m128i data) { ++ auto updatePtrSimd = [&](__m128i data) -> bool { + __m128i masked = _mm_and_si128(mask, data); + __m128i comparison = _mm_cmpeq_epi16(masked, _mm_setzero_si128()); + uint result = _mm_movemask_epi8(comparison); diff --git a/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch b/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch new file mode 100644 index 0000000..3675cf9 --- /dev/null +++ b/recipes/qt/6.x.x/patches/32fa63f_6.5.0.patch @@ -0,0 +1,28 @@ +From b404930e122013e76ba8fe165f3432288c051438 Mon Sep 17 00:00:00 2001 +From: shjiu +Date: Fri, 17 Nov 2023 09:41:31 +0900 +Subject: [PATCH] Fix build error with lambda on GCC 9.2 + +This patch is specific to the return type of updatePtrSimd function as boolean to avoid the bug of GCC 9.2. + +Fixes: QTBUG-112920 +Pick-to: 6.7 6.6 6.5 +Change-Id: I21cb1f6dda34448b2290ab72ec280b6b2a3732c9 +Reviewed-by: Volker Hilsheimer +--- + src/corelib/text/qstring.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp +index 2dc415584f3..d9e89f8e5bb 100644 +--- a/src/corelib/text/qstring.cpp ++++ b/src/corelib/text/qstring.cpp +@@ -461,7 +461,7 @@ static bool simdTestMask(const char *&ptr, const char *end, quint32 maskval) + if constexpr (UseSse4_1) { + # ifndef Q_OS_QNX // compiler fails in the code below + __m128i mask; +- auto updatePtrSimd = [&](__m128i data) { ++ auto updatePtrSimd = [&](__m128i data) -> bool { + __m128i masked = _mm_and_si128(mask, data); + __m128i comparison = _mm_cmpeq_epi16(masked, _mm_setzero_si128()); + uint result = _mm_movemask_epi8(comparison); diff --git a/recipes/qt/6.x.x/patches/c72097e.diff b/recipes/qt/6.x.x/patches/c72097e.diff new file mode 100644 index 0000000..0f21c17 --- /dev/null +++ b/recipes/qt/6.x.x/patches/c72097e.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tosrcols/gn/ninja_action_target_writer.cc +@@ -122,9 +122,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff b/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff new file mode 100644 index 0000000..968f4ab --- /dev/null +++ b/recipes/qt/6.x.x/patches/c72097e_6.6.0.diff @@ -0,0 +1,42 @@ +From c72097e8790553771daf3231124c3fbe1a438379 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Thu, 30 Mar 2017 11:37:24 +0300 +Subject: [PATCH] chromium: workaround for too long .rps file name + +Ninja may fail when the build directory is too long: + +ninja: error: WriteFile(__third_party_WebKit_Source_bindings_modules_\ +interfaces_info_individual_modules__home_qt_work_build_build-nitrogen\ +6x_tmp_work_cortexa9hf-neon-mx6qdl-poky-linux-gnueabi_qtwebengine_5.9\ +.0_gitAUTOINC_29afdb0a34_049134677a-r0_build_src_toolchain_target__ru\ +le.rsp): Unable to create file. File name too long + +Task-number: QTBUG-59769 +Change-Id: I73c5e64ae5174412be2a675e35b0b6047f2bf4c1 +--- + src/3rdparty/gn/src/gn/ninja_action_target_writer.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +index a5bc6cd..5cefbfe 100644 +--- a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/tosrcols/gn/ninja_action_target_writer.cc +@@ -125,9 +125,18 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; ++ + out_ << " rspfile = " << rspfile << std::endl; + + // Response file contents. diff --git a/recipes/qt/6.x.x/patches/d13958d.diff b/recipes/qt/6.x.x/patches/d13958d.diff new file mode 100644 index 0000000..1da1b66 --- /dev/null +++ b/recipes/qt/6.x.x/patches/d13958d.diff @@ -0,0 +1,26 @@ +From d13958dabb9f5542d772c6312cd33e4960bf1137 Mon Sep 17 00:00:00 2001 +From: Eric Lemanissier +Date: Tue, 29 Nov 2022 09:15:58 +0000 +Subject: [PATCH] fix pcre2 detection + +Pick-to: 6.3 +Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8 +--- + +diff --git a/cmake/FindWrapSystemPCRE2.cmake b/cmake/FindWrapSystemPCRE2.cmake +index f8516d3..3ac04b8 100644 +--- a/cmake/FindWrapSystemPCRE2.cmake ++++ b/cmake/FindWrapSystemPCRE2.cmake +@@ -6,11 +6,7 @@ + + find_package(PCRE2 ${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION} COMPONENTS 16BIT QUIET) + +-# TODO: pcre2-16 is not the target name provided by the upstream Config file. It is PCRE2::16BIT. +-# https://github.com/PCRE2Project/pcre2/blob/2410fbe3869cab403f02b94caa9ab37ee9f5854b/cmake/pcre2-config.cmake.in#L122 +-# We don't strictly need to handle that though, because the pkg-config code path below still +-# finds the correct libraries. +-set(__pcre2_target_name "PCRE2::pcre2-16") ++set(__pcre2_target_name "PCRE2::16BIT") + if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}") + # Hunter case. + set(__pcre2_found TRUE) diff --git a/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch new file mode 100644 index 0000000..2b9a861 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.5.3.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -851,12 +851,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch new file mode 100644 index 0000000..2dd2a1e --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.0.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -875,12 +875,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch new file mode 100644 index 0000000..67967d9 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix-long-path-on-windows_6.6.1.patch @@ -0,0 +1,16 @@ +--- a/src/tools/syncqt/main.cpp ++++ b/src/tools/syncqt/main.cpp +@@ -866,12 +866,7 @@ + + bool headerFileExists = std::filesystem::exists(headerFile); + +- std::filesystem::path headerFileRootName = +- std::filesystem::weakly_canonical(headerFile, ec).root_name(); +- std::string aliasedFilepath = !ec && headerFileRootName == m_outputRootName +- ? std::filesystem::relative(headerFile, outputDir).generic_string() +- : headerFile.generic_string(); +- ec.clear(); ++ std::string aliasedFilepath = headerFile.generic_string(); + + std::string aliasPath = outputDir + '/' + m_currentFilename; + diff --git a/recipes/qt/6.x.x/patches/fix_cmake3.28.patch b/recipes/qt/6.x.x/patches/fix_cmake3.28.patch new file mode 100644 index 0000000..c89a954 --- /dev/null +++ b/recipes/qt/6.x.x/patches/fix_cmake3.28.patch @@ -0,0 +1,45 @@ +From 0efea8020c1d221635aaa0a71529edb392cfe3cc Mon Sep 17 00:00:00 2001 +From: Joerg Bornemann +Date: Mon, 11 Sep 2023 14:48:32 +0200 +Subject: [PATCH] CMake: Fix build with CMake 3.28 on macOS + +FindWrapOpenGL.cmake assumed that IMPORTED_LOCATION is the absolute path +of the library within the framework. That's not the case with CMake 3.28 +anymore. There, IMPORTED_LOCATION is the absolute path of the framework +directory. + +The relevant upstream CMake change is +6b01a27f901b5eb392955fea322cde44a1b782a3. + +Pick-to: 6.2 6.5 6.6 +Change-Id: I6b702a28318e0978c56dec83c398965aa77ef020 +Reviewed-by: Alexandru Croitor +--- + cmake/FindWrapOpenGL.cmake | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake +index 3e6abaf4dda..7295a159caf 100644 +--- a/cmake/FindWrapOpenGL.cmake ++++ b/cmake/FindWrapOpenGL.cmake +@@ -14,14 +14,18 @@ + + add_library(WrapOpenGL::WrapOpenGL INTERFACE IMPORTED) + if(APPLE) ++ # CMake 3.27 and older: + # On Darwin platforms FindOpenGL sets IMPORTED_LOCATION to the absolute path of the library + # within the framework. This ends up as an absolute path link flag, which we don't want, + # because that makes our .prl files un-relocatable. + # Extract the framework path instead, and use that in INTERFACE_LINK_LIBRARIES, +- # which CMake ends up transforming into a reloctable -framework flag. ++ # which CMake ends up transforming into a relocatable -framework flag. + # See https://gitlab.kitware.com/cmake/cmake/-/issues/20871 for details. ++ # ++ # CMake 3.28 and above: ++ # IMPORTED_LOCATION is the absolute path the the OpenGL.framework folder. + get_target_property(__opengl_fw_lib_path OpenGL::GL IMPORTED_LOCATION) +- if(__opengl_fw_lib_path) ++ if(__opengl_fw_lib_path AND NOT __opengl_fw_lib_path MATCHES "/([^/]+)\\.framework$") + get_filename_component(__opengl_fw_path "${__opengl_fw_lib_path}" DIRECTORY) + endif() + diff --git a/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff b/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff new file mode 100644 index 0000000..8038f41 --- /dev/null +++ b/recipes/qt/6.x.x/patches/qt6-pri-helpers-fix.diff @@ -0,0 +1,15 @@ +--- QtPriHelpers.cmake.original 2021-08-03 23:38:06.343653948 +0300 ++++ QtPriHelpers.cmake 2021-08-03 23:26:24.483637483 +0300 +@@ -30,7 +30,11 @@ + if(lib_target_type STREQUAL "INTERFACE_LIBRARY") + get_target_property(iface_libs ${lib_target} INTERFACE_LINK_LIBRARIES) + if(iface_libs) +- list(PREPEND lib_targets ${iface_libs}) ++ foreach (iface_lib ${iface_libs}) ++ if (NOT "${iface_lib}" STREQUAL "${lib_target}") ++ list(PREPEND lib_targets ${iface_lib}) ++ endif () ++ endforeach () + endif() + else() + list(APPEND lib_libs "$") diff --git a/recipes/qt/6.x.x/qtmodules6.5.3.conf b/recipes/qt/6.x.x/qtmodules6.5.3.conf new file mode 100644 index 0000000..aee8d56 --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.5.3.conf @@ -0,0 +1,332 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.5.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.5.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.5.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.5.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.5.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.5.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.5.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.5.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.5.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.5.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.5.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.5.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.5.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools + path = qt3d + url = ../qt3d.git + branch = 6.5.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.5.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.5.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.5.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.5.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.5.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.5.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.5.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.5.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.5.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.5.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.5.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.5.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.5.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.5.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.5.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.5.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.5.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.5.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.5.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.5.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.5.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.5.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.5.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.5.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.5.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.5.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.5.3 + status = addon diff --git a/recipes/qt/6.x.x/qtmodules6.6.3.conf b/recipes/qt/6.x.x/qtmodules6.6.3.conf new file mode 100644 index 0000000..9ab358b --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.6.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.6.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.6.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.6.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.6.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.6.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.6.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.6.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.6.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.6.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.6.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.6.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.6.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.6.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.6.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.6.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.6.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.6.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.6.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.6.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.6.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.6.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.6.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.6.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.6.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.6.3 + status = addon +[submodule "qtspeech"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtspeech + url = ../qtspeech.git + branch = 6.6.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.6.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.6.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.6.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.6.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.6.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.6.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.6.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.6.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.6.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.6.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.6.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.6.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.6.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.6.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.6.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.6.3 + status = preview diff --git a/recipes/qt/6.x.x/qtmodules6.7.3.conf b/recipes/qt/6.x.x/qtmodules6.7.3.conf new file mode 100644 index 0000000..416cfaa --- /dev/null +++ b/recipes/qt/6.x.x/qtmodules6.7.3.conf @@ -0,0 +1,338 @@ +[submodule "qtbase"] + path = qtbase + url = ../qtbase.git + branch = 6.7.3 + status = essential +[submodule "qtsvg"] + depends = qtbase + path = qtsvg + url = ../qtsvg.git + branch = 6.7.3 + status = addon +[submodule "qtdeclarative"] + depends = qtbase + recommends = qtimageformats qtshadertools qtsvg qtlanguageserver + path = qtdeclarative + url = ../qtdeclarative.git + branch = 6.7.3 + status = essential +[submodule "qtactiveqt"] + depends = qtbase + path = qtactiveqt + url = ../qtactiveqt.git + branch = 6.7.3 + status = addon +[submodule "qtmultimedia"] + depends = qtbase qtshadertools + recommends = qtdeclarative qtquick3d + path = qtmultimedia + url = ../qtmultimedia.git + branch = 6.7.3 + status = addon +[submodule "qttools"] + depends = qtbase + recommends = qtdeclarative qtactiveqt + path = qttools + url = ../qttools.git + branch = 6.7.3 + status = essential +[submodule "qtxmlpatterns"] + depends = qtbase + recommends = qtdeclarative + path = qtxmlpatterns + url = ../qtxmlpatterns.git + branch = dev + status = ignore +[submodule "qttranslations"] + depends = qttools + path = qttranslations + url = ../qttranslations.git + branch = 6.7.3 + status = essential + priority = 30 +[submodule "qtdoc"] + depends = qtdeclarative qttools + recommends = qtmultimedia qtshadertools qtwebengine + path = qtdoc + url = ../qtdoc.git + branch = 6.7.3 + status = essential + priority = 40 +[submodule "qtrepotools"] + path = qtrepotools + url = ../qtrepotools.git + branch = master + status = essential + project = - +[submodule "qtqa"] + depends = qtbase + path = qtqa + url = ../qtqa.git + branch = dev + status = essential + priority = 50 +[submodule "qtlocation"] + depends = qtbase qtpositioning + recommends = qtdeclarative + path = qtlocation + url = ../qtlocation.git + branch = 6.7.3 + status = preview +[submodule "qtpositioning"] + depends = qtbase + recommends = qtdeclarative qtserialport + path = qtpositioning + url = ../qtpositioning.git + branch = 6.7.3 + status = addon +[submodule "qtsensors"] + depends = qtbase + recommends = qtdeclarative + path = qtsensors + url = ../qtsensors.git + branch = 6.7.3 + status = addon +[submodule "qtsystems"] + depends = qtbase + recommends = qtdeclarative + path = qtsystems + url = ../qtsystems.git + branch = dev + status = ignore +[submodule "qtfeedback"] + depends = qtdeclarative + recommends = qtmultimedia + path = qtfeedback + url = ../qtfeedback.git + branch = master + status = ignore +[submodule "qtpim"] + depends = qtdeclarative + path = qtpim + url = ../qtpim.git + branch = dev + status = ignore +[submodule "qtconnectivity"] + depends = qtbase + recommends = qtdeclarative + path = qtconnectivity + url = ../qtconnectivity.git + branch = 6.7.3 + status = addon +[submodule "qtwayland"] + depends = qtbase + recommends = qtdeclarative + path = qtwayland + url = ../qtwayland.git + branch = 6.7.3 + status = addon +[submodule "qt3d"] + depends = qtbase + recommends = qtdeclarative qtshadertools qtmultimedia + path = qt3d + url = ../qt3d.git + branch = 6.7.3 + status = addon +[submodule "qtimageformats"] + depends = qtbase + path = qtimageformats + url = ../qtimageformats.git + branch = 6.7.3 + status = addon +[submodule "qtserialbus"] + depends = qtbase + recommends = qtserialport + path = qtserialbus + url = ../qtserialbus.git + branch = 6.7.3 + status = addon +[submodule "qtserialport"] + depends = qtbase + path = qtserialport + url = ../qtserialport.git + branch = 6.7.3 + status = addon +[submodule "qtwebsockets"] + depends = qtbase + recommends = qtdeclarative + path = qtwebsockets + url = ../qtwebsockets.git + branch = 6.7.3 + status = addon +[submodule "qtwebchannel"] + depends = qtbase + recommends = qtdeclarative qtwebsockets + path = qtwebchannel + url = ../qtwebchannel.git + branch = 6.7.3 + status = addon +[submodule "qtwebengine"] + depends = qtdeclarative + recommends = qtwebchannel qttools qtpositioning + path = qtwebengine + url = ../qtwebengine.git + branch = 6.7.3 + status = addon + priority = 10 +[submodule "qtcanvas3d"] + depends = qtdeclarative + path = qtcanvas3d + url = ../qtcanvas3d.git + branch = dev + status = ignore +[submodule "qtwebview"] + depends = qtdeclarative + recommends = qtwebengine + path = qtwebview + url = ../qtwebview.git + branch = 6.7.3 + status = addon +[submodule "qtcharts"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtcharts + url = ../qtcharts.git + branch = 6.7.3 + status = addon +[submodule "qtdatavis3d"] + depends = qtbase + recommends = qtdeclarative qtmultimedia + path = qtdatavis3d + url = ../qtdatavis3d.git + branch = 6.7.3 + status = addon +[submodule "qtvirtualkeyboard"] + depends = qtbase qtdeclarative qtsvg + recommends = qtmultimedia + path = qtvirtualkeyboard + url = ../qtvirtualkeyboard.git + branch = 6.7.3 + status = addon +[submodule "qtgamepad"] + depends = qtbase + recommends = qtdeclarative + path = qtgamepad + url = ../qtgamepad.git + branch = dev + status = ignore +[submodule "qtscxml"] + depends = qtbase qtdeclarative + path = qtscxml + url = ../qtscxml.git + branch = 6.7.3 + status = addon +[submodule "qtspeech"] + depends = qtbase qtmultimedia + recommends = qtdeclarative + path = qtspeech + url = ../qtspeech.git + branch = 6.7.3 + status = addon +[submodule "qtnetworkauth"] + depends = qtbase + path = qtnetworkauth + url = ../qtnetworkauth.git + branch = 6.7.3 + status = addon +[submodule "qtremoteobjects"] + depends = qtbase + recommends = qtdeclarative + path = qtremoteobjects + url = ../qtremoteobjects.git + branch = 6.7.3 + status = addon +[submodule "qtwebglplugin"] + depends = qtbase qtwebsockets + recommends = qtdeclarative + path = qtwebglplugin + url = ../qtwebglplugin.git + branch = dev + status = ignore +[submodule "qtlottie"] + depends = qtbase qtdeclarative + path = qtlottie + url = ../qtlottie.git + branch = 6.7.3 + status = addon +[submodule "qtquicktimeline"] + depends = qtbase qtdeclarative + path = qtquicktimeline + url = ../qtquicktimeline + branch = 6.7.3 + status = addon +[submodule "qtquick3d"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquicktimeline + path = qtquick3d + url = ../qtquick3d.git + branch = 6.7.3 + status = addon +[submodule "qtshadertools"] + depends = qtbase + path = qtshadertools + url = ../qtshadertools.git + branch = 6.7.3 + status = addon +[submodule "qt5compat"] + depends = qtbase qtdeclarative + path = qt5compat + url = ../qt5compat.git + branch = 6.7.3 + status = deprecated +[submodule "qtcoap"] + depends = qtbase + path = qtcoap + url = ../qtcoap.git + branch = 6.7.3 + status = addon +[submodule "qtmqtt"] + depends = qtbase qtdeclarative + path = qtmqtt + url = ../qtmqtt.git + branch = 6.7.3 + status = addon +[submodule "qtopcua"] + depends = qtbase qtdeclarative + path = qtopcua + url = ../qtopcua.git + branch = 6.7.3 + status = addon +[submodule "qtlanguageserver"] + depends = qtbase + path = qtlanguageserver + url = ../qtlanguageserver.git + branch = 6.7.3 + status = preview +[submodule "qthttpserver"] + depends = qtbase + recommends = qtwebsockets + path = qthttpserver + url = ../qthttpserver.git + branch = 6.7.3 + status = preview +[submodule "qtquick3dphysics"] + depends = qtbase qtdeclarative qtquick3d qtshadertools + path = qtquick3dphysics + url = ../qtquick3dphysics.git + branch = 6.7.3 + status = addon +[submodule "qtgrpc"] + depends = qtbase + recommends = qtdeclarative + path = qtgrpc + url = ../qtgrpc.git + branch = 6.7.3 + status = preview +[submodule "qtquickeffectmaker"] + depends = qtbase qtdeclarative qtshadertools + recommends = qtquick3d + path = qtquickeffectmaker + url = ../qtquickeffectmaker.git + branch = 6.7.3 + status = addon +[submodule "qtgraphs"] + depends = qtbase qtdeclarative qtquick3d + path = qtgraphs + url = ../qtgraphs.git + branch = 6.7.3 + status = preview diff --git a/recipes/qt/6.x.x/test_package/CMakeLists.txt b/recipes/qt/6.x.x/test_package/CMakeLists.txt new file mode 100644 index 0000000..45e4bb9 --- /dev/null +++ b/recipes/qt/6.x.x/test_package/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.cpp greeter.h example.qrc) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml Qt6::Widgets) +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) +set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTORCC ON) + +# Only running this Qt macros in macOS +if (APPLE) + # Related to https://github.com/conan-io/conan-center-index/issues/20574 + qt_standard_project_setup() + qt_add_executable(test_macos_bundle MACOSX_BUNDLE test_macos_bundle.cpp) + target_link_libraries(test_macos_bundle PRIVATE Qt6::Core) + target_compile_features(test_macos_bundle PRIVATE cxx_std_17) +endif() diff --git a/recipes/qt/6.x.x/test_package/conanfile.py b/recipes/qt/6.x.x/test_package/conanfile.py new file mode 100644 index 0000000..11efc3f --- /dev/null +++ b/recipes/qt/6.x.x/test_package/conanfile.py @@ -0,0 +1,47 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.env import VirtualRunEnv +from conan.tools.files import copy, save + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualBuildEnv" + test_type = "explicit" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires(self.tested_reference_str, run=can_run(self)) + + def build_requirements(self): + if not can_run(self): + self.tool_requires(self.tested_reference_str) + + def generate(self): + path = self.dependencies["qt"].package_folder.replace("\\", "/") + save(self, "qt.conf", f"""[Paths] +Prefix = {path}""") + + VirtualRunEnv(self).generate() + if can_run(self): + VirtualRunEnv(self).generate(scope="build") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + copy(self, "qt.conf", src=self.generators_folder, dst=os.path.join(self.cpp.build.bindirs[0])) + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") + # Related to https://github.com/conan-io/conan-center-index/issues/20574 + if self.settings.os == "Macos": + bin_macos_path = os.path.join(self.cpp.build.bindirs[0], "test_macos_bundle.app", "Contents", "MacOS", "test_macos_bundle") + self.run(bin_macos_path, env="conanrun") diff --git a/recipes/qt/6.x.x/test_package/example.qrc b/recipes/qt/6.x.x/test_package/example.qrc new file mode 100644 index 0000000..7060adf --- /dev/null +++ b/recipes/qt/6.x.x/test_package/example.qrc @@ -0,0 +1,5 @@ + + + resource.txt + + diff --git a/recipes/qt/6.x.x/test_package/greeter.h b/recipes/qt/6.x.x/test_package/greeter.h new file mode 100644 index 0000000..85052e0 --- /dev/null +++ b/recipes/qt/6.x.x/test_package/greeter.h @@ -0,0 +1,26 @@ +#include +#include +#include + +class Greeter : public QObject +{ + Q_OBJECT +public: + Greeter(const QString& name, QObject *parent = 0) + : QObject(parent) + , mName(name) {} + +public slots: + void run() + { + qDebug() << QString("Hello %1!").arg(mName); + + emit finished(); + } + +signals: + void finished(); + +private: + const QString& mName; +}; diff --git a/recipes/qt/6.x.x/test_package/resource.txt b/recipes/qt/6.x.x/test_package/resource.txt new file mode 100644 index 0000000..ab281a2 --- /dev/null +++ b/recipes/qt/6.x.x/test_package/resource.txt @@ -0,0 +1 @@ +Hello World From Resource diff --git a/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp b/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp new file mode 100644 index 0000000..fb10bbf --- /dev/null +++ b/recipes/qt/6.x.x/test_package/test_macos_bundle.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + return 0; + } diff --git a/recipes/qt/6.x.x/test_package/test_package.cpp b/recipes/qt/6.x.x/test_package/test_package.cpp new file mode 100644 index 0000000..5374ecf --- /dev/null +++ b/recipes/qt/6.x.x/test_package/test_package.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "greeter.h" + +int main(int argc, char *argv[]){ + QCoreApplication app(argc, argv); + QCoreApplication::setApplicationName("Application Example"); + QCoreApplication::setApplicationVersion("1.0.0"); + + QString name = argc > 0 ? argv[1] : ""; + if (name.isEmpty()) { + name = "World"; + } + + Greeter* greeter = new Greeter(name, &app); + QObject::connect(greeter, SIGNAL(finished()), &app, SLOT(quit())); + QTimer::singleShot(0, greeter, SLOT(run())); + + QFile f(":/resource.txt"); + if(!f.open(QIODevice::ReadOnly)) + qFatal("Could not open resource file"); + qDebug() << "Resource content:" << f.readAll(); + f.close(); + + QNetworkAccessManager networkTester; + + QSqlDatabase sqlTester; + + QVector v; + v << 1 << 2 << 3 << 4; + QtConcurrent::blockingFilter(v, [](int i) + { + return i % 2; + }); + + QDomText xmlTester; + + return app.exec(); +} diff --git a/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt b/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt new file mode 100644 index 0000000..60524d0 --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.3.0) + +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_set_vs_runtime() +conan_set_libcxx() +conan_output_dirs_setup() + +find_package(Qt6 COMPONENTS Core Network Sql Concurrent Xml REQUIRED CONFIG) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +add_executable(${PROJECT_NAME} ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME} Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) + +# check if extra qt cmake functions are usable +qt_add_executable(${PROJECT_NAME}2 ../test_package/test_package.cpp ../test_package/greeter.h ../test_package/example.qrc) + +set_property(TARGET ${PROJECT_NAME}2 PROPERTY CXX_STANDARD 17) + +target_link_libraries(${PROJECT_NAME}2 PRIVATE Qt6::Core Qt6::Network Qt6::Sql Qt6::Concurrent Qt6::Xml) diff --git a/recipes/qt/6.x.x/test_v1_package/conanfile.py b/recipes/qt/6.x.x/test_v1_package/conanfile.py new file mode 100644 index 0000000..a586ad3 --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/conanfile.py @@ -0,0 +1,134 @@ +import os +import shutil + +from conan import ConanFile +from conan.tools.build import cross_building +from conan.tools.files import mkdir, chdir, save +from conan.tools.microsoft import is_msvc +from conan.tools.scm import Version + +from conans import tools, Meson, RunEnvironment, CMake +from conan.errors import ConanException + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "qmake" + + def build_requirements(self): + self.tool_requires("cmake/3.25.3") + if self._meson_supported(): + self.tool_requires("meson/1.1.0") + + def generate(self): + save(self, "qt.conf", """[Paths] +Prefix = {}""".format(self.dependencies["qt"].package_folder.replace('\\', '/'))) + + def _is_mingw(self): + return self.settings.os == "Windows" and self.settings.compiler == "gcc" + + def _meson_supported(self): + return False and self.options["qt"].shared and\ + not cross_building(self) and\ + not self.settings.os == "Macos" and\ + not self._is_mingw() + + def _qmake_supported(self): + return self.options["qt"].shared + + def _build_with_qmake(self): + if not self._qmake_supported(): + return + mkdir(self, "qmake_folder") + with chdir(self, "qmake_folder"): + self.output.info("Building with qmake") + + with tools.vcvars(self.settings) if is_msvc(self) else tools.no_op(): + args = [self.source_folder, "DESTDIR=bin"] + + def _getenvpath(var): + val = os.getenv(var) + if val and tools.os_info.is_windows: + val = val.replace("\\", "/") + os.environ[var] = val + return val + + value = _getenvpath('CC') + if value: + args.append(f"QMAKE_CC=\"{value}\"") + + value = _getenvpath('CXX') + if value: + args.append(f"QMAKE_CXX=\"{value}\"") + + value = _getenvpath('LD') + if value: + args.append(f"QMAKE_LINK_C=\"{value}\"") + args.append(f"QMAKE_LINK_C_SHLIB=\"{value}\"") + args.append(f"QMAKE_LINK=\"{value}\"") + args.append(f"QMAKE_LINK_SHLIB=\"{value}\"") + + self.run(f"qmake {' '.join(args)}", run_environment=True) + if tools.os_info.is_windows: + if is_msvc(self): + self.run("nmake", run_environment=True) + else: + self.run("mingw32-make", run_environment=True) + else: + self.run("make", run_environment=True) + + def _build_with_meson(self): + if self._meson_supported(): + self.output.info("Building with Meson") + mkdir(self, "meson_folder") + with tools.environment_append(RunEnvironment(self).vars): + meson = Meson(self) + try: + meson.configure(build_folder="meson_folder", defs={"cpp_std": "c++11"}) + except ConanException: + self.output.info(open("meson_folder/meson-logs/meson-log.txt", 'r').read()) + raise + meson.build() + + def _build_with_cmake_find_package_multi(self): + self.output.info("Building with cmake_find_package_multi") + env_build = RunEnvironment(self) + with tools.environment_append(env_build.vars): + cmake = CMake(self, set_cmake_flags=True) + if self.settings.os == "Macos": + cmake.definitions['CMAKE_OSX_DEPLOYMENT_TARGET'] = '10.15' if Version(self.deps_cpp_info["qt"].version) >= "6.5.0" else "10.14" + + cmake.configure() + cmake.build() + + def build(self): + self._build_with_qmake() + self._build_with_meson() + self._build_with_cmake_find_package_multi() + + def _test_with_qmake(self): + if not self._qmake_supported(): + return + self.output.info("Testing qmake") + bin_path = os.path.join("qmake_folder", "bin") + if self.settings.os == "Macos": + bin_path = os.path.join(bin_path, "test_package.app", "Contents", "MacOS") + shutil.copy("qt.conf", bin_path) + self.run(os.path.join(bin_path, "test_package"), run_environment=True) + + def _test_with_meson(self): + if self._meson_supported(): + self.output.info("Testing Meson") + shutil.copy("qt.conf", "meson_folder") + self.run(os.path.join("meson_folder", "test_package"), run_environment=True) + + def _test_with_cmake_find_package_multi(self): + self.output.info("Testing CMake_find_package_multi") + shutil.copy("qt.conf", "bin") + self.run(os.path.join("bin", "test_package"), run_environment=True) + + def test(self): + if not cross_building(self, skip_x64_x86=True): + self._test_with_qmake() + self._test_with_meson() + self._test_with_cmake_find_package_multi() diff --git a/recipes/qt/6.x.x/test_v1_package/meson.build b/recipes/qt/6.x.x/test_v1_package/meson.build new file mode 100644 index 0000000..684dfec --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/meson.build @@ -0,0 +1,6 @@ +project('test_package', 'cpp') +qt6 = import('qt6') +qt6_dep = dependency('qt6', modules: ['Core', 'Network', 'Sql', 'Concurrent', 'Xml']) +moc_files = qt6.preprocess(moc_headers : 'greeter.h', qresources : 'example.qrc') +executable('test_package', 'test_package.cpp', moc_files, + dependencies : qt6_dep) diff --git a/recipes/qt/6.x.x/test_v1_package/test_package.pro b/recipes/qt/6.x.x/test_v1_package/test_package.pro new file mode 100644 index 0000000..3b3ce9c --- /dev/null +++ b/recipes/qt/6.x.x/test_v1_package/test_package.pro @@ -0,0 +1,14 @@ +SOURCES += ../test_package/test_package.cpp + +HEADERS += ../test_package/greeter.h + +RESOURCES = ../test_package/example.qrc + +QT -= gui +QT += network sql concurrent xml + +CONFIG += console + +CONFIG += conan_basic_setup +include($$OUT_PWD/../conanbuildinfo.pri) +LIBS -= $$CONAN_LIBS_QT diff --git a/recipes/qt/config.yml b/recipes/qt/config.yml new file mode 100644 index 0000000..3628ca4 --- /dev/null +++ b/recipes/qt/config.yml @@ -0,0 +1,9 @@ +versions: + "6.7.3": + folder: 6.x.x + "6.6.3": + folder: 6.x.x + "6.5.3": + folder: 6.x.x + "5.15.16": + folder: 5.x.x diff --git a/recipes/xkbcommon/all/conandata.yml b/recipes/xkbcommon/all/conandata.yml new file mode 100644 index 0000000..915c6da --- /dev/null +++ b/recipes/xkbcommon/all/conandata.yml @@ -0,0 +1,25 @@ +https://git.avroid.tech/Mirrors/libyuv/commit/d5aa3d4a76930cde9527f5be5bc89524b48fc069sources: + "1.6.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.6.0.tar.xz" + sha256: "0edc14eccdd391514458bc5f5a4b99863ed2d651e4dd761a90abf4f46ef99c2b" + "1.5.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.5.0.tar.xz" + sha256: "560f11c4bbbca10f495f3ef7d3a6aa4ca62b4f8fb0b52e7d459d18a26e46e017" + "1.4.1": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.4.1.tar.xz" + sha256: "943c07a1e2198026d8102b17270a1f406e4d3d6bbc4ae105b9e1b82d7d136b39" + "1.3.1": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.3.1.tar.xz" + sha256: "b3c710d27a2630054e1e1399c85b7f330ef03359b460f0c1b3b587fd01fe9234" + "1.2.1": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.2.1.tar.xz" + sha256: "e833a7d3024c9bb9d5eb2b20f6d5de08865541f21bb7ba227c83cbd236691fb3" + "1.1.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.1.0.tar.xz" + sha256: "412cfcca596f92914ea1a66ad244804d73a5ff20b6d86459951e7ad20576c246" + "1.0.3": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-1.0.3.tar.xz" + sha256: "a2202f851e072b84e64a395212cbd976ee18a8ee602008b0bad02a13247dbc52" + "0.10.0": + url: "https://nexus.avroid.tech/repository/all-raw-proxy-xkbcommon_org/download/libxkbcommon-0.10.0.tar.xz" + sha256: "57c3630cdc38fb4734cd57fa349e92244f5ae3862813e533cedbd86721a0b6f2" diff --git a/recipes/xkbcommon/all/conanfile.py b/recipes/xkbcommon/all/conanfile.py new file mode 100644 index 0000000..a614051 --- /dev/null +++ b/recipes/xkbcommon/all/conanfile.py @@ -0,0 +1,180 @@ +import os +import textwrap + +from conan import ConanFile +from conan.tools.apple import fix_apple_shared_install_name +from conan.tools.env import VirtualBuildEnv, VirtualRunEnv +from conan.tools.files import copy, get, replace_in_file, rmdir, save +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout +from conan.tools.meson import Meson, MesonToolchain +from conan.tools.scm import Version +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.60.0 <2 || >=2.0.5" + + +class XkbcommonConan(ConanFile): + name = "xkbcommon" + package_type = "library" + description = "keymap handling library for toolkits and window systems" + topics = ("keyboard", "wayland", "x11", "xkb") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/xkbcommon/libxkbcommon" + license = "MIT" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_x11": [True, False], + "with_wayland": [True, False], + "xkbregistry": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_x11": True, + "with_wayland": True, + "xkbregistry": True, + } + + @property + def _has_build_profile(self): + return hasattr(self, "settings_build") + + @property + def _has_xkbregistry_option(self): + return Version(self.version) >= "1.0.0" + + def config_options(self): + if not self._has_xkbregistry_option: + del self.options.xkbregistry + if self.settings.os != "Linux": + del self.options.with_wayland + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + basic_layout(self, src_folder="src") + + def requirements(self): + self.requires("xkeyboard-config/system") + if self.options.with_x11: + self.requires("xorg/system") + if self.options.get_safe("xkbregistry"): + self.requires("libxml2/[>=2.12.5 <3]") + if self.options.get_safe("with_wayland"): + self.requires("wayland/1.22.0") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration(f"{self.ref} is only compatible with Linux and FreeBSD") + + def build_requirements(self): + #self.tool_requires("meson/1.3.2") + self.tool_requires("bison/3.8.2") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.1.0]") + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + self.tool_requires("wayland/") + self.tool_requires("wayland-protocols/1.33") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + env = VirtualBuildEnv(self) + env.generate() + if self.options.get_safe("with_wayland") and not self._has_build_profile: + env = VirtualRunEnv(self) + env.generate(scope="build") + + tc = MesonToolchain(self) + if Version(self.version) >= "1.6": + tc.project_options["enable-bash-completion"] = False + tc.project_options["enable-docs"] = False + tc.project_options["enable-wayland"] = self.options.get_safe("with_wayland", False) + tc.project_options["enable-x11"] = self.options.with_x11 + if self._has_xkbregistry_option: + tc.project_options["enable-xkbregistry"] = self.options.xkbregistry + tc.project_options["build.pkg_config_path"] = self.generators_folder + tc.generate() + + pkg_config_deps = PkgConfigDeps(self) + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + pkg_config_deps.build_context_activated = ["wayland", "wayland-protocols"] + pkg_config_deps.build_context_suffix = {"wayland": "_BUILD"} + else: + # Manually generate pkgconfig file of wayland-protocols since + # PkgConfigDeps.build_context_activated can't work with legacy 1 profile + wp_prefix = self.dependencies.build["wayland-protocols"].package_folder + wp_version = self.dependencies.build["wayland-protocols"].ref.version + wp_pkg_content = textwrap.dedent(f"""\ + prefix={wp_prefix} + datarootdir=${{prefix}}/res + pkgdatadir=${{datarootdir}}/wayland-protocols + Name: Wayland Protocols + Description: Wayland protocol files + Version: {wp_version} + """) + save(self, os.path.join(self.generators_folder, "wayland-protocols.pc"), wp_pkg_content) + pkg_config_deps.generate() + + def _patch_sources(self): + if self.options.get_safe("with_wayland"): + if self._has_build_profile: + # Patch the build system to use the pkg-config files generated for the build context. + meson_build_file = os.path.join(self.source_folder, "meson.build") + replace_in_file( + self, + meson_build_file, + "wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)", + "wayland_scanner_dep = dependency('wayland-scanner_BUILD', required: false, native: true)", + ) + + def build(self): + self._patch_sources() + meson = Meson(self) + meson.configure() + meson.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + meson = Meson(self) + meson.install() + rmdir(self, os.path.join(self.package_folder, "share")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + fix_apple_shared_install_name(self) + + def package_info(self): + self.cpp_info.components["libxkbcommon"].set_property("pkg_config_name", "xkbcommon") + self.cpp_info.components["libxkbcommon"].libs = ["xkbcommon"] + self.cpp_info.components["libxkbcommon"].requires = ["xkeyboard-config::xkeyboard-config"] + self.cpp_info.components["libxkbcommon"].resdirs = ["res"] + + if self.options.with_x11: + self.cpp_info.components["libxkbcommon-x11"].set_property("pkg_config_name", "xkbcommon-x11") + self.cpp_info.components["libxkbcommon-x11"].libs = ["xkbcommon-x11"] + self.cpp_info.components["libxkbcommon-x11"].requires = ["libxkbcommon", "xorg::xcb", "xorg::xcb-xkb"] + if self.options.get_safe("xkbregistry"): + self.cpp_info.components["libxkbregistry"].set_property("pkg_config_name", "xkbregistry") + self.cpp_info.components["libxkbregistry"].libs = ["xkbregistry"] + self.cpp_info.components["libxkbregistry"].requires = ["libxml2::libxml2"] + if self.options.get_safe("with_wayland", False): + self.cpp_info.components["xkbcli-interactive-wayland"].libs = [] + self.cpp_info.components["xkbcli-interactive-wayland"].includedirs = [] + self.cpp_info.components["xkbcli-interactive-wayland"].requires = ["wayland::wayland-client"] + + if Version(self.version) >= "1.0.0": + self.env_info.PATH.append(os.path.join(self.package_folder, "bin")) + + # unofficial, but required to avoid side effects (libxkbcommon component + # "steals" the default global pkg_config name) + self.cpp_info.set_property("pkg_config_name", "xkbcommon_all_do_not_use") + self.cpp_info.names["pkg_config"] = "xkbcommon_all_do_not_use" diff --git a/recipes/xkbcommon/all/test_package/CMakeLists.txt b/recipes/xkbcommon/all/test_package/CMakeLists.txt new file mode 100644 index 0000000..713779f --- /dev/null +++ b/recipes/xkbcommon/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package LANGUAGES CXX) + +find_package(xkbcommon REQUIRED COMPONENTS libxkbcommon) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE xkbcommon::libxkbcommon) diff --git a/recipes/xkbcommon/all/test_package/CMakeUserPresets.json b/recipes/xkbcommon/all/test_package/CMakeUserPresets.json new file mode 100644 index 0000000..781f643 --- /dev/null +++ b/recipes/xkbcommon/all/test_package/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/gcc-12-x86_64-gnu17-release/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/recipes/xkbcommon/all/test_package/conanfile.py b/recipes/xkbcommon/all/test_package/conanfile.py new file mode 100644 index 0000000..0bd86fa --- /dev/null +++ b/recipes/xkbcommon/all/test_package/conanfile.py @@ -0,0 +1,27 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeToolchain", "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(cmd, env="conanrun") diff --git a/recipes/xkbcommon/all/test_package/test_package.cpp b/recipes/xkbcommon/all/test_package/test_package.cpp new file mode 100644 index 0000000..92ee66e --- /dev/null +++ b/recipes/xkbcommon/all/test_package/test_package.cpp @@ -0,0 +1,8 @@ +#include "xkbcommon/xkbcommon.h" + +int main() +{ + struct xkb_context *ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + if (!ctx) return 1; + return 0; +} diff --git a/recipes/xkbcommon/config.yml b/recipes/xkbcommon/config.yml new file mode 100644 index 0000000..dc3bda3 --- /dev/null +++ b/recipes/xkbcommon/config.yml @@ -0,0 +1,17 @@ +versions: + "1.6.0": + folder: all + "1.5.0": + folder: all + "1.4.1": + folder: all + "1.3.1": + folder: all + "1.2.1": + folder: all + "1.1.0": + folder: all + "1.0.3": + folder: all + "0.10.0": + folder: all diff --git a/recipes/xkeyboard-config/all/conanfile.py b/recipes/xkeyboard-config/all/conanfile.py new file mode 100644 index 0000000..bd17172 --- /dev/null +++ b/recipes/xkeyboard-config/all/conanfile.py @@ -0,0 +1,51 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager +from conan.errors import ConanInvalidConfiguration + +required_conan_version = ">=1.50.0" + + +class XkeyboardConfigConan(ConanFile): + name = "xkeyboard-config" + package_type = "application" + url = "https://github.com/conan-io/conan-center-index" + license = "MIT" + homepage = "https://www.freedesktop.org/wiki/Software/XKeyboardConfig/" + description = "The non-arch keyboard configuration database for X Window." + settings = "os", "compiler", "build_type" # no arch here, because the xkeyboard-config system package is arch independant + topics = ("x11", "xorg", "keyboard") + + def validate(self): + if self.settings.os not in ["Linux", "FreeBSD"]: + raise ConanInvalidConfiguration("This recipe supports only Linux and FreeBSD") + + def package_id(self): + self.info.clear() + + def system_requirements(self): + apt = package_manager.Apt(self) + apt.install(["xkb-data"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["xkeyboard-config-devel"], update=True, check=True) + + dnf = package_manager.Dnf(self) + dnf.install(["xkeyboard-config-devel"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["xkeyboard-config"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["xkeyboard-config"], update=True, check=True) + + package_manager.Pkg(self).install(["xkeyboard-config"], update=True, check=True) + + def package_info(self): + pkg_config = PkgConfig(self, "xkeyboard-config") + pkg_config.fill_cpp_info( + self.cpp_info, is_system=self.settings.os != "FreeBSD") + self.cpp_info.set_property("pkg_config_name", "xkeyboard-config") + self.cpp_info.set_property("component_version", pkg_config.version) + self.cpp_info.set_property("pkg_config_custom_content", + "\n".join(f"{key}={value}" for key, value in pkg_config.variables.items() if key not in ["pcfiledir","prefix", "includedir"])) diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuild.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuild.sh new file mode 100644 index 0000000..dbc249c --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..6271db2 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanbuildenv-release-x86_64.sh @@ -0,0 +1,18 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan" +echo "echo Restoring environment" > "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" +for v in CXX CC CONAN_V2_MODE +do + is_defined="true" + value=$(printenv $v) || is_defined="" || true + if [ -n "$value" ] || [ -n "$is_defined" ] + then + echo export "$v='$value'" >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" + else + echo unset $v >> "$script_folder/deactivate_conanbuildenv-release-x86_64.sh" + fi +done + + +export CXX="x86_64-linux-gnu-g++-12" +export CC="x86_64-linux-gnu-gcc-12" +export CONAN_V2_MODE="true" \ No newline at end of file diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrun.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrun.sh new file mode 100644 index 0000000..4bfca3d --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh new file mode 100644 index 0000000..1d961d9 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/conanrunenv-release-x86_64.sh @@ -0,0 +1,14 @@ +script_folder="/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan" +echo "echo Restoring environment" > "$script_folder/deactivate_conanrunenv-release-x86_64.sh" +for v in +do + is_defined="true" + value=$(printenv $v) || is_defined="" || true + if [ -n "$value" ] || [ -n "$is_defined" ] + then + echo export "$v='$value'" >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh" + else + echo unset $v >> "$script_folder/deactivate_conanrunenv-release-x86_64.sh" + fi +done + diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuild.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuild.sh new file mode 100644 index 0000000..d06f522 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuild.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh new file mode 100644 index 0000000..40fee45 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanbuildenv-release-x86_64.sh @@ -0,0 +1,4 @@ +echo Restoring environment +unset CXX +unset CC +unset CONAN_V2_MODE diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrun.sh b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrun.sh new file mode 100644 index 0000000..1c01f0f --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrun.sh @@ -0,0 +1 @@ +. "/home/aleksandr.vodyanov/Documents/Avroid/Conan/conan_recipes.git/recipes/xkeyboard-config/all/test_package/build-release/conan/deactivate_conanrunenv-release-x86_64.sh" \ No newline at end of file diff --git a/recipes/xkeyboard-config/all/test_package/build-release/conan/xkeyboard-config.pc b/recipes/xkeyboard-config/all/test_package/build-release/conan/xkeyboard-config.pc new file mode 100644 index 0000000..d38b587 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/build-release/conan/xkeyboard-config.pc @@ -0,0 +1,8 @@ +prefix=/home/aleksandr.vodyanov/.conan2/p/b/xkeybfb432262e432a/p +bindir=${prefix}/bin +xkb_base=/usr/share/X11/xkb +datadir=/usr/share + +Name: xkeyboard-config +Description: Conan package: xkeyboard-config +Version: system diff --git a/recipes/xkeyboard-config/all/test_package/conanfile.py b/recipes/xkeyboard-config/all/test_package/conanfile.py new file mode 100644 index 0000000..5ce13b9 --- /dev/null +++ b/recipes/xkeyboard-config/all/test_package/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.gnu import PkgConfigDeps +from conan.tools.layout import basic_layout + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "VirtualBuildEnv", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + basic_layout(self) + + def generate(self): + pkg_config_deps = PkgConfigDeps(self) + pkg_config_deps.generate() + + def test(self): + pkg_config = self.conf_info.get("tools.gnu:pkg_config", default="pkg-config") + self.run(f"{pkg_config} --validate xkeyboard-config") diff --git a/recipes/xkeyboard-config/config.yml b/recipes/xkeyboard-config/config.yml new file mode 100644 index 0000000..76a338d --- /dev/null +++ b/recipes/xkeyboard-config/config.yml @@ -0,0 +1,3 @@ +versions: + "system": + folder: "all"