summaryrefslogtreecommitdiff
blob: 05d93ff24a1fcce3ae90c733c6dc140867bb652f (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/musescore/musescore-0.7.0.1.ebuild,v 1.1 2007/10/03 17:44:56 drac Exp $

inherit eutils font toolchain-funcs

MY_P=${P/musescore/mscore}

DESCRIPTION="WYSIWYG Music Score Typesetter"
HOMEPAGE="http://mscore.sourceforge.net"
SRC_URI="mirror://sourceforge/mscore/${MY_P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~sparc ~x86"
IUSE="doc jack"

RDEPEND=">=x11-libs/qt-4.3
	media-sound/fluidsynth
	media-libs/alsa-lib
	jack? ( media-sound/jack-audio-connection-kit )"
DEPEND="${RDEPEND}
	>=dev-util/cmake-2.4.6
	dev-util/pkgconfig
	doc? ( virtual/tetex app-doc/doxygen )"

S="${WORKDIR}"/${MY_P/.1}
BUILDDIR="${S}"/build
FONT_SUFFIX="otf"
FONT_S="${S}"/mscore/mscore/fonts

pkg_setup() {
	local failure="re-emerge x11-libs/qt with qt3support."

	if ! built_with_use ">=x11-libs/qt-4.3" qt3support; then
		eerror "${failure}"
		die "${failure}"
	fi
}

src_compile() {
	mkdir "${BUILDDIR}"
	cd "${BUILDDIR}"

	cmake \
		-DCMAKE_VERBOSE_MAKEFILE="ON" \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DCMAKE_C_COMPILER="$(type -P $(tc-getCC))" \
		-DCMAKE_CXX_COMPILER="$(type -P $(tc-getCXX))" \
		-DCMAKE_C_FLAGS="${CFLAGS}" \
		-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
		-DCMAKE_LD_FLAGS="${LDFLAGS}" \
		../mscore || die "cmake failed."

	emake || die "emake failed."
}

src_install() {
	cd "${BUILDDIR}"
	emake DESTDIR="${D}" install || die "emake install failed."

	font_src_install

	cd "${S}"/mscore
	dodoc ChangeLog NEWS README doc/README.translate

	doicon mscore/data/mscore.png
	make_desktop_entry mscore MuseScore mscore
}