Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/
Date: Wed, 27 Nov 2019 22:58:11
Message-Id: 1574895479.91330e1d176561bb267945a0142ef40e1a9d8295.slyfox@gentoo
1 commit: 91330e1d176561bb267945a0142ef40e1a9d8295
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 27 22:56:32 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 27 22:57:59 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91330e1d
7
8 dev-libs/libffi: drop libffi version from includedir, bug #695788
9
10 Posting ebuild source note as-is:
11
12 ```
13 --includedir= path maintains a few properties:
14 1. have stable name across libffi versions: some packages like
15 dev-lang/ghc or kde-frameworks/networkmanager-qt embed
16 ${includedir} at build-time. Don't require those to be
17 rebuilt unless SONAME changes. bug #695788
18
19 We use /usr/.../${PN} (instead of former /usr/.../${P}).
20
21 2. have ${ABI}-specific location as ffi.h is target-dependent.
22
23 We use /usr/$(get_libdir)/... to have ABI identifier.
24 ```
25
26 Before the change libffi installed headers into:
27 /usr/lib/libffi-3.3/include/
28 /usr/lib64/libffi-3.3/include/
29 After the change the patchs are:
30 /usr/lib/libffi/include/
31 /usr/lib64/libffi/include/
32
33 Reported-by: Franz Trischberger
34 Bug: https://bugs.gentoo.org/695788
35 Package-Manager: Portage-2.3.79, Repoman-2.3.18
36 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
37
38 dev-libs/libffi/libffi-3.3-r1.ebuild | 83 ++++++++++++++++++++++++++++++++++++
39 1 file changed, 83 insertions(+)
40
41 diff --git a/dev-libs/libffi/libffi-3.3-r1.ebuild b/dev-libs/libffi/libffi-3.3-r1.ebuild
42 new file mode 100644
43 index 00000000000..53912670ba1
44 --- /dev/null
45 +++ b/dev-libs/libffi/libffi-3.3-r1.ebuild
46 @@ -0,0 +1,83 @@
47 +# Copyright 1999-2019 Gentoo Authors
48 +# Distributed under the terms of the GNU General Public License v2
49 +
50 +EAPI=7
51 +inherit multilib multilib-minimal toolchain-funcs
52 +
53 +MY_PV=${PV/_rc/-rc}
54 +MY_P=${PN}-${MY_PV}
55 +
56 +DESCRIPTION="a portable, high level programming interface to various calling conventions"
57 +HOMEPAGE="https://sourceware.org/libffi/"
58 +SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
59 +
60 +LICENSE="MIT"
61 +SLOT="0/7" # SONAME=libffi.so.7
62 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
63 +IUSE="debug pax_kernel static-libs test test-bhaible"
64 +
65 +RESTRICT="!test? ( test )"
66 +
67 +RDEPEND=""
68 +DEPEND=""
69 +BDEPEND="test? ( dev-util/dejagnu )"
70 +
71 +DOCS="ChangeLog* README.md"
72 +
73 +PATCHES=(
74 + "${FILESDIR}"/${PN}-3.2.1-o-tmpfile-eacces.patch #529044
75 + "${FILESDIR}"/${PN}-3.3_rc0-ppc-macos-go.patch
76 +)
77 +
78 +S=${WORKDIR}/${MY_P}
79 +
80 +ECONF_SOURCE=${S}
81 +
82 +pkg_setup() {
83 + # Check for orphaned libffi, see https://bugs.gentoo.org/354903 for example
84 + if [[ ${ROOT} == "/" && ${EPREFIX} == "" ]] && ! has_version ${CATEGORY}/${PN}; then
85 + local base="${T}"/conftest
86 + echo 'int main() { }' > "${base}".c
87 + $(tc-getCC) -o "${base}" "${base}".c -lffi >&/dev/null
88 + if [ $? -eq 0 ]; then
89 + eerror "The linker reported linking against -lffi to be working while it shouldn't have."
90 + eerror "This is wrong and you should find and delete the old copy of libffi before continuing."
91 + die "The system is in inconsistent state with unknown libffi installed."
92 + fi
93 + fi
94 +}
95 +
96 +src_prepare() {
97 + default
98 +
99 + if ! use test-bhaible; then
100 + # These tests are very heavyweight (hours of runtime)
101 + rm -v testsuite/libffi.bhaible/bhaible.exp || die
102 + fi
103 +}
104 +
105 +multilib_src_configure() {
106 + use userland_BSD && export HOST="${CHOST}"
107 + # --includedir= path maintains a few properties:
108 + # 1. have stable name across libffi versions: some packages like
109 + # dev-lang/ghc or kde-frameworks/networkmanager-qt embed
110 + # ${includedir} at build-time. Don't require those to be
111 + # rebuilt unless SONAME changes. bug #695788
112 + #
113 + # We use /usr/.../${PN} (instead of former /usr/.../${P}).
114 + #
115 + # 2. have ${ABI}-specific location as ffi.h is target-dependent.
116 + #
117 + # We use /usr/$(get_libdir)/... to have ABI identifier.
118 + econf \
119 + --includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
120 + --disable-multi-os-directory \
121 + $(use_enable static-libs static) \
122 + $(use_enable pax_kernel pax_emutramp) \
123 + $(use_enable debug)
124 +}
125 +
126 +multilib_src_install_all() {
127 + find "${ED}" -name "*.la" -delete || die
128 + einstalldocs
129 +}