Skip to content

Commit

Permalink
x11/xscreensaver: Adopt and clean up
Browse files Browse the repository at this point in the history
Take maintainership as discussed with manu via email. Also clean up:

- Remove USES=desktop-file-utils again, the desktop files don't register
  any MIME types
- Add USES=shebangfix to fix the perl shebang, remove manual patching
- Remove MAKE_JOBS_UNSAFE, parallel builds seem to work just fine
- Format according to portclippy recommendations
- Update local patches

Approved by:	x11 (manu)
  • Loading branch information
Zirias committed Oct 22, 2023
1 parent 120f67a commit f984e47
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 48 deletions.
68 changes: 31 additions & 37 deletions x11/xscreensaver/Makefile
Expand Up @@ -3,31 +3,32 @@ DISTVERSION= 6.07
CATEGORIES= x11
MASTER_SITES= http://www.jwz.org/xscreensaver/

MAINTAINER= x11@FreeBSD.org
MAINTAINER= zirias@FreeBSD.org
COMMENT= Save your screen while you entertain your cat
WWW= https://www.jwz.org/xscreensaver/

LICENSE= MIT

RUN_DEPENDS= giftopnm:graphics/netpbm \
p5-libwww>0:www/p5-libwww \
p5-LWP-Protocol-https>0:www/p5-LWP-Protocol-https \
unix-selfauth-helper>0:security/unix-selfauth-helper
LIB_DEPENDS= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2 \
libgle.so:graphics/gle \
libharfbuzz.so:print/harfbuzz
RUN_DEPENDS= giftopnm:graphics/netpbm \
p5-libwww>0:www/p5-libwww \
p5-LWP-Protocol-https>0:www/p5-LWP-Protocol-https \
unix-selfauth-helper>0:security/unix-selfauth-helper

USES= autoreconf cpe desktop-file-utils gettext gl gmake gnome \
jpeg localbase:ldflags perl5 pkgconfig xorg
USES= autoreconf cpe gettext gl gmake gnome jpeg localbase:ldflags \
perl5 pkgconfig shebangfix xorg
CPE_VENDOR= xscreensaver_project
USE_GL= gl glu
USE_GNOME= cairo gdkpixbuf2 gtk30 intltool libxml2
USE_PERL5= run
USE_XORG= ice sm x11 xext xft xi xinerama xmu xrandr xrender xt xxf86vm
CPE_VENDOR= xscreensaver_project

SHEBANG_FILES= hacks/check-configs.pl

GNU_CONFIGURE= yes
CONFIGURE_ENV+= PERL="${PERL}"
CONFIGURE_ARGS= --enable-locking \
--with-app-defaults=${PREFIX}/lib/X11/app-defaults/ \
--with-configdir=${PREFIX}/share/xscreensaver/config/ \
Expand All @@ -48,44 +49,39 @@ CONFIGURE_ARGS= --enable-locking \
--with-xshm-ext \
--without-kerberos \
--without-shadow
MAKE_ARGS+= install_prefix=${STAGEDIR}
MAKE_JOBS_UNSAFE= yes
CONFIGURE_ENV= PERL="${PERL}"

OPTIONS_DEFINE= FIREF NLS NSFW SETUID_HACKS XAOS1 XDALI XEARTH \
XMOUN XPLANET XSNOW
OPTIONS_SUB= yes
MAKE_ARGS= install_prefix=${STAGEDIR}

SETUID_HACKS_DESC= Install sonar hack suid so it can ping
SETUID_HACKS_CONFIGURE_WITH= setuid-hacks

FIREF_DESC= Add extra port x11/fireflies
FIREF_RUN_DEPENDS= ${LOCALBASE}/bin/xscreensaver-hacks/fireflies:x11/fireflies
SUB_FILES= xscreensaver-blank.desktop xscreensaver-lock.desktop \
xscreensaver-start.desktop xscreensaver-stop.desktop

NLS_USES= gettext-runtime
NLS_CONFIGURE_ENABLE= nls
OPTIONS_DEFINE= FIREF NLS NSFW SETUID_HACKS XAOS1 XDALI XEARTH XMOUN XPLANET \
XSNOW
OPTIONS_SUB= yes

FIREF_DESC= Add extra port x11/fireflies
NSFW_DESC= Include material that is Not Safe For Work

