# $Header: $ IUSE="doc" inherit gcc MY_PV="v$(echo ${PV} | cut -d. -f1,2)" DESCRIPTION="GNU Music Typesetter" SRC_URI="http://www.lilypond.org/ftp/${MY_PV}/${P}.tar.gz" HOMEPAGE="http://lilypond.org/" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" DEPEND=">=dev-lang/python-2.2.3-r1 >=dev-lang/perl-5.8.0-r12 >=dev-util/guile-1.6.4 >=sys-devel/bison-1.35 >=app-text/tetex-1.0.7-r12 >=sys-apps/texinfo-4.5 >=sys-devel/flex-2.5.4a-r5 >=app-text/mftrace-1.0.19 doc? ( media-gfx/imagemagick >=app-text/ghostscript-7.05.6-r3 >=media-libs/netpbm-9.12-r4 )" RDEPEND=">=dev-util/guile-1.6.4 >=app-text/ghostscript-7.05.6-r3 >=app-text/tetex-1.0.7-r12 >=dev-lang/python-2.2.3-r1" src_unpack() { unpack ${A} || die "unpack failed" cd ${S} if [ "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -ge "3" ]; then epatch ${FILESDIR}/lilypond-1.8.0-gcc33.patch NOCONFIGURE=1 ./autogen.sh >/dev/null fi } src_compile() { addwrite /dev/stderr # See http://lilypond.org/stable/Documentation/topdocs/out-www/INSTALL.html if [ "`gcc-major-version`" -eq "2" ]; then # Verified by agriffis 03 Dec 2002 using # gcc-2.95.3-r7 with flex-2.5.4a-r5 # (i.e. Gentoo 1.2) ./configure --build=${CHOST} --prefix=/usr || die "configure failed" emake || die "emake failed" elif [ "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -eq "2" ]; then # Verified by agriffis 03 Dec 2002 using # gcc-3.2.1 with flex-2.5.4a and flex-2.5.23 ./configure --build=${CHOST} --prefix=/usr || die "configure failed" # Fix std::cerr problem in flex 2.5.4a and 2.5.23 make -C lily out/lexer.cc perl -i -pe 's/\scerr\s/ std::cerr /g' lily/out/lexer.cc emake || die "emake failed" elif [ "`gcc-major-version`" -eq "3" -a "`gcc-minor-version`" -ge "3" ]; then # Verified by chandlerc 2003.08.08 using # gcc-3.3.1 (20030804 snapshot) with flex 2.5.4a econf --build=${CHOST} || die "econf failed" addwrite /var/cache/fonts/ls-R emake MAKE_PFA_FILES=1 || die "emake failed" else eerror "Unsupported GCC version, 2.95 and 3.2 are supported" die fi if use doc; then addwrite /usr/share/texmf/fonts addwrite /usr/share/texmf/ls-R addwrite /var/cache/fonts/pk/ljfour make web || die "make web failed" fi } src_install () { einstall \ lilypond_datadir=${D}/usr/share/lilypond \ local_lilypond_datadir=${D}/usr/share/lilypond/${PV} \ MAKE_PFA_FILES=1 dodoc AUTHORS* COPYING ChangeLog DEDICATION NEWS* README.txt \ ROADMAP THANKS VERSION *.el lilypond.words vimrc insinto /usr/share/lilypond/${PV}/buildscripts/out doins buildscripts/out/lilypond-profile \ buildscripts/out/lilypond-login \ buildscripts/out/clean-fonts use doc && dohtml -A txt,midi,ly,pdf,gz -r \ Documentation input *.html *.png } pkg_postinst () { # Cleaning out old fonts is more appropriate in pkg_prerm, but we # also need to clean up after any lilypond installations which may # not have been installed via portage. . /usr/share/lilypond/${PV}/buildscripts/out/clean-fonts } pkg_prerm () { . /usr/share/lilypond/${PV}/buildscripts/out/clean-fonts }