Skip to content

Commit

Permalink
x11-toolkits/qt5-declarative: split out 'test' parts into new port
Browse files Browse the repository at this point in the history
kde@ has been focused recently on reducing the load of "unnecessary"
runtime dependencies, to allow third party distributions to have a
leaner installation.
One part of this effort was to make qt5-testlib a "build only"
dependency.
Unfortunately, parts of qt5-declarative link against testlib (to provide
test functionality for declarative parts).

This lead to an unfortunate loop of pkg-autoremove removing testlib, and
then pkg-update adding it again (as it was an improperly registered
dependency).

This change splits out the "test"-parts into its own port. Thereby
making testlib not even a required build-time dependency for
x11-toolkits/qt5-delcarative.

Reported by:		jrm
Differential Revision: https://reviews.freebsd.org/D32097
  • Loading branch information
tcberner committed Sep 24, 2021
1 parent 6ae8585 commit 4d10eef
Show file tree
Hide file tree
Showing 19 changed files with 252 additions and 41 deletions.
5 changes: 4 additions & 1 deletion Mk/Uses/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ _USES_POST+= qt
_QT_MK_POST_INCLUDED= qt.mk

# The Qt components supported by qt.mk: list of shared, and version specific ones
_USE_QT_ALL= assistant dbus declarative designer doc gui help \
_USE_QT_ALL= assistant dbus declarative declarative-test designer doc gui help \
imageformats l10n linguist linguisttools multimedia \
network opengl pixeltool qdbusviewer qmake script \
scripttools sql sql-mysql sql-odbc sql-pgsql \
Expand Down Expand Up @@ -177,6 +177,9 @@ qt-dbus_LIB= libQt${_QT_LIBVER}DBus.so
qt-declarative_PORT= x11-toolkits/${_QT_RELNAME}-declarative
qt-declarative_LIB= libQt${_QT_LIBVER}Qml.so

qt-declarative-test_PORT= x11-toolkits/${_QT_RELNAME}-declarative-test
qt-declarative-test_LIB= libQt${_QT_LIBVER}QuickTest.so

qt-designer_PORT= devel/${_QT_RELNAME}-designer
qt-designer_PATH= ${LOCALBASE}/${QT_BINDIR_REL}/designer

Expand Down
6 changes: 3 additions & 3 deletions audio/elisa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ USE_KDE= auth baloo5 bookmarks codecs completion config configwidgets \
coreaddons crash dbusaddons filemetadata i18n iconthemes itemviews \
jobwidgets kcmutils kdeclarative kio kirigami2 package \
service solid widgetsaddons windowsystem xmlgui
USE_QT= buildtools_build qmake_build testlib_build \
concurrent core dbus declarative gui multimedia network \
quickcontrols2 sql svg widgets xml
USE_QT= concurrent core dbus declarative gui multimedia network \
quickcontrols2 sql svg widgets xml \
buildtools_build declarative-test_build qmake_build testlib_build

OPTIONS_DEFINE= DOCS VLC
OPTIONS_DEFAULT= DOCS VLC
Expand Down
2 changes: 1 addition & 1 deletion www/qt5-webchannel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COMMENT= Qt 5 library for integration of C++/QML with HTML/js clients

USES= compiler:c++11-lang qmake:norecursive qt-dist:5,webchannel
USE_QT= core declarative \
buildtools_build testlib_build
buildtools_build declarative-test_build testlib_build

# The default EXTRACT_AFTER_ARGS value excludes examples/ from the extracted
# tarball, which we need during the build.
Expand Down
2 changes: 1 addition & 1 deletion www/qt5-webkit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ USE_GNOME= glib20 libxml2 libxslt
USE_PERL5= build
USE_QT= core declarative gui location network opengl printsupport \
sensors webchannel widgets \
buildtools_build qmake_build testlib_build
buildtools_build declarative-test_build qmake_build testlib_build
USE_RUBY= yes
USE_XORG= x11 xcomposite xrender