SETUID_HACKS_DESC= Install sonar hack suid so it can ping
XAOS1_DESC= Add extra port graphics/xaos
XAOS1_RUN_DEPENDS= xaos:graphics/xaos

XDALI_DESC= Add extra port x11-clocks/xdaliclock
XDALI_RUN_DEPENDS= xdaliclock:x11-clocks/xdaliclock

XEARTH_DESC= Add extra port astro/xearth
XEARTH_RUN_DEPENDS= xearth:astro/xearth

XMOUN_DESC= Add extra port graphics/xmountains
XMOUN_RUN_DEPENDS= xmountains:graphics/xmountains

XPLANET_DESC= Add extra port astro/xplanet
XPLANET_RUN_DEPENDS= xplanet:astro/xplanet

XSNOW_DESC= Add extra port x11/xsnow
XSNOW_RUN_DEPENDS= xsnow:x11/xsnow

SUB_FILES= xscreensaver-blank.desktop xscreensaver-lock.desktop \
xscreensaver-start.desktop xscreensaver-stop.desktop
FIREF_RUN_DEPENDS= ${FIREF_HACKBIN}:x11/fireflies
NLS_USES= gettext-runtime
NLS_CONFIGURE_ENABLE= nls
SETUID_HACKS_CONFIGURE_WITH= setuid-hacks
XAOS1_RUN_DEPENDS= xaos:graphics/xaos
XDALI_RUN_DEPENDS= xdaliclock:x11-clocks/xdaliclock
XEARTH_RUN_DEPENDS= xearth:astro/xearth
XMOUN_RUN_DEPENDS= xmountains:graphics/xmountains
XPLANET_RUN_DEPENDS= xplanet:astro/xplanet
XSNOW_RUN_DEPENDS= xsnow:x11/xsnow

FIREF_HACKBIN= ${LOCALBASE}/bin/xscreensaver-hacks/fireflies

post-patch:
${REINPLACE_CMD} -e 's|/usr/X11R6|${LOCALBASE}|g' \
Expand All @@ -94,8 +90,6 @@ post-patch:
${REINPLACE_CMD} -e "s|/etc/pam.d|${PREFIX}/etc/pam.d|g" \
${WRKSRC}/driver/passwd-pam.c \
${WRKSRC}/driver/xscreensaver.man
${REINPLACE_CMD} -e "s|/usr/bin/perl|${PREFIX}/bin/perl|" \
${WRKSRC}/hacks/check-configs.pl

