commit:     797e22a344c611216f9a503a5f5c3dedfd50c220
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 18:54:25 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 18:57:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=797e22a3

media-video/vlc: migrate to lua-single.eclass

Both the release (build-tested for both supported Lua implementations)
and the two live ebuilds (not build-tested because git.videolan.org is
extremely slow now but have confirmed in configure.ac that Lua-detection
logic hasn't changed and the associated patch applies cleanly - exactly
for 3.0.9999, with an offset for 9999). Supports 5.1 and 5.2 as per
upstream checks in configure.ac.

Closes: https://bugs.gentoo.org/752771
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../files/vlc-3.0.11.1-configure_lua_version.patch | 47 ++++++++++++++++++
 ...lc-3.0.9999.ebuild => vlc-3.0.11.1-r100.ebuild} | 57 ++++++++++++----------
 media-video/vlc/vlc-3.0.9999.ebuild                |  9 +++-
 media-video/vlc/vlc-9999.ebuild                    |  9 +++-
 profiles/package.mask                              |  1 +
 5 files changed, 94 insertions(+), 29 deletions(-)

diff --git a/media-video/vlc/files/vlc-3.0.11.1-configure_lua_version.patch 
b/media-video/vlc/files/vlc-3.0.11.1-configure_lua_version.patch
new file mode 100644
index 00000000000..0bf8faf4da8
--- /dev/null
+++ b/media-video/vlc/files/vlc-3.0.11.1-configure_lua_version.patch
@@ -0,0 +1,47 @@
+Only look for one single version of Lua: the one pointed to by the
+pkgconfig package 'lua'. The wrapper set up by lua eclasses will take care
+of the rest.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1676,37 +1676,10 @@
+     [disable LUA scripting support (default enabled)])])
+ if test "${enable_lua}" != "no"
+ then
+-  PKG_CHECK_MODULES(LUA, lua5.2,
++  PKG_CHECK_MODULES(LUA, lua,
+     [ have_lua=yes ],
+-    [
+-    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
+-
+-    PKG_CHECK_MODULES(LUA, lua5.1,
+-      [ have_lua=yes ],
+-      [
+-      AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
+-      PKG_CHECK_MODULES(LUA, lua >= 5.1,
+-        [ have_lua=yes ],
+-        [
+-          AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
+-          have_lua=yes
+-          AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
+-            [],
+-            [ have_lua=no ] )
+-          AC_CHECK_LIB(  lua5.2 , luaL_newstate,
+-            [LUA_LIBS="-llua5.2"],
+-          AC_CHECK_LIB( lua5.1 , luaL_newstate,
+-            [LUA_LIBS="-llua5.1"],
+-            AC_CHECK_LIB( lua51 , luaL_newstate,
+-              [LUA_LIBS="-llua51"],
+-              AC_CHECK_LIB( lua , luaL_newstate,
+-                [LUA_LIBS="-llua"],
+-                [ have_lua=no
+-                ], [-lm])
+-            )))
+-        ])
+-      ])
+-    ])
++    [ have_lua=no ]
++    )
+   if test "x${have_lua}" != "xyes" ;  then
+       AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces 
(rc, telnet, http) as well as many other custom scripts. Use --disable-lua to 
ignore this error.])
+   fi

diff --git a/media-video/vlc/vlc-3.0.9999.ebuild 
b/media-video/vlc/vlc-3.0.11.1-r100.ebuild
similarity index 92%
copy from media-video/vlc/vlc-3.0.9999.ebuild
copy to media-video/vlc/vlc-3.0.11.1-r100.ebuild
index 7b9bcc5e950..23ebcaad281 100644
--- a/media-video/vlc/vlc-3.0.9999.ebuild
+++ b/media-video/vlc/vlc-3.0.11.1-r100.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=7
 
+LUA_COMPAT=( lua5-{1..2} )
+
 MY_PV="${PV/_/-}"
 MY_PV="${MY_PV/-beta/-test}"
 MY_P="${PN}-${MY_PV}"
@@ -21,7 +23,7 @@ else
        fi
        KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 -sparc ~x86"
 fi