Expand Down
1 change: 1 addition & 0 deletions x11-toolkits/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
SUBDIR += qt5-charts
SUBDIR += qt5-datavis3d
SUBDIR += qt5-declarative
SUBDIR += qt5-declarative-test
SUBDIR += qt5-gamepad
SUBDIR += qt5-gui
SUBDIR += qt5-quick3d
Expand Down
29 changes: 29 additions & 0 deletions x11-toolkits/qt5-declarative-test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PORTNAME= declarative-test
DISTVERSION= ${QT5_VERSION}
CATEGORIES= x11-toolkits
PKGNAMEPREFIX= qt5-

MAINTAINER= kde@FreeBSD.org
COMMENT= Qt declarative framework for dynamic user interface (testing)

USES= compiler:c++11-lang gl python:build qmake:norecursive \
qt-dist:5,declarative
USE_GL= gl
USE_QT= core declarative gui network sql testlib widgets \
buildtools_build

CONFLICTS= qt5-declarative-render2d-* qt5-qml qt5-quick

BINARY_ALIAS= python=${PYTHON_CMD}

QT_BINARIES= yes
TOOLS= qmltestrunner

post-patch:
# qtdeclarative.pro wants to run python, replace that with PYTHON_CMD
${REINPLACE_CMD} '/py_out/s#python#${PYTHON_CMD}#g' \
${WRKSRC}/qtdeclarative.pro
${REINPLACE_CMD} 's,python,${PYTHON_CMD},g' \
${WRKSRC}/src/3rdparty/masm/masm.pri

