Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better package split for qt5-sql and sql plugins #34803

Closed
2 tasks
krab opened this issue Jan 1, 2022 · 2 comments
Closed
2 tasks

Better package split for qt5-sql and sql plugins #34803

krab opened this issue Jan 1, 2022 · 2 comments
Labels

Comments

@krab
Copy link

krab commented Jan 1, 2022

System

  • xuname:
    Void 5.15.11-xanmod1_1 x86_64 GenuineIntel notuptodate rrFFF
  • package:
    qt5-sql-5.15.3+20211001_1

I'm building a local package for qt5 software that uses qt5sql-sqlite plugin in it sources. So currently I have to specify all qt5-sql plugins like qt5-plugin-sqlite etc. in template file to make package. Because if you look at Qt5SqlConfig.cmake file, it uses GLOB CMake function:

    # In Qt 5.15 the glob pattern was relaxed to also catch plugins not literally named Plugin.
    # Define QT5_STRICT_PLUGIN_GLOB or ModuleName_STRICT_PLUGIN_GLOB to revert to old behavior.
    if (QT5_STRICT_PLUGIN_GLOB OR Qt5Sql_STRICT_PLUGIN_GLOB)
        file(GLOB pluginTargets "${CMAKE_CURRENT_LIST_DIR}/Qt5Sql_*Plugin.cmake")
    else()
        file(GLOB pluginTargets "${CMAKE_CURRENT_LIST_DIR}/Qt5Sql_*.cmake")
    endif()

So it's trying to find every single .so file from Qt5Sql_Q***DriverPlugin.cmake file. But they don't exist, they separated into packages like qt5-plugin-sqlite etc. and configuration fails with:

macro(_qt5_Sql_check_file_exists file)
    if(NOT EXISTS "${file}" )
        message(FATAL_ERROR "The imported target \"Qt5::Sql\" references the file
   \"${file}\"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   \"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
    endif()
endmacro()

The solution I'm suggesting is:

  • Move Qt5SqlConfig.cmake Qt5SqlConfigVersion.cmake from /usr/lib/cmake/Qt5Sql/ (qt5-sql package) into qt5-sql-devel package.
  • Move all Qt5Sql_QMYSQLDriverPlugin.cmake Qt5Sql_QODBCDriverPlugin.cmake Qt5Sql_QPSQLDriverPlugin.cmake Qt5Sql_QSQLiteDriverPlugin.cmake Qt5Sql_QTDSDriverPlugin.cmake from qt5-sql package into qt5-plugin-*-devel subpackages for example: Qt5Sql_QSQLiteDriverPlugin.cmake file into qt5-plugin-sqlite-devel etc.

That way to build software, we can specify single qt5-plugin-sqlite-devel as makedepends and qt5-plugin-sqlite as depends and don't list all of qt5sql plugins in template.

@krab
Copy link
Author

krab commented Jan 1, 2022

Also, /usr/include/qt5/QtSql folder can be moved into qt5-sql-devel package, it will make sense.

@github-actions
Copy link

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant