tech-pkg archive

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

chat/tkirc2: Fix broken substitution



The SUBST for the hardcoded wish version fails to run at pre-configure because of NO_CONFIGURE=yes.
This simple patch addresses that:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/chat/tkirc2/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile    26 Jan 2020 17:30:49 -0000      1.17
+++ Makefile    5 Dec 2024 04:55:41 -0000
@@ -14,7 +14,6 @@
 DEPENDS+=      tk>=8.3.2:../../x11/tk
 
 WRKSRC=                ${WRKDIR}/tkirc2
-NO_CONFIGURE=  yes
 NO_BUILD=      yes
 
 SUBST_CLASSES+=                paths
--------------------------------------------------------------8<---------------------------------------------------------

However, this leaves the shebang line like this:
#! /bin/sh
# \
exec wish "$0" "$@"

We could change it to directly invoke ${WISH} with this patch instead:

chat/tkirc2$ cvs diff -u Makefile 
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/chat/tkirc2/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile    26 Jan 2020 17:30:49 -0000      1.17
+++ Makefile    5 Dec 2024 05:09:33 -0000
@@ -14,14 +14,14 @@
 DEPENDS+=      tk>=8.3.2:../../x11/tk
 
 WRKSRC=                ${WRKDIR}/tkirc2
-NO_CONFIGURE=  yes
 NO_BUILD=      yes
+USE_TOOLS+=    wish:run
 
-SUBST_CLASSES+=                paths
-SUBST_MESSAGE.paths=   Fixing hardcoded command names.
-SUBST_STAGE.paths=     pre-configure
-SUBST_FILES.paths=     tkirc2
-SUBST_SED.paths=       -e 's,wish8.3,wish,g'
+SUBST_CLASSES+=                shebang
+SUBST_MESSAGE.shebang= Fixing script shebang to directly invoke wish.
+SUBST_STAGE.shebang=   pre-configure
+SUBST_FILES.shebang=   tkirc2
+SUBST_SED.shebang=     -e 's,/bin/sh,${WISH},g' -e 2,3d
 
 INSTALLATION_DIRS=     bin


Home | Main Index | Thread Index | Old Index