commit:     d768a17282bdc5db37625b6b2edce92667588d2a
Author:     Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx>
AuthorDate: Mon Jun  9 18:00:54 2025 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Jul 17 07:50:25 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d768a172

x11-misc/xscreensaver: fix implicit dependency on media-video/ffmpeg

Since version 6.07, xscreensaver could save videos, using
```media-video/ffmpeg```. But the ```configure``` flag
```--with-record-animation``` doesn't work to deactivate this feature.

Also, version 6.09 isn't compatible with recent ffmpeg versions.

Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx>
Part-of: https://github.com/gentoo/gentoo/pull/42397
Closes: https://github.com/gentoo/gentoo/pull/42397
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 .../files/xscreensaver-6.09-ffmpeg.patch           | 94 ++++++++++++++++++++++
 ...r-6.10.1.ebuild => xscreensaver-6.09-r2.ebuild} | 10 ++-
 ...6.10.1.ebuild => xscreensaver-6.10.1-r1.ebuild} |  7 +-
 3 files changed, 105 insertions(+), 6 deletions(-)

diff --git a/x11-misc/xscreensaver/files/xscreensaver-6.09-ffmpeg.patch 
b/x11-misc/xscreensaver/files/xscreensaver-6.09-ffmpeg.patch
new file mode 100644
index 000000000000..432530216e09
--- /dev/null
+++ b/x11-misc/xscreensaver/files/xscreensaver-6.09-ffmpeg.patch
@@ -0,0 +1,94 @@
+Since version 6.07, xscreensaver could save videos, using ffmpeg
+But the configure flag --with-record-animation doesn't work to
+deactivate this feature.
+
+Signed-off-by: Cristian Othón Martínez Vera <[email protected]>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -3992,6 +3992,28 @@
+   XFT_OBJS='$(UTILS_BIN)/xft.o'
+ fi
+ 
++###############################################################################
++#
++#       Check for --with-record-animation
++#
++###############################################################################
++
++record_anim_default=no
++record_anim="$record_anim_default"
++AC_ARG_WITH(record-animation,
++[  --with-record-animation Include code for generating MP4 videos.],
++  [record_anim="$withval"], [record_anim="$record_anim_default"])
++
++HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation)
++
++if test "$record_anim" = yes; then
++  true
++elif test "$record_anim" != no; then
++  echo "error: must be yes or no: --with-record-animation=$record_anim"
++  exit 1
++fi
++
++if test "$record_anim" = yes; then
+ 
+ 
###############################################################################
+ #
+@@ -4130,6 +4152,15 @@
+   FFMPEG_LIBS="$FFMPEG_LIBS $extra_ffmpeg_bs"
+ fi
+ 
++  if test "$have_ffmpeg" != yes; then
++    AC_MSG_WARN(--with-record-animation requires the ffmpeg libraries)
++  else
++    AC_MSG_RESULT(enabling --with-record-animation)
++    AC_DEFINE(HAVE_RECORD_ANIM)
++    ANIM_OBJS='$(ANIM_OBJS)'
++    ANIM_LIBS='$(ANIM_LIBS)'
++  fi
++fi
+ 
+ 
###############################################################################
+ #
+@@ -4221,40 +4252,6 @@
+   exit 1
+ fi
+ 
+-
+-###############################################################################
+-#
+-#       Check for --with-record-animation
+-#
+-###############################################################################
+-
+-record_anim_default=no
+-record_anim="$record_anim_default"
+-AC_ARG_WITH(record-animation,
+-[  --with-record-animation Include code for generating MP4 videos.],
+-  [record_anim="$withval"], [record_anim="$record_anim_default"])
+-
+-HANDLE_X_PATH_ARG(record_anim, --with-record-animation, record animation)
+-
+-if test "$record_anim" = yes; then
+-  true
+-elif test "$record_anim" != no; then
+-  echo "error: must be yes or no: --with-record-animation=$record_anim"
+-  exit 1
+-fi
+-
+-if test "$record_anim" = yes; then
+-  if test "$have_ffmpeg" != yes; then
+-    AC_MSG_WARN(--with-record-animation requires the ffmpeg libraries)
+-  else
+-    AC_MSG_RESULT(enabling --with-record-animation)
+-    AC_DEFINE(HAVE_RECORD_ANIM)
+-    ANIM_OBJS='$(ANIM_OBJS)'
+-    ANIM_LIBS='$(ANIM_LIBS)'
+-  fi
+-fi
+-
+-
+ 
###############################################################################
+ #
+ #       Done testing.  Now, set up the various -I and -L variables,

diff --git a/x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild 
b/x11-misc/xscreensaver/xscreensaver-6.09-r2.ebuild
similarity index 95%
copy from x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild
copy to x11-misc/xscreensaver/xscreensaver-6.09-r2.ebuild
index 912a7ecd7038..379a96cdae1c 100644
--- a/x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild
+++ b/x11-misc/xscreensaver/xscreensaver-6.09-r2.ebuild
@@ -8,7 +8,7 @@ inherit autotools flag-o-matic font optfeature pam 
strip-linguas systemd xdg-uti
 DESCRIPTION="Modular screen saver and locker for the X Window System"
 HOMEPAGE="https://www.jwz.org/xscreensaver/";
 SRC_URI="
