[libev-perl] 01/02: Add patch to find headers using Devel::CheckLib
gregor herrmann
gregoa at debian.org
Wed Aug 7 12:36:24 UTC 2013
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libev-perl.
commit 099ebcbe4ae69bb7d2fc8f899b7298bf86a61743
Author: gregor herrmann <gregoa at debian.org>
Date: Wed Aug 7 14:33:17 2013 +0200
Add patch to find headers using Devel::CheckLib
instead of looking for hard-coded path, which fails since
multiarchi-ification.
Thanks: Petr Salinger for the bug report and the test of the patch.
Closes: #718280
---
debian/control | 3 +-
debian/patches/multiarch-checklib.patch | 62 +++++++++++++++++++++++++++++++
debian/patches/multiarch-paths.patch | 56 ++++++++++++++++++++++++++++
debian/patches/series | 4 ++
4 files changed, 124 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index d6e72f0..80a28c4 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,8 @@ Section: perl
Priority: optional
Build-Depends: debhelper (>= 9.20120312),
perl,
- libcommon-sense-perl
+ libcommon-sense-perl,
+ libdevel-checklib-perl
Standards-Version: 3.9.4
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libev-perl.git
Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libev-perl.git
diff --git a/debian/patches/multiarch-checklib.patch b/debian/patches/multiarch-checklib.patch
new file mode 100644
index 0000000..484f308
--- /dev/null
+++ b/debian/patches/multiarch-checklib.patch
@@ -0,0 +1,62 @@
+Description: Find headers with Devel::CheckLib instead of hardcoded paths
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/718280
+Forwarded: no
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-08-07
+
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -3,6 +3,7 @@
+ use strict qw(vars subs);
+ use Config;
+ use ExtUtils::MakeMaker;
++use Devel::CheckLib;
+
+ unless (-e "libev/ev_epoll.c") {
+ print <<EOF;
+@@ -129,7 +130,7 @@
+
+ EOF
+
+-my $can_epoll = -e "/usr/include/sys/epoll.h";
++my $can_epoll = check_lib( header => "sys/epoll.h" );
+ $can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL};
+ $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/));
+
+@@ -157,7 +158,7 @@
+
+ EOF
+
+-my $can_kqueue = -e "/usr/include/sys/event.h";
++my $can_kqueue = check_lib( header => "sys/event.h" );
+ $can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE};
+ $DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/));
+
+@@ -204,7 +205,7 @@
+
+ EOF
+
+-my $can_inotify = -e "/usr/include/sys/inotify.h";
++my $can_inotify = check_lib( header => "sys/inotify.h" );
+ $can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY};
+ $DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/));
+
+@@ -221,7 +222,7 @@
+
+ EOF
+
+-my $can_eventfd = -e "/usr/include/sys/eventfd.h";
++my $can_eventfd = check_lib( header => "sys/eventfd.h" );
+ $can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD};
+ $DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/));
+
+@@ -237,7 +238,7 @@
+
+ EOF
+
+-my $can_signalfd = -e "/usr/include/sys/signalfd.h";
++my $can_signalfd = check_lib( header => "sys/signalfd.h" );
+ $can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD};
+ $DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/));
+
diff --git a/debian/patches/multiarch-paths.patch b/debian/patches/multiarch-paths.patch
new file mode 100644
index 0000000..7d1a7ca
--- /dev/null
+++ b/debian/patches/multiarch-paths.patch
@@ -0,0 +1,56 @@
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -129,7 +129,7 @@
+
+ EOF
+
+-my $can_epoll = -e "/usr/include/sys/epoll.h";
++my $can_epoll = findheader( "sys/epoll.h" );
+ $can_epoll = $ENV{EV_EPOLL} if exists $ENV{EV_EPOLL};
+ $DEFINE .= " -DEV_USE_EPOLL=" . (0 + (prompt ("Enable epoll backend (y/n)?", $can_epoll ? "y" : "n") =~ /[yY]/));
+
+@@ -157,7 +157,7 @@
+
+ EOF
+
+-my $can_kqueue = -e "/usr/include/sys/event.h";
++my $can_kqueue = findheader( "sys/event.h" );
+ $can_kqueue = $ENV{EV_KQUEUE} if exists $ENV{EV_KQUEUE};
+ $DEFINE .= " -DEV_USE_KQUEUE=" . (0 + (prompt ("Enable kqueue backend (y/n)?", $can_kqueue ? "y" : "n") =~ /[yY]/));
+
+@@ -204,7 +204,7 @@
+
+ EOF
+
+-my $can_inotify = -e "/usr/include/sys/inotify.h";
++my $can_inotify = findheader( "sys/inotify.h" );
+ $can_inotify = $ENV{EV_INOTIFY} if exists $ENV{EV_INOTIFY};
+ $DEFINE .= " -DEV_USE_INOTIFY=" . (0 + (prompt ("Enable inotify support (y/n)?", $can_inotify ? "y" : "n") =~ /[yY]/));
+
+@@ -221,7 +221,7 @@
+
+ EOF
+
+-my $can_eventfd = -e "/usr/include/sys/eventfd.h";
++my $can_eventfd = findheader( "sys/eventfd.h" );
+ $can_eventfd = $ENV{EV_EVENTFD} if exists $ENV{EV_EVENTFD};
+ $DEFINE .= " -DEV_USE_EVENTFD=" . (0 + (prompt ("Enable linux eventfd support (y/n)?", $can_eventfd ? "y" : "n") =~ /[yY]/));
+
+@@ -237,7 +237,7 @@
+
+ EOF
+
+-my $can_signalfd = -e "/usr/include/sys/signalfd.h";
++my $can_signalfd = findheader( "sys/signalfd.h" );
+ $can_signalfd = $ENV{EV_SIGNALFD} if exists $ENV{EV_SIGNALFD};
+ $DEFINE .= " -DEV_USE_SIGNALFD=" . (0 + (prompt ("Enable linux signalfd support (y/n)?", $can_signalfd ? "y" : "n") =~ /[yY]/));
+
+@@ -304,3 +304,8 @@
+ );
+
+
++sub findheader {
++ my $header = shift;
++ my @args = ("/bin/echo '#include <$header>' | gcc -E - >/dev/null 2>&1");
++ return ( system( @args ) == 0 ? 1 : 0);
++}
diff --git a/debian/patches/series b/debian/patches/series
index 2475b92..573651f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,5 @@
fix-spelling-error.patch
+
+multiarch-checklib.patch
+# alternative, but probably the former is better
+# multiarch-paths.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libev-perl.git
More information about the Pkg-perl-cvs-commits
mailing list