dev-python/agate: Bump to 1.13.0
[gentoo/gentoo.git] / x11-misc / xscreensaver / xscreensaver-6.08.ebuild
blobfa0e6da22cd4acbb959b2b4719ce6dc66aab8ee8
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit autotools flag-o-matic font optfeature pam strip-linguas systemd xdg-utils
8 DESCRIPTION="Modular screen saver and locker for the X Window System"
9 HOMEPAGE="https://www.jwz.org/xscreensaver/"
10 SRC_URI="
11         https://www.jwz.org/xscreensaver/${P}.tar.gz
12         logind-idle-hint? (
13                 https://github.com/Flowdalic/xscreensaver/commit/59e7974c42dc08411c9af2a3a644a582c2116f46.patch ->
14                         ${PN}-6.06-logind-idle-hint.patch
15         )
16         systemd? (
17                 https://github.com/Flowdalic/xscreensaver/commit/376b07ec76cfe1070f498773aaec8fd7030593af.patch ->
18                         ${PN}-6.07-xscreensaver.service-start-with-no-splash.patch
19         )
22 # Font license mapping for folder ./hacks/fonts/ as following:
23 #   clacon.ttf       -- MIT
24 #   gallant12x22.ttf -- unclear, hence dropped
25 #   luximr.ttf       -- bh-luxi (package media-fonts/font-bh-ttf)
26 #   OCRAStd.otf      -- unclear, hence dropped
27 #   SpecialElite.ttf -- Apache-2.0
28 LICENSE="BSD fonts? ( MIT Apache-2.0 ) systemd? ( ISC )"
29 SLOT="0"
30 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux"
31 IUSE="elogind fonts gdm gles glx jpeg +locking logind-idle-hint new-login offensive pam +perl selinux suid systemd xinerama"
32 REQUIRED_USE="
33         gles? ( !glx )
34         ?? ( elogind systemd )
35         pam? ( locking )
36         logind-idle-hint? ( || ( elogind systemd ) )
39 COMMON_DEPEND="
40         >=dev-libs/libxml2-2.4.6
41         x11-apps/appres
42         x11-apps/xwininfo
43         x11-libs/libX11
44         x11-libs/libXext
45         x11-libs/libXi
46         x11-libs/libXrandr
47         x11-libs/libXt
48         x11-libs/libXxf86vm
49         elogind? ( sys-auth/elogind )
50         x11-libs/gdk-pixbuf-xlib
51         >=x11-libs/gdk-pixbuf-2.42.0:2
52         >=x11-libs/gtk+-3.0.0:3
53         jpeg? ( media-libs/libjpeg-turbo:= )
54         locking? ( virtual/libcrypt:= )
55         new-login? (
56                 gdm? ( gnome-base/gdm )
57                 !gdm? ( || ( x11-misc/lightdm lxde-base/lxdm ) )
58         )
59         virtual/glu
60         virtual/opengl
61         pam? ( sys-libs/pam )
62         media-libs/libpng:=
63         systemd? ( >=sys-apps/systemd-221 )
64         >=x11-libs/libXft-2.1.0
65         xinerama? ( x11-libs/libXinerama )
67 # For USE="perl" see output of `qlist xscreensaver | grep bin | xargs grep '::'`
68 RDEPEND="
69         ${COMMON_DEPEND}
70         media-gfx/fbida
71         perl? (
72                 dev-lang/perl
73                 dev-perl/libwww-perl
74                 virtual/perl-Digest-MD5
75         )
76         selinux? ( sec-policy/selinux-xscreensaver )
78 DEPEND="
79         ${COMMON_DEPEND}
80         x11-base/xorg-proto
82 BDEPEND="
83         dev-util/intltool
84         app-alternatives/bc
85         sys-devel/gettext
86         virtual/pkgconfig
88 PATCHES=(
89         "${FILESDIR}"/${PN}-5.31-pragma.patch
90         "${FILESDIR}"/${PN}-6.01-gentoo.patch
91         "${FILESDIR}"/${PN}-6.07-gcc.patch
92         "${FILESDIR}"/${PN}-6.01-configure.ac-sandbox.patch
93 #       "${FILESDIR}"/${PN}-6.01-without-gl-makefile.patch
94 #       "${FILESDIR}"/${PN}-6.01-non-gtk-install.patch
95         "${FILESDIR}"/${PN}-6.01-configure-install_sh.patch
96 #       "${FILESDIR}"/${PN}-6.03-without-gl-configure.patch
97         "${FILESDIR}"/${PN}-6.05-remove-update-icon-cache.patch
98 #       "${FILESDIR}"/${PN}-6.05-r2-configure-exit-codes.patch
99 #       "${FILESDIR}"/${PN}-6.05-get-dirs-from-gtk3.0-in-configure.patch
100         "${FILESDIR}"/${PN}-6.07-allow-no-pam.patch
101         "${FILESDIR}"/${PN}-6.07-fix-desktop-files.patch
104 DOCS=( README{,.hacking} )
106 # see https://bugs.gentoo.org/898328
107 QA_CONFIG_IMPL_DECL_SKIP=( getspnam_shadow )
109 src_prepare() {
110         default
112         # bug #896440
113         mv po/ca.po po/ca.po.old || die
114         iconv -f ISO-8859-15 -t UTF-8 po/ca.po.old >po/ca.po || die
116         sed -i configure.ac -e '/^ALL_LINGUAS=/d' || die
118         if use systemd; then
119                 # Causes "Failed to enable unit: Cannot alias xscreensaver.service as org.jwz.xscreensaver."
120                 # after "systemctl --user enable xscreensaver".
121                 sed -i -e '/^Alias=org.jwz.xscreensaver.service/d' \
122                         driver/xscreensaver.service.in || die
124                 eapply "${DISTDIR}/${PN}-6.07-xscreensaver.service-start-with-no-splash.patch"
125         fi
127         strip-linguas -i po/
128         export ALL_LINGUAS="${LINGUAS}"
130         if use new-login && ! use gdm; then #392967
131                 sed -i \
132                         -e "/default_l.*1/s:gdmflexiserver -ls:${EPREFIX}/usr/libexec/lightdm/&:" \
133                         configure{,.ac} || die
134         fi
136         # We are patching driver/XScreenSaver.ad.in, so let's delete the
137         # header generated from it so that it gets back in sync during build:
138         rm driver/XScreenSaver_ad.h || die
140         if ! use offensive; then
141                 sed -i \
142                         -e '/boobies/d;/boobs/d;/cock/d;/pussy/d;/viagra/d;/vibrator/d' \
143                         hacks/barcode.c || die
144                 sed -i \
145                         -e 's|erect penis|shuffle board|g' \
146                         -e 's|flaccid penis|flaccid anchor|g' \
147                         -e 's|vagina|engagement ring|g' \
148                         -e 's|Penis|Shuttle|g' \
149                         hacks/glx/glsnake.c || die
150                 sed -i \
151                         's| Stay.*fucking mask\.$||' \
152                         hacks/glx/covid19.man \
153                         hacks/config/covid19.xml || die
154                 eapply "${FILESDIR}/xscreensaver-6.05-teach-handsy-some-manners.patch"
155         fi
157         if use logind-idle-hint; then
158                 eapply "${DISTDIR}/${PN}-6.06-logind-idle-hint.patch"
159         fi
161         config_rpath_update "${S}"/config.rpath
163         # Must be eauto*re*conf, to force the rebuild
164         eautoreconf
167 src_configure() {
168         if use ppc || use ppc64; then
169                 filter-flags -maltivec -mabi=altivec
170                 append-flags -U__VEC__
171         fi
173         unset BC_ENV_ARGS #24568
175         # /proc/interrupts won't always have the keyboard bits needed
176         # Not clear this does anything in 6.03+(?) but let's keep it for now in case.
177         # (See also: configure argument)
178         export ac_cv_have_proc_interrupts=yes
180         # WARNING: This is NOT a normal autoconf script
181         # Some of the --with options are NOT standard, and expect "--with-X=no" rather than "--without-X"
182         ECONF_OPTS=(
183                 $(use_enable locking)
184                 $(use_with elogind)
185                 --with-pixbuf
186                 $(use_with gles)
187                 $(use_with glx)
188                 --with-gtk
189                 $(use_with new-login login-manager)
190                 $(use_with pam)
191                 $(use_with suid setuid-hacks)
192                 $(use_with systemd)
193                 $(use_with xinerama xinerama-ext)
194                 --with-jpeg=$(usex jpeg yes no)
195                 --with-png=yes
196                 --with-xft=yes
197                 --with-app-defaults="${EPREFIX}"/usr/share/X11/app-defaults
198                 --with-configdir="${EPREFIX}"/usr/share/${PN}/config
199                 --with-dpms-ext
200                 --with-hackdir="${EPREFIX}"/usr/$(get_libdir)/misc/${PN}
201                 --with-proc-interrupts
202                 --with-randr-ext
203                 --with-text-file="${EPREFIX}"/etc/gentoo-release
204                 --with-xdbe-ext
205                 --with-xf86gamma-ext
206                 --with-xf86vmode-ext
207                 --with-xinput-ext
208                 --with-xkb-ext
209                 --with-xshm-ext
210                 --without-gle
211                 --without-kerberos
212                 --without-motif
213                 --with-proc-oom
214                 --x-includes="${EPREFIX}"/usr/include
215                 --x-libraries="${EPREFIX}"/usr/$(get_libdir)
216         )
217         # WARNING: This is NOT a normal autoconf script
218         econf "${ECONF_OPTS[@]}"
221 src_compile() {
222         # stock target is "default", which is broken in some releases.
223         emake all
226 src_install() {
227         use pam && dodir /etc/pam.d/
228         emake install_prefix="${D}" DESTDIR="${D}" GTK_SHAREDIR="${installprefix}"/usr/share/xscreensaver install
230         if use fonts; then
231                 # Do not install fonts with unclear licensing
232                 rm -v "${ED}${FONTDIR}"/gallant12x22.ttf || die
234                 # Do not duplicate font Luxi Mono (of package media-fonts/font-bh-ttf)
235                 rm -v "${ED}${FONTDIR}"/luximr.ttf || die
237                 font_xfont_config
238         else
239                 rm -rfv "${ED}${FONTDIR}" || die #812473
240         fi
242         einstalldocs
244         if use pam; then
245                 fperms 755 /usr/bin/${PN}
246                 pamd_mimic_system ${PN} auth
247         fi
249         if use systemd; then
250                 systemd_douserunit "${ED}/usr/share/${PN}/xscreensaver.service"
251         fi
252         # Makefile installs xscreensaver.service regardless of
253         # --without-systemd, and if USE=systemd, we will have installed the
254         # unit file already.
255         rm "${ED}/usr/share/${PN}/xscreensaver.service" || die
257         # bug #885989
258         fperms 4755 /usr/$(get_libdir)/misc/xscreensaver/xscreensaver-auth
261 pkg_postinst() {
262         use fonts && font_pkg_postinst
264         # bug #811885
265         if ! use glx; then
266                 elog "Enable USE='glx' if OpenGL screensavers are crashing."
267         fi
269         optfeature 'Bitmap fonts 75dpi' media-fonts/font-adobe-75dpi
270         optfeature 'Bitmap fonts 100dpi' media-fonts/font-adobe-100dpi
271         optfeature 'Truetype font Luxi Mono' media-fonts/font-bh-ttf
273         xdg_icon_cache_update
276 pkg_postrm() {
277         use fonts && font_pkg_postrm
278         xdg_icon_cache_update