View previous topic :: View next topic |
Author |
Message |
manyacrulez n00b
Joined: 03 Nov 2004 Posts: 16
|
Posted: Sun May 20, 2007 12:14 pm Post subject: ps3: libspe 2.1.0 ebuild |
|
|
I recently created an ebuild for libspe2, version 2.1.0. Currently the latest version in the lu_zero's overlay is 2.1.0. I based it on libspe2-2.0.1.ebuild from lu_zero's overlay.
You'll need to put the following files in the files/ directory:
- The 3 patches from http://www.bsc.es/plantillaH.php?cat_id=306
- A patched version of the spe.rc6 file. I used the file from lu_zero and changed 'elfspe2' to 'elfspe'.
Until now I have had only few problems with libspe 2.1.0: With the latest kernel from git://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux it is possible to create a program that completely hangs the ps3. Of course, this is a kernel problem: A normal user program shouldn't be able to do this.
This library provides both libspe1 and libspe2, so I've added an RDEPEND to make sure it won't be installed together with libspe1 (libspe).
In the ebuild you might want to modify some file paths.
Last edited by manyacrulez on Sun May 20, 2007 12:22 pm; edited 1 time in total |
|
Back to top |
|
|
manyacrulez n00b
Joined: 03 Nov 2004 Posts: 16
|
Posted: Sun May 20, 2007 12:17 pm Post subject: libspe2-2.1.0.ebuild |
|
|
Code: |
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils
DESCRIPTION="A wrapper library to adapt the JSRE SPU usage model to SPUFS"
HOMEPAGE="http://www.bsc.es/plantillaH.php?cat_id=306"
SRC_URI="http://www.bsc.es/projects/deepcomputing/linuxoncell/cellsimulator/sdk2.1/sources/libspe2/libspe2-2.1.0.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~ppc ~ppc64"
IUSE="debug"
DEPEND=""
# This packages also provides libspe1
RDEPEND="!sys-libs/libspe"
export CBUILD=${CBUILD:-${CHOST}}
export CTARGET=${CTARGET:-${CHOST}}
if [[ ${CTARGET} == ${CHOST} ]] ; then
if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
export CTARGET=${CATEGORY/cross-}
fi
fi
if [[ ${CTARGET} == ${CHOST} ]] ; then
SYSROOT=""
else
SYSROOT="/usr/${CTARGET}"
fi
src_unpack () {
unpack ${A}
#just in case something is missing
einfo Going to directory ${S}
cd ${S}
EPATCH_OPTS=-p1 epatch ${FILESDIR}/initevent.diff
epatch ${FILESDIR}/event-public.diff
epatch ${FILESDIR}/make_speevent_thread-safe.diff
}
src_compile() {
myconf=""
use debug && myconf="${myconf} DEBUG=1"
make all elfspe-all CROSS="${CTARGET}-" prefix=/usr SYSROOT="$SYSROOT" ${myconf}
}
src_install() {
make CROSS="${CTARGET}-" prefix=/usr SYSROOT="$SYSROOT" \
DESTDIR="$D" install elfspe-install
cp ${FILESDIR}/spe.rc6 ${T}/elfspe
doinitd ${T}/elfspe
}
pkg_postinst() {
einfo "You may want to register elfspe to binfmt using the"
einfo "provided initscript"
einfo "# rc-update add elfspe boot"
ewarn "make sure your fstab contains the following line"
ewarn "none /spu spufs defaults
0 0"
ewarn "and that you have spufs support enabled in the kernel"
}
|
Last edited by manyacrulez on Sun May 20, 2007 12:19 pm; edited 1 time in total |
|
Back to top |
|
|
manyacrulez n00b
Joined: 03 Nov 2004 Posts: 16
|
Posted: Sun May 20, 2007 12:19 pm Post subject: spe.rc6 |
|
|
Code: |
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
# you need the elfspe bin
need localmount
}
start() {
ebegin "Registering elfspe to binfmt"
if test -f /proc/sys/fs/binfmt_misc/spe
then
eerror "elfspe already registered"
return 1
else
if test -f /proc/sys/fs/binfmt_misc/register
then
echo ':spe:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x17::/usr/bin/elfspe:' >/proc/sys/fs/binfmt_misc/register
eend $?
else
eerror "binfmt not available"
return 1
fi
fi
}
stop() {
if ! test -f /proc/sys/fs/binfmt_misc/spe
then
eerror "elfspe not present"
return 1
else
echo -1 > /proc/sys/fs/binfmt_misc/spe
eend $?
fi
}
|
|
|
Back to top |
|
|
|