-inherit autotools flag-o-matic toolchain-funcs virtualx xdg
+inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg
 
 DESCRIPTION="Media player and framework with support for most multimedia files 
and streaming"
 HOMEPAGE="https://www.videolan.org/vlc/";
@@ -29,15 +31,16 @@ HOMEPAGE="https://www.videolan.org/vlc/";
 LICENSE="LGPL-2.1 GPL-2"
 SLOT="0/5-9" # vlc - vlccore
 
-IUSE="a52 alsa aom archive aribsub bidi bluray cddb chromaprint chromecast 
dav1d dbus
-       dc1394 debug directx dts +dvbpsi dvd +encode faad fdk +ffmpeg flac 
fluidsynth
-       fontconfig +gcrypt gme gnome-keyring gstreamer +gui ieee1394 jack jpeg 
kate
-       libass libcaca libnotify +libsamplerate libtar libtiger linsys lirc 
live lua
-       macosx-notifications mad matroska modplug mp3 mpeg mtp musepack ncurses 
nfs ogg
-       omxil optimisememory opus png projectm pulseaudio rdp run-as-root samba 
sdl-image
-       sftp shout sid skins soxr speex srt ssl svg taglib theora tremor 
truetype twolame
-       udev upnp vaapi v4l vdpau vnc vorbis vpx wayland +X x264 x265 xml 
zeroconf zvbi
-       cpu_flags_arm_neon cpu_flags_ppc_altivec cpu_flags_x86_mmx 
cpu_flags_x86_sse
+IUSE="a52 alsa aom archive aribsub bidi bluray cddb chromaprint chromecast
+       dav1d dbus dc1394 debug directx dts +dvbpsi dvd +encode faad fdk 
+ffmpeg flac
+       fluidsynth fontconfig +gcrypt gme gnome-keyring gstreamer ieee1394 jack 
jpeg kate
+       libass libcaca libnotify +libsamplerate libtar libtiger linsys lirc
+       live lua macosx-notifications mad matroska modplug mp3 mpeg mtp 
musepack ncurses
+       nfs ogg omxil optimisememory opus png projectm pulseaudio +qt5 rdp
+       run-as-root samba sdl-image sftp shout sid skins soxr speex srt ssl svg 
taglib
+       theora tremor truetype twolame udev upnp vaapi v4l vdpau vnc vorbis vpx 
wayland +X
+       x264 x265 xml zeroconf zvbi cpu_flags_arm_neon cpu_flags_ppc_altivec 
cpu_flags_x86_mmx
+       cpu_flags_x86_sse
 "
 REQUIRED_USE="
        chromecast? ( encode )
@@ -46,7 +49,8 @@ REQUIRED_USE="
        libcaca? ( X )
        libtar? ( skins )
        libtiger? ( kate )
-       skins? ( gui truetype X xml )
+       lua? ( ${LUA_REQUIRED_USE} )
+       skins? ( qt5 truetype X xml )
        ssl? ( gcrypt )
        vaapi? ( ffmpeg X )
        vdpau? ( ffmpeg X )
@@ -54,6 +58,7 @@ REQUIRED_USE="
 BDEPEND="
        >=sys-devel/gettext-0.19.8
        virtual/pkgconfig
+       lua? ( ${LUA_DEPS} )
        amd64? ( dev-lang/yasm )
        x86? ( dev-lang/yasm )
 "
@@ -78,7 +83,7 @@ RDEPEND="
        chromaprint? ( media-libs/chromaprint:= )
        chromecast? (
                >=dev-libs/protobuf-2.5.0:=
-               >=net-libs/libmicrodns-0.1.2:=
+               >=net-libs/libmicrodns-0.0.9:=
        )
        dav1d? ( media-libs/dav1d:= )
        dbus? ( sys-apps/dbus )
@@ -108,16 +113,6 @@ RDEPEND="
        gme? ( media-libs/game-music-emu )
        gnome-keyring? ( app-crypt/libsecret )
        gstreamer? ( >=media-libs/gst-plugins-base-1.4.5:1.0 )
