Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541698 - dev-libs/qjson - add Qt5 support
Summary: dev-libs/qjson - add Qt5 support
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-28 19:03 UTC by Superfox il Volpone
Modified: 2016-05-04 01:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Superfox il Volpone 2015-02-28 19:03:33 UTC
Hey there,
the current ebuild for dev-libs/qjson, qjson-0.8.1-r1.ebuild, has a strong dependency on qt4: 

RDEPEND="dev-qt/qtcore:4[${MULTILIB_USEDEP}]"
DEPEND="${RDEPEND}
    doc? ( app-doc/doxygen )
    test? ( dev-qt/qttest:4[${MULTILIB_USEDEP}] )"

DOCS=( ChangeLog README.md )

multilib_src_configure() {
    local mycmakeargs=(
        $(cmake-utils_use test QJSON_BUILD_TESTS)
        -DQT_QMAKE_EXECUTABLE=/usr/$(get_libdir)/qt4/bin/qmake
    )

    cmake-utils_src_configure
}

This is not strictly required, as qjson would use qt5 if available, see https://github.com/flavio/qjson/blob/master/CMakeLists.txt ~ 43 - 67 


option(QT4_BUILD "Force building with Qt4 even if Qt5 is found")
IF (NOT QT4_BUILD)
  FIND_PACKAGE( Qt5Core QUIET )
ENDIF()

IF (Qt5Core_FOUND)
  MESSAGE ("Qt5 found")

  INCLUDE_DIRECTORIES(${Qt5Core_INCLUDE_DIRS})
  ADD_DEFINITIONS(${Qt5Core_DEFINITIONS})
  SET(PC_Requires "Qt5Core")
  # Tell CMake to run moc when necessary:
  set(CMAKE_AUTOMOC ON)
  # As moc files are generated in the binary dir, tell CMake
  # to always look for includes there:
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
ELSE()
  MESSAGE ("Qt5 not found, searching for Qt4")
  # Find Qt4
  FIND_PACKAGE( Qt4 REQUIRED )

  # Include the cmake file needed to use qt4
  INCLUDE( ${QT_USE_FILE} )
  SET(PC_Requires "QtCore")
ENDIF()

I have no idea how to update the .ebuild, can you please add the check for either qt4 or qt5? :)

Kind regards,
Dean De Leo
Comment 1 Michael Palimaka (kensington) gentoo-dev 2015-03-04 17:12:52 UTC
Note that we can't do this until upstream makes some naming/versioning changes otherwise Qt4 consumers will break.
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2016-05-04 01:04:41 UTC
What's the point of this? Qt5 has JSON support out of the box[1]. All packages I've seen so far rely on the built-in support when building against Qt5, and fallback to the qjson library only when building against Qt4.

[1] http://doc.qt.io/qt-5/json.html