dev-db/postgresql: Merge "use /bin/sh (...) for postgres user"
[gentoo.git] / media-sound / lilypond / lilypond-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit elisp-common autotools eutils git-r3 python-single-r1
9
10 EGIT_REPO_URI="git://git.sv.gnu.org/lilypond.git"
11
12 DESCRIPTION="GNU Music Typesetter"
13 HOMEPAGE="http://lilypond.org/"
14
15 LICENSE="GPL-3 FDL-1.3"
16 SLOT="0"
17 LANGS=" ca cs da de el eo es fi fr it ja nl ru sv tr uk vi zh_TW"
18 IUSE="debug emacs profile vim-syntax ${LANGS// / linguas_}"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 RDEPEND=">=app-text/ghostscript-gpl-8.15
22         >=dev-scheme/guile-1.8.2[deprecated,regex]
23         media-fonts/tex-gyre
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         || (
33                 ( >=dev-texlive/texlive-metapost-2013 >=dev-tex/metapost-1.803 )
34                 <dev-texlive/texlive-metapost-2013
35         )
36         virtual/pkgconfig
37         media-gfx/fontforge
38         >=sys-apps/texinfo-4.11
39         >=sys-devel/bison-2.0
40         sys-devel/flex
41         sys-devel/gettext
42         sys-devel/make"
43
44 # Correct output data for tests isn't bundled with releases
45 RESTRICT="test"
46
47 pkg_setup() {
48         # make sure >=metapost-1.803 is selected if it's installed, bug 498704
49         if [[ ${MERGE_TYPE} != binary ]] && has_version ">=dev-tex/metapost-1.803" ; then
50                 if [[ $(readlink "${EROOT}"/usr/bin/mpost) =~ mpost-texlive-* ]] ; then
51                         einfo "Updating metapost symlink"
52                         eselect mpost update || die
53                 fi
54         fi
55
56         python-single-r1_pkg_setup
57 }
58
59 src_prepare() {
60         if ! use vim-syntax ; then
61                 sed -i 's/vim//' GNUmakefile.in || die
62         fi
63
64         # respect CFLAGS
65         sed -i 's/OPTIMIZE -g/OPTIMIZE/' aclocal.m4 || die
66
67         for lang in ${LANGS}; do
68                 use linguas_${lang} || rm po/${lang}.po || die
69         done
70
71         # respect AR
72         sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
73
74         # remove bundled texinfo file (fixes bug #448560)
75         rm tex/texinfo.tex || die
76
77         eautoreconf
78 }
79
80 src_configure() {
81         # documentation generation currently not supported since it requires a newer
82         # version of texi2html than is currently in the tree
83
84         econf \
85                 --with-texgyre-dir=/usr/share/fonts/tex-gyre \
86                 --disable-documentation \
87                 --disable-optimising \
88                 --disable-pipe \
89                 $(use_enable debug debugging) \
90                 $(use_enable profile profiling)
91 }
92
93 src_compile() {
94         default
95
96         if use emacs ; then
97                 elisp-compile elisp/lilypond-{font-lock,indent,mode,what-beat}.el \
98                         || die "elisp-compile failed"
99         fi
100 }
101
102 src_install () {
103         emake DESTDIR="${D}" vimdir=/usr/share/vim/vimfiles install
104
105         # remove elisp files since they are in the wrong directory
106         rm -r "${ED}"/usr/share/emacs || die
107
108         if use emacs ; then
109                 elisp-install ${PN} elisp/*.{el,elc} elisp/out/*.el \
110                         || die "elisp-install failed"
111                 elisp-site-file-install "${FILESDIR}"/50${PN}-gentoo.el
112         fi
113
114         python_fix_shebang "${ED}"
115
116         dodoc HACKING README.txt
117 }
118
119 pkg_postinst() {
120         use emacs && elisp-site-regen
121 }
122
123 pkg_postrm() {
124         use emacs && elisp-site-regen
125 }