libspe2-2.3.0_p135.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils
  4. MY_P=${P/_p/.}
  5. DESCRIPTION="A wrapper library to adapt the JSRE SPU usage model to SPUFS"
  6. HOMEPAGE="https://sourceforge.net/projects/libspe"
  7. SRC_URI="mirror://sourceforge/libspe/${MY_P}.tar.gz"
  8. LICENSE="LGPL-2"
  9. SLOT="0"
  10. KEYWORDS="~ppc ~ppc64"
  11. IUSE="debug"
  12. S="${WORKDIR}/${P/_p*//}"
  13. DEPEND=""
  14. # This packages also provides libspe1
  15. RDEPEND="!sys-libs/libspe"
  16. export CBUILD=${CBUILD:-${CHOST}}
  17. export CTARGET=${CTARGET:-${CHOST}}
  18. if [[ ${CTARGET} == ${CHOST} ]] ; then
  19. if [[ ${CATEGORY} == cross-* ]] ; then
  20. export CTARGET=${CATEGORY#cross-}
  21. fi
  22. fi
  23. if [[ ${CTARGET} == ${CHOST} ]] ; then
  24. SYSROOT=""
  25. else
  26. SYSROOT="/usr/${CTARGET}"
  27. fi
  28. src_unpack () {
  29. unpack ${A}
  30. #just in case something is missing
  31. cd "${S}"
  32. echo "${S}"
  33. }
  34. src_compile() {
  35. myconf=""
  36. use debug && myconf="${myconf} DEBUG=1"
  37. make all elfspe-all CROSS="${CTARGET}-" \
  38. prefix=/usr SYSROOT="$SYSROOT" ${myconf} \
  39. speinclude=/usr/spu-elf/include || die
  40. }
  41. src_install() {
  42. make CROSS="${CTARGET}-" prefix=/usr \
  43. speinclude=/usr/spu-elf/include \
  44. SYSROOT="$SYSROOT" \
  45. DESTDIR="$D" install elfspe-install || die
  46. newinitd "${FILESDIR}/spe.rc6" elfspe
  47. }
  48. pkg_postinst() {
  49. einfo "You may want to register elfspe to binfmt using the"
  50. einfo "provided initscript"
  51. einfo "# rc-update add elfspe boot"
  52. ewarn "make sure your fstab contains the following line"
  53. ewarn "none /spu spufs defaults
  54. 0 0"
  55. ewarn "and that you have spufs support enabled in the kernel"
  56. }