.include <bsd.port.mk>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/3rdparty/masm/assembler/ARM64Assembler.h.orig 2020-10-27 08:02:12 UTC
+++ src/3rdparty/masm/assembler/ARM64Assembler.h
@@ -3040,6 +3040,8 @@ class ARM64Assembler { (public)
linuxPageFlush(current, current + page);

linuxPageFlush(current, end);
+#elif OS(FREEBSD)
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
#elif OS(QNX)
#if !ENABLE(ASSEMBLER_WX_EXCLUSIVE)
msync(code, size, MS_INVALIDATE_ICACHE);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/3rdparty/masm/assembler/ARMv7Assembler.h.orig 2020-10-27 08:02:12 UTC
+++ src/3rdparty/masm/assembler/ARMv7Assembler.h
@@ -2369,6 +2369,8 @@ class ARMv7Assembler { (public)
UNUSED_PARAM(code);
UNUSED_PARAM(size);
#endif
+#elif OS(FREEBSD) && COMPILER(CLANG)
+ __clear_cache(code, reinterpret_cast<char*>(code) + size);
#else
#error "The cacheFlush support is missing on this platform."
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Due to a misspelling in GCC [1] (probably) the check for the ARMv6KZ platform
used __ARM_ARCH_6ZK__ instead of __ARM_ARCH_6KZ__.

Append the correct spellings to the checks for __ARM_ARCH_6ZK__.

[1] https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01679.html

--- src/3rdparty/masm/wtf/Platform.h.orig 2020-10-27 08:02:12 UTC
+++ src/3rdparty/masm/wtf/Platform.h
@@ -222,6 +222,7 @@
#elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6K__) \
+ || defined(__ARM_ARCH_6KZ__) \
|| defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6ZK__) \
|| defined(__ARM_ARCH_6T2__) \
44 changes: 44 additions & 0 deletions x11-toolkits/qt5-declarative-test/files/patch-src_src.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- src/src.pro.orig 2021-09-24 07:19:35 UTC
+++ src/src.pro
@@ -7,40 +7,6 @@ QT_FOR_CONFIG += qml qml-private quick-private
# Otherwise we cannot compile qmltyperegistrar
requires(qtConfig(commandlineparser))

-# We need qmltyperegistrar for all type registrations, even in qml
-SUBDIRS += \
- qmltyperegistrar \
- qml \
- qmlmodels
-
-qtConfig(qml-worker-script): \
- SUBDIRS += qmlworkerscript
-
-qtHaveModule(gui):qtConfig(qml-animation) {
- SUBDIRS += quick
-
- qtConfig(quick-path): \
- SUBDIRS += quickshapes
-
- qtConfig(testlib): \
- SUBDIRS += qmltest
-
- qtConfig(quick-particles): \
- SUBDIRS += particles
- qtHaveModule(widgets): SUBDIRS += quickwidgets
-}
-
-SUBDIRS += \
- plugins \
- imports
-
-qtConfig(qml-devtools): SUBDIRS += qmldevtools
-
-qmldevtools.depends = qml
-
-qtConfig(qml-network) {
- QT_FOR_CONFIG += network
- qtConfig(thread):qtConfig(localserver):qtConfig(qml-debug): SUBDIRS += qmldebug
-}
+SUBDIRS += qmltest

DISTFILES += sync.profile configure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- tools/qmlcachegen/qmlcachegen.pro.orig 2020-10-27 08:02:12 UTC
+++ tools/qmlcachegen/qmlcachegen.pro
@@ -32,7 +32,7 @@ cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cm
QMAKE_SUBSTITUTES += cmake_config_file

cmake_build_integration.files = $$cmake_config_file.output
-cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QuickCompiler
+cmake_build_integration.path = $$[QT_INSTALL_PREFIX]/lib/cmake/Qt5QuickCompiler
prefix_build: INSTALLS += cmake_build_integration
else: COPIES += cmake_build_integration

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- tools/qmlimportscanner/qmlimportscanner.pro.orig 2019-12-31 21:19:52 UTC
+++ tools/qmlimportscanner/qmlimportscanner.pro
@@ -47,7 +47,7 @@ cmake_config_file.output = $$MODULE_BASE_OUTDIR/lib/cm
QMAKE_SUBSTITUTES += cmake_config_file

cmake_build_integration.files = $$cmake_config_file.output $$PWD/Qt5QmlImportScannerTemplate.cpp.in
-cmake_build_integration.path = $$[QT_INSTALL_LIBS]/cmake/Qt5QmlImportScanner
+cmake_build_integration.path = $$[QT_INSTALL_PREFIX]/lib/cmake/Qt5QmlImportScanner
prefix_build: INSTALLS += cmake_build_integration
else: COPIES += cmake_build_integration

50 changes: 50 additions & 0 deletions x11-toolkits/qt5-declarative-test/files/patch-tools_tools.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
--- tools/tools.pro.orig 2021-09-24 07:43:40 UTC
+++ tools/tools.pro
@@ -1,45 +1,8 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += qml-private

-qtConfig(qml-devtools) {
- SUBDIRS += \
- qmllint \
- qmlmin \
- qmlimportscanner \
- qmlformat
-
- qtConfig(commandlineparser):qtConfig(xmlstreamwriter): SUBDIRS += qmlcachegen
-}
-
-qtConfig(thread):!android|android_app:!wasm:!rtems {
- SUBDIRS += \
- qml
-
- qtConfig(qml-profiler): SUBDIRS += qmlprofiler
- qtConfig(qml-preview): SUBDIRS += qmlpreview
-
- qtHaveModule(quick) {
- !static: {
- SUBDIRS += \
- qmlscene \
- qmltime
-
- qtConfig(regularexpression):qtConfig(process) {
- SUBDIRS += \
- qmlplugindump
- }
- }
- qtHaveModule(widgets) {
- QT_FOR_CONFIG += widgets
- qtConfig(dialogbuttonbox) {
- SUBDIRS += \
- qmleasing
- }
- }
- }
- qtHaveModule(qmltest): SUBDIRS += qmltestrunner
- qtConfig(private_tests): SUBDIRS += qmljs
-}
+SUBDIRS += qmltestrunner
+qtConfig(private_tests): SUBDIRS += qmljs

qtConfig(qml-devtools) {
qml.depends = qmlimportscanner
7 changes: 7 additions & 0 deletions x11-toolkits/qt5-declarative-test/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Qt is a cross-platform application and UI framework for developers
using C++ or QML, a CSS/JavaScript-like language.

Qt Quick is a collection of technologies that are designed to help
developers create intuitive, modern, and fluid user interfaces.

WWW: https://qt-project.org
25 changes: 25 additions & 0 deletions x11-toolkits/qt5-declarative-test/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%%QT_INCDIR%%/QtQuickTest/%%FULLVER%%/QtQuickTest/private/qtestoptions_p.h
%%QT_INCDIR%%/QtQuickTest/%%FULLVER%%/QtQuickTest/private/quicktest_p.h
%%QT_INCDIR%%/QtQuickTest/%%FULLVER%%/QtQuickTest/private/quicktestresult_p.h
%%QT_INCDIR%%/QtQuickTest/QtQuickTest
%%QT_INCDIR%%/QtQuickTest/QtQuickTestDepends
%%QT_INCDIR%%/QtQuickTest/QtQuickTestVersion
%%QT_INCDIR%%/QtQuickTest/qtquicktestversion.h
%%QT_INCDIR%%/QtQuickTest/quicktest.h
%%QT_INCDIR%%/QtQuickTest/quicktestglobal.h
%%QT_CMAKEDIR%%/Qt5QuickTest/Qt5QuickTestConfig.cmake
%%QT_CMAKEDIR%%/Qt5QuickTest/Qt5QuickTestConfigVersion.cmake
%%QT_BINDIR%%/qmltestrunner
%%DEBUG%%%%QT_BINDIR%%/qmltestrunner.debug
%%QT_LIBDIR%%/libQt5QuickTest.prl
%%QT_LIBDIR%%/libQt5QuickTest.so
%%QT_LIBDIR%%/libQt5QuickTest.so.5
%%QT_LIBDIR%%/libQt5QuickTest.so.%%SHORTVER%%
%%QT_LIBDIR%%/libQt5QuickTest.so.%%FULLVER%%
%%DEBUG%%%%QT_LIBDIR%%/libQt5QuickTest.so.%%FULLVER%%.debug
%%QT_LIBDIR%%/metatypes/qt5quicktest_metatypes.json
%%QT_MKSPECDIR%%/modules/qt_lib_qmltest.pri
%%QT_MKSPECDIR%%/modules/qt_lib_qmltest_private.pri
%%QT_QMLDIR%%/Qt/test/qtestroot/plugins.qmltypes
%%QT_QMLDIR%%/Qt/test/qtestroot/qmldir
libdata/pkgconfig/Qt5QuickTest.pc
6 changes: 3 additions & 3 deletions x11-toolkits/qt5-declarative/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PORTNAME= declarative
DISTVERSION= ${QT5_VERSION}
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= x11-toolkits
PKGNAMEPREFIX= qt5-

Expand All @@ -11,7 +11,7 @@ USES= compiler:c++11-lang gl python:build qmake:norecursive \
qt-dist:5
USE_GL= gl
USE_QT= core gui network sql widgets \
buildtools_build testlib_build
buildtools_build

CONFLICTS= qt5-declarative-render2d-* qt5-qml qt5-quick

Expand All @@ -22,7 +22,7 @@ QT_DEFINES= ACCESSIBILITY
QT_CONFIG= accessibility accessibility-atspi-bridge

TOOLS= qml qmlcachegen qmleasing qmlformat qmlimportscanner qmllint qmlmin \
qmlplugindump qmlpreview qmlprofiler qmlscene qmltestrunner qmltyperegistrar
qmlplugindump qmlpreview qmlprofiler qmlscene qmltyperegistrar
post-patch:
# qtdeclarative.pro wants to run python, replace that with PYTHON_CMD
${REINPLACE_CMD} '/py_out/s#python#${PYTHON_CMD}#g' \
Expand Down
12 changes: 12 additions & 0 deletions x11-toolkits/qt5-declarative/files/patch-src_src.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- src/src.pro.orig 2021-09-24 07:16:45 UTC
+++ src/src.pro
@@ -22,9 +22,6 @@ qtHaveModule(gui):qtConfig(qml-animation) {
qtConfig(quick-path): \
SUBDIRS += quickshapes

- qtConfig(testlib): \
- SUBDIRS += qmltest
-
qtConfig(quick-particles): \
SUBDIRS += particles
qtHaveModule(widgets): SUBDIRS += quickwidgets
11 changes: 11 additions & 0 deletions x11-toolkits/qt5-declarative/files/patch-tools_tools.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- tools/tools.pro.orig 2021-09-24 07:53:27 UTC
+++ tools/tools.pro
@@ -37,8 +37,6 @@ qtConfig(thread):!android|android_app:!wasm:!rtems {
}
}
}
- qtHaveModule(qmltest): SUBDIRS += qmltestrunner
- qtConfig(private_tests): SUBDIRS += qmljs
}

qtConfig(qml-devtools) {
Loading

0 comments on commit 4d10eef

Please sign in to comment.