Skip to content

Commit

Permalink
devel/cmake*: Pet portclippy(1) and migrate to Qt6
Browse files Browse the repository at this point in the history
Migrate towards Qt6:
- Switch the default flavor of devel/cmake-gui to qt6.
- Use qt6-tools instead of qt5-help in devel/cmake-doc to generate the Qt
  help file.

Depend on the flavorized version of textproc/py-sphinx.

Pet portclippy(1) and portlint(1) and make Makefile order more consistent
within the devel/cmake* ports. Remove duplicate DISTINFO_FILE line from
devel/cmake-man. [1]

Make build of devel/cmake-core verbose [2] and respect WITH_CCACHE_BUILD
in bootstrapping phase.

Remove the "experimental" annotation from the CPACK option in
devel/cmake-core to avoid end-user confusion. [3] The FreeBSD CPack
generator has been marked experimental since version 3.11.4, but is
supported upstream and shouldn't be considered experimental even if
we've had to make some local changes to it. If it isn't working
correctly, please file a bug report.

PR:		276792 [1], 276782[2], 274640 [3]
Reported by:	diizzy [1], Anton Saietskii <vsasjason@gmail.com> [2],
		Martin Waschbüsch <martin@waschbuesch.de> [3]
  • Loading branch information
BSDKaffee committed Feb 3, 2024
1 parent 796ad3a commit 97c31b9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 31 deletions.
17 changes: 11 additions & 6 deletions devel/cmake-core/Makefile
Expand Up @@ -17,10 +17,9 @@ LIB_DEPENDS= libexpat.so:textproc/expat2 \
librhash.so:security/rhash

USES= cmake:_internal compiler:c++11-lang cpe localbase ncurses ssl

CPE_VENDOR= cmake_project

HAS_CONFIGURE= yes
CONFIGURE_ENV= MAKE=make
CONFIGURE_ARGS= --prefix=${PREFIX} \
--datadir="/${DATADIR_REL}" \
--docdir="/${DOCSDIR_REL}" \
Expand All @@ -37,21 +36,25 @@ CONFIGURE_ARGS= --prefix=${PREFIX} \
--no-system-curl \
--no-system-nghttp2 \
--parallel=${MAKE_JOBS_NUMBER} \
--verbose \
--init="${WRKSRC}/InitialCache.cmake"
.if defined(WITH_CCACHE_BUILD)
CONFIGURE_ARGS+= --enable-ccache
.endif
CONFIGURE_ENV= MAKE=${MAKE}

# Quick fix to enable build with non-base SSL (PR: 274512)
# Quick fix to enable build with non-base SSL (CFLAGS/LDFLAGS only) (PR: 274512)
CFLAGS+= -I${OPENSSLINC}
CXXFLAGS+= -D__BSD_VISIBLE
LDFLAGS+= -L${OPENSSLLIB}

OPTIONS_DEFINE= DOCS CPACK
OPTIONS_DEFAULT= CPACK
OPTIONS_SUB= yes

CPACK_DESC= Enable FreeBSD generator in CPack (experimental)
CPACK_DESC= Enable FreeBSD generator in CPack
CPACK_LIB_DEPENDS= libpkg.so:${PKG_ORIGIN}

CXXFLAGS+= -D__BSD_VISIBLE

.include <bsd.port.pre.mk>

.if defined(STRIP) && ${STRIP} != "" && !defined(WITH_DEBUG)
Expand Down Expand Up @@ -93,6 +96,8 @@ post-patch:
${WRKSRC}/Modules/FindDCMTK.cmake
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/Modules/FindFLEX.cmake
@${REINPLACE_CMD} -e 's|_compiler=\"ccache|_compiler="${CCACHE_BIN}|g' \
${WRKSRC}/bootstrap

