*/*: [QA] Remove redundant `|| die` guards
[gentoo.git] / x11-wm / fvwm / fvwm-2.6.8-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools flag-o-matic desktop
6
7 DESCRIPTION="An extremely powerful ICCCM-compliant multiple virtual desktop window manager"
8 HOMEPAGE="http://www.fvwm.org/"
9 SRC_URI="https://github.com/fvwmorg/fvwm/releases/download/${PV}/${P}.tar.gz"
10
11 LICENSE="GPL-2 FVWM"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
14 IUSE="bidi debug doc netpbm nls perl png readline rplay stroke svg tk truetype +vanilla xinerama lock"
15
16 COMMON_DEPEND="
17         sys-libs/zlib
18         x11-libs/libICE
19         x11-libs/libSM
20         x11-libs/libX11
21         x11-libs/libXau
22         x11-libs/libxcb
23         x11-libs/libXcursor
24         x11-libs/libXdmcp
25         x11-libs/libXext
26         x11-libs/libXfixes
27         x11-libs/libXpm
28         x11-libs/libXrandr
29         x11-libs/libXrender
30         virtual/libiconv
31         bidi? ( dev-libs/fribidi )
32         nls? ( virtual/libintl )
33         png? ( media-libs/libpng:0= )
34         readline? (
35                 sys-libs/ncurses:0=
36                 sys-libs/readline:0=
37         )
38         stroke? ( dev-libs/libstroke )
39         svg? ( gnome-base/librsvg )
40         truetype? (
41                 media-libs/fontconfig
42                 x11-libs/libXft
43         )
44         xinerama? ( x11-libs/libXinerama )
45 "
46 RDEPEND="${COMMON_DEPEND}
47         dev-lang/perl
48         perl? ( tk? (
49                         dev-lang/tk
50                         dev-perl/Tk
51                         >=dev-perl/X11-Protocol-0.56
52                 )
53         )
54         rplay? ( media-sound/rplay )
55         lock? ( x11-misc/xlockmore )
56         userland_GNU? ( sys-apps/debianutils )
57         !x86-fbsd? ( netpbm? ( media-libs/netpbm ) )
58 "
59 DEPEND="${COMMON_DEPEND}
60         virtual/pkgconfig
61         x11-base/xorg-proto
62         doc? ( dev-libs/libxslt )
63 "
64
65 src_prepare() {
66         if ! use vanilla; then
67                 # Enables fast translucent menus; patch from fvwm-user mailing list.
68                 eapply -p0 "${FILESDIR}/${PN}-2.5.27-translucent-menus.diff"
69
70                 # Allow more mouse buttons, bug #411811
71                 eapply -p0 "${FILESDIR}/${PN}-2.6.5-mouse-buttons.patch"
72         fi
73
74         eapply -p0 "${FILESDIR}/${PN}-2.6.5-ar.patch" #474528
75
76         # Fix for Perl 5.28
77         eapply -p0 "${FILESDIR}/${PN}-2.6.8-perl528.patch"
78
79         default
80         eautoreconf
81 }
82
83 src_configure() {
84         local myeconfargs=(
85                 --libexecdir="${EPREFIX}"/usr/$(get_libdir)
86                 --with-imagepath=/usr/include/X11/bitmaps:/usr/include/X11/pixmaps:/usr/share/icons/fvwm
87                 --enable-iconv
88                 --enable-package-subdirs
89                 --docdir="/usr/share/doc/${P}"
90                 $(use_enable bidi)
91                 $(use_enable debug debug-msgs)
92                 $(use_enable debug command-log)
93                 $(use_enable doc htmldoc)
94                 $(use_enable nls)
95                 $(use_enable perl perllib)
96                 $(use_enable png)
97                 $(use_with readline readline-library)
98                 $(use_with rplay rplay-library)
99                 $(use_with stroke stroke-library)
100                 $(use_enable svg rsvg)
101                 $(use_enable truetype xft)
102                 $(use_enable xinerama)
103         )
104
105         # Non-upstream email where bugs should be sent; used in fvwm-bug.
106         export FVWM_BUGADDR="maintainer-needed@gentoo.org"
107
108         # Recommended by upstream, reference ????
109         append-flags -fno-strict-aliasing
110
111         # Signed chars are required.
112         use ppc && append-flags -fsigned-char
113
114         use readline && myeconfargs+=( --without-termcap-library )
115
116         econf "${myeconfargs[@]}"
117 }
118
119 src_install() {
120         default
121         make_session_desktop fvwm /usr/bin/fvwm
122
123         if ! use lock; then
124                 find "${D}" -name '*fvwm-menu-xlock' -exec rm -f '{}' \; 2>/dev/null
125         fi
126
127         if use perl; then
128                 if ! use tk; then
129                         rm "${D}"/usr/share/fvwm/perllib/FVWM/Module/Tk.pm || die
130                         rm "${D}"/usr/share/fvwm/perllib/FVWM/Module/Toolkit.pm || die
131                         find "${D}"/usr/share/fvwm/perllib -depth -type d -exec rmdir '{}' \; 2>/dev/null
132                 fi
133         else
134                 # Completely wipe it if ! use perl
135                 rm -r "${D}"/usr/bin/fvwm-perllib "${D}"/usr/share/man/man1/fvwm-perllib.1
136         fi
137
138         # Utility for testing FVWM behaviour by creating a simple window with
139         # configurable hints.
140         if use debug; then
141                 dobin "${S}"/tests/hints/hints_test
142                 newdoc "${S}"/tests/hints/README README.hints
143         fi
144
145         dodir /etc/X11/Sessions
146         echo "/usr/bin/fvwm" > "${D}"/etc/X11/Sessions/${PN} || die
147         fperms a+x /etc/X11/Sessions/${PN}
148
149         dodoc docs/{COMMANDS,DEVELOPERS.md}
150
151         # README file for translucent menus patch.
152         if ! use vanilla; then
153                 dodoc "${FILESDIR}"/README.translucency
154                 ewarn "You are using a patched build, so, please, don't"
155                 ewarn "report bugs at the fvwm-workers list unless you are"
156                 ewarn "also able to reproduce them with a vanilla build (USE=vanilla)."
157         fi
158 }