Skip to content
Permalink
Browse files

kde-extra-cmake-modules: sync from RJVB/macstrop

Differences from https://github.com/RJVB/macstrop/tree/master/kde/ECM:

* Add the GitHub handle to the maintainer
* Add size to checksum
* Not adding kECM subport as it wasn't there
* Not syncing patches in old/

Closes: https://trac.macports.org/ticket/50033
  • Loading branch information
yan12125 committed Jul 9, 2019
1 parent 2fe07c7 commit a4ae221a49bbb2e34cec646d0a0bb2a50d120f9c
@@ -7,14 +7,14 @@ set ECM extra-cmake-modules
name kde-${ECM}
subport ${name}-devel {}

set kf5.branch 5.29
set kf5.branch 5.59

if {${subport} eq "${name}-devel"} {
fetch.type git
git.url git://anongit.kde.org/extra-cmake-modules
# v5.30.0-rc2-1-gf63f400
git.branch f63f400787ac42f64fafe006ef19579238067f40
version 5.29.92
git.branch 3f51cb1fcd5f7b00b565b9f2ddf7366aeef3c415
# v5.59.0-1-g3f51cb1
version 5.59.0.1
distname ECM-5.1x.git
} else {
version ${kf5.branch}.0
@@ -24,8 +24,9 @@ if {${subport} eq "${name}-devel"} {
distname ${ECM}-${version}
use_xz yes

checksums rmd160 bdf712bed088fc497f14b625cd5dc48f4b8d7b3f \
sha256 48f76e626e2235bd4b64aeea9bbbcb803eb8966a6d020d0ab8ddbe81930e98d8
checksums rmd160 6a477336c39f9866da84095d6e746859b3829b42 \
sha256 1a630b242242ac32d20d14e7ae5645aa28a47676eae0e62ed76af8bc1f56c438 \
size 326980
}

supported_archs noarch
@@ -42,25 +43,21 @@ platforms darwin
homepage http://projects.kde.org/projects/kdesupport/${ECM}

patchfiles-append patch-BUNDLEDIR.diff
# https://commits.kde.org/extra-cmake-modules/f63f400787ac42f64fafe006ef19579238067f40
if {${subport} eq "${name}"} {
patchfiles-append \
patch-ecm-addappicon.diff
}
if {${subport} eq "${name}"} {
# https://commits.kde.org/extra-cmake-modules/187d8881a6a0c33f50eb65689aa1dd74a8d107a4
patchfiles-append \
patch-no-undefined.diff
}

# # Not used here, but these are used when configuring KF5 packages (cf KF5 PortGroup):
# configure.args-append \
# -DCMAKE_DISABLE_FIND_PACKAGE_X11=ON \
# -DAPPLE_SUPPRESS_X11_WARNING=ON \
# -DCMAKE_INSTALL_LIBEXECDIR=${prefix}/libexec \
# -DKDE_INSTALL_LIBEXECDIR=${prefix}/libexec/kde5
# https://phabricator.kde.org/D5865
patchfiles-append patch-enable-named-operators.diff
# https://phabricator.kde.org/D5972
patchfiles-append patch-qt_no_exceptions.diff
if {${subport} eq "${name}-devel"} {
# https://phabricator.kde.org/D16894
patchfiles-append patch-kdecompilerflags.diff
}
# https://phabricator.kde.org/T10112
patchfiles-append patch-mac-installdirs.diff

configure.args-append -DBUILD_HTML_DOCS:BOOL=OFF
configure.args-append -DBUILD_HTML_DOCS=OFF \
-DBUILD_MAN_DOCS=OFF \
-DBUILD_QTHELP_DOCS=OFF

variant qt4 conflicts qt5 description {Use Qt4 to build the Qt documentation} {}
variant qt5 conflicts qt4 description {Use Qt5 to build the Qt documentation} {}
@@ -89,15 +86,26 @@ if {[variant_isset docs]} {
} elseif {[variant_isset qt5]} {
set qt5.prefer_kde 1
PortGroup qt5 1.0
qt5.depends_build_component \
qttools
}
patchfiles-append patch-doc-building.diff
depends_build-append port:py-sphinx
configure.args-append -DBUILD_QTHELP_DOCS:BOOL=ON
platform darwin {
depends_build-append \
port:py-sphinx
}
configure.args-replace -DBUILD_MAN_DOCS=OFF \
-DBUILD_MAN_DOCS=ON
configure.args-replace -DBUILD_QTHELP_DOCS=OFF \
-DBUILD_QTHELP_DOCS=ON
pre-destroot {
system -W ${build.dir}/docs "${qt_bins_dir}/qcollectiongenerator qthelp/ExtraCMakeModules.qhcp"
}
}

