media-sound/*: Update Manifest hashes
[gentoo.git] / media-sound / lilypond / lilypond-2.18.2-r3.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 )
6
7 inherit elisp-common autotools python-single-r1 xdg-utils
8
9 DESCRIPTION="GNU Music Typesetter"
10 SRC_URI="http://download.linuxaudio.org/lilypond/sources/v${PV:0:4}/${P}.tar.gz"
11 HOMEPAGE="http://lilypond.org/"
12
13 LICENSE="GPL-3 FDL-1.3"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~hppa x86"
16 LANGS=" ca cs da de el eo es fi fr it ja nl ru sv tr uk vi zh_TW"
17 IUSE="debug emacs profile vim-syntax ${LANGS// / linguas_}"
18 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
19
20 RDEPEND=">=app-text/ghostscript-gpl-8.15
21         >=dev-scheme/guile-1.8.2:12[deprecated,regex]
22         <dev-scheme/guile-2.0:12
23         media-fonts/urw-fonts
24         media-libs/fontconfig
25         media-libs/freetype:2
26         >=x11-libs/pango-1.12.3
27         emacs? ( virtual/emacs )
28         ${PYTHON_DEPS}"
29 DEPEND="${RDEPEND}
30         app-text/t1utils
31         dev-lang/perl
32         dev-libs/kpathsea
33         >=dev-texlive/texlive-metapost-2013
34         || (
35                 >=app-text/texlive-core-2013
36                 >=dev-tex/metapost-1.803
37         )
38         virtual/pkgconfig
39         media-gfx/fontforge[png]
40         >=sys-apps/texinfo-4.11
41         >=sys-devel/bison-2.0
42         sys-devel/flex
43         sys-devel/gettext
44         sys-devel/make"
45
46 # Correct output data for tests isn't bundled with releases
47 RESTRICT="test"
48
49 PATCHES=(
50         "${FILESDIR}"/${PN}-2.17.2-tex-docs.patch
51         "${FILESDIR}"/${P}-fontforge.patch
52 )
53
54 DOCS=( AUTHORS.txt NEWS.txt README.txt )
55
56 pkg_setup() {
57         # make sure >=metapost-1.803 is selected if it's installed, bug 498704
58         if [[ ${MERGE_TYPE} != binary ]] && has_version ">=dev-tex/metapost-1.803" ; then
59                 if [[ $(readlink "${EROOT}"/usr/bin/mpost) =~ mpost-texlive-* ]] ; then
60                         einfo "Updating metapost symlink"
61                         eselect mpost update || die
62                 fi
63         fi
64
65         python-single-r1_pkg_setup
66 }
67
68 src_prepare() {
69         eapply "${PATCHES[@]}"
70
71         if ! use vim-syntax ; then
72                 sed -i 's/vim//' GNUmakefile.in || die
73         fi
74
75         # respect CFLAGS
76         sed -i 's/OPTIMIZE -g/OPTIMIZE/' aclocal.m4 || die
77
78         for lang in ${LANGS}; do
79                 use linguas_${lang} || rm po/${lang}.po || die
80         done
81
82         # respect AR
83         sed -i "s:^AR=ar:AR=$(tc-getAR):" stepmake/stepmake/library-vars.make || die
84
85         # remove bundled texinfo file (fixes bug #448560)
86         rm tex/texinfo.tex || die
87
88         eapply_user
89
90         eautoreconf
91
92         xdg_environment_reset #586592
93 }
94
95 src_configure() {
96         # documentation generation currently not supported since it requires a newer
97         # version of texi2html than is currently in the tree
98
99         econf \
100                 --with-ncsb-dir=/usr/share/fonts/urw-fonts \
101                 --disable-documentation \
102                 --disable-optimising \
103                 --disable-pipe \
104                 $(use_enable debug debugging) \
105                 $(use_enable profile profiling)
106 }
107
108 src_compile() {
109         default
110
111         if use emacs ; then
112                 elisp-compile elisp/lilypond-{font-lock,indent,mode,what-beat}.el \
113                         || die "elisp-compile failed"
114         fi
115 }
116
117 src_install () {
118         emake DESTDIR="${D}" vimdir=/usr/share/vim/vimfiles install
119
120         # remove elisp files since they are in the wrong directory
121         rm -r "${ED}"/usr/share/emacs || die
122
123         if use emacs ; then
124                 elisp-install ${PN} elisp/*.{el,elc} elisp/out/*.el \
125                         || die "elisp-install failed"
126                 elisp-site-file-install "${FILESDIR}"/50${PN}-gentoo.el
127         fi
128
129         python_fix_shebang "${ED}"
130
131         einstalldocs
132 }
133
134 pkg_postinst() {
135         use emacs && elisp-site-regen
136 }
137
138 pkg_postrm() {
139         use emacs && elisp-site-regen
140 }