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