On Fri, Dec 22, 2017 at 04:29:47PM -0800, Matthew Clarke wrote:
> Hi.
> 
> The textproc/filepp port has no maintainer, and the current filepp package
> installs a filepp script that won't run due to the following error:
> 
>       Global symbol "$DESTDIR" requires explicit package name (did you forget 
> to declare "my $DESTDIR"?) at /usr/local/bin/filepp line 43.
>       Execution of /usr/local/bin/filepp aborted due to compilation errors.
> 
> Line 43 of /usr/local/bin/filepp reads:
> 
>       push(@INC, "${DESTDIR}/usr/local/share/filepp/modules");
> 
> I've used filepp successfully on OpenBSD before, but not for a couple of
> years or so.  Reviewing the port history, I see that revision 1.6 (October
> 2015) of textproc/filepp/Makefile removed the following code:
> 
>       post-configure:
>              @perl -pi -e 's,\$${DESTDIR},,g;' ${WRKSRC}/filepp
> 
> Reverting that change makes filepp work again, but introduces the
> following warning into the "configure" phase of the build:
> 
>       Unescaped left brace in regex is deprecated, passed through in regex; 
> marked by <-- HERE in m/\${ <-- HERE DESTDIR}/ at -e line 1.
> 
> Switching from perl to sed is one way to avoid the warning.  Would a ports
> committer please review the following diff, and commit it if it's OK?


Hmm technically the filepp script isn't right since its buildsystem
replaces @moduledir@ by what ends up in moduledir, defaulting to
$prefix/share/filepp/modules, and $prefix is assigned ${DESTDIR} by the
openbsd build system.
-----
The moduledir is also set in the filepp script.  If you do not run
configure for whatever reason you should also change @moduledir@ on
line 40 to the directory you intend to install the modules in (or
delete the whole line if you are not using modules).
-----
There should be some TRUEPREFIX here..

so i think the following is "more correct" in case TRUEPREFIX changes
someday:

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/filepp/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- Makefile    15 Nov 2017 21:28:05 -0000      1.8
+++ Makefile    23 Dec 2017 09:02:57 -0000
@@ -3,7 +3,7 @@
 COMMENT =      cpp-like generic file pre-processor
 
 DISTNAME =     filepp-1.8.0
-REVISION =     2
+REVISION =     3
 CATEGORIES =   textproc devel
 MASTER_SITES = http://www-users.york.ac.uk/~dm26/filepp/
 
@@ -16,5 +16,8 @@
 NO_BUILD =             Yes
 PKG_ARCH =             *
 TEST_TARGET =  fulltest
+
+post-configure:
+       sed -i 's,$${DESTDIR}${TRUEPREFIX},${TRUEPREFIX},g' ${WRKSRC}/filepp

Reply via email to