Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ps3: libspe 2.1.0 ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
manyacrulez
n00b
n00b


Joined: 03 Nov 2004
Posts: 16

PostPosted: Sun May 20, 2007 12:14 pm    Post subject: ps3: libspe 2.1.0 ebuild Reply with quote

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
View user's profile Send private message
manyacrulez
n00b
n00b


Joined: 03 Nov 2004
Posts: 16

PostPosted: Sun May 20, 2007 12:17 pm    Post subject: libspe2-2.1.0.ebuild Reply with quote

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
View user's profile Send private message
manyacrulez
n00b
n00b


Joined: 03 Nov 2004
Posts: 16

PostPosted: Sun May 20, 2007 12:19 pm    Post subject: spe.rc6 Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum