rtpengine: use perl/host when building 749/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Sat, 26 Feb 2022 17:02:31 +0000 (18:02 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sat, 26 Feb 2022 17:02:34 +0000 (18:02 +0100)
utils/const_str_hash is called by rtpengine build system. The Perl
script uses shebang "#!/usr/bin/perl" and depends on perl-IPC-Cmd. If
this is missing the build will fail:

../utils/const_str_hash < "control_ng.c" > "control_ng.strhash.c"
Can't locate IPC/Cmd.pm in @INC (you may need to install the IPC::Cmd module) (@INC contains: /usr/local/lib64/perl5/5.34 /usr/local/share/perl5/5.34 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ../utils/const_str_hash line 6.
BEGIN failed--compilation aborted at ../utils/const_str_hash line 6.
make[4]: *** [../lib/common.Makefile:46: control_ng.strhash.c] Error 2

OpenWrt does not depend on perl-IPC-Cmd being available, so this commit
makes rtpengine build depend on perl/host, which provides this Perl
module.

Closes #748

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/rtpengine/Makefile

index 2fa234303682d3c9cd6e1f54018f609dc49348c2..05586a96f986ae1700b415d32a2643deaa53645d 100644 (file)
@@ -29,7 +29,7 @@ PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
 # errors.
 PKG_BUILD_PARALLEL:=0
 
-PKG_BUILD_DEPENDS:=gperf/host
+PKG_BUILD_DEPENDS:=gperf/host perl/host
 
 # With below variable set, $(PKG_SYMVERS_DIR)/rtpengine.symvers gets generated
 # from kernel-module/Module.symvers.
@@ -242,7 +242,9 @@ ifeq ($(QUILT),)
        cd "$(PKG_BUILD_DIR)" && \
                $(FIND) . -maxdepth 2 -name "*Makefile" | \
                xargs  -I{} $(SED) \
-               '/shell which dpkg-/s/dpkg/OpenWrt-has-no-dpkg/' {}
+               '/shell which dpkg-/s/dpkg/OpenWrt-has-no-dpkg/' {} && \
+               $(SED) 's|#!/usr/bin/perl|#!$(STAGING_DIR_HOSTPKG)/usr/bin/perl|' \
+               utils/const_str_hash
 endif
 endef