From 13292808a38d708134474a0c86d740b1bd2825f6 Mon Sep 17 00:00:00 2001 From: Marcel Denia Date: Sat, 12 Sep 2015 14:20:29 +0200 Subject: [PATCH] perl-inline-c: New package Signed-off-by: Marcel Denia --- lang/perl-inline-c/Makefile | 65 +++++++++++++++++++ .../100-inline_c-no_compile_hack.patch | 11 ++++ ...ne_c-make_system_typemap_overridable.patch | 46 +++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 lang/perl-inline-c/Makefile create mode 100644 lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch create mode 100644 lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch diff --git a/lang/perl-inline-c/Makefile b/lang/perl-inline-c/Makefile new file mode 100644 index 000000000..52826d20a --- /dev/null +++ b/lang/perl-inline-c/Makefile @@ -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 + +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 index 000000000..dcfe2bb58 --- /dev/null +++ b/lang/perl-inline-c/patches/100-inline_c-no_compile_hack.patch @@ -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 index 000000000..b2ae09e6b --- /dev/null +++ b/lang/perl-inline-c/patches/110-inline_c-make_system_typemap_overridable.patch @@ -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;