Hello,

I have been working on a gentoo ebuild for the parrot-0.4.9 release. I
have commented more extensively on the install target in a mail: 

"the value of maintaining a working install target to the parrot project"

This ebuild is provided for reference in discussion of the points raised
in that mail, and also in indicating problems in the current install target.

the ebuild looks like shell code so it is quite readable to just about any
UNIX person.

Of particular interest to parrot hackers would be the list of paths that
are mistakenly installed by parrot. These are easily located in the
src_install() function, the "for frag" loop.

I noticed that the rpm recently posted to the list had similar path
removals as well.

I also install all of the .pbc's found in runtime/parrot/library
which increases the number of examples that will run, and lays
a foundation for getting the languages to run.

this is a work in-progress. for reference I call this copy of
the ebuild rev 623.

Cheers,
Mike Mattie


# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/parrot/parrot-0.4.6.ebuild,v 1.1 
2006/10/18 16:52:12 yuval Exp $

inherit base eutils multilib

DESCRIPTION="The virtual machine that perl6 relies on."
HOMEPAGE="http://www.parrotcode.org/";
SRC_URI="mirror://cpan/authors/id/P/PM/PMIC/${P}.tar.gz"
LICENSE="GPL-2"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc-macos ~sparc ~x86"
IUSE="gdbm gmp python test examples doc pheme"

DEPEND="dev-lang/perl
                >=dev-libs/icu-2.6
                gdbm? ( >=sys-libs/gdbm-1.8.3-r1 )
                gmp? ( >=dev-libs/gmp-4.1.4 )
                python? ( >=dev-lang/python-2.3.4-r1  )
                "
                #java? ( >=dev-java/antlr-2.7.5 )

src_unpack() {
        unpack ${A}
        cd ${S}

#       epatch ${FILESDIR}/parrot-shlib-naming.patch
}

src_compile()   {

        # clear our environment variable before Configure.pl is run,
        # so that the configure/build system is free to leave it
        # unset, or set it as needed.

        # unless PARROT_RUNTIME is cleared entirely the compile will
        # explode.

        unset PARROT_RUNTIME

        perl Configure.pl --prefix="/usr" || die "Perl ./Configure.pl failed"

        emake -j1 || die "parrot compile failed"

        if use "pheme" ; then
           cd languages
           emake pheme || die "pheme compile failed"
        fi

        # the MANIFEST and MANIFEST.generated control the make initiated install
        # process. control these files and you control the install.

        # parrot has a rather significant problem in that the .pbc files in
        # runtime/library are not installed. Among other things this breaks
        # pheme.

        # this ham-handed solution is to locate the .pbc files with a find
        # and add them all to the install list. It moves parrot towards
        # functioning language-wise but also installs a number of objects
        # that probably shouldn't be seen yet outside of the working-copy.

        (
                cd ${S} && find runtime/parrot/library -name '*.pbc' |\
 perl -e 'while(<>){ chomp; print $_  , " " x ( 50 - length $_ ) , "[main]" , 
"\n"; }' |\
                           cat MANIFEST.generated - |\
                           sort -u >MANIFEST.gentoo

                mv MANIFEST.{generated,default}
                mv MANIFEST.{gentoo,generated}              
        )
          
}

src_install()   {

        # reallyinstall is needed as the install target, the normal
        # install target will refuse to install if it detects a
        # previous installation of parrot

        make reallyinstall DESTDIR=${D} || die

        # create the doc directory now.

        dodir /usr/share/doc/${P}

        # trim some of the akward branches of the install tree, but at least 
record
        # the files that were removed

        for frag in "${D}/usr/include/src" \
                    "${D}/usr/$(get_libdir)/pkgconfig" \
                    "${D}/usr/src" \
                    "${D}/usr/compilers" \
                    "${D}/usr/config" ; do
          find $frag -print >>${D}/usr/share/doc/${P}/files-removed-by-ebuild   
              
          rm -r $frag        
        done

        # provide gentoo-standard placement of documentation in 
/usr/share/doc/${P}
        # with use flag refinement of the files installed.

        dodoc README RESPONSIBLE_PARTIES ABI_CHANGES ChangeLog CREDITS NEWS
        
        if use "examples" ; then
          mv ${D}/usr/share/doc/parrot/examples ${D}/usr/share/doc/${P}
        fi

        if use "doc" ; then
          mv ${D}/usr/share/doc/parrot/docs ${D}/usr/share/doc/${P}
        fi

        rm -r ${D}/usr/share/doc/parrot

        if use "pheme" ; then
           einfo "installing pheme language"

           dodir /usr/$(get_libdir)/parrot/languages

           dodir /usr/$(get_libdir)/parrot/languages/pheme
           insinto /usr/$(get_libdir)/parrot/languages/pheme
           doins ${S}/languages/pheme/pheme.pbc


           dodir /usr/$(get_libdir)/parrot/languages/pheme/lib
           insinto /usr/$(get_libdir)/parrot/languages/pheme/lib

           doins ${S}/languages/pheme/lib/pheme_grammar_gen.pir

           for pbc in $( find ${S}/languages/pheme/lib -name '*.pbc' -print ) ; 
do
#                  einfo "installing pbc file $pbc"
                   doins $pbc
                   
           done    
        fi
}

src_test()      {
        emake test || die "test failed"
}

Attachment: signature.asc
Description: PGP signature

Reply via email to