perl-inline-c: New package
authorMarcel Denia <naoir@gmx.net>
Sat, 12 Sep 2015 12:20:29 +0000 (14:20 +0200)
committerMarcel Denia <naoir@gmx.net>
Mon, 14 Sep 2015 13:33:18 +0000 (15:33 +0200)
Signed-off-by: Marcel Denia <naoir@gmx.net>
lang/perl-inline-c/Makefile [new file with mode: 0644]
lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch [new file with mode: 0644]
lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch [new file with mode: 0644]

diff --git a/lang/perl-inline-c/Makefile b/lang/perl-inline-c/Makefile
new file mode 100644 (file)
index 0000000..52826d2
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=perl-inline-c
+PKG_VERSION:=0.76
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://www.cpan.org/authors/id/I/IN/INGY
+PKG_SOURCE:=Inline-C-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=c0fbfdd058075c9271a1384c822c9a87
+
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/Inline-C-$(PKG_VERSION)
+HOST_BUILD_DEPENDS:=perl/host perl-inline/host perl-parse-recdescent/host perl-file-sharedir-install/host
+PKG_BUILD_DIR:=$(BUILD_DIR)/perl/Inline-C-$(PKG_VERSION)
+PKG_BUILD_DEPENDS:=perl-inline/host perl-parse-recdescent/host perl-file-sharedir-install/host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+include ../perl/perlmod.mk
+
+define Package/perl-inline-c
+  SUBMENU:=Perl
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=C Language Support for Inline
+  URL:=http://search.cpan.org/dist/Inline-C/
+  DEPENDS:=perl +perl-inline +perl-parse-recdescent +perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-if
+endef
+
+define Host/Configure
+        $(call perlmod/host/Configure,,,)
+endef
+
+define Host/Compile
+        $(call perlmod/host/Compile,,)
+endef
+
+define Host/Install
+        $(call perlmod/host/Install,$(1),)
+endef
+
+define Build/Configure
+        $(call perlmod/Configure,,)
+endef
+
+define Build/Compile
+        $(call perlmod/Compile,,)
+endef
+
+define Package/perl-inline-c/install
+        $(call perlmod/Install,$(1),Inline auto/Inline)
+endef
+
+
+$(eval $(call BuildPackage,perl-inline-c))
+$(eval $(call HostBuild))
diff --git a/lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch b/lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch
new file mode 100644 (file)
index 0000000..dcfe2bb
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/Inline/C.pm
++++ b/lib/Inline/C.pm
+@@ -361,7 +361,7 @@ sub build {
+     $o->call('write_XS', 'Build Glue 1');
+     $o->call('write_Inline_headers', 'Build Glue 2');
+     $o->call('write_Makefile_PL', 'Build Glue 3');
+-    $o->call('compile', 'Build Compile');
++    $o->call('compile', 'Build Compile') unless $ENV{'_INLINE_C_NO_COMPILE_'};
+     if (IS_WIN32) {
+         $lockfh->release or die "releasemutex $file: $^E";
+     }
diff --git a/lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch b/lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch
new file mode 100644 (file)
index 0000000..b2ae09e
--- /dev/null
@@ -0,0 +1,46 @@
+--- a/lib/Inline/C.pm
++++ b/lib/Inline/C.pm
+@@ -438,22 +438,28 @@ sub get_maps {
+     print STDERR "get_maps Stage\n" if $o->{CONFIG}{BUILD_NOISY};
+     my $typemap = '';
+     my $file;
+-    $file = File::Spec->catfile(
+-        $Config::Config{installprivlib},
+-        "ExtUtils",
+-        "typemap",
+-    );
+-    $typemap = $file if -f $file;
+-    $file = File::Spec->catfile(
+-        $Config::Config{privlibexp}
+-        ,"ExtUtils","typemap"
+-    );
+-    $typemap = $file
+-        if (not $typemap and -f $file);
+-    warn "Can't find the default system typemap file"
+-        if (not $typemap and $^W);
++    
++    unless ($ENV{'_INLINE_C_SYSTEM_TYPEMAP_'}) {
++        $file = File::Spec->catfile(
++            $Config::Config{installprivlib},
++            "ExtUtils",
++            "typemap",
++        );
++        $typemap = $file if -f $file;
++        $file = File::Spec->catfile(
++            $Config::Config{privlibexp}
++            ,"ExtUtils","typemap"
++        );
++        $typemap = $file
++            if (not $typemap and -f $file);
++        warn "Can't find the default system typemap file"
++            if (not $typemap and $^W);
+-    unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $typemap) if $typemap;
++        unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $typemap) if $typemap;
++    }
++    else {
++        unshift(@{$o->{ILSM}{MAKEFILE}{TYPEMAPS}}, $ENV{'_INLINE_C_SYSTEM_TYPEMAP_'});
++    }
+     if (not $o->UNTAINT) {
+         require FindBin;