post-patch-NSFW-off:
${REINPLACE_CMD} -e 's|Dick Pix|Stuff|' ${WRKSRC}/hacks/bsod.c
Expand Down
46 changes: 44 additions & 2 deletions x11/xscreensaver/files/patch-configure.ac
@@ -1,6 +1,30 @@
--- configure.ac.orig 2022-12-19 10:45:37 UTC
--- configure.ac.orig 2023-08-07 17:52:35 UTC
+++ configure.ac
@@ -4003,7 +4003,7 @@ fi
@@ -612,8 +612,8 @@ AC_DEFUN([AC_PATH_X_APP_DEFAULTS_DIRECT],[
/usr/share/X11/app-defaults \
\
/usr/X11/lib/app-defaults \
- /usr/X11R6/lib/app-defaults \
- /usr/X11R6/lib/X11/app-defaults \
+ /usr/local/lib/app-defaults \
+ /usr/local/lib/X11/app-defaults \
/usr/X11R5/lib/app-defaults \
/usr/X11R5/lib/X11/app-defaults \
/usr/X11R4/lib/app-defaults \
@@ -3181,10 +3181,10 @@ case "$with_textfile" in

#### Could use some more defaults here...
for f in \
- "/usr/X11R6/lib/X11/doc/README" \
+ "/usr/local/lib/X11/doc/README" \
"/usr/share/doc/xserver-common/copyright" \
"/usr/share/doc/xserver-xorg-core/copyright" \
- "/usr/X11R6/README" \
+ "/usr/local/README" \
"/usr/share/doc/libX11*/COPYING" \
"/usr/X11/share/X11/doc/README*" \
"/usr/share/doc/debian/debian-manifesto" \
@@ -4139,7 +4139,7 @@ PTY_LIBS=
###############################################################################

PTY_LIBS=
Expand All @@ -9,3 +33,21 @@
AC_CHECK_X_LIB(util, forkpty,
[PTY_LIBS="-lutil"
ac_have_forkpty=yes
@@ -4397,7 +4397,7 @@ if test -z "$PO_DATADIR" ; then
if test -z "$PO_DATADIR" ; then
#
# #### Total fucking kludge --
- # Map /build/prefix/usr/X11R6/share/ to /build/prefix/usr/share/
+ # Map /build/prefix/usr/local/share/ to /build/prefix/usr/share/
# but of course we need to expand all the nested variables to do that...
#
dd=`eval eval eval eval eval eval eval eval eval eval eval echo $datadir`
@@ -4665,7 +4665,7 @@ else
warn2 "detection of the various GTK libraries won't work."
CONF_STATUS=1
else
- pkgerr=`$pkg_config --list-all 2>&1 >/dev/null`
+ pkgerr=`$pkg_config --help 2>&1 >/dev/null`
if test "x$pkgerr" != "x" ; then
warnL 'The "pkg-config" program produces errors. This often causes'
warn2 "detection of the various GTK libraries to malfunction."
4 changes: 2 additions & 2 deletions x11/xscreensaver/files/patch-driver_Makefile.in
@@ -1,6 +1,6 @@
--- driver/Makefile.in.orig 2022-09-02 09:08:36 UTC
--- driver/Makefile.in.orig 2023-10-11 00:37:06 UTC
+++ driver/Makefile.in
@@ -78,7 +78,7 @@ INTL_LIBS = @INTLLIBS@
@@ -79,7 +79,7 @@ AD_DIR = @APPDEFAULTS@
AD_DIR = @APPDEFAULTS@

# $(sysconfdir) is either /usr/local/etc or /usr/etc but this must be /etc.
Expand Down
4 changes: 2 additions & 2 deletions x11/xscreensaver/files/patch-driver_XScreenSaver.ad.in
@@ -1,4 +1,4 @@
--- driver/XScreenSaver.ad.in.orig 2022-12-11 20:32:55 UTC
--- driver/XScreenSaver.ad.in.orig 2023-10-11 00:24:06 UTC
+++ driver/XScreenSaver.ad.in
@@ -55,7 +55,7 @@
*splashDuration: 0:00:05
Expand Down Expand Up @@ -37,7 +37,7 @@
maze --root \n\
@GL_KLUDGE@ GL: superquadrics --root \n\
attraction --root \n\
@@ -610,7 +622,6 @@ XScreenSaver.bourneShell: /bin/sh
@@ -615,7 +627,6 @@ - lcdscrub --root \n\
*hacks.dangerball.name: Danger Ball
*hacks.decayscreen.name: Decay Screen
*hacks.deepstars.name: Deep Stars
Expand Down
6 changes: 3 additions & 3 deletions x11/xscreensaver/files/patch-hacks_glx_Makefile.in
@@ -1,11 +1,11 @@
--- hacks/glx/Makefile.in.orig 2021-10-12 01:04:30 UTC
--- hacks/glx/Makefile.in.orig 2023-10-11 00:37:06 UTC
+++ hacks/glx/Makefile.in
@@ -40,7 +40,7 @@ DEPEND_DEFINES = @DEPEND_DEFINES@
@@ -40,7 +40,7 @@ INSTALL = @INSTALL@

SHELL = /bin/sh
INSTALL = @INSTALL@
-SUID_FLAGS = -o root -m 4755
+SUID_FLAGS = -m 4555
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_SETUID = $(INSTALL_PROGRAM) $(SUID_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
4 changes: 2 additions & 2 deletions x11/xscreensaver/files/patch-hacks_memscroller.c
@@ -1,6 +1,6 @@
--- hacks/memscroller.c.orig 2016-05-22 01:57:03 UTC
--- hacks/memscroller.c.orig 2023-01-28 21:15:50 UTC
+++ hacks/memscroller.c
@@ -306,13 +306,6 @@ open_file (state *st)
@@ -276,13 +276,6 @@ open_file (state *st)
from earlier days before the advent of virtual memory management."
-- sbrk(2) man page on BSD systems, as of 1995 or so.
*/
Expand Down

0 comments on commit f984e47

Please sign in to comment.