summaryrefslogtreecommitdiff
blob: 1257335e447874eef59391c55487c0dcaa217b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/lilypond/lilypond-2.5.2.ebuild,v 1.8 2006/03/29 17:31:00 agriffis Exp $

inherit versionator

IUSE="doc"

MY_PV="v$(get_version_component_range 1-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"
#-amd64: 2.2.6: lilypond-bin exits error code 139 ... upstream needs to fix it...
KEYWORDS="~x86 ~amd64 ~sparc"

RDEPEND=">=dev-util/guile-1.6.5
	virtual/ghostscript
	=virtual/tetex-2*
	>=dev-lang/python-2.2.3-r1
	media-fonts/ec-fonts-mftraced"

DEPEND="${RDEPEND}
	>=app-text/t1utils-1.32
	>=dev-lang/perl-5.8.0-r12
	>=sys-apps/texinfo-4.7
	>=sys-devel/flex-2.5.4a-r5
	>=sys-devel/gcc-3.1-r8
	>=sys-devel/make-3.80
	>=app-text/mftrace-1.1.16
	sys-devel/bison !=sys-devel/bison-1.75
	doc? ( media-gfx/imagemagick
		>=media-libs/netpbm-9.12-r4 )"

src_unpack() {
	unpack ${A}
	# Fix makefiles to work with recent mftrace #90334
	grep -rlZ 'MFTRACE.*--pf[ab]' --include=GNUmakefile --include=\*.make ${S} | \
		xargs -0r sed -i '
			s/--pfa --pfb/--formats=PFA,PFB/;
			s/--pfa/--formats=PFA/;
			s/--pfb/--formats=PFB/'
}

src_compile() {
	# Remove ccache from the PATH since it can break compilation of
	# this package.  See bug 21305
	PATH="$(echo ":${PATH}:" | sed 's/:[^:]*ccache[^:]*:/:/;s/^://;s/:$//;')"

	addwrite /root/.PfaEdit  # fontforge, see bug 127723
	addwrite /dev/stderr
	addwrite /var/cache/fonts
	addwrite /usr/share/texmf/fonts
	addwrite /usr/share/texmf/ls-R

	econf --build=${CHOST} || die "econf failed"
	LC_ALL=C emake || die "emake failed"

	if use doc; then
		make web || die "make web failed"
	fi
}

src_install () {
	einstall \
		lilypond_datadir=${D}/usr/share/lilypond \
		local_lilypond_datadir=${D}/usr/share/lilypond/${PV} \
		|| die "einstall failed"

	dodoc AUTHORS.txt COPYING ChangeLog DEDICATION INSTALL.txt \
		NEWS.txt README.txt ROADMAP THANKS VERSION \
		|| die "dodoc failed"

	insinto /usr/share/lilypond/${PV}/buildscripts/out
	doins buildscripts/out/lilypond-profile \
		buildscripts/out/lilypond-login \
		buildscripts/out/clean-fonts \
		buildscripts/out/lilypond-words \
		|| die "doins failed"

	# emacs support, should this be done differently?
	insinto /usr/share/lilypond/${PV}/elisp
	doins elisp/*.el \
		|| die "doins failed"
	insinto /usr/share/lilypond/${PV}/elisp/out
	doins elisp/out/lilypond-words.el \
		|| die "doins failed"

	# vim support, should this be done differently?
	insinto /usr/share/lilypond/${PV}/vim/out
	doins vim/out/lilypond-words.vim \
		|| die "doins failed"
	insinto /usr/share/lilypond/${PV}/vim
	doins vim/lilypond*.vim vim/vimrc \
		|| die "doins failed"

	# we might be able to get the new "make out=www web-install"
	# to work (if someone wants to fight with it), but our
	# old way is easier for now:
	if use doc; then
		dohtml -A txt,midi,ly,pdf,gz -r Documentation input *.html *.png \
		|| die "doins failed"
	fi
}

pkg_postinst () {
	# Cleaning out old fonts is more appropriate in pkg_prerm, but we
	# also need to clean up after any previous lilypond installations.
	# Make sure to run this from somewhere safe since it references .
	cd ${T}
	. /usr/share/lilypond/${PV}/buildscripts/out/clean-fonts
}

pkg_prerm () {
	# Make sure to run this from somewhere safe since it references .
	cd ${T}
	. /usr/share/lilypond/${PV}/buildscripts/out/clean-fonts
}