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