pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/shells {,standalone-,static-}tcsh: Add build options f...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bb50b3c85c11
branches:  trunk
changeset: 769444:bb50b3c85c11
user:      kim <kim%pkgsrc.org@localhost>
date:      Mon Nov 15 17:11:57 2021 +0000

description:
{,standalone-,static-}tcsh: Add build options for nls and static. Cleanup.

For tcsh and defaults for other variants, unless otherwise noted:
- Option nls enables building of NLS catalogs. Enabled by default.
- Option static enables static linking. Disabled by default.

For standalone-tcsh:
- Option static is enabled by default, except on SunOS.
- Fix building of NLS catalogs, which possibly worked at some point
  in time given the existence of the NLSDIR variable in Makefile.
- Use PLIST from tcsh, with some awk to transform the entries.
- Use DESCR from tcsh as base, with an additional local DESCR. Adjust the
  local DESCR to not say that the package is static, as that is controlled
  by an option now (and never was true for all platforms).
- Remove unnecessary DISTINFO_FILE, INSTALLATION_DIRS, and WRKSRC.

For static-tcsh:
- Option static is not available: the package is always built like tcsh
  with the static option enabled.
- Remove unnecessary DISTINFO_FILE.

diffstat:

 shells/standalone-tcsh/DESCR              |   5 +----
 shells/standalone-tcsh/Makefile           |  28 ++++++++++++++--------------
 shells/standalone-tcsh/PLIST              |   5 -----
 shells/standalone-tcsh/plist-examples.awk |   3 +++
 shells/standalone-tcsh/plist-nls.awk      |   3 +++
 shells/static-tcsh/Makefile               |  16 +++++-----------
 shells/tcsh/Makefile                      |   4 ++--
 shells/tcsh/Makefile.common               |  17 ++++++++++-------
 shells/tcsh/PLIST                         |  26 +++++++++++++-------------
 shells/tcsh/options.mk                    |  31 +++++++++++++++++++++++++++++++
 10 files changed, 82 insertions(+), 56 deletions(-)

diffs (247 lines):

diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/standalone-tcsh/DESCR
--- a/shells/standalone-tcsh/DESCR      Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/standalone-tcsh/DESCR      Mon Nov 15 17:11:57 2021 +0000
@@ -1,5 +1,2 @@
-TCSH is an extended C-shell with many useful features like
-filename completion, history editing, etc.
 
-This version installs a statically-linked version of tcsh into
-/bin, for use as a standalone shell.
+This version installs tcsh into /bin, for use as a standalone shell.
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/standalone-tcsh/Makefile
--- a/shells/standalone-tcsh/Makefile   Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/standalone-tcsh/Makefile   Mon Nov 15 17:11:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2021/11/14 22:36:12 kim Exp $
+# $NetBSD: Makefile,v 1.35 2021/11/15 17:11:57 kim Exp $
 #
 
 # FIXME: This is because of PREFIX=/ below.
@@ -6,10 +6,11 @@
 NOT_FOR_UNPRIVILEGED=  yes
 
 PKGNAME=               standalone-${DISTNAME}
-PKGREVISION=           1
+PKGREVISION=           2
 
-WRKSRC=                        ${WRKDIR}/${DISTNAME}
 PATCHDIR=              ${.CURDIR}/../../shells/tcsh/patches
+PKGDIR=                        ${.CURDIR}/../../shells/tcsh
+DESCR_SRC=             ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR
 
 # This package only makes sense on platforms that don't themselves ship tcsh
 # in /bin. Otherwise it clobbers the native copy, which really isn't what
@@ -25,24 +26,23 @@
 .include "../../shells/tcsh/Makefile.common"
 .include "../../mk/bsd.pkg.mk"
 
-INSTALLATION_DIRS+=    usr/share/man/man1
-
 COMMENT:=              Standalone version of the Extended C-shell
 MAINTAINER=            agc%NetBSD.org@localhost
 
 # FIXME: Packages shall only install into ${LOCALBASE} or a subdirectory.
 PREFIX=                        /
-EGDIR=                 /usr/share/examples/tcsh
+PKGMANDIR=             usr/share/man
+EGDIR=                 usr/share/examples/tcsh
+NLSDIR=                        usr/share/nls
 NOT_FOR_BULK_PLATFORM= *-*-*
 
-NLSDIR=                        usr/share/nls
 CONFIGURE_ARGS+=       --prefix=${PREFIX:Q}
