1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-17 08:01:36 +00:00

- Convert to new options framework

Reviewed by:	bapt
This commit is contained in:
Martin Wilke 2012-05-29 16:42:24 +00:00
parent 44a8264372
commit 8c2c328510
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=297696
4 changed files with 68 additions and 64 deletions

View File

@ -49,25 +49,23 @@ BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \
-e 's,2to3,2to3-${PYTHON_VER},' \
-e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},'
OPTIONS= THREADS "Enable thread support" on \
SEM "Use POSIX semaphores (experimental)" off \
PTH "Use GNU Pth for threading/multiprocessing" off \
UCS4 "Use UCS4 for unicode support" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
OPTIONS_SINGLE= UCS
OPTIONS_SINGLE_UCS= UCS4 UCS2
.include <bsd.port.pre.mk>
.if defined(WITH_SEM)
.if ${PORT_OPTIONS:MSEM}
.if ${OSVERSION} >= 701106
SEM_MSG= ""
.else
IGNORE= POSIX semaphore support only works in FreeBSD 7-STABLE and later
.endif # ${OSVERSION} >= 701106
.else # !defined(WITH_SEM)
.else
SEM_MSG= "@comment "
.endif # defined(WITH_SEM)
.endif
SUB_FILES= pkg-message
SUB_LIST= SEM=${SEM_MSG}
@ -79,9 +77,9 @@ PLIST_SUB+= IF_DEFAULT=""
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
.if !defined(WITHOUT_THREADS)
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
.if defined(WITH_PTH)
.if ${PORT_OPTIONS:MPTH}
CONFIGURE_ARGS+= --with-pth
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure-pth
LIB_DEPENDS+= pth:${PORTSDIR}/devel/pth
@ -89,21 +87,25 @@ _PTH_CPPFLAGS= "-I${LOCALBASE}/include/pth"
_PTH_LDFLAGS= "-L${LOCALBASE}/lib/pth"
CPPFLAGS+= ${_PTH_CPPFLAGS}
LDFLAGS+= ${_PTH_LDFLAGS}
.else # !defined(WITH_PTH)
.else
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
.endif # defined(WITH_PTH)
.else # defined(WITHOUT_THREADS)
.endif
.else
PLIST_SUB+= THREADS="@comment "
CONFIGURE_ARGS+= --without-threads
.endif # !defined(WITHOUT_THREADS)
.endif
.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
.if ${PORT_OPTIONS:MUCS4}
CONFIGURE_ARGS+= --enable-unicode=ucs4
.endif
.if defined(WITHOUT_PYMALLOC)
.if ${PORT_OPTIONS:MUCS2}
CONFIGURE_ARGS+= --enable-unicode=ucs2
.endif
.if ${PORT_OPTIONS:MPYMALLOC}
CONFIGURE_ARGS+= --without-pymalloc
.endif
@ -124,13 +126,13 @@ WITHOUT_NIS?= detected
PLIST_SUB+= NO_NIS=""
.endif
.if !defined(WITHOUT_IPV6)
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if defined(WITH_FPECTL)
.if ${PORT_OPTIONS:MFPECTL}
CONFIGURE_ARGS+= --with-fpectl
.endif
@ -166,13 +168,13 @@ pre-patch:
${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION:S/thon/thon-shared/}|' \
${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config
.if defined(WITH_FPECTL) && ${ARCH} == i386
.if ${PORT_OPTIONS:MFPECTL) && ${ARCH} == i386
${MKDIR} ${WRKSRC}/Modules
${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
.endif
post-patch:
.if defined(WITH_SEM)
.if ${PORT_OPTIONS:MSEM}
.if ${OSVERSION} >= 701106
@cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-setup.py
.endif
@ -257,7 +259,7 @@ post-install:
@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
(cd ${DATADIR}; ${TAR} -xf -)
.endif
.if !defined(NOPORTEXAMPLES)
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
@cd ${PYTHON_WRKSRC}/Demo; ${TAR} -cf - * | \
(cd ${EXAMPLESDIR}; ${TAR} -xf -)

View File

@ -49,25 +49,23 @@ BINLINKS_SUB= -e 's,smtpd,smtpd${PYTHON_VER},' \
-e 's,2to3,2to3-${PYTHON_VER},' \
-e 's,(idle|pydoc|python-shared|python),\1${PYTHON_VER},'
OPTIONS= THREADS "Enable thread support" on \
SEM "Use POSIX semaphores (experimental)" off \
PTH "Use GNU Pth for threading/multiprocessing" off \
UCS4 "Use UCS4 for unicode support" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
OPTIONS_DEFINE= THREADS SEM PTH PYMALLOC IPV6 FPECTL EXAMPLES
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
OPTIONS_SINGLE= UCS
OPTIONS_SINGLE_UCS= UCS4 UCS2
.include <bsd.port.pre.mk>
.if defined(WITH_SEM)
.if ${PORT_OPTIONS:MSEM}
.if ${OSVERSION} >= 701106
SEM_MSG= ""
.else
IGNORE= POSIX semaphore support only works in FreeBSD 7-STABLE and later
.endif # ${OSVERSION} >= 701106
.else # !defined(WITH_SEM)
.else
SEM_MSG= "@comment "
.endif # defined(WITH_SEM)
.endif
SUB_FILES= pkg-message
SUB_LIST= SEM=${SEM_MSG}
@ -79,9 +77,9 @@ PLIST_SUB+= IF_DEFAULT=""
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
.if !defined(WITHOUT_THREADS)
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
.if defined(WITH_PTH)
.if ${PORT_OPTIONS:MPTH}
BROKEN= does not build with PTH enabled
CONFIGURE_ARGS+= --with-pth
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-configure-pth
@ -90,21 +88,25 @@ _PTH_CPPFLAGS= "-I${LOCALBASE}/include/pth"
_PTH_LDFLAGS= "-L${LOCALBASE}/lib/pth"
CPPFLAGS:= ${_PTH_CPPFLAGS} ${CPPFLAGS}
LDFLAGS+= ${_PTH_LDFLAGS}
.else # !defined(WITH_PTH)
.else
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
.endif # defined(WITH_PTH)
.else # defined(WITHOUT_THREADS)
.endif
.else
PLIST_SUB+= THREADS="@comment "
CONFIGURE_ARGS+= --without-threads
.endif # !defined(WITHOUT_THREADS)
.endif
.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
.if ${PORT_OPTIONS:MUCS4}
CONFIGURE_ARGS+= --enable-unicode=ucs4
.endif
.if defined(WITHOUT_PYMALLOC)
.if ${PORT_OPTIONS:MUCS2}
CONFIGURE_ARGS+= --enable-unicode=ucs2
.endif
.if ${PORT_OPTIONS:MPYMALLOC}
CONFIGURE_ARGS+= --without-pymalloc
.endif
@ -133,13 +135,13 @@ WITHOUT_NIS?= detected
PLIST_SUB+= NO_NIS=""
.endif
.if !defined(WITHOUT_IPV6)
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if defined(WITH_FPECTL)
.if ${PORT_OPTIONS:MFPECTL}
CONFIGURE_ARGS+= --with-fpectl
.endif
@ -175,13 +177,13 @@ pre-patch:
${SED} -e 's|^#!.*|#!${PREFIX}/bin/${PYTHON_VERSION:S/thon/thon-shared/}|' \
${PATCH_WRKSRC}/Misc/python-config.in > ${WRKDIR}/${PYTHON_VERSION:S/thon/thon-shared/}-config
.if defined(WITH_FPECTL) && ${ARCH} == i386
.if ${PORT_OPTIONS:MFPECTL) && ${ARCH} == i386
${MKDIR} ${WRKSRC}/Modules
${ECHO} "fpectl fpectlmodule.c" >> ${WRKSRC}/Modules/Setup.dist
.endif
post-patch:
.if defined(WITH_SEM)
.if ${PORT_OPTIONS:MSEM}
.if ${OSVERSION} >= 701106
@cd ${WRKSRC} && ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/extra-patch-setup.py
.endif
@ -266,7 +268,7 @@ post-install:
@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
(cd ${DATADIR}; ${TAR} -xf -)
.endif
.if !defined(NOPORTEXAMPLES)
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
@cd ${PYTHON_WRKSRC}/Demo; ${TAR} -cf - * | \
(cd ${EXAMPLESDIR}; ${TAR} -xf -)

View File

@ -49,11 +49,8 @@ BIN_FILES= python python-shared python-config python-shared-config \
BINLINKS_SUB= -e 's,(2to3|idle3|pydoc3),\1-${PYTHON_VER},' \
-e 's,(python-shared|python),\1${PYTHON_VER},'
OPTIONS= THREADS "Enable thread support" on \
UCS4 "Use UCS4 for unicode support" on \
PYMALLOC "Use python's internal malloc" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
.include <bsd.port.pre.mk>
@ -64,7 +61,7 @@ PLIST_SUB+= IF_DEFAULT=""
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
.if !defined(WITHOUT_THREADS)
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
@ -74,11 +71,11 @@ PLIST_SUB+= THREADS="@comment "
CONFIGURE_ARGS+= --without-threads
.endif # !defined(WITHOUT_THREADS)
.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
.if .if ${PORT_OPTIONS:MUCS4}
CONFIGURE_ARGS+= --with-wide-unicode
.endif
.if defined(WITHOUT_PYMALLOC)
.if ${PORT_OPTIONS:MPYMALLOC}
CONFIGURE_ARGS+= --without-pymalloc
.endif
@ -94,13 +91,13 @@ WITHOUT_NIS?= detected
PLIST_SUB+= NO_NIS=""
.endif
.if !defined(WITHOUT_IPV6)
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if defined(WITH_FPECTL)
.if ${PORT_OPTIONS:MFPECTL}
CONFIGURE_ARGS+= --with-fpectl
.endif
@ -218,7 +215,7 @@ post-install:
@cd ${PYTHON_WRKSRC}; ${TAR} -cf - Tools | \
(cd ${DATADIR}; ${TAR} -xf -)
.endif
.if !defined(NOPORTEXAMPLES)
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
@cd ${PYTHON_WRKSRC}/Demo; ${TAR} -cf - * | \
(cd ${EXAMPLESDIR}; ${TAR} -xf -)

View File

@ -56,6 +56,9 @@ OPTIONS= THREADS "Enable thread support" on \
IPV6 "Enable IPv6 support" on \
FPECTL "Enable floating point exception handling" off
OPTIONS_DEFINE= THREADS UCS4 PYMALLOC IPV6 FPECTL EXAMPLES
OPTIONS_DEFAULT= THREADS UCS4 PYMALLOC IPV6
.include <bsd.port.pre.mk>
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION} || !exists(${LOCALBASE}/bin/python)
@ -65,22 +68,22 @@ PLIST_SUB+= IF_DEFAULT=""
PLIST_SUB+= IF_DEFAULT="@comment "
.endif
.if !defined(WITHOUT_THREADS)
.if ${PORT_OPTIONS:MTHREADS}
PLIST_SUB+= THREADS=""
CONFIGURE_ARGS+= --with-threads
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
.else # defined(WITHOUT_THREADS)
.else
PLIST_SUB+= THREADS="@comment "
CONFIGURE_ARGS+= --without-threads
.endif # !defined(WITHOUT_THREADS)
.endif
.if !defined(WITHOUT_UCS4) && !defined(WITH_UCS2)
.if ${PORT_OPTIONS:MUCS4}
CONFIGURE_ARGS+= --with-wide-unicode
PYABIVER:= ${PYABIVER}u
.endif
.if defined(WITHOUT_PYMALLOC)
.if ${PORT_OPTIONS:MPYMALLOC}
CONFIGURE_ARGS+= --without-pymalloc
.else
PYABIVER:= m${PYABIVER}
@ -98,13 +101,13 @@ WITHOUT_NIS?= detected
PLIST_SUB+= NO_NIS=""
.endif
.if !defined(WITHOUT_IPV6)
.if ${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
.if defined(WITH_FPECTL)
.if ${PORT_OPTIONS:MFPECTL}
CONFIGURE_ARGS+= --with-fpectl
.endif