-       https://www.jwz.org/xscreensaver/${PN}-${PV}.tar.gz
+       https://www.jwz.org/xscreensaver/${P}.tar.gz
        logind-idle-hint? (
                
https://github.com/Flowdalic/xscreensaver/commit/59e7974c42dc08411c9af2a3a644a582c2116f46.patch
 ->
                        ${PN}-6.06-logind-idle-hint.patch
@@ -19,7 +19,6 @@ SRC_URI="
        )
 "
 
-S="${WORKDIR}/${PN}-$(ver_cut 1-2)"
 # Font license mapping for folder ./hacks/fonts/ as following:
 #   clacon.ttf       -- MIT
 #   gallant12x22.ttf -- unclear, hence dropped
@@ -29,7 +28,7 @@ S="${WORKDIR}/${PN}-$(ver_cut 1-2)"
 LICENSE="BSD fonts? ( MIT Apache-2.0 ) systemd? ( ISC )"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv 
~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="elogind fonts gdm gles glx jpeg +locking logind-idle-hint new-login 
offensive pam +perl selinux suid systemd xinerama"
+IUSE="elogind ffmpeg fonts gdm gles glx jpeg +locking logind-idle-hint 
new-login offensive pam +perl selinux suid systemd xinerama"
 REQUIRED_USE="
        gles? ( !glx )
        ?? ( elogind systemd )
@@ -38,7 +37,7 @@ REQUIRED_USE="
 "
 
 COMMON_DEPEND="
-       >=dev-libs/libxml2-2.4.6
+       >=dev-libs/libxml2-2.4.6:=
        x11-apps/appres
        x11-apps/xwininfo
        x11-libs/libX11
@@ -51,6 +50,7 @@ COMMON_DEPEND="
        x11-libs/gdk-pixbuf-xlib
        >=x11-libs/gdk-pixbuf-2.42.0:2
        >=x11-libs/gtk+-3.0.0:3
+       ffmpeg? ( <media-video/ffmpeg-7:= )
        jpeg? ( media-libs/libjpeg-turbo:= )
        locking? ( virtual/libcrypt:= )
        new-login? (
@@ -99,6 +99,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-6.05-r2-configure-exit-codes.patch
        "${FILESDIR}"/${PN}-6.07-allow-no-pam.patch
        "${FILESDIR}"/${PN}-6.07-fix-desktop-files.patch
+       "${FILESDIR}"/${PN}-6.09-ffmpeg.patch
 )
 
 DOCS=( README{,.hacking} )
@@ -192,6 +193,7 @@ src_configure() {
                $(use_with systemd)
                $(use_with xinerama xinerama-ext)
                --with-jpeg=$(usex jpeg yes no)
+               --with-record-animation=$(usex ffmpeg yes no)
                --with-png=yes
                --with-xft=yes
                --with-app-defaults="${EPREFIX}"/usr/share/X11/app-defaults

diff --git a/x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild 
b/x11-misc/xscreensaver/xscreensaver-6.10.1-r1.ebuild
similarity index 96%
rename from x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild
rename to x11-misc/xscreensaver/xscreensaver-6.10.1-r1.ebuild
index 912a7ecd7038..e3206273e19f 100644
--- a/x11-misc/xscreensaver/xscreensaver-6.10.1.ebuild
+++ b/x11-misc/xscreensaver/xscreensaver-6.10.1-r1.ebuild
@@ -29,7 +29,7 @@ S="${WORKDIR}/${PN}-$(ver_cut 1-2)"
 LICENSE="BSD fonts? ( MIT Apache-2.0 ) systemd? ( ISC )"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv 
~sparc ~x86 ~amd64-linux ~x86-linux"
-IUSE="elogind fonts gdm gles glx jpeg +locking logind-idle-hint new-login 
offensive pam +perl selinux suid systemd xinerama"
+IUSE="elogind ffmpeg fonts gdm gles glx jpeg +locking logind-idle-hint 
new-login offensive pam +perl selinux suid systemd xinerama"
 REQUIRED_USE="
        gles? ( !glx )
        ?? ( elogind systemd )
@@ -38,7 +38,7 @@ REQUIRED_USE="
 "
 
 COMMON_DEPEND="
-       >=dev-libs/libxml2-2.4.6
+       >=dev-libs/libxml2-2.4.6:=
        x11-apps/appres
        x11-apps/xwininfo
        x11-libs/libX11
@@ -51,6 +51,7 @@ COMMON_DEPEND="
        x11-libs/gdk-pixbuf-xlib
        >=x11-libs/gdk-pixbuf-2.42.0:2
        >=x11-libs/gtk+-3.0.0:3
+       ffmpeg? ( media-video/ffmpeg:= )
        jpeg? ( media-libs/libjpeg-turbo:= )
        locking? ( virtual/libcrypt:= )
        new-login? (
@@ -99,6 +100,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-6.05-r2-configure-exit-codes.patch
        "${FILESDIR}"/${PN}-6.07-allow-no-pam.patch
        "${FILESDIR}"/${PN}-6.07-fix-desktop-files.patch
+       "${FILESDIR}"/${PN}-6.09-ffmpeg.patch
 )
 
 DOCS=( README{,.hacking} )
@@ -192,6 +194,7 @@ src_configure() {
                $(use_with systemd)
                $(use_with xinerama xinerama-ext)
                --with-jpeg=$(usex jpeg yes no)
+               --with-record-animation=$(usex ffmpeg yes no)
                --with-png=yes
                --with-xft=yes
                --with-app-defaults="${EPREFIX}"/usr/share/X11/app-defaults

Reply via email to