Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/Authen-Libwrap/files/, dev-perl/Authen-Libwrap/
Date: Sun, 16 Aug 2020 01:32:12
Message-Id: 1597541375.8cd94a41de24204614aa921c19262c8e53333a26.kentnl@gentoo
1 commit: 8cd94a41de24204614aa921c19262c8e53333a26
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 16 01:26:19 2020 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 16 01:29:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cd94a41
7
8 dev-perl/Authen-Libwrap: -r bump fix for bug #737212
9
10 This overrides the magic detection in Build.PL, which was previously
11 creating problems for LD=lld due to the inclusion of "/usr/lib/" instead
12 of "/usr/lib64/".
13
14 This employs get_libdir to resolve the right version, and passes
15 expected config into Build.PL, and patches Build.PL to simply die when
16 the passed values don't look usable, instead of doing some weird config
17 discovery which could possibly do wrong things.
18
19 Bug: https://bugs.gentoo.org/737212
20 Package-Manager: Portage-2.3.103, Repoman-2.3.22
21 Signed-off-by: Kent Fredric <kentnl <AT> gentoo.org>
22
23 .../Authen-Libwrap-0.230.0-r2.ebuild | 46 ++++++++++
24 .../files/Authen-Libwrap-0.23-inc-paths.patch | 98 ++++++++++++++++++++++
25 2 files changed, 144 insertions(+)
26
27 diff --git a/dev-perl/Authen-Libwrap/Authen-Libwrap-0.230.0-r2.ebuild b/dev-perl/Authen-Libwrap/Authen-Libwrap-0.230.0-r2.ebuild
28 new file mode 100644
29 index 00000000000..79aaf42ae9b
30 --- /dev/null
31 +++ b/dev-perl/Authen-Libwrap/Authen-Libwrap-0.230.0-r2.ebuild
32 @@ -0,0 +1,46 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +DIST_AUTHOR=DMUEY
39 +DIST_VERSION=0.23
40 +DIST_EXAMPLES=("example.pl")
41 +inherit perl-module multilib
42 +
43 +DESCRIPTION="A Perl access to the TCP Wrappers interface"
44 +
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~x86"
47 +IUSE="test"
48 +RESTRICT="!test? ( test )"
49 +
50 +RDEPEND="sys-apps/tcp-wrappers"
51 +DEPEND="dev-perl/Module-Build"
52 +BDEPEND="${RDEPEND}
53 + >=dev-perl/Module-Build-0.420.0
54 + virtual/perl-ExtUtils-CBuilder
55 + test? (
56 + virtual/perl-Test-Simple
57 + dev-perl/Test-Exception
58 + )
59 +"
60 +PATCHES=(
61 + "${FILESDIR}/${PN}-0.23-inc-paths.patch"
62 +)
63 +PERL_RM_FILES=(
64 + t/03_pod.t
65 + t/02_maintainer.t
66 +)
67 +src_configure() {
68 + unset LD
69 + if [[ -n "${CCLD}" ]]; then
70 + export LD="${CCLD}"
71 + fi
72 + GENTOO_INCDIR="${EPREFIX}/usr/include" \
73 + GENTOO_LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
74 + perl-module_src_configure
75 +}
76 +src_compile() {
77 + ./Build --config optimize="${CFLAGS}" build || die
78 +}
79
80 diff --git a/dev-perl/Authen-Libwrap/files/Authen-Libwrap-0.23-inc-paths.patch b/dev-perl/Authen-Libwrap/files/Authen-Libwrap-0.23-inc-paths.patch
81 new file mode 100644
82 index 00000000000..e6b2998b5eb
83 --- /dev/null
84 +++ b/dev-perl/Authen-Libwrap/files/Authen-Libwrap-0.23-inc-paths.patch
85 @@ -0,0 +1,98 @@
86 +From 012d607fa5ca2dd8d7b48110a9639841cd3db704 Mon Sep 17 00:00:00 2001
87 +From: Kent Fredric <kentnl@g.o>
88 +Date: Sun, 16 Aug 2020 12:59:38 +1200
89 +Subject: Remove libdir/incdir autodetection magic
90 +
91 +Instead, in favour of gentoo controled paths and hard-erroring when
92 +they're wrong.
93 +
94 +Bug: https://bugs.gentoo.org/737212
95 +---
96 + Build.PL | 70 +++++++++++---------------------------------------------
97 + 1 file changed, 13 insertions(+), 57 deletions(-)
98 +
99 +diff --git a/Build.PL b/Build.PL
100 +index c76c1d8..d2179de 100644
101 +--- a/Build.PL
102 ++++ b/Build.PL
103 +@@ -9,64 +9,20 @@ use Module::Build;
104 +
105 + use File::Spec;
106 +
107 +-my $inc_dir;
108 +-my $lib_dir;
109 +-
110 +-# possible prefixes where we might find libwrap.a
111 +-# if you know of other common ones please let me know
112 +-my @prefixes = (
113 +- File::Spec->catdir( File::Spec->rootdir, 'usr' ),
114 +- File::Spec->catdir( File::Spec->rootdir, 'usr', 'local' ),
115 +- File::Spec->catdir( File::Spec->rootdir, 'opt' ),
116 +- File::Spec->catdir( File::Spec->rootdir, 'opt', 'local' ),
117 +- File::Spec->catdir( File::Spec->rootdir, 'opt', 'libwrap' ),
118 +- File::Spec->catdir( File::Spec->rootdir, 'opt', 'tcpwrappers' ),
119 +-);
120 +-
121 +-# try to figure out where libwrap.a is
122 +-for my $prefix( @prefixes ) {
123 +- for my $libname( qw|libwrap.so libwrap.a| ) {
124 +- my $candidate = File::Spec->catfile( $prefix, 'lib', $libname );
125 +- if( -e $candidate && -f _ && -r _ ) {
126 +- my $y_n = Module::Build->y_n(
127 +- "do you want to link against $candidate?", "y"
128 +- );
129 +- if( $y_n ) {
130 +- $lib_dir = File::Spec->catdir( $prefix, 'lib' );
131 +- last;
132 +- }
133 +- }
134 +- }
135 +-}
136 +-
137 +-# try to figure out where tcpd.h is
138 +-for my $prefix( @prefixes ) {
139 +- my $candidate = File::Spec->catfile( $prefix, 'include', 'tcpd.h' );
140 +- if( -e $candidate && -f _ && -r _ ) {
141 +- my $y_n = Module::Build->y_n(
142 +- "do you want to use $candidate as your header?", "y"
143 +- );
144 +- if( $y_n ) {
145 +- $inc_dir = File::Spec->catdir( $prefix, 'include' );
146 +- last;
147 +- }
148 +- }
149 +-}
150 +-
151 +-# if we can't find it, prompt
152 +-unless( $inc_dir ) {
153 +- $inc_dir = Module::Build->prompt(
154 +- "enter include directory to use:",
155 +- File::Spec->catdir($prefixes[0], 'include')
156 +- );
157 +-}
158 +-unless( $lib_dir ) {
159 +- $lib_dir = Module::Build->prompt(
160 +- "enter library directory to use:",
161 +- File::Spec->catdir($prefixes[0], 'lib')
162 +- );
163 +-}
164 ++my $inc_dir = $ENV{GENTOO_INCDIR};
165 ++my $lib_dir = $ENV{GENTOO_LIBDIR};
166 +
167 ++die "GENTOO_LIBDIR not set" unless $lib_dir;
168 ++die "GENTOO_INCDIR not set" unless $inc_dir;
169 ++
170 ++die "No usable libwrap.so in $lib_dir" unless -e File::Spec->catfile( $lib_dir, 'libwrap.so' )
171 ++ and -f _ and -r _;
172 ++
173 ++die "No usable tcpd.h in $inc_dir" unless -e File::Spec->catfile( $inc_dir, 'tcpd.h' )
174 ++ and -f _ and -r _;
175 ++
176 ++warn "$0 libdir: $lib_dir\n";
177 ++warn "$0 incdir: $inc_dir\n";
178 + # create the Buildfile
179 + Module::Build->new(
180 +
181 +--
182 +2.28.0
183 +