1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- Aadds a new way of working with threaded versions and

resolves conflicts.
- Bump PORTREVISION

Notes:
Threaded libraries and shell are installed on top of the standard ones
so ports that depend on threaded and non-threaded tcl can be used
simultaneously.

Behaiviour with non-threaded libraries does not change.

PR:             110395
Submitted by:   Martin Matuska <martin@matuska.org> (maintainer)
This commit is contained in:
Martin Wilke 2007-03-16 20:40:00 +00:00
parent ddae5b2437
commit 421c9b0983
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=187536
10 changed files with 124 additions and 72 deletions

View File

@ -5,7 +5,7 @@
# $FreeBSD$
#
WITH_THREADS= yes
BUILDING_TK_THREADS= yes
MASTERDIR= ${.CURDIR}/../tk85

View File

@ -7,7 +7,7 @@
PORTNAME= tk
PORTVERSION= 8.5.a.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= x11-toolkits
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= tcl
@ -17,9 +17,6 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.a./a/}-src
MAINTAINER= martin@matuska.org
COMMENT= Graphical toolkit for TCL
USE_TCL= 85
USE_TCL_BUILD= 85
LATEST_LINK?= tk85
USE_XLIB= yes
USE_LDCONFIG= yes
@ -27,44 +24,40 @@ WRKSRC= ${WRKDIR}/${PORTNAME}${PORTVERSION:S/.a./a/}/unix
GNU_CONFIGURE= yes
TK_VER= 8.5
SHORT_TK_VER= 85
CONFIGURE_ARGS= --enable-shared --with-tcl=${LOCALBASE}/lib/tcl${TK_VER} \
--includedir=${PREFIX}/include/tk${TK_VER}
CONFIGURE_ARGS= --enable-shared --includedir=${PREFIX}/include/tk${TK_VER}
CONFIGURE_ENV= PORTSDIR=${PORTSDIR} TK_LIB_FILE=libtk${SHORT_TK_VER}.so.1
MAKE_ENV= SHORT_TK_VER=${SHORT_TK_VER}
PLIST_SUB= TK_VER=${TK_VER} SHORT_TK_VER=${SHORT_TK_VER}
PKGINSTALL= ${PKGDIR}/pkg-install.wish
PKGDEINSTALL= ${PKGDIR}/pkg-deinstall.wish
NOPRECIOUSMAKEVARS= yes # Otherwise 'make readmes' is broken
MANCOMPRESSED= no
DATADIR= ${PREFIX}/share/${PORTNAME}${TK_VER}
SUB_FILES= pkgIndex.tcl
.if !defined(BUILDING_TK_THREADS)
USE_TCL= ${SHORT_TK_VER}
USE_TCL_BUILD= ${SHORT_TK_VER}
OPTIONS= TK85_MAN "Install tk 8.5 manpages" off \
WISH_WRAPPER "Require wish wrapper from ports" off
.else
USE_TK= ${SHORT_TK_VER}
PLIST= ${PKGDIR}/pkg-plist.threads
THREADS_SUFFIX= -threads
LIB_DEPENDS= tcl${SHORT_TK_VER}${THREADS_SUFFIX}:${PORTSDIR}/lang/tcl${SHORT_TK_VER}-thread
.endif
SUB_LIST+= THREADS_SUFFIX="${THREADS_SUFFIX}"
.include <bsd.port.pre.mk>
.if exists(${TCLSH})
_TCL_IS_THREADED!= ${ECHO_CMD} 'puts [array names tcl_platform -exact threaded]' | ${TCLSH} || return 0
. if !defined(TCL_WITH_THREADS) && !defined(WITH_THREADS) && !empty(_TCL_IS_THREADED)
TCL_WITH_THREADS= yes
. endif
.endif
.if defined(TCL_WITH_THREADS) || defined(WITH_THREADS)
. if defined(_TCL_IS_THREADED) && empty(_TCL_IS_THREADED)
IGNORE= tcl with threads is required. Please install tcl with WITH_THREADS defined or from lang/tcl${USE_TCL} port and try again
. endif
CONFIGURE_ARGS+= --enable-threads
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}" PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
THREADS_SUFFIX= -threads
USE_TCL= 85-thread
USE_TCL_BUILD= 85-thread
CONFLICTS= tk-8.5*
.include "${PORTSDIR}/Mk/bsd.tcl.mk"
.if defined(BUILDING_TK_THREADS)
CONFIGURE_ARGS+= --enable-threads --with-tcl=${LOCALBASE}/lib/tcl${TK_VER}${THREADS_SUFFIX}
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}" PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
ac_cv_path_tclsh="${LOCALBASE}/bin/tclsh${TK_VER}${THREADS_SUFFIX}"
LATEST_LINK= tk85${THREADS_SUFFIX}
.else
CONFIGURE_ARGS+= --disable-threads
CONFLICTS= tk-threads-8.5*
.endif
CONFIGURE_ARGS+= --disable-threads --with-tcl=${LOCALBASE}/lib/tcl${TK_VER} \
ac_cv_path_tclsh="${TCLSH}"
.if defined(WITH_WISH_WRAPPER)
RUN_DEPENDS+= wish:${PORTSDIR}/lang/tcl-tk-wrapper
@ -389,23 +382,47 @@ MLINKS= 3DBorder.3 Tk_Alloc3DBorderFromObj.3 \
.endif
.endif # defined(BUILDING_TK_THREADS)
TKBASE?= ${PORTSDIR}/${PKGCATEGORY}/${LATEST_LINK}
pre-everything::
@if ${TEST} -e "${NONEXISTENT}"; then ${ECHO_MSG} "=== Aborted, please remove ${NONEXISTENT}"; exit 1; fi
pre-configure:
post-patch:
@${REINPLACE_CMD} -e 's|@TK_SHARED_BUILD@|#@TK_SHARED_BUILD@|g' ${WRKSRC}/Makefile.in
.if defined(BUILDING_TK_THREADS)
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
-e 's|$${TCL_TRIM_DOTS}|$${TCL_TRIM_DOTS}${THREADS_SUFFIX}|g' \
-e 's|-ltk$${TK_VERSION}|-ltk$${TK_VERSION}${THREADS_SUFFIX}|g' \
-e 's/-ltk`echo $${TK_VERSION} | tr -d .`/-ltk`echo $${TK_VERSION} | tr -d .`${THREADS_SUFFIX}/g' \
-e 's|-ltkstub$${TK_VERSION}|-ltkstub$${TK_VERSION}${THREADS_SUFFIX}|g' \
-e 's/-ltkstub`echo $${TK_VERSION} | tr -d .`/-ltkstub`echo $${TK_VERSION} | tr -d .`${THREADS_SUFFIX}/g' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|libtk$${SHORT_TK_VER}|libtk$${SHORT_TK_VER}${THREADS_SUFFIX}|g' \
-e 's|$$(BIN_INSTALL_DIR)/wish$$(VERSION)|$$(BIN_INSTALL_DIR)/wish$$(VERSION)${THREADS_SUFFIX}|g' \
-e 's|tk$$(VERSION)/tkConfig.sh|tk$$(VERSION)/tkConfig${THREADS_SUFFIX}.sh|g' \
-e 's|$$(LIB_INSTALL_DIR)$$(TK_PKG_DIR)|${WRKDIR}|g' \
-e 's|$$(MINOR_VERSION)$$(TCLPATCHL)|$$(MINOR_VERSION)$$(TCLPATCHL)${THREADS_SUFFIX}|g' \
${WRKSRC}/Makefile.in
.endif
post-configure:
${REINPLACE_CMD} \
-e 's|${WRKDIRPREFIX}${.CURDIR}|$${WRKDIRPREFIX}${TKBASE}|' \
${WRKSRC}/tkConfig.sh
.if defined(BUILDING_TK_THREADS)
do-install:
@cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} -f Makefile install-binaries
@${MKDIR} ${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}
@${LN} -s ${PREFIX}/lib/tk${TK_VER}/tkConfig${THREADS_SUFFIX}.sh \
${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}/tkConfig.sh
.endif
post-install:
${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/tk${TK_VER}/
.if !defined(NO_INSTALL_MANPAGES) && defined(WITH_TK85_MAN)
${INSTALL_DATA} ${WRKDIR}/pkgIndex.tcl ${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}/
.if !defined(BUILDING_TK_THREADS) && !defined(NO_INSTALL_MANPAGES) && defined(WITH_TK85_MAN)
${MKDIR} ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/../doc/man.macros ${DATADIR}
. for mp in ${MAN1} ${MAN3} ${MANN}

View File

@ -1,3 +0,0 @@
# Tcl package index file, version 1.0
package ifneeded Tk 8.5 [list load "[file join [file dirname $dir] libtk85.so.1]" Tk]

View File

@ -0,0 +1,3 @@
# Tcl package index file, version 1.0
package ifneeded Tk%%THREADS_SUFFIX%% 8.5 [list load "[file join [file dirname $dir] libtk85%%THREADS_SUFFIX%%.so.1]" Tk]

View File

@ -0,0 +1,9 @@
bin/wish%%TK_VER%%-threads
lib/libtk%%SHORT_TK_VER%%-threads.a
lib/libtk%%SHORT_TK_VER%%-threads.so
lib/libtk%%SHORT_TK_VER%%-threads.so.1
lib/libtkstub%%SHORT_TK_VER%%-threads.a
lib/tk%%TK_VER%%/tkConfig-threads.sh
lib/tk%%TK_VER%%-threads/tkConfig.sh
lib/tk%%TK_VER%%-threads/pkgIndex.tcl
@dirrm lib/tk%%TK_VER%%-threads

View File

@ -5,7 +5,7 @@
# $FreeBSD$
#
WITH_THREADS= yes
BUILDING_TK_THREADS= yes
MASTERDIR= ${.CURDIR}/../tk85

View File

@ -7,7 +7,7 @@
PORTNAME= tk
PORTVERSION= 8.5.a.5
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= x11-toolkits
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= tcl
@ -17,9 +17,6 @@ DISTNAME= ${PORTNAME}${PORTVERSION:S/.a./a/}-src
MAINTAINER= martin@matuska.org
COMMENT= Graphical toolkit for TCL
USE_TCL= 85
USE_TCL_BUILD= 85
LATEST_LINK?= tk85
USE_XLIB= yes
USE_LDCONFIG= yes
@ -27,44 +24,40 @@ WRKSRC= ${WRKDIR}/${PORTNAME}${PORTVERSION:S/.a./a/}/unix
GNU_CONFIGURE= yes
TK_VER= 8.5
SHORT_TK_VER= 85
CONFIGURE_ARGS= --enable-shared --with-tcl=${LOCALBASE}/lib/tcl${TK_VER} \
--includedir=${PREFIX}/include/tk${TK_VER}
CONFIGURE_ARGS= --enable-shared --includedir=${PREFIX}/include/tk${TK_VER}
CONFIGURE_ENV= PORTSDIR=${PORTSDIR} TK_LIB_FILE=libtk${SHORT_TK_VER}.so.1
MAKE_ENV= SHORT_TK_VER=${SHORT_TK_VER}
PLIST_SUB= TK_VER=${TK_VER} SHORT_TK_VER=${SHORT_TK_VER}
PKGINSTALL= ${PKGDIR}/pkg-install.wish
PKGDEINSTALL= ${PKGDIR}/pkg-deinstall.wish
NOPRECIOUSMAKEVARS= yes # Otherwise 'make readmes' is broken
MANCOMPRESSED= no
DATADIR= ${PREFIX}/share/${PORTNAME}${TK_VER}
SUB_FILES= pkgIndex.tcl
.if !defined(BUILDING_TK_THREADS)
USE_TCL= ${SHORT_TK_VER}
USE_TCL_BUILD= ${SHORT_TK_VER}
OPTIONS= TK85_MAN "Install tk 8.5 manpages" off \
WISH_WRAPPER "Require wish wrapper from ports" off
.else
USE_TK= ${SHORT_TK_VER}
PLIST= ${PKGDIR}/pkg-plist.threads
THREADS_SUFFIX= -threads
LIB_DEPENDS= tcl${SHORT_TK_VER}${THREADS_SUFFIX}:${PORTSDIR}/lang/tcl${SHORT_TK_VER}-thread
.endif
SUB_LIST+= THREADS_SUFFIX="${THREADS_SUFFIX}"
.include <bsd.port.pre.mk>
.if exists(${TCLSH})
_TCL_IS_THREADED!= ${ECHO_CMD} 'puts [array names tcl_platform -exact threaded]' | ${TCLSH} || return 0
. if !defined(TCL_WITH_THREADS) && !defined(WITH_THREADS) && !empty(_TCL_IS_THREADED)
TCL_WITH_THREADS= yes
. endif
.endif
.if defined(TCL_WITH_THREADS) || defined(WITH_THREADS)
. if defined(_TCL_IS_THREADED) && empty(_TCL_IS_THREADED)
IGNORE= tcl with threads is required. Please install tcl with WITH_THREADS defined or from lang/tcl${USE_TCL} port and try again
. endif
CONFIGURE_ARGS+= --enable-threads
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}" PTHREAD_CFLAGS="${PTHREAD_CFLAGS}"
THREADS_SUFFIX= -threads
USE_TCL= 85-thread
USE_TCL_BUILD= 85-thread
CONFLICTS= tk-8.5*
.include "${PORTSDIR}/Mk/bsd.tcl.mk"
.if defined(BUILDING_TK_THREADS)
CONFIGURE_ARGS+= --enable-threads --with-tcl=${LOCALBASE}/lib/tcl${TK_VER}${THREADS_SUFFIX}
CONFIGURE_ENV+= PTHREAD_LIBS="${PTHREAD_LIBS}" PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
ac_cv_path_tclsh="${LOCALBASE}/bin/tclsh${TK_VER}${THREADS_SUFFIX}"
LATEST_LINK= tk85${THREADS_SUFFIX}
.else
CONFIGURE_ARGS+= --disable-threads
CONFLICTS= tk-threads-8.5*
.endif
CONFIGURE_ARGS+= --disable-threads --with-tcl=${LOCALBASE}/lib/tcl${TK_VER} \
ac_cv_path_tclsh="${TCLSH}"
.if defined(WITH_WISH_WRAPPER)
RUN_DEPENDS+= wish:${PORTSDIR}/lang/tcl-tk-wrapper
@ -389,23 +382,47 @@ MLINKS= 3DBorder.3 Tk_Alloc3DBorderFromObj.3 \
.endif
.endif # defined(BUILDING_TK_THREADS)
TKBASE?= ${PORTSDIR}/${PKGCATEGORY}/${LATEST_LINK}
pre-everything::
@if ${TEST} -e "${NONEXISTENT}"; then ${ECHO_MSG} "=== Aborted, please remove ${NONEXISTENT}"; exit 1; fi
pre-configure:
post-patch:
@${REINPLACE_CMD} -e 's|@TK_SHARED_BUILD@|#@TK_SHARED_BUILD@|g' ${WRKSRC}/Makefile.in
.if defined(BUILDING_TK_THREADS)
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' \
-e 's|$${TCL_TRIM_DOTS}|$${TCL_TRIM_DOTS}${THREADS_SUFFIX}|g' \
-e 's|-ltk$${TK_VERSION}|-ltk$${TK_VERSION}${THREADS_SUFFIX}|g' \
-e 's/-ltk`echo $${TK_VERSION} | tr -d .`/-ltk`echo $${TK_VERSION} | tr -d .`${THREADS_SUFFIX}/g' \
-e 's|-ltkstub$${TK_VERSION}|-ltkstub$${TK_VERSION}${THREADS_SUFFIX}|g' \
-e 's/-ltkstub`echo $${TK_VERSION} | tr -d .`/-ltkstub`echo $${TK_VERSION} | tr -d .`${THREADS_SUFFIX}/g' \
${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|libtk$${SHORT_TK_VER}|libtk$${SHORT_TK_VER}${THREADS_SUFFIX}|g' \
-e 's|$$(BIN_INSTALL_DIR)/wish$$(VERSION)|$$(BIN_INSTALL_DIR)/wish$$(VERSION)${THREADS_SUFFIX}|g' \
-e 's|tk$$(VERSION)/tkConfig.sh|tk$$(VERSION)/tkConfig${THREADS_SUFFIX}.sh|g' \
-e 's|$$(LIB_INSTALL_DIR)$$(TK_PKG_DIR)|${WRKDIR}|g' \
-e 's|$$(MINOR_VERSION)$$(TCLPATCHL)|$$(MINOR_VERSION)$$(TCLPATCHL)${THREADS_SUFFIX}|g' \
${WRKSRC}/Makefile.in
.endif
post-configure:
${REINPLACE_CMD} \
-e 's|${WRKDIRPREFIX}${.CURDIR}|$${WRKDIRPREFIX}${TKBASE}|' \
${WRKSRC}/tkConfig.sh
.if defined(BUILDING_TK_THREADS)
do-install:
@cd ${WRKSRC} && ${MAKE_ENV} ${MAKE} -f Makefile install-binaries
@${MKDIR} ${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}
@${LN} -s ${PREFIX}/lib/tk${TK_VER}/tkConfig${THREADS_SUFFIX}.sh \
${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}/tkConfig.sh
.endif
post-install:
${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/tk${TK_VER}/
.if !defined(NO_INSTALL_MANPAGES) && defined(WITH_TK85_MAN)
${INSTALL_DATA} ${WRKDIR}/pkgIndex.tcl ${PREFIX}/lib/tk${TK_VER}${THREADS_SUFFIX}/
.if !defined(BUILDING_TK_THREADS) && !defined(NO_INSTALL_MANPAGES) && defined(WITH_TK85_MAN)
${MKDIR} ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/../doc/man.macros ${DATADIR}
. for mp in ${MAN1} ${MAN3} ${MANN}

View File

@ -1,3 +0,0 @@
# Tcl package index file, version 1.0
package ifneeded Tk 8.5 [list load "[file join [file dirname $dir] libtk85.so.1]" Tk]

View File

@ -0,0 +1,3 @@
# Tcl package index file, version 1.0
package ifneeded Tk%%THREADS_SUFFIX%% 8.5 [list load "[file join [file dirname $dir] libtk85%%THREADS_SUFFIX%%.so.1]" Tk]

View File

@ -0,0 +1,9 @@
bin/wish%%TK_VER%%-threads
lib/libtk%%SHORT_TK_VER%%-threads.a
lib/libtk%%SHORT_TK_VER%%-threads.so
lib/libtk%%SHORT_TK_VER%%-threads.so.1
lib/libtkstub%%SHORT_TK_VER%%-threads.a
lib/tk%%TK_VER%%/tkConfig-threads.sh
lib/tk%%TK_VER%%-threads/tkConfig.sh
lib/tk%%TK_VER%%-threads/pkgIndex.tcl
@dirrm lib/tk%%TK_VER%%-threads