perl: version modules and non-base packages
authorPhilip Prindeville <philipp@redfish-solutions.com>
Tue, 7 Aug 2018 22:00:19 +0000 (16:00 -0600)
committerPhilip Prindeville <philipp@redfish-solutions.com>
Tue, 14 Aug 2018 19:28:53 +0000 (13:28 -0600)
Currently external modules and non-base packages are numbered
from their own internal number space, and even though the Perl
ABI number is embedded into them this isn't externally visible.

For example, perl-html-parser-3.72.1 could be built for ABI
5.26 or for 5.28, we can't easily tell.  This changes all of
that by embedding the ABI number into the filename.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
(cherry picked from commit 0d9584724ff1c011f587540c2d25be8a90a81413)

lang/perl/Makefile
lang/perl/perlmod.mk
lang/perl/perlver.mk [new file with mode: 0644]

index 60c304691b978241eee2452fe296092d226a0198..86a4351ac3c06d26f548cd6f600f1c2ecd1c8f2a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2018 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,8 +7,10 @@
 
 include $(TOPDIR)/rules.mk
 
+include perlver.mk
+
 PKG_NAME:=perl
-PKG_VERSION:=5.28.0
+PKG_VERSION:=$(PERL_VERSION)
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=\
index 48adea666f12a58189d1e68d9c792f9a958c96db..d00a8c42ecf4c50b03a4906500139a19b98ab554 100644 (file)
@@ -1,7 +1,13 @@
 # This makefile simplifies perl module builds.
 #
 
-PERL_VERSION:=5.28
+include ../perl/perlver.mk
+
+ifneq ($(PKG_NAME),perl)
+  PKG_VERSION:=$(PKG_VERSION)+perl$(PERL_VERSION2)
+endif
+
+PERL_VERSION:=$(PERL_VERSION2)
 
 # Build environment
 HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
@@ -9,7 +15,7 @@ ifneq ($(CONFIG_USE_GLIBC),)
        EXTRA_LIBS:=bsd
        EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
 endif
-PERL_CMD:=$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION).0
+PERL_CMD:=$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION3)
 
 MOD_CFLAGS_PERL:=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
 ifdef CONFIG_PERL_THREADS
diff --git a/lang/perl/perlver.mk b/lang/perl/perlver.mk
new file mode 100644 (file)
index 0000000..b23e68a
--- /dev/null
@@ -0,0 +1,10 @@
+PERL_VERSION:=5.28.0
+
+PERL_EXPLODE:=$(subst ., ,$(PERL_VERSION))
+
+PERL_MAJOR:=$(word 1,$(PERL_EXPLODE))
+PERL_MINOR:=$(word 2,$(PERL_EXPLODE))
+PERL_REL:=$(word 3,$(PERL_EXPLODE))
+
+PERL_VERSION3:=$(PERL_VERSION)
+PERL_VERSION2:=$(PERL_MAJOR).$(PERL_MINOR)