-       gui? (
-               dev-qt/qtcore:5
-               dev-qt/qtgui:5
-               dev-qt/qtsvg:5
-               dev-qt/qtwidgets:5
-               X? (
-                       dev-qt/qtx11extras:5
-                       x11-libs/libX11
-               )
-       )
        ieee1394? (
                sys-libs/libavc1394
                sys-libs/libraw1394
@@ -142,7 +137,7 @@ RDEPEND="
        linsys? ( media-libs/zvbi )
        lirc? ( app-misc/lirc )
        live? ( media-plugins/live:= )
-       lua? ( >=dev-lang/lua-5.1:0= )
+       lua? ( ${LUA_DEPS} )
        mad? ( media-libs/libmad )
        matroska? (
                >=dev-libs/libebml-1.3.6:=
@@ -163,6 +158,16 @@ RDEPEND="
                media-libs/libprojectm
        )
        pulseaudio? ( media-sound/pulseaudio )
+       qt5? (
+               dev-qt/qtcore:5
+               dev-qt/qtgui:5
+               dev-qt/qtsvg:5
+               dev-qt/qtwidgets:5
+               X? (
+                       dev-qt/qtx11extras:5
+                       x11-libs/libX11
+               )
+       )
        rdp? ( >=net-misc/freerdp-2.0.0_rc0:=[client(+)] )
        samba? ( >=net-fs/samba-4.0.0:0[client,-debug(-)] )
        sdl-image? ( media-libs/sdl-image )
@@ -195,7 +200,7 @@ RDEPEND="
        )
        twolame? ( media-sound/twolame )
        udev? ( virtual/udev )
-       upnp? ( net-libs/libupnp:= )
+       upnp? ( net-libs/libupnp:=[ipv6] )
        v4l? ( media-libs/libv4l:= )
        vaapi? ( x11-libs/libva:=[drm,wayland?,X?] )
        vdpau? ( x11-libs/libvdpau )
@@ -226,6 +231,8 @@ PATCHES=(
        "${FILESDIR}"/${PN}-2.1.0-fix-libtremor-libs.patch # build system
        "${FILESDIR}"/${PN}-2.2.8-freerdp-2.patch # bug 590164
        "${FILESDIR}"/${PN}-3.0.6-fdk-aac-2.0.0.patch # bug 672290
+       "${FILESDIR}"/${PN}-3.0.8-qt-5.15.patch # TODO: upstream
+       "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
 )
 
 DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt )
