*/*: Discontinue Gentoo SuperH port
[gentoo.git] / x11-misc / xscreensaver / xscreensaver-5.43-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools desktop eutils flag-o-matic multilib pam
6
7 DESCRIPTION="A modular screen saver and locker for the X Window System"
8 HOMEPAGE="https://www.jwz.org/xscreensaver/"
9 SRC_URI="
10         https://www.jwz.org/xscreensaver/${P}.tar.gz -> ${P}-r1.tar.gz
11 "
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris"
16 IUSE="caps gdm jpeg new-login offensive opengl pam +perl selinux suid xinerama"
17
18 COMMON_DEPEND="
19         >=gnome-base/libglade-2
20         dev-libs/libxml2
21         media-libs/netpbm
22         x11-apps/appres
23         x11-apps/xwininfo
24         x11-libs/gdk-pixbuf:2[X]
25         x11-libs/gtk+:2
26         x11-libs/libX11
27         x11-libs/libXext
28         x11-libs/libXft
29         x11-libs/libXi
30         x11-libs/libXmu
31         x11-libs/libXrandr
32         x11-libs/libXt
33         x11-libs/libXxf86misc
34         x11-libs/libXxf86vm
35         caps? ( sys-libs/libcap )
36         jpeg? ( virtual/jpeg:0 )
37         new-login? (
38                 gdm? ( gnome-base/gdm )
39                 !gdm? ( || ( x11-misc/lightdm lxde-base/lxdm ) )
40                 )
41         opengl? (
42                 virtual/glu
43                 virtual/opengl
44         )
45         pam? ( sys-libs/pam )
46         xinerama? ( x11-libs/libXinerama )
47 "
48 # For USE="perl" see output of `qlist xscreensaver | grep bin | xargs grep '::'`
49 RDEPEND="
50         ${COMMON_DEPEND}
51         perl? (
52                 dev-lang/perl
53                 dev-perl/libwww-perl
54                 virtual/perl-Digest-MD5
55         )
56         selinux? ( sec-policy/selinux-xscreensaver )
57 "
58 DEPEND="
59         ${COMMON_DEPEND}
60         dev-util/intltool
61         sys-devel/bc
62         sys-devel/gettext
63         virtual/pkgconfig
64         x11-base/xorg-proto
65 "
66 PATCHES=(
67         "${FILESDIR}"/${PN}-5.05-interix.patch
68         "${FILESDIR}"/${PN}-5.20-blurb-hndl-test-passwd.patch
69         "${FILESDIR}"/${PN}-5.20-test-passwd-segv-tty.patch
70         "${FILESDIR}"/${PN}-5.20-tests-miscfix.patch
71         "${FILESDIR}"/${PN}-5.31-pragma.patch
72         "${FILESDIR}"/${PN}-5.43-gentoo.patch
73 )
74
75 src_prepare() {
76         sed -i configure.in -e '/^ALL_LINGUAS=/d' || die
77         strip-linguas -i po/
78         export ALL_LINGUAS="${LINGUAS}"
79
80         if use new-login && ! use gdm; then #392967
81                 sed -i \
82                         -e "/default_l.*1/s:gdmflexiserver -ls:${EPREFIX}/usr/libexec/lightdm/&:" \
83                         configure{,.in} || die
84         fi
85
86         default
87
88         use offensive || eapply "${FILESDIR}"/${PN}-5.43-offensive.patch
89
90         eapply_user
91
92         eautoconf
93         eautoheader
94 }
95
96 src_configure() {
97         if use ppc || use ppc64; then
98                 filter-flags -maltivec -mabi=altivec
99                 append-flags -U__VEC__
100         fi
101
102         unset BC_ENV_ARGS #24568
103         export RPM_PACKAGE_VERSION=no #368025
104
105         econf \
106                 $(use_with caps setcap-hacks) \
107                 $(use_with jpeg) \
108                 $(use_with new-login login-manager) \
109                 $(use_with opengl gl) \
110                 $(use_with pam) \
111                 $(use_with suid setuid-hacks) \
112                 $(use_with xinerama xinerama-ext) \
113                 --enable-locking \
114                 --with-configdir="${EPREFIX}"/usr/share/${PN}/config \
115                 --with-dpms-ext \
116                 --with-gtk \
117                 --with-hackdir="${EPREFIX}"/usr/$(get_libdir)/misc/${PN} \
118                 --with-pixbuf \
119                 --with-proc-interrupts \
120                 --with-randr-ext \
121                 --with-text-file="${EPREFIX}"/etc/gentoo-release \
122                 --with-x-app-defaults="${EPREFIX}"/usr/share/X11/app-defaults \
123                 --with-xdbe-ext \
124                 --with-xf86gamma-ext \
125                 --with-xf86vmode-ext \
126                 --with-xinput-ext \
127                 --with-xshm-ext \
128                 --without-gle \
129                 --without-kerberos \
130                 --x-includes="${EPREFIX}"/usr/include \
131                 --x-libraries="${EPREFIX}"/usr/$(get_libdir)
132 }
133
134 src_install() {
135         emake install_prefix="${D}" install
136
137         dodoc README{,.hacking}
138
139         use pam && fperms 755 /usr/bin/${PN}
140         pamd_mimic_system ${PN} auth
141
142         rm -f "${ED}"/usr/share/${PN}/config/{electricsheep,fireflies}.xml
143 }