-CONFIGURE_ARGS+=       --bindir=/bin
-CONFIGURE_ARGS+=       --mandir=/usr/share/man
-CONFIGURE_ARGS+=       --disable-nls-catalogs
+CONFIGURE_ARGS+=       --bindir=${PREFIX:S/\/$//:Q}/bin
+CONFIGURE_ARGS+=       --localedir=${PREFIX:S/\/$//:Q}/${NLSDIR}
+CONFIGURE_ARGS+=       --mandir=${PREFIX:S/\/$//:Q}/${PKGMANDIR}
 
-DISTINFO_FILE=         ${.CURDIR}/../../shells/tcsh/distinfo
+PLIST_AWK+=            -f ${.CURDIR}/plist-examples.awk
+PLIST_AWK_ENV+=                EGDIR=${EGDIR}
 
-.if ${OPSYS} != "SunOS"
-LDFLAGS+=              -static
-.endif
+PLIST_AWK+=            -f ${.CURDIR}/plist-nls.awk
+PLIST_AWK_ENV+=                NLSDIR=${NLSDIR}
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/standalone-tcsh/PLIST
--- a/shells/standalone-tcsh/PLIST      Mon Nov 15 17:03:08 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-@comment $NetBSD: PLIST,v 1.5 2021/11/14 22:36:12 kim Exp $
-bin/tcsh
-usr/share/examples/tcsh/complete.tcsh
-usr/share/examples/tcsh/csh-mode.el
-usr/share/man/man1/tcsh.1
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/standalone-tcsh/plist-examples.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/standalone-tcsh/plist-examples.awk Mon Nov 15 17:11:57 2021 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: plist-examples.awk,v 1.1 2021/11/15 17:11:57 kim Exp $
+BEGIN { EGDIR = getenv_or_die("EGDIR") }
+{ sub(/^share\/examples\/tcsh\//, EGDIR "/") }
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/standalone-tcsh/plist-nls.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/standalone-tcsh/plist-nls.awk      Mon Nov 15 17:11:57 2021 +0000
@@ -0,0 +1,3 @@
+# $NetBSD: plist-nls.awk,v 1.1 2021/11/15 17:11:57 kim Exp $
+BEGIN { NLSDIR = getenv_or_die("NLSDIR") }
+{ sub(/^share\/locale\//, NLSDIR "/") }
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/static-tcsh/Makefile
--- a/shells/static-tcsh/Makefile       Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/static-tcsh/Makefile       Mon Nov 15 17:11:57 2021 +0000
@@ -1,25 +1,19 @@
-# $NetBSD: Makefile,v 1.13 2021/11/14 22:15:13 kim Exp $
+# $NetBSD: Makefile,v 1.14 2021/11/15 17:11:58 kim Exp $
 #
 
+PKGNAME=               static-${DISTNAME}
+PKGREVISION=           2
+
 .include "../../shells/tcsh/Makefile.common"
 
 MAINTAINER=            agc%NetBSD.org@localhost
 
-DISTINFO_FILE=         ${.CURDIR}/../../shells/tcsh/distinfo
 PATCHDIR=              ${.CURDIR}/../../shells/tcsh/patches
 PKGDIR=                        ${.CURDIR}/../../shells/tcsh
 DESCR_SRC=             ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR
 
 CONFLICTS=             tcsh-[0-9]*
 
-PKGNAME=               static-${DISTNAME}
-PKGREVISION=           1
-
-# SunOS 5.10 stopped shipping static libraries.
-NOT_FOR_PLATFORM+=     SunOS-5.1[0-9]-*
-
-COMMENT:=              Statically-linked version of the ${COMMENT}
-
-LDFLAGS+=              -static
+COMMENT=               Statically-linked version of the Extended C-shell
 
 .include "../../mk/bsd.pkg.mk"
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/tcsh/Makefile
--- a/shells/tcsh/Makefile      Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/tcsh/Makefile      Mon Nov 15 17:11:57 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.101 2021/11/14 22:15:13 kim Exp $
+# $NetBSD: Makefile,v 1.102 2021/11/15 17:11:58 kim Exp $
 
 .include "../../shells/tcsh/Makefile.common"
 
-PKGREVISION=1
+PKGREVISION=   2
 
 .include "../../mk/bsd.pkg.mk"
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/tcsh/Makefile.common
--- a/shells/tcsh/Makefile.common       Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/tcsh/Makefile.common       Mon Nov 15 17:11:57 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.1 2021/11/11 22:47:55 kim Exp $
+# $NetBSD: Makefile.common,v 1.2 2021/11/15 17:11:58 kim Exp $
 #
 # used by shells/standalone-tcsh/Makefile
 # used by shells/static-tcsh/Makefile
@@ -19,9 +19,10 @@
 GNU_CONFIGURE= yes
 USE_TOOLS+=    autoconf:test perl:test
 
-EGDIR=         ${PREFIX}/share/examples/tcsh
+EGDIR=         share/examples/tcsh
 
 .include "../../mk/bsd.prefs.mk"
+.include "options.mk"
 
 .if ${OPSYS} == "SunOS"
 LOWER_OPSYS_VERSUFFIX= ${OS_VERSION:S/5./2./}
@@ -37,11 +38,13 @@
 
 PKG_SHELL=     bin/tcsh
 
-INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1
-
 post-install:
-       ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
-       ${INSTALL_DATA} ${WRKSRC}/complete.tcsh ${DESTDIR}${EGDIR}
-       ${INSTALL_DATA} ${WRKSRC}/csh-mode.el ${DESTDIR}${EGDIR}
+       ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
+       ${INSTALL_DATA} \
+               ${WRKSRC}/complete.tcsh \
+               ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
+       ${INSTALL_DATA} \
+               ${WRKSRC}/csh-mode.el \
+               ${DESTDIR}${PREFIX:S/\/$//:Q}/${EGDIR}
 
 .include "../../mk/termcap.buildlink3.mk"
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/tcsh/PLIST
--- a/shells/tcsh/PLIST Mon Nov 15 17:03:08 2021 +0000
+++ b/shells/tcsh/PLIST Mon Nov 15 17:11:57 2021 +0000
@@ -1,17 +1,17 @@
-@comment $NetBSD: PLIST,v 1.5 2015/05/22 08:03:43 kim Exp $
+@comment $NetBSD: PLIST,v 1.6 2021/11/15 17:11:58 kim Exp $
 bin/tcsh
 man/man1/tcsh.1
 share/examples/tcsh/complete.tcsh
 share/examples/tcsh/csh-mode.el
-share/locale/C/LC_MESSAGES/tcsh.cat
-share/locale/de/LC_MESSAGES/tcsh.cat
-share/locale/es/LC_MESSAGES/tcsh.cat
-share/locale/et/LC_MESSAGES/tcsh.cat
-share/locale/fi/LC_MESSAGES/tcsh.cat
-share/locale/fr/LC_MESSAGES/tcsh.cat
-share/locale/gr/LC_MESSAGES/tcsh.cat
-share/locale/it/LC_MESSAGES/tcsh.cat
-share/locale/ja/LC_MESSAGES/tcsh.cat
-share/locale/pl/LC_MESSAGES/tcsh.cat
-share/locale/ru/LC_MESSAGES/tcsh.cat
-share/locale/ru_UA/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/C/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/de/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/es/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/et/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/fi/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/fr/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/gr/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/it/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/ja/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/pl/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/ru/LC_MESSAGES/tcsh.cat
+${PLIST.nls}share/locale/ru_UA/LC_MESSAGES/tcsh.cat
diff -r 9a2b5ce7ee50 -r bb50b3c85c11 shells/tcsh/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/tcsh/options.mk    Mon Nov 15 17:11:57 2021 +0000
@@ -0,0 +1,31 @@
+# $NetBSD: options.mk,v 1.1 2021/11/15 17:11:58 kim Exp $
+
+PKG_OPTIONS_VAR?=      PKG_OPTIONS.tcsh
+
+PKG_SUPPORTED_OPTIONS= nls
+PKG_SUGGESTED_OPTIONS= nls
+.if empty(PKGNAME:Mstatic-tcsh-[0-9]*)
+PKG_SUPPORTED_OPTIONS+=        static
+. if !empty(PKGNAME:Mstandalone-tcsh-[0-9]*) && ${OPSYS} != "SunOS"
+PKG_SUGGESTED_OPTIONS+=        static
+. endif
+.endif
+
+PLIST_VARS+=           nls
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mnls)
+PLIST.nls=             yes
+.else
+CONFIGURE_ARGS+=       --disable-nls-catalogs
+.endif
+
+.if !empty(PKG_OPTIONS:Mstatic) || !empty(PKGNAME:Mstatic-tcsh-[0-9]*)
+LDFLAGS+=              -static
+
+# SunOS 5.10 stopped shipping static libraries.
+NOT_FOR_PLATFORM+=     SunOS-5.1[0-9]-*
+.endif
+
+PRINT_PLIST_AWK+=      {if ($$0 ~ /\.cat$$/) {$$0 = "$${PLIST.nls}" $$0;}}



Home | Main Index | Thread Index | Old Index