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

EAPI=8

inherit edo toolchain-funcs

MY_PV="${PV//_/}"

DESCRIPTION="Simple EWMH compatible window manager with titlebars and frames"
HOMEPAGE="https://github.com/segin/matwm2"
SRC_URI="https://github.com/segin/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${MY_PV}/${PN}"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug xft xinerama"

RDEPEND="
	x11-libs/libXext
	x11-libs/libX11
	xft? ( x11-libs/libXft )
	xinerama? ( x11-libs/libXinerama )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

PATCHES=( "${FILESDIR}"/${P}-destdir-fix.patch )

src_prepare() {
	default

	# Let the package manager handle stripping
	sed -e 's/install -s/install/g' -i Makefile.in || die
}

src_configure() {
	# configure is not autotools based
	local myconfigureargs=(
		--prefix="${EPREFIX}/usr"
		--mandir="${EPREFIX}/usr/share/man"
		--cc="$(tc-getCC)"
		$(usev debug --enable-debug)
		$(usev !xft --disable-xft)
		$(usev !xinerama --disable-xinerama)
	)

	edo ./configure "${myconfigureargs[@]}"
}

src_install() {
	default

	docompress -x /usr/share/doc/${PF}/default_matwmrc
	dodoc default_matwmrc

	insinto /usr/share/xsessions
	doins "${FILESDIR}"/${PN}.desktop

	exeinto /etc/X11/Sessions
	newexe - ${PN} <<-EOF
	#!/bin/sh
	${PN}
	EOF
}