You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.8 KiB
76 lines
1.8 KiB
4 years ago
|
# Copyright 1999-2021 Gentoo Authors
|
||
7 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
3 years ago
|
EAPI=7
|
||
7 years ago
|
|
||
|
inherit autotools toolchain-funcs
|
||
|
|
||
|
DESCRIPTION="Library for arbitrary precision integer arithmetic (fork of gmp)"
|
||
|
HOMEPAGE="http://www.mpir.org/"
|
||
|
SRC_URI="http://www.mpir.org/${P}.tar.bz2"
|
||
|
|
||
|
LICENSE="LGPL-3"
|
||
|
SLOT="0/23"
|
||
4 years ago
|
KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ppc ppc64 ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
|
||
3 years ago
|
IUSE="+cxx cpudetection"
|
||
7 years ago
|
|
||
3 years ago
|
BDEPEND="
|
||
7 years ago
|
x86? ( dev-lang/yasm )
|
||
|
amd64? ( dev-lang/yasm )
|
||
|
"
|
||
|
|
||
|
PATCHES=(
|
||
|
"${FILESDIR}"/${PN}-2.7.2-ABI-multilib.patch
|
||
|
)
|
||
|
|
||
|
src_prepare() {
|
||
|
tc-export CC
|
||
|
default
|
||
|
# In the same way there was QA regarding executable stacks
|
||
|
# with GMP we have some here as well. We cannot apply the
|
||
|
# GMP solution as yasm is used, at least on x86/amd64.
|
||
|
# Furthermore we are able to patch config.ac.
|
||
|
ebegin "Patching assembler files to remove executable sections"
|
||
|
local i
|
||
|
for i in $(find . -type f -name '*.asm') ; do
|
||
3 years ago
|
cat >> $i <<-EOF || die
|
||
7 years ago
|
|
||
|
#if defined(__linux__) && defined(__ELF__)
|
||
|
.section .note.GNU-stack,"",%progbits
|
||
|
#endif
|
||
|
EOF
|
||
|
done
|
||
|
|
||
|
for i in $(find . -type f -name '*.as') ; do
|
||
3 years ago
|
cat >> $i <<-EOF || die
|
||
7 years ago
|
|
||
|
%ifidn __OUTPUT_FORMAT__,elf
|
||
|
section .note.GNU-stack noalloc noexec nowrite progbits
|
||
|
%endif
|
||
|
EOF
|
||
|
done
|
||
|
eend
|
||
|
eautoreconf
|
||
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
# beware that cpudetection aka fat binaries is x86/amd64 only.
|
||
|
# Place mpir in profiles/arch/$arch/package.use.mask
|
||
|
# when making it available on $arch.
|
||
5 years ago
|
local myeconfargs=(
|
||
7 years ago
|
$(use_enable cxx)
|
||
|
$(use_enable cpudetection fat)
|
||
3 years ago
|
--disable-static
|
||
7 years ago
|
)
|
||
5 years ago
|
# https://bugs.gentoo.org/661430
|
||
4 years ago
|
if ! use amd64 && ! use x86; then
|
||
3 years ago
|
myeconfargs+=( --with-yasm="${BROOT}"/bin/false )
|
||
5 years ago
|
fi
|
||
|
econf "${myeconfargs[@]}"
|
||
7 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
default
|
||
3 years ago
|
find "${ED}" -name '*.la' -delete || die
|
||
7 years ago
|
}
|