Changeset View
Standalone View
Mk/Uses/kde.mk
Show All 24 Lines | |||||
# this will then set default values for MASTER_SITES and DIST_SUBDIR | # this will then set default values for MASTER_SITES and DIST_SUBDIR | ||||
# as well as CPE_VENDOR and LICENSE. | # as well as CPE_VENDOR and LICENSE. | ||||
# | # | ||||
# MAINTAINER: kde@FreeBSD.org | # MAINTAINER: kde@FreeBSD.org | ||||
.if !defined(_INCLUDE_USES_KDE_MK) | .if !defined(_INCLUDE_USES_KDE_MK) | ||||
_INCLUDE_USES_KDE_MK= yes | _INCLUDE_USES_KDE_MK= yes | ||||
_USES_POST+= kde | |||||
_KDE_SUPPORTED= 4 5 | _KDE_SUPPORTED= 4 5 | ||||
. if empty(kde_ARGS) | . if empty(kde_ARGS) | ||||
IGNORE= kde needs a version (${_KDE_SUPPORTED}) | IGNORE= kde needs a version (${_KDE_SUPPORTED}) | ||||
. endif | . endif | ||||
. for ver in ${_KDE_SUPPORTED:O:u} | . for ver in ${_KDE_SUPPORTED:O:u} | ||||
. if ${kde_ARGS:M${ver}} | . if ${kde_ARGS:M${ver}} | ||||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | PLIST_SUB+= KDE4_VERSION="${KDE4_VERSION}" \ | ||||
KDE4_GENERIC_LIB_VERSION=${KDE4_KDELIBS_VERSION} \ | KDE4_GENERIC_LIB_VERSION=${KDE4_KDELIBS_VERSION} \ | ||||
KDE4_NON_GENERIC_LIB_VERSION=${KDE4_KDELIBS_VERSION:S,^4,5,} \ | KDE4_NON_GENERIC_LIB_VERSION=${KDE4_KDELIBS_VERSION:S,^4,5,} \ | ||||
KDE4_KDELIBS_VERSION=${KDE4_KDELIBS_VERSION} \ | KDE4_KDELIBS_VERSION=${KDE4_KDELIBS_VERSION} \ | ||||
KDE4_NG_KDELIBS_VERSION=${KDE4_KDELIBS_VERSION:S,^4,5,} | KDE4_NG_KDELIBS_VERSION=${KDE4_KDELIBS_VERSION:S,^4,5,} | ||||
. elif ${_KDE_VERSION:M*5*} | . elif ${_KDE_VERSION:M*5*} | ||||
PLIST_SUB+= KDE_FRAMEWORKS_VERSION="${KDE_FRAMEWORKS_VERSION}" | PLIST_SUB+= KDE_FRAMEWORKS_VERSION="${KDE_FRAMEWORKS_VERSION}" | ||||
. endif | . endif | ||||
# ============================================================================== | # ============================================================================== | ||||
# === HANDLE PYTHON ============================================================ | |||||
# TODO: Keep in sync with cmake/modules/PythonMacros.cmake | |||||
_PYTHON_SHORT_VER= ${PYTHON_VERSION:S/^python//:S/.//} | |||||
. if ${_PYTHON_SHORT_VER} > 31 | |||||
PLIST_SUB+= PYCACHE="__pycache__/" \ | |||||
PYC_SUFFIX=cpython-${_PYTHON_SHORT_VER}.pyc \ | |||||
PYO_SUFFIX=cpython-${_PYTHON_SHORT_VER}.pyo | |||||
. else | |||||
PLIST_SUB+= PYCACHE="" \ | |||||
PYC_SUFFIX=pyc \ | |||||
PYO_SUFFIX=pyo | |||||
. endif | |||||
# ============================================================================== | # ============================================================================== | ||||
mat: This will not work, USES entries are most often sorted alphabetically, and this means python.mk… | |||||
Done Inline ActionsGood catch, however PYTHON_VERSION is not guaranteed to be available. It is only available if: I included ${USESDIR}/python.mk, if needed, to get the correct version of PYTHON_VERSION. dbn: Good catch, however PYTHON_VERSION is not guaranteed to be available. It is only available if… | |||||
Done Inline ActionsAh, sorry, I meant PYTHON_DEFAULT, not PYTHON_VERSION... I really don't like all that spaghetti code with many uses includ'ing each other. As the only thing this is used for is to add stuff to PLIST_SUB, maybe it could go in a _POST section here, and you would not need to include it. See kmod.mk or autoconf.mk for what I mean about a _POST section. mat: Ah, sorry, I meant PYTHON_DEFAULT, not PYTHON_VERSION...
I really don't like all that… | |||||
Done Inline ActionsI didn't know about the post section. I'm sure it is very useful in getting USES to interact cleanly with each other. I have updated kde per your suggestion, and updated the test to cover both the Python 3 and Python 2 case. dbn: I didn't know about the post section. I'm sure it is very useful in getting USES to interact… | |||||
_USE_KDE4_ALL= baloo baloo-widgets baseapps kactivities kate kdelibs \ | _USE_KDE4_ALL= baloo baloo-widgets baseapps kactivities kate kdelibs \ | ||||
kfilemetadata korundum libkcddb libkcompactdisc \ | kfilemetadata korundum libkcddb libkcompactdisc \ | ||||
libkdcraw libkdeedu libkdegames libkexiv2 libkipi \ | libkdcraw libkdeedu libkdegames libkexiv2 libkipi \ | ||||
libkonq libksane marble nepomuk-core nepomuk-widgets \ | libkonq libksane marble nepomuk-core nepomuk-widgets \ | ||||
okular oxygen-icons4 perlkde perlqt pimlibs pykde4 \ | okular oxygen-icons4 perlkde perlqt pimlibs pykde4 \ | ||||
pykdeuic4 qtruby runtime smokegen smokekde smokeqt \ | pykdeuic4 qtruby runtime smokegen smokekde smokeqt \ | ||||
workspace | workspace | ||||
# These components are not part of the Software Compilation. | # These components are not part of the Software Compilation. | ||||
_USE_KDE4_ALL+= akonadi attica automoc4 ontologies qimageblitz soprano \ | _USE_KDE4_ALL+= akonadi attica automoc4 ontologies qimageblitz soprano \ | ||||
▲ Show 20 Lines • Show All 428 Lines • ▼ Show 20 Lines | |||||
RUN_DEPENDS+= ${${component}_DEPENDS} | RUN_DEPENDS+= ${${component}_DEPENDS} | ||||
. endif | . endif | ||||
. endif # ${${component}_LIB} && ${${component}_TYPE:Mbuild} && ${${component}_TYPE:Mrun} | . endif # ${${component}_LIB} && ${${component}_TYPE:Mbuild} && ${${component}_TYPE:Mrun} | ||||
. endif # defined(${component}_PORT) && defined(${component}_PATH) | . endif # defined(${component}_PORT) && defined(${component}_PATH) | ||||
. else # ! ${_USE_KDE_ALL:M${component}} != "" | . else # ! ${_USE_KDE_ALL:M${component}} != "" | ||||
IGNORE= cannot be installed: unknown USE_KDE component '${component}' | IGNORE= cannot be installed: unknown USE_KDE component '${component}' | ||||
. endif # ${_USE_KDE_ALL:M${component}} != "" | . endif # ${_USE_KDE_ALL:M${component}} != "" | ||||
. endfor | . endfor | ||||
.endif | |||||
.if defined(_POSTMKINCLUDED) && !defined(_INCLUDE_USES_KDE_POST_MK) | |||||
_INCLUDE_USES_KDE_POST_MK= yes | |||||
# === HANDLE PYTHON ============================================================ | |||||
# TODO: Keep in sync with cmake/modules/PythonMacros.cmake | |||||
.if defined(PYTHON_SUFFIX) | |||||
. if ${PYTHON_SUFFIX} > 31 | |||||
PLIST_SUB+= PYCACHE="__pycache__/" \ | |||||
PYC_SUFFIX=cpython-${PYTHON_SUFFIX}.pyc \ | |||||
PYO_SUFFIX=cpython-${PYTHON_SUFFIX}.pyo | |||||
. else | |||||
PLIST_SUB+= PYCACHE="" \ | |||||
PYC_SUFFIX=pyc \ | |||||
PYO_SUFFIX=pyo | |||||
. endif | |||||
.endif | |||||
.endif | .endif |
This will not work, USES entries are most often sorted alphabetically, and this means python.mk will be parsed after kde.mk, and PYTHON_SUFFIX will not be defined at that point, whereas PYTHON_VERSION is guaranteed to be.