summaryrefslogtreecommitdiff
blob: c733ff0ee36122d6f15ca940eef1985d14afa33b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit autotools desktop

DESCRIPTION="A lightweight window manager initially based on aewm++"
HOMEPAGE="
	https://www.pekwm.org/
	https://github.com/pekdon/pekwm
"
SRC_URI="
	https://github.com/pekdon/${PN}/archive/release-${PV}.tar.gz -> ${P}.tar.gz
	themes? ( https://dev.gentoo.org/~jer/${PN}-themes.tar.bz2 )
"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~mips ppc x86"
IUSE="contrib debug themes truetype xinerama"

RDEPEND="
	media-libs/libpng:0=
	virtual/jpeg:0
	x11-libs/libXpm
	x11-libs/libXrandr
	x11-libs/libXrender
	truetype? ( x11-libs/libXft )
	xinerama? ( x11-libs/libXinerama )
"
DEPEND="
	${RDEPEND}
	virtual/pkgconfig
"
S=${WORKDIR}/${PN}-release-${PV}

src_prepare() {
	if use themes; then
		rm "${WORKDIR}"/themes/Ace/.theme.swp || die
	fi

	default
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable debug) \
		$(use_enable truetype xft) \
		$(use_enable xinerama) \
		--enable-image-jpeg \
		--enable-image-png \
		--enable-image-xpm \
		--enable-shape \
		--enable-xrandr
}

src_install() {
	default

	# Install contributor scripts into doc folder
	if use contrib ; then
		docinto /usr/share/doc/${PF}/contrib
		dodoc contrib/lobo/{check.png,pekwm_autoprop.pl,pekwm_menu_config.pl} \
			contrib/lobo/{pekwm_menu_config.pl.vars,README,uncheck.png}
	fi

	if use themes; then
		insinto /usr/share/${PN}/themes
		doins -r "${WORKDIR}"/themes/*
	fi

	# Insert an Xsession
	echo -e "#!/bin/sh\n\n/usr/bin/${PN}" > "${T}"/${PN} || die
	exeinto /etc/X11/Sessions
	doexe "${T}"/${PN}

	# Insert a GDM/KDM xsession file
	make_session_desktop ${PN} ${PN}
}

pkg_postinst() {
	if use contrib ; then
		elog " User contributed scripts have been installed into:"
		elog " /usr/share/doc/${PF}/contrib"
	fi
}