databases/p5-Memcached-libmemcached: improve patch

The patch to Makefile.PL needed to also replace $Config{lib_ext} (which
defaults to ".a") with ".so" so that we link against the right thing. This
avoids the need to patch databases/libmemcached.

While here, also avoid hard coding the path to PREFIX and split out the
libstdc++ to libc++ patch, avoiding duplication.

Pointyhat to:		swills
Reported by:		tijl, bapt
This commit is contained in:
Steve Wills 2015-07-01 01:03:03 +00:00
parent b36410e31e
commit 054d194d68
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=391019
4 changed files with 22 additions and 38 deletions

View file

@ -3,6 +3,7 @@
PORTNAME= Memcached-libmemcached
PORTVERSION= 1.001801
PORTREVISION= 1
CATEGORIES= databases devel perl5
MASTER_SITES= CPAN
PKGNAMEPREFIX= p5-
@ -19,14 +20,13 @@ USE_LDCONFIG= yes
post-extract:
@${RM} -r ${WRKDIR}/src
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/Makefile.PL
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD
.if ${OSVERSION} > 1000000
EXTRA_PATCHES= ${FILESDIR}/extra-patch-Makefile.PL-10
.else
EXTRA_PATCHES= ${FILESDIR}/extra-patch-Makefile.PL-9
.endif
.if ${OPSYS} == FreeBSD && ${OSVERSION} > 1000000
EXTRA_PATCHES= ${FILESDIR}/extra-patch-Makefile.PL
.endif
.include <bsd.port.post.mk>

View file

@ -0,0 +1,11 @@
--- Makefile.PL.orig 2015-05-07 17:56:22 UTC
+++ Makefile.PL
@@ -54,7 +54,7 @@ if (my $gccversion = $Config{gccversion}
$opts{DEFINE} .= ' -Wmissing-prototypes';
}
}
-$opts{LIBS} = ["-lstdc++"]; # else error: libmemcached.so: undefined symbol: __gxx_personality_v0
+$opts{LIBS} = ["-lc++"]; # else error: libmemcached.so: undefined symbol: __gxx_personality_v0
$opts{OPTIMIZE} = "-g" if $opt_g;
$opts{CCFLAGS} = "-pg" if $opt_pg;
my $coverage_flags = "";

View file

@ -1,29 +0,0 @@
--- Makefile.PL.orig 2015-05-07 17:56:22 UTC
+++ Makefile.PL
@@ -30,7 +30,7 @@ $Data::Dumper::Indent = 1;
$Data::Dumper::Sortkeys = 1;
my $lmcd_api_ver = "1.0"; # eg $lmcd_src/libmemcached-$lmcd_api_ver/
-my $lmcd_inst = getcwd()."/src_inst";
+my $lmcd_inst = "/usr/local";
my $lmcd_built_lib = "$lmcd_inst/lib/libmemcached$Config{lib_ext}";
my $is_developer = (-d ".svn" || -d ".git");
@@ -54,7 +54,7 @@ if (my $gccversion = $Config{gccversion}
$opts{DEFINE} .= ' -Wmissing-prototypes';
}
}
-$opts{LIBS} = ["-lstdc++"]; # else error: libmemcached.so: undefined symbol: __gxx_personality_v0
+$opts{LIBS} = ["-lc++"]; # else error: libmemcached.so: undefined symbol: __gxx_personality_v0
$opts{OPTIMIZE} = "-g" if $opt_g;
$opts{CCFLAGS} = "-pg" if $opt_pg;
my $coverage_flags = "";
@@ -76,7 +76,7 @@ WriteMakefile(
AUTHOR => 'Tim Bunce <Tim.Bunce@pobox.com>',
VERSION_FROM => 'libmemcached.pm',
ABSTRACT_FROM => 'libmemcached.pm',
- INC => "-I$lmcd_inst/include",
+ INC => "-I$lmcd_inst/include/",
# We want to link to *our* private libmemcached and not one that
# might already be installed on the system. The LIBS config gets
# appended to the link command line, so if we used "-L$dir -lmemcached"

View file

@ -1,14 +1,16 @@
--- Makefile.PL.orig 2015-05-07 17:56:22 UTC
+++ Makefile.PL
@@ -30,7 +30,7 @@ $Data::Dumper::Indent = 1;
@@ -30,8 +30,8 @@ $Data::Dumper::Indent = 1;
$Data::Dumper::Sortkeys = 1;
my $lmcd_api_ver = "1.0"; # eg $lmcd_src/libmemcached-$lmcd_api_ver/
-my $lmcd_inst = getcwd()."/src_inst";
+my $lmcd_inst = "/usr/local";
my $lmcd_built_lib = "$lmcd_inst/lib/libmemcached$Config{lib_ext}";
-my $lmcd_built_lib = "$lmcd_inst/lib/libmemcached$Config{lib_ext}";
+my $lmcd_inst = "%%PREFIX%%";
+my $lmcd_built_lib = "$lmcd_inst/lib/libmemcached.so";
my $is_developer = (-d ".svn" || -d ".git");
my ($lmcd_h) = eval { build_libmemcached() };
@@ -76,7 +76,7 @@ WriteMakefile(
AUTHOR => 'Tim Bunce <Tim.Bunce@pobox.com>',
VERSION_FROM => 'libmemcached.pm',