shells/ksh*: Allow the ksh ports to coexist

Add an option to allow the ksh ports to avoid conflicting with each
other and to coexist. This allows people who wish to punish themselves
by tracking developent to still be able to fall back should upstream
cause regressions.

This also allows legacy ksh93 to coexist with the recently added
ksh93/ksh, which is not entirely compatible with legacy ksh. Applications
which require a legacy ksh compatible package should use the ksh93 port
installed using one of its options. This allows new and old to exist on
the same system.
This commit is contained in:
Cy Schubert 2022-08-28 13:12:47 -07:00
parent 039bde8216
commit 6e9237ba47
6 changed files with 40 additions and 30 deletions

View file

@ -36,13 +36,15 @@ GH_TAGNAME= ${HASH}
# $PATH.
KSH_CONFLICTS= pdksh
KSH93_CONFLICTS= ksh2020 ksh93 ast-ksh
KSH93D_CONFLICTS= ksh2020 ksh93 ast-ksh
OPTIONS_DEFAULT= KSH93 EXAMPLES
OPTIONS_DEFINE= EXAMPLES STATIC
OPTIONS_SINGLE= BIN_KSH
OPTIONS_SINGLE_BIN_KSH= KSH KSH93
OPTIONS_SINGLE_BIN_KSH= KSH KSH93 KSH93D
KSH_DESC= Install to ${PREFIX}/bin/ksh
KSH93_DESC= Install to ${PREFIX}/bin/ksh93
KSH93D_DESC= Install to ${PREFIX}/bin/ksh93d (development)
CFLAGS+= -DMAP_TYPE
LDFLAGS+= -lm
@ -52,13 +54,14 @@ STATIC_MAKE_ENV= LDFLAGS+=-static
KSH_PLIST_SUB= 93=""
KSH93_PLIST_SUB= 93="93"
KSH93D_PLIST_SUB= 93="93d"
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MKSH93}
PNAME= ksh93
.else
PNAME= ksh
.if ${PORT_OPTIONS:MKSH93D}
PSUFFIX= 93d
.elif ${PORT_OPTIONS:MKSH93}
PSUFFIX= 93
.endif
post-patch:
@ -68,10 +71,10 @@ do-build:
@cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/${PNAME}
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${PNAME}.1
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}/
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/ksh${PSUFFIX}
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/ksh${PSUFFIX}.1
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
do-test:
cd ${WRKSRC}/src/cmd/ksh93/tests/ && ${SETENV} SHELL=${WRKSRC}/bin/ksh ${WRKSRC}/bin/ksh shtests

View file

@ -1,6 +1,6 @@
@shell bin/ksh%%93%%
man/man1/ksh%%93%%.1.gz
share/examples/ksh/dirs
share/examples/ksh/popd
share/examples/ksh/pushd
share/examples/ksh%%93%%/dirs
share/examples/ksh%%93%%/popd
share/examples/ksh%%93%%/pushd

View file

@ -39,6 +39,7 @@ OPTIONS_SINGLE= BIN_KSH
OPTIONS_SINGLE_BIN_KSH= KSH KSH93
KSH_DESC= Install to ${PREFIX}/bin/ksh
KSH93_DESC= Install to ${PREFIX}/bin/ksh93
KSH93N_DESC= Install to ${PREFIX}/bin/ksh93n (new)
CFLAGS+= -DMAP_TYPE
LDFLAGS+= -lm
@ -48,13 +49,14 @@ STATIC_MAKE_ENV= LDFLAGS+=-static
KSH_PLIST_SUB= 93=""
KSH93_PLIST_SUB= 93="93"
KSH93N_PLIST_SUB= 93="93n"
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MKSH93}
PNAME= ksh93
.else
PNAME= ksh
.if ${PORT_OPTIONS:MKSH93N}
PSUFFIX= 93n
.elif ${PORT_OPTIONS:MKSH93}
PSUFFIX= 93
.endif
post-patch:
@ -64,10 +66,10 @@ do-build:
@cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/${PNAME}
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${PNAME}.1
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}/
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/ksh${PSUFFIX}
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/ksh${PSUFFIX}.1
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
do-test:
cd ${WRKSRC}/src/cmd/ksh93/tests/ && ${SETENV} SHELL=${WRKSRC}/bin/ksh ${WRKSRC}/bin/ksh shtests

View file

@ -1,6 +1,6 @@
@shell bin/ksh%%93%%
man/man1/ksh%%93%%.1.gz
share/examples/ksh/dirs
share/examples/ksh/popd
share/examples/ksh/pushd
share/examples/ksh%%93%%/dirs
share/examples/ksh%%93%%/popd
share/examples/ksh%%93%%/pushd

View file

@ -39,9 +39,10 @@ KSH93_CONFLICTS= ksh2020 ksh93-devel ast-ksh
OPTIONS_DEFAULT= KSH93 EXAMPLES
OPTIONS_DEFINE= EXAMPLES STATIC
OPTIONS_SINGLE= BIN_KSH
OPTIONS_SINGLE_BIN_KSH= KSH KSH93
OPTIONS_SINGLE_BIN_KSH= KSH KSH93 KSH93L
KSH_DESC= Install to ${PREFIX}/bin/ksh
KSH93_DESC= Install to ${PREFIX}/bin/ksh93
KSH93L_DESC= Install to ${PREFIX}/bin/ksh93l (legacy)
CFLAGS+= -DMAP_TYPE
LDFLAGS+= -lm
@ -51,6 +52,7 @@ STATIC_MAKE_ENV= LDFLAGS+=-static
KSH_PLIST_SUB= 93=""
KSH93_PLIST_SUB= 93="93"
KSH93L_PLIST_SUB= 93="93l"
.include <bsd.port.pre.mk>
@ -58,7 +60,10 @@ KSH93_PLIST_SUB= 93="93"
BROKEN= GCC 9.1 changes the output of `gcc -E` which breaks the conf.sh script, fixed in shells/ksh93-devel
.endif
.if ${PORT_OPTIONS:MKSH93}
.if ${PORT_OPTIONS:MKSH93L}
PNAME= ksh93l
PSUFFIX= l
.elif ${PORT_OPTIONS:MKSH93}
PNAME= ksh93
.else
PNAME= ksh
@ -73,8 +78,8 @@ do-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/${PNAME}
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${PNAME}.1
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}/
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}${PSUFFIX}/
do-test:
cd ${WRKSRC}/src/cmd/ksh93/tests/ && ${SETENV} SHELL=${WRKSRC}/bin/ksh ${WRKSRC}/bin/ksh shtests

View file

@ -1,6 +1,6 @@
@shell bin/ksh%%93%%
man/man1/ksh%%93%%.1.gz
share/examples/ksh93/dirs
share/examples/ksh93/popd
share/examples/ksh93/pushd
share/examples/ksh%%93%%/dirs
share/examples/ksh%%93%%/popd
share/examples/ksh%%93%%/pushd