From nobody Mon Feb 19 22:37:33 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tdy8s6MDmz59dPc; Mon, 19 Feb 2024 22:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tdy8s5vybz4XHy; Mon, 19 Feb 2024 22:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708382253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1p4THDSkvI+U2kp9QtZnBPKL0y99BsHPqKQHn2F6pgY=; b=ppGAnfXgG0Dcv5wA//pI12lpcJTUoiC1uog1pXy4Ox8MsqQ/0zKZaMwpRk6ir7Pgas+She PS4tyMVtKH4kw9tF5vpPSSTIcN2m7MJGDrZYGYPADfhYJ8CmTw0GBIarbcOAFbcmfleC+Q x+iqM4Qk5IBEXzonhT98FaiUpwOjn2gZevq43MP1X7Xv6qP3ewK5s864Z9ijTHMu59OoDp Nm6BPe4zaHuczQlxAoe2xsIZBIrfMrHvb/DEYO4eF+HjaCCCiN1iMnPY3lB/jfej5n+dZi FTsAYFmpSxAyurezQepr6t/fZXiOsDIcuILYnrl9GZOlKOZFEeR0943XRHakuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708382253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1p4THDSkvI+U2kp9QtZnBPKL0y99BsHPqKQHn2F6pgY=; b=DprYeZnnbcVXKHQUkLkJqjHXJ3ibdaK3wtQ5m8SsGkQc6loV6Di6NzJn+w4DKCz3rryvwP 6O7bFrI5y6JxB4jt1BNK13P8ZfzIxxnLbJvgP7z2WRNCyLJo8AEAgOONvvzZQJlFWGY4Id l5vMvYhqDiNM+sg/VynyJ8LFerVTT1zIZ414ozoV/PUfZZ1OF40GLnkTQiUnVK8IU/jPlR unmYg0r/IhsxWaIxVbPwTaFVq1xLnVFKRpTW2Nf9JujLo6LCyokzoJevE4Yi9fd6MrsDZa Gl+hgudB7LuXCZz5aNxiSlN6TeQ+HNsfB4x5Wl8LHE3TUtcvOeEMBmhEiUqE5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708382253; a=rsa-sha256; cv=none; b=R6BagGzk3BhjtKmi8ADcsb0YExl2gRtYDiXToooHuHWxmr4NaBeULlUx7sptflevDgBzdG wR3tkZrd92nqC2GKJqtKa9d3OoeAj7py+93g79tzuwSoRDkqsME3DrG4OPcvVN7nxJqhx6 tstKAHr9rSy8r93FMZrwlH6YaXgSmgRCSfig5vyb02fgrqSyIsdW7PMWfHvzxhEwiBHsoB x0cxm+IWRsM+n+NFpsbvjCcfYCh1oup7EfRQ+yJsf7GO2I7pD/zC+ZIFJFpYB/LpCPwSkP EtBlSHeSWu+C7XrNt5uWsU4SvAkqTwWfng/OWNfoaBtYE/CxXHIacb24MrgzLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tdy8s4zhNzstN; Mon, 19 Feb 2024 22:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JMbXc7086571; Mon, 19 Feb 2024 22:37:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JMbXRC086568; Mon, 19 Feb 2024 22:37:33 GMT (envelope-from git) Date: Mon, 19 Feb 2024 22:37:33 GMT Message-Id: <202402192237.41JMbXRC086568@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Max Brazhnikov Subject: git: ddd7c2bdcad5 - main - graphics/qcustomplot: add support for Qt5 and Qt6 flavors List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: makc X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddd7c2bdcad5f945bb45b623300baba1e2dbe760 Auto-Submitted: auto-generated The branch main has been updated by makc: URL: https://cgit.FreeBSD.org/ports/commit/?id=ddd7c2bdcad5f945bb45b623300baba1e2dbe760 commit ddd7c2bdcad5f945bb45b623300baba1e2dbe760 Author: Max Brazhnikov AuthorDate: 2024-02-19 22:34:55 +0000 Commit: Max Brazhnikov CommitDate: 2024-02-19 22:34:55 +0000 graphics/qcustomplot: add support for Qt5 and Qt6 flavors - Add support for Qt5 and Qt6 flavors - Switch to cmake using patches from Debian Differential Revision: https://reviews.freebsd.org/D43969 --- audio/polyphone/Makefile | 2 +- devel/hotspot/Makefile | 2 +- graphics/qcustomplot/Makefile | 40 +++++----- graphics/qcustomplot/files/CMakeLists.txt | 113 +++++++++++++++++++++++++++++ graphics/qcustomplot/files/Config.cmake.in | 5 ++ graphics/qcustomplot/pkg-plist.qt5 | 7 ++ graphics/qcustomplot/pkg-plist.qt6 | 7 ++ misc/nn-insight/Makefile | 2 +- 8 files changed, 153 insertions(+), 25 deletions(-) diff --git a/audio/polyphone/Makefile b/audio/polyphone/Makefile index fc6d9072c7a4..a22c4f9a019b 100644 --- a/audio/polyphone/Makefile +++ b/audio/polyphone/Makefile @@ -14,7 +14,7 @@ LIB_DEPENDS= libFLAC.so:audio/flac \ libjack.so:audio/jack \ libogg.so:audio/libogg \ libportaudio.so:audio/portaudio \ - libQCustomPlot-qt5.so:graphics/qcustomplot \ + libQCustomPlot-qt5.so:graphics/qcustomplot@qt5 \ librtmidi.so:audio/rtmidi \ libstk.so:audio/stk \ libvorbisfile.so:audio/libvorbis diff --git a/devel/hotspot/Makefile b/devel/hotspot/Makefile index 9160d8cc51d4..ccacf5f4163c 100644 --- a/devel/hotspot/Makefile +++ b/devel/hotspot/Makefile @@ -13,7 +13,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.GPL.txt BUILD_DEPENDS= ${LOCALBASE}/lib/librustc_demangle.a:devel/rustc-demangle LIB_DEPENDS= libdw.so:devel/elfutils \ - libQCustomPlot-qt5.so:graphics/qcustomplot \ + libQCustomPlot-qt5.so:graphics/qcustomplot@qt5 \ libkddockwidgets.so:x11-toolkits/kddockwidgets \ libzstd.so:archivers/zstd diff --git a/graphics/qcustomplot/Makefile b/graphics/qcustomplot/Makefile index e55b7be07c25..9b70a3c0ede1 100644 --- a/graphics/qcustomplot/Makefile +++ b/graphics/qcustomplot/Makefile @@ -1,8 +1,9 @@ PORTNAME= qcustomplot DISTVERSION= 2.1.1 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= https://www.qcustomplot.com/release/${PORTVERSION}/ -PKGNAMESUFFIX= ${SUFFIX} +PKGNAMESUFFIX= -${FLAVOR} DISTNAME= QCustomPlot DIST_SUBDIR= ${PORTNAME}-${DISTVERSION} @@ -13,30 +14,25 @@ WWW= https://www.qcustomplot.com LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/GPL.txt -USES= compiler:c++11-lang pkgconfig qt:5 -USE_QT= core gui widgets printsupport buildtools:build +FLAVORS= qt5 qt6 +FLAVOR?= qt5 + +USES= cmake compiler:c++11-lang qt:${FLAVOR:S/qt//} +USE_QT= ${_USE_QT_${FLAVOR}} USE_LDCONFIG= yes +_USE_QT_qt5= core gui printsupport widgets buildtools:build qmake:build +_USE_QT_qt6= base tools:build + +CMAKE_ARGS= -DUSE_QT_VERSION=${FLAVOR:S/qt//} WRKSRC= ${WRKDIR}/${PORTNAME} -SUFFIX= -qt5 - -PLIST_FILES= include/qcustomplot.h \ - lib/libQCustomPlot${SUFFIX}.so - -do-build: - @cd ${WRKSRC} && \ - ${MOC} qcustomplot.h > qcustomplot_moc.cpp && \ - ${CXX} ${CXXFLAGS} -shared -fPIC \ - -I${PREFIX}/include \ - `pkg-config --cflags --libs Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport` \ - qcustomplot.cpp \ - qcustomplot_moc.cpp \ - -o ${WRKSRC}/libQCustomPlot${SUFFIX}.so \ - -Wl,-soname,libQCustomPlot${SUFFIX}.so - -do-install: - ${INSTALL_DATA} ${WRKSRC}/qcustomplot.h ${STAGEDIR}${PREFIX}/include - ${INSTALL_LIB} ${WRKSRC}/libQCustomPlot${SUFFIX}.so ${STAGEDIR}${PREFIX}/lib +PLIST_SUB= SHLIB_VER=${DISTVERSION} + +${FLAVOR}_PLIST= ${.CURDIR}/pkg-plist.${FLAVOR} + +post-patch: + ${CP} ${FILESDIR}/CMakeLists.txt ${FILESDIR}/Config.cmake.in \ + ${WRKSRC} .include diff --git a/graphics/qcustomplot/files/CMakeLists.txt b/graphics/qcustomplot/files/CMakeLists.txt new file mode 100644 index 000000000000..d1b0a12201a5 --- /dev/null +++ b/graphics/qcustomplot/files/CMakeLists.txt @@ -0,0 +1,113 @@ +cmake_minimum_required(VERSION 3.18.4) + +SET(QCustomPlot_MAJOR_VERSION "2") +SET(QCustomPlot_MINOR_VERSION "1") +SET(QCustomPlot_PATCH_VERSION "1") + +set(QCustomPlot_VERSION "${QCustomPlot_MAJOR_VERSION}.${QCustomPlot_MINOR_VERSION}.${QCustomPlot_PATCH_VERSION}") +set(QCustomPlot_SOVERSION "${QCustomPlot_MAJOR_VERSION}") + +PROJECT(QCustomPlot LANGUAGES CXX VERSION ${QCustomPlot_VERSION}) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) + +include(GNUInstallDirs) +include(FeatureSummary) + +#-----------------------------------------------------------# +# Dependencies +#-----------------------------------------------------------# + +set(REQUIRED_QT_COMPONENTS Core Widgets PrintSupport) + +set(MIN_REQUIRED_QT5_VERSION "5.12") +set(MIN_REQUIRED_QT6_VERSION "6.2.0") + + +find_package(Qt${USE_QT_VERSION} ${MIN_REQUIRED_QT${USE_QT_VERSION}_VERSION} + COMPONENTS ${REQUIRED_QT_COMPONENTS} REQUIRED) +set(QT_VERSION_MAJOR ${USE_QT_VERSION}) + + +#-----------------------------------------------------------# +# Definitions +#-----------------------------------------------------------# + +set(LIB5_SUFFIX "-qt5") +set(LIB6_SUFFIX "Qt6") +set(LIB_SUFFIX "${LIB${QT_VERSION_MAJOR}_SUFFIX}") + +set(LIB_NAME QCustomPlot${LIB_SUFFIX}) +set(CMAKE_CONFIG_FILE_NAME ${LIB_NAME}Config.cmake) +set(CMAKE_CONFIG_LIB_NAMES ${LIB_NAME} lib${LIB_NAME}) + +set(INC5_SUBDIR "") +set(INC6_SUBDIR "${LIB_NAME}") +set(QCUSTOMPLOT_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/${INC${QT_VERSION_MAJOR}_SUBDIR}") + + +#-----------------------------------------------------------# +# Compiler Settings +#-----------------------------------------------------------# + +#set(CMAKE_CXX_STANDARD 17) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +# Only enable strict warnings in debug mode +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Werror -pedantic") + +# As per the author of the library, we should export the symbols under +# MS-Windows. +add_definitions(-DQCUSTOMPLOT_COMPILE_LIBRARY) + +#-----------------------------------------------------------# +# Sources +#-----------------------------------------------------------# + +add_library(${LIB_NAME} SHARED qcustomplot.cpp) + +set_target_properties(${LIB_NAME} PROPERTIES + VERSION ${QCustomPlot_VERSION} + SOVERSION ${QCustomPlot_SOVERSION}) + +target_link_libraries(${LIB_NAME} + Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::PrintSupport) + +#-----------------------------------------------------------# +# Installation +#-----------------------------------------------------------# + +install(TARGETS ${LIB_NAME} + EXPORT ${LIB_NAME}Targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${QCUSTOMPLOT_INSTALL_INCLUDEDIR}) + +install(FILES qcustomplot.h DESTINATION "${QCUSTOMPLOT_INSTALL_INCLUDEDIR}") + +install(EXPORT ${LIB_NAME}Targets + FILE ${LIB_NAME}Targets.cmake + NAMESPACE ${LIB_NAME}:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LIB_NAME}) + +include(CMakePackageConfigHelpers) + +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}Config.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LIB_NAME}) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}Config.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LIB_NAME}) + +#-----------------------------------------------------------# +# Summary +#-----------------------------------------------------------# + +feature_summary(FATAL_ON_MISSING_REQUIRED_PACKAGES WHAT ALL) + diff --git a/graphics/qcustomplot/files/Config.cmake.in b/graphics/qcustomplot/files/Config.cmake.in new file mode 100644 index 000000000000..07b184a53912 --- /dev/null +++ b/graphics/qcustomplot/files/Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@LIB_NAME@Targets.cmake") + +check_required_components(@LIB_NAME@) diff --git a/graphics/qcustomplot/pkg-plist.qt5 b/graphics/qcustomplot/pkg-plist.qt5 new file mode 100644 index 000000000000..c662cc44b810 --- /dev/null +++ b/graphics/qcustomplot/pkg-plist.qt5 @@ -0,0 +1,7 @@ +include/qcustomplot.h +lib/cmake/QCustomPlot-qt5/QCustomPlot-qt5Config.cmake +lib/cmake/QCustomPlot-qt5/QCustomPlot-qt5Targets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/QCustomPlot-qt5/QCustomPlot-qt5Targets.cmake +lib/libQCustomPlot-qt5.so +lib/libQCustomPlot-qt5.so.2 +lib/libQCustomPlot-qt5.so.%%SHLIB_VER%% diff --git a/graphics/qcustomplot/pkg-plist.qt6 b/graphics/qcustomplot/pkg-plist.qt6 new file mode 100644 index 000000000000..9dd841ce2959 --- /dev/null +++ b/graphics/qcustomplot/pkg-plist.qt6 @@ -0,0 +1,7 @@ +include/QCustomPlotQt6/qcustomplot.h +lib/cmake/QCustomPlotQt6/QCustomPlotQt6Config.cmake +lib/cmake/QCustomPlotQt6/QCustomPlotQt6Targets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/QCustomPlotQt6/QCustomPlotQt6Targets.cmake +lib/libQCustomPlotQt6.so +lib/libQCustomPlotQt6.so.2 +lib/libQCustomPlotQt6.so.%%SHLIB_VER%% diff --git a/misc/nn-insight/Makefile b/misc/nn-insight/Makefile index 32ff7832631b..578dc429ac55 100644 --- a/misc/nn-insight/Makefile +++ b/misc/nn-insight/Makefile @@ -18,7 +18,7 @@ BUILD_DEPENDS= avir>0:graphics/avir \ png++>0:graphics/png++ LIB_DEPENDS= libcgraph.so:graphics/graphviz \ libpng.so:graphics/png \ - libQCustomPlot-qt5.so:graphics/qcustomplot \ + libQCustomPlot-qt5.so:graphics/qcustomplot@qt5 \ libtcmalloc.so:devel/google-perftools USES= compiler:c++17-lang cmake pkgconfig qt:5