summaryrefslogtreecommitdiff
blob: c26a92ed57b29137aac19a3f24a322d1b2f46f80 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="1"

inherit subversion

DESCRIPTION="LeoCAD is a CAD program that uses bricks similar to those found in many toys."
HOMEPAGE="http://www.leocad.org"

ESVN_REPO_URI="http://svn.gerf.org/${PN}/trunk"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""

IUSE="jpeg zlib png"

RDEPEND="virtual/opengl
	x11-libs/gtk+:2
	jpeg? ( virtual/jpeg )
	zlib? ( sys-libs/zlib )
	png? ( media-libs/libpng )"
DEPEND="${RDEPEND}"

src_unpack() {
	subversion_src_unpack
	cd "${S}"

	if ! use jpeg; then
		sed -i \
			-e "s:(test -s jpegtest); then :{(test -s jpegtest);} \&\& false; then :" \
			config.mk || die "patching Makefile failed"
	fi
	if ! use zlib; then
		sed -i \
			-e "s:(test -s ztest); then :{(test -s ztest);} \&\& false; then :" \
			config.mk || die "patching Makefile failed"
	fi
	if ! use png; then
		sed -i \
			-e "s:(test -s pngtest); then :{(test -s pngtest);} \&\& false; then :" \
			config.mk || die "patching Makefile failed"
	fi
}

src_compile() {
	emake config || die
	emake || die
}

src_install() {
	dobin bin/leocad || die
	doman docs/leocad.1 || die
	dodoc docs/*.txt || die
}

pkg_postinst() {
	elog "Due to a missing release number, automatic fetching of the"
	elog "pieces library is disabled. Please download it yourself:"
	elog
	elog "	wget http://www.leocad.org/files/pieces.zip"
	elog
	elog "and unpack it with the following command:"
	elog
	elog "	unzip pieces.zip"
}