@@ -319,7 +326,6 @@ src_configure() {
                $(use_enable gme)
                $(use_enable gnome-keyring secret)
                $(use_enable gstreamer gst-decode)
-               $(use_enable gui qt)
                $(use_enable ieee1394 dv1394)
                $(use_enable jack)
                $(use_enable jpeg)
@@ -352,6 +358,7 @@ src_configure() {
                $(use_enable png)
                $(use_enable projectm)
                $(use_enable pulseaudio pulse)
+               $(use_enable qt5 qt)
                $(use_enable rdp freerdp)
                $(use_enable run-as-root)
                $(use_enable samba smbclient)

diff --git a/media-video/vlc/vlc-3.0.9999.ebuild 
b/media-video/vlc/vlc-3.0.9999.ebuild
index 7b9bcc5e950..2cd26034d19 100644
--- a/media-video/vlc/vlc-3.0.9999.ebuild
+++ b/media-video/vlc/vlc-3.0.9999.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=7
 
+LUA_COMPAT=( lua5-{1..2} )
+
 MY_PV="${PV/_/-}"
 MY_PV="${MY_PV/-beta/-test}"
 MY_P="${PN}-${MY_PV}"
@@ -21,7 +23,7 @@ else
        fi
        KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 -sparc ~x86"
 fi
-inherit autotools flag-o-matic toolchain-funcs virtualx xdg
+inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg
 
 DESCRIPTION="Media player and framework with support for most multimedia files 
and streaming"
 HOMEPAGE="https://www.videolan.org/vlc/";
@@ -46,6 +48,7 @@ REQUIRED_USE="
        libcaca? ( X )
        libtar? ( skins )
        libtiger? ( kate )
+       lua? ( ${LUA_REQUIRED_USE} )
        skins? ( gui truetype X xml )
        ssl? ( gcrypt )
        vaapi? ( ffmpeg X )
@@ -54,6 +57,7 @@ REQUIRED_USE="
 BDEPEND="
        >=sys-devel/gettext-0.19.8
        virtual/pkgconfig
+       lua? ( ${LUA_DEPS} )
        amd64? ( dev-lang/yasm )
        x86? ( dev-lang/yasm )
 "
@@ -142,7 +146,7 @@ RDEPEND="
        linsys? ( media-libs/zvbi )
        lirc? ( app-misc/lirc )
        live? ( media-plugins/live:= )
-       lua? ( >=dev-lang/lua-5.1:0= )
+       lua? ( ${LUA_DEPS} )
        mad? ( media-libs/libmad )
        matroska? (
                >=dev-libs/libebml-1.3.6:=
@@ -226,6 +230,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-2.1.0-fix-libtremor-libs.patch # build system
        "${FILESDIR}"/${PN}-2.2.8-freerdp-2.patch # bug 590164
        "${FILESDIR}"/${PN}-3.0.6-fdk-aac-2.0.0.patch # bug 672290
+       "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
 )
 
 DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt )

diff --git a/media-video/vlc/vlc-9999.ebuild b/media-video/vlc/vlc-9999.ebuild
index a93a385cb40..bd6ded539cc 100644
--- a/media-video/vlc/vlc-9999.ebuild
+++ b/media-video/vlc/vlc-9999.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=7
 
+LUA_COMPAT=( lua5-{1..2} )
+
 MY_PV="${PV/_/-}"
 MY_PV="${MY_PV/-beta/-test}"
 MY_P="${PN}-${MY_PV}"
@@ -21,7 +23,7 @@ else
        fi
        KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 -sparc ~x86"
 fi
-inherit autotools flag-o-matic toolchain-funcs virtualx xdg
+inherit autotools flag-o-matic lua-single toolchain-funcs virtualx xdg
 
 DESCRIPTION="Media player and framework with support for most multimedia files 
and streaming"
 HOMEPAGE="https://www.videolan.org/vlc/";
@@ -46,6 +48,7 @@ REQUIRED_USE="
        libcaca? ( X )
        libtar? ( skins )
        libtiger? ( kate )
+       lua? ( ${LUA_REQUIRED_USE} )
        skins? ( gui truetype X xml )
        ssl? ( gcrypt )
        vaapi? ( ffmpeg X )
@@ -54,6 +57,7 @@ REQUIRED_USE="
 BDEPEND="
        >=sys-devel/gettext-0.19.8
        virtual/pkgconfig
+       lua? ( ${LUA_DEPS} )
        amd64? ( dev-lang/yasm )
        x86? ( dev-lang/yasm )
 "
@@ -144,7 +148,7 @@ RDEPEND="
        lirc? ( app-misc/lirc )
        live? ( media-plugins/live:= )
        loudness? ( >=media-libs/libebur128-1.2.4:= )
-       lua? ( >=dev-lang/lua-5.1:0= )
+       lua? ( ${LUA_DEPS} )
        mad? ( media-libs/libmad )
        matroska? (
                >=dev-libs/libebml-1.3.6:=
@@ -229,6 +233,7 @@ DEPEND="${RDEPEND}
 PATCHES=(
        "${FILESDIR}"/${PN}-2.1.0-fix-libtremor-libs.patch # build system
        "${FILESDIR}"/${PN}-2.2.8-freerdp-2.patch # bug 590164
+       "${FILESDIR}"/${PN}-3.0.11.1-configure_lua_version.patch
 )
 
 DOCS=( AUTHORS THANKS NEWS README doc/fortunes.txt )

diff --git a/profiles/package.mask b/profiles/package.mask
index b324197f5df..0288aa15bc7 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -591,6 +591,7 @@ gnome-base/orbit
 >=media-libs/libquvi-0.9.4-r100
 >=media-libs/libquvi-scripts-0.9.20131130-r100
 >=media-sound/aqualung-1.1-r100
+>=media-video/vlc-3.0.11.1-r100
 >=net-analyzer/suricata-6.0.1-r100
 >=net-im/prosody-0.11.7-r100
 >=net-im/swift-4.0.2-r100

Reply via email to