# $Id$ PNAME="ppl" PVER="0.10.2" PBUILD="r1" PCATEGORIE="dev-libs" STATE="unstable" DESCRIPTION="The Parma Polyhedra Library (PPL) provides numerical abstractions especially targeted at applications in the field of analysis and verification of complex systems." HOMEPAGE="http://www.cs.unipr.it/ppl/" # do not depend on glibc, as it depends ob libstdc++ and this wants mpc # as SRCDEPEND -> this may generate loops DEPEND=">= dev-libs/gmp-5.0.1" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools multilib SRC_URI=( ftp://ftp.cs.unipr.it/pub/ppl/releases/${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} ) UP2DATE="updatecmd ftp://ftp.cs.unipr.it/pub/ppl/releases/LATEST/ | lasttarball" src_prepare() { munpack ${SRCFILE} || die # fixes detection of newer gmp versions all-abis 'sed -i "s/__GMP_BITS_PER_MP_LIMB/GMP_LIMB_BITS/g" configure' || die } src_compile() { mconfigure --enable-shared --disable-optimization || die mmake || die if [[ ${ARCH} = x86_64 ]] then # create a multiarch-wrapper cat > ${BUILDDIR}/multiarch_wrapper.c << "EOF" #define _GNU_SOURCE #include #include #include #include #include #include #ifndef DEF_SUFFIX # define DEF_SUFFIX "64" #endif int main(int argc, char **argv) { char *filename; char *suffix; if(!(suffix = getenv("USE_ARCH"))) if(!(suffix = getenv("BUILDENV"))) suffix = DEF_SUFFIX; if (asprintf(&filename, "%s-%s", argv[0], suffix) < 0) { perror(argv[0]); return -1; } int status = EXIT_FAILURE; pid_t pid = fork(); if (pid == 0) { execvp(filename, argv); perror(filename); goto end; } else if (pid < 0) { goto end_error; } else { if (waitpid(pid, &status, 0) != pid) { status = EXIT_FAILURE; goto end_error; } status = WEXITSTATUS(status); } goto end; end_error: perror(argv[0]); end: free(filename); return status; } EOF # compile and install the wrapper gcc -m64 ${BUILDDIR}/multiarch_wrapper.c -o ${BUILDDIR}/ppl-config || die fi } src_install() { local abi for abi in ${MULTILIB_ABIS} do cd ${SRCDIR}-${abi} make DESTDIR=${BINDIR} install || die if [[ ${ARCH} = x86_64 ]] then # move the header mv ${BINDIR}/usr/include/ppl{,-${abi/m/}}.hh || die # move the config program mv ${BINDIR}/usr/bin/ppl-config{,-${abi/m/}} || die # create a wrapper header cat > ${BINDIR}/usr/include/ppl.h << "EOF" /* ppl.h - Stub Header */ #ifndef __STUB__PPL_HH__ #define __STUB__PPL_HH__ #if defined(__x86_64__) || \ defined(__sparc64__) || \ defined(__arch64__) || \ defined(__powerpc64__) || \ defined (__s390x__) # include "ppl-64.h" #else # include "ppl-32.h" #endif #endif /* __STUB__PPL_HH__ */ EOF # install the multiarch-wrapper minstalldir /usr/bin || die minstallexec ${BUILDDIR}/ppl-config /usr/bin || die fi minstalldocs AUTHORS COPYING* ChangeLog NEWS README || die done }