perlmod: avoid 'do' semantics and just concatenate 5504/head
authorPhilip Prindeville <philipp@redfish-solutions.com>
Fri, 26 Jan 2018 01:34:32 +0000 (18:34 -0700)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Fri, 26 Jan 2018 01:48:34 +0000 (18:48 -0700)
In Perl the 'do' construct has some odd side-effects regarding $@,
$!, and return values (i.e. 'do'ing a file which evaluates to undef
can be a little ambiguous).

Instead, generate a preamble to the Makefile.PL and execute it as
stdin.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
lang/perl/Makefile
lang/perl/perlmod.mk

index 5e20f6cb3693ee4ba2cf3142d85e41966e3771a8..b6111aad4e8e64452953274c01f3072fbe31410b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
 PKG_VERSION:=5.26.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=\
                https://cpan.metacpan.org/src/5.0 \
index 7adf16b1b3f3518ff7d17d53ed99463cdd7c0b80..551d4532b19891aa4aa163ee068bcbeac7ae7af6 100644 (file)
@@ -55,9 +55,10 @@ endef
 
 define perlmod/Configure
        (cd $(if $(3),$(3),$(PKG_BUILD_DIR)); \
-       PERL_MM_USE_DEFAULT=1 \
-       $(2) \
-       $(PERL_CMD) -MConfig -e '$$$${tied %Config::Config}{cpprun}="$(GNU_TARGET_NAME)-cpp -E"; do "./Makefile.PL"' \
+        (echo -e 'use Config;\n\n$$$${tied %Config::Config}{cpprun}="$(GNU_TARGET_NAME)-cpp -E";\n' ; cat Makefile.PL) | \
+        PERL_MM_USE_DEFAULT=1 \
+        $(2) \
+        $(PERL_CMD) -I. -- - \
                $(1) \
                AR=ar \
                CC=$(GNU_TARGET_NAME)-gcc \
@@ -103,8 +104,8 @@ define perlmod/Configure
                INSTALLVENDORMAN3DIR=" " \
                LINKTYPE=dynamic \
                DESTDIR=$(PKG_INSTALL_DIR) \
-       );
-       sed 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/!' -i $(if $(3),$(3),$(PKG_BUILD_DIR))/Makefile
+       )
+       sed -i -e 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/!' $(if $(3),$(3),$(PKG_BUILD_DIR))/Makefile
 endef
 
 define perlmod/Compile