# cmake-gui(1) is installed by devel/cmake-gui. Remove the man page's source to
# prevent it from being built/installed by devel/cmake.
Expand Down
@@ -1,8 +1,6 @@
diff --git Source/CPack/cmCPackFreeBSDGenerator.cxx Source/CPack/cmCPackFreeBSDGenerator.cxx
index 162dfc7346..206f2d06a0 100644
--- Source/CPack/cmCPackFreeBSDGenerator.cxx
--- Source/CPack/cmCPackFreeBSDGenerator.cxx.orig 2024-01-29 20:01:32 UTC
+++ Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -245,8 +245,15 @@ public:
@@ -245,8 +245,15 @@ class ManifestKeyDepsValue : public ManifestKeyListVal
void write_value(cmGeneratedFileStream& s) const override
{
s << "{\n";
Expand Down
19 changes: 10 additions & 9 deletions devel/cmake-doc/Makefile
@@ -1,5 +1,6 @@
PORTNAME= cmake
DISTVERSION= ${_CMAKE_VERSION}
PORTREVISION= 1
CATEGORIES= devel
PKGNAMESUFFIX= -doc

Expand All @@ -10,24 +11,24 @@ WWW= https://www.cmake.org
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/Copyright.txt

BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
BUILD_DEPENDS= sphinx-build:textproc/py-sphinx@${PY_FLAVOR}

DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo

NO_ARCH= yes
USES= cmake qt:5
USE_QT= help:build
USES= cmake python:build qt:6
USE_LOCALE= en_US.UTF-8
USE_QT= sqldriver-sqlite:build tools:build

CMAKE_OFF= SPHINX_MAN
CMAKE_ON= SPHINX_HTML SPHINX_QTHELP
CMAKE_ARGS= -DCMAKE_DOC_DIR:STRING="${DOCSDIR_REL}" \
-DQHELPGENERATOR_EXECUTABLE=${QT_BINDIR}/qhelpgenerator
-DQHELPGENERATOR_EXECUTABLE=${QT_TOOLDIR}/qhelpgenerator
CMAKE_ON= SPHINX_HTML SPHINX_QTHELP
CMAKE_OFF= SPHINX_MAN
CMAKE_SOURCE_PATH= ${WRKSRC}/Utilities/Sphinx

ALL_TARGET= documentation
INSTALL_TARGET= install

NO_ARCH= yes

DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo
PLIST_SUB= CMAKEVERSION="${DISTVERSION:S/.//g:C/-.*//}"

.include <bsd.port.mk>
7 changes: 4 additions & 3 deletions devel/cmake-gui/Makefile
@@ -1,5 +1,6 @@
PORTNAME= cmake
DISTVERSION= ${_CMAKE_VERSION}
PORTREVISION= 1
CATEGORIES= devel
PKGNAMESUFFIX= -gui-${FLAVOR}

Expand All @@ -10,20 +11,20 @@ WWW= https://www.cmake.org
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/Copyright.txt

BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
BUILD_DEPENDS= sphinx-build:textproc/py-sphinx@${PY_FLAVOR}
LIB_DEPENDS= libcurl.so:ftp/curl \
libexpat.so:textproc/expat2 \
libjsoncpp.so:devel/jsoncpp \
libuv.so:devel/libuv \
librhash.so:security/rhash

FLAVORS= qt5 qt6
FLAVOR?= qt5
FLAVOR?= qt6
qt5_CONFLICTS_INSTALL= cmake-gui-qt6
qt6_CONFLICTS_INSTALL= cmake-gui-qt5

USES= cmake:run,insource compiler:c++11-lang desktop-file-utils libarchive \
shared-mime-info qt:${FLAVOR:S/qt//}
python:build shared-mime-info qt:${FLAVOR:S/qt//}
_USE_QT_qt5= core gui widgets buildtools:build qmake:build
_USE_QT_qt6= base
USE_QT= ${_USE_QT_${FLAVOR}}
Expand Down
17 changes: 8 additions & 9 deletions devel/cmake-man/Makefile
@@ -1,5 +1,6 @@
PORTNAME= cmake
DISTVERSION= ${_CMAKE_VERSION}
PORTREVISION= 1
CATEGORIES= devel
PKGNAMESUFFIX= -man

Expand All @@ -9,25 +10,23 @@ WWW= https://www.cmake.org/

LICENSE= BSD3CLAUSE

DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo

BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
BUILD_DEPENDS= sphinx-build:textproc/py-sphinx@${PY_FLAVOR}

USES= cmake
USES= cmake python:build
USE_LOCALE= en_US.UTF-8

NO_ARCH= yes
DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo

CMAKE_OFF= SPHINX_HTML SPHINX_QTHELP
CMAKE_ON= SPHINX_MAN
CMAKE_ARGS= -DCMAKE_DOC_DIR:STRING="${DOCSDIR_REL}" \
-DCMAKE_MAN_DIR:STRING="share/man"
CMAKE_ON= SPHINX_MAN
CMAKE_OFF= SPHINX_HTML SPHINX_QTHELP
CMAKE_SOURCE_PATH= ${WRKSRC}/Utilities/Sphinx

ALL_TARGET= documentation
INSTALL_TARGET= install

NO_ARCH= yes

DISTINFO_FILE= ${.CURDIR}/../cmake-core/distinfo
PLIST_SUB= CMAKEVERSION="${DISTVERSION:S/.//g:C/-.*//}"

post-install:
Expand Down

0 comments on commit 97c31b9

Please sign in to comment.