test.run yes

livecheck.type regex
livecheck.url http://download.kde.org/stable/frameworks/${kf5.branch}
livecheck.regex ${ECM}-(5+(\\.\\d+)+)
livecheck.version ${kf5.branch}
livecheck.url http://download.kde.org/stable/frameworks/
livecheck.regex (5+(\\.\\d+)+)
@@ -1,5 +1,5 @@
diff --git kde-modules/KDEInstallDirs.cmake kde-modules/KDEInstallDirs.cmake
index b7cd34d..89b37b6 100644
index 5c8783b..f5dfd6d 100644
--- kde-modules/KDEInstallDirs.cmake
+++ kde-modules/KDEInstallDirs.cmake
@@ -18,7 +18,7 @@
@@ -11,12 +11,12 @@ index b7cd34d..89b37b6 100644
# ``EXECROOTDIR``
# executables and libraries (``<empty>``) [``EXEC_INSTALL_PREFIX``]
# ``BINDIR``
@@ -383,7 +383,7 @@ macro(_define_non_cache varname value)
@@ -417,7 +417,7 @@ macro(_define_non_cache varname value)
endmacro()

if(APPLE)
- _define_absolute(BUNDLEDIR "/Applications/KDE"
+ _define_absolute(BUNDLEDIR "/Applications/MacPorts/KF5"
"application bundles"
BUNDLE_INSTALL_DIR)
endif(APPLE)
endif()

This file was deleted.

@@ -0,0 +1,51 @@
diff --git kde-modules/KDECompilerSettings.cmake kde-modules/KDECompilerSettings.cmake
index 8f87ecc1970b3523890e0c91d7627dd7ec5fb542..ae2eaffc79273185a196ee00986a017245f3c09e 100644
--- kde-modules/KDECompilerSettings.cmake
+++ kde-modules/KDECompilerSettings.cmake
@@ -219,6 +219,46 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
endif()

+# allow projects that do require named operators to (re)activate them
+# (this includes projects using boost)
+function(KDE_ENABLE_NAMED_OPERATORS)
+ set(WMSG "Using C++ named operators is not compatible with MSVC prior to version 2017 (19.1).\
+ You should reconsider using this macro if your code is meant to be cross-platform")
+ if (MSVC)
+ if (MSVC_VERSION LESS 1910)
+ # https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/ and
+ # https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/
+ # https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
+ message(WARNING ${WMSG})
+ else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
+ endif()
+ else()
+ string(REPLACE "-fno-operator-names" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ message(WARNING ${WMSG})
+ endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
+endfunction()
+
+function(KDE_TARGET_ENABLE_NAMED_OPERATORS target mode)
+ set(WMSG "Using C++ named operators is not compatible with MSVC prior to version 2017 (19.1).\
+ You should reconsider using this macro if \"${target}\" is meant to be cross-platform")
+ if (MSVC)
+ if (MSVC_VERSION LESS 1910)
+ # https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/ and
+ # https://blogs.msdn.microsoft.com/vcblog/2016/06/07/standards-version-switches-in-the-compiler/
+ # https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
+ message(WARNING ${WMSG})
+ else()
+ target_compile_options(${target} ${mode} "/permissive-")
+ endif()
+ else()
+ target_compile_options(${target} ${mode}
+ "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-foperator-names>")
+ message(WARNING ${WMSG})
+ endif()
+endfunction()
+
# Default to hidden visibility for symbols
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

0 comments on commit a4ae221

Please sign in to comment.
You can’t perform that action at this time.