summaryrefslogtreecommitdiff
blob: 449d88600609f879c5e3888ff2b97c01fcee99ee (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
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs

DESCRIPTION="TWM descendant that implements a Virtual Desktop"
HOMEPAGE="http://www.vtwm.org/"
SRC_URI="http://www.vtwm.org/downloads/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
IUSE="rplay"

RDEPEND="x11-libs/libX11
	x11-libs/libXmu
	x11-libs/libXt
	x11-libs/libXext
	x11-libs/libXpm
	rplay? ( media-sound/rplay )"
DEPEND="${RDEPEND}
	app-text/rman
	sys-devel/bison
	sys-devel/flex
	x11-base/xorg-proto
	x11-misc/imake"

src_prepare() {
	eapply "${FILESDIR}"/${P}-do-not-rm.patch
	sed -i Imakefile \
		-e 's:-L/usr/local/lib::g' \
		-e 's:-I/usr/local/include::g' \
		|| die "sed Imakefile"
	if ! use rplay ; then
		sed -i Imakefile \
			-e 's:^XCOMM\ \(.*NO_SOUND\):\1:' \
			-e 's:^\(SOUNDLIB.*\):XCOMM\ \1:' \
			-e 's:sound\..::g' \
			|| die "sed Imakefile"
		eapply "${FILESDIR}"/${P}-NO_SOUND_SUPPORT.patch
	fi
	default
}

src_configure() {
	xmkmf || die "xmkmf failed"
	emake depend
}

src_compile() {
	emake \
		CC=$(tc-getCC) \
		CCOPTIONS="${CFLAGS}" \
		EXTRA_LDOPTIONS="${LDFLAGS}"
}

src_install() {
	emake BINDIR=/usr/bin \
		LIBDIR=/etc/X11 \
		MANPATH=/usr/share/man \
		DESTDIR="${D}" install

	echo "#!/bin/sh" > vtwm
	echo "xsetroot -cursor_name left_ptr &" >> vtwm
	echo "/usr/bin/vtwm" >> vtwm
	exeinto /etc/X11/Sessions
	doexe vtwm
	dodoc doc/{4.7.*,CHANGELOG,BUGS,DEVELOPERS,HISTORY,SOUND,WISHLIST}
}