experimental/SFEvlc-1.1.4.1.spec: release to experimental, needs SFEqt47-gpp in new path layout and more work to find QT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/experimental/SFEvlc-1.1.4.1.spec Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,484 @@
+#
+# spec file for package SFEvlc
+#
+# includes module(s): vlc
+#
+
+##TODO##
+#'t find: SFElibdts developer/documentation-tool/gtk SUNWsmbau SUNWgtk
+#00:58 < Hazelesque2> and it complains that SUNWxwplt matches multiple packages
+
+
+
+
+
+
+
+
+
+# NOTE EXPERIMENTAL - current stat: 1.1.4.1 compiles, really needs a smart solution for NAME_MAX
+# see patch header in Patch24 vlc-24-1114-NAME_MAX-dirty-fix-need-rework-x11_factory.cpp.diff,
+# needs review of disabled patches if they still apply to 1.1.4.1,
+# X consolidation for build 153 adds "x11-xcb" which is needed for vlc to
+# display video inside the main window (and more) - see http://twitter.com/#!/alanc/status/29060334076
+# and http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6667057 Fixed in: snv_153
+
+
+
+# NOTE EXPERIMENTAL - does contain a few null pointer uses, so you might want to " LD_PRELOAD=/usr/lib/[email protected] vlc "
+# NOTE EXPERIMENTAL - uses SFEqt45 which is build by: pkgtool build experimental/SFEqt45-gcc.spec (no autodeps for experimentalif you don't add experimental directory to your .pkgtoolrc specdirs-line !)
+# make SFEqt45 *before* vlc, manually
+# NOTE EXPERIMENTAL - patches from old revision are not all reviewd if they are still needed
+
+# tickets
+#
+# Ticket #3034 (closed defect: fixed) https://trac.videolan.org/vlc/ticket/3034
+# confusing delayed Interface initialization failed message
+# Fixed by 1861697
+
+
+# Ticket #3036 (reopened patch) https://trac.videolan.org/vlc/ticket/3036
+# vlc-config calls /bin/sh but uses bash-isms
+
+# Ticket #3033 (new defect) https://trac.videolan.org/vlc/ticket/3033
+# lazy use of NULL pointers causes segfaults on Solaris
+
+# Ticket #3039 (new defect) https://trac.videolan.org/vlc/ticket/3039
+# no MMX symbols on Solaris 10?
+
+
+# ticket worked around here in he spec-file (see tickets related to patches below in the patch section)
+# Ticket #3035 (closed defect: fixed) https://trac.videolan.org/vlc/ticket/3035
+# Solaris needs explicit -lsocket
+# Fixed by d17b37c
+
+
+%include Solaris.inc
+%include osdistro.inc
+
+%define cc_is_gcc 1
+%define _gpp /usr/gnu/bin/g++
+%if %arch_sse2
+#######%define arch_opt --cpu=i686 --enable-mmx --enable-mmx2
+%include x86_sse2.inc
+%endif
+
+%include base.inc
+
+%define SUNWlibsdl %(/usr/bin/pkginfo -q SUNWlibsdl && echo 1 || echo 0)
+
+#we have new X-org with x11-xcb CR 6667057
+##TODO## check if other solarish OS do have same x11-xcb integrated with build 153
+%define huhu $( echo %{osbuild} > /tmp/osdistro.txt )
+%if %( expr %{osbuild} '>=' 153 )
+%define enable_x11_xcb 1
+%else
+%define enable_x11_xcb 0
+%endif
+
+%define src_name vlc
+%define src_url http://download.videolan.org/pub/videolan/vlc
+
+Name: SFEvlc
+Summary: vlc - the cross-platform media player and streaming server
+Version: 1.1.4.1
+Source: %{src_url}/%{version}/%{src_name}-%{version}.tar.bz2
+#Patch1: vlc-01-configure-no-pipe.diff
+#obsoleted by ticket #3027 Solaris does not have AF_LOCAL - define AF_LOCAL as AF_UNIX
+#Patch2: vlc-02-solaris.diff-1.0.1
+Patch3: vlc-03-1141-oss.diff
+Patch4: vlc-04-solaris_specific.diff
+Patch5: vlc-05-solaris-cmds.diff-1.0.1
+Patch6: vlc-06-intl.diff-1.0.1
+Patch7: vlc-07-live.diff-1.0.1
+Patch8: vlc-08-osdmenu_path.diff-1.0.1
+#pausiert ##TODO## ##FIXME## Patch9: vlc-09-pic-mmx.diff
+Patch10: vlc-10-real_codecs_path.diff-1.0.1
+Patch12: vlc-12-for-int-loop.diff-1.0.1
+#Patch13: vlc-13-x264-git-20090404.diff
+#https://trac.videolan.org/vlc/ticket/3028
+#Fixed by [23414d6]
+Patch14: vlc-14-modules-access-file.c-disable_have_fstatfs.diff
+Patch16: vlc-16-modules.c-file_offset_bits_ticket_3031.diff
+#seems only relevant to older SunOS releases (5.10, eventuall older builds of 5.11)
+##TODO## need rework to test for already existing dirfd else define
+#Patch17: vlc-17-dirfd-missing-ticket-3029-Fixed-by-c438250.diff
+#Patch17: vlc-17-1114-dirfd.diff
+Patch18: vlc-18-empty-struct.diff-1.0.1
+Patch21: vlc-21-1114-filesystem.c-NAME_MAX.diff
+Patch22: vlc-22-remove-dirent.h-checks.diff
+Patch23: vlc-23-1114-dirfd.diff
+Patch24: vlc-24-1114-NAME_MAX-dirty-fix-need-rework-x11_factory.cpp.diff
+
+#note: ts.c:2455:21: error: implicit declaration of function 'dvbpsi_SDTServiceAddDescriptor'
+#needs libdvbpsi >=0.1.6
+
+
+
+
+
+SUNW_BaseDir: %{_basedir}
+SUNW_BaseDir: %{_basedir}
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%include default-depend.inc
+
+%if %SUNWlibsdl
+BuildRequires: SUNWlibsdl-devel
+Requires: SUNWlibsdl
+%else
+BuildRequires: SFEsdl-devel
+Requires: SFEsdl
+%endif
+BuildRequires: SFEsdl-image-devel
+Requires: SFEsdl-image
+Requires: SUNWhal
+BuildRequires: SUNWdbus-devel
+Requires: SUNWdbus
+Requires: SUNWxorg-clientlibs
+BuildRequires: SUNWsmbau
+BuildRequires: SFElibfribidi-devel
+Requires: SFElibfribidi
+#BuildRequires: SFEfreetype-devel
+Requires: SUNWfreetype2
+BuildRequires: SFEliba52-devel
+Requires: SFEliba52
+BuildRequires: SFEffmpeg-devel
+Requires: SFEffmpeg
+BuildRequires: SFElibmad-devel
+Requires: SFElibmad
+BuildRequires: SFElibmpcdec-devel
+Requires: SFElibmpcdec
+BuildRequires: SFElibmatroska-devel
+Requires: SFElibmatroska
+BuildRequires: SUNWogg-vorbis-devel
+Requires: SUNWogg-vorbis
+BuildRequires: SFElibdvbpsi-devel
+Requires: SFElibdvbpsi
+BuildRequires: SFElibdvdnav-devel
+Requires: SFElibdvdnav
+BuildRequires: SFElibdts-devel
+Requires: SFElibdts
+BuildRequires: SFElibcddb-devel
+Requires: SFElibcddb
+BuildRequires: SFElibmpeg2-devel
+Requires: SFElibmpeg2
+BuildRequires: SFElibupnp-devel
+Requires: SFElibupnp
+BuildRequires: SFEvcdimager-devel
+Requires: SFEvcdimager
+BuildRequires: SFElibx264-devel
+Requires: SFElibx264
+BuildRequires: SFElibtar-devel
+Requires: SFElibtar
+%if %{enable_x11_xcb}
+BuildRequires: SFElibxcb-devel
+Requires: SFElibxcb
+%endif
+BuildRequires: SFElua
+Requires: SFElua
+
+##TODO## using gcc compiled qt 4.5.x from experimental/SFEqt45-gcc.s- must "pkgtool build" manually before, no autodeps available for specs in experimental/*
+BuildRequires: SFEqt47-gpp-devel
+Requires: SFEqt47-gpp
+
+%if %build_l10n
+%package l10n
+Summary: %{summary} - l10n files
+SUNW_BaseDir: %{_basedir}
+%include default-depend.inc
+Requires: %{name}
+%endif
+
+%package devel
+Summary: %{summary} - development files
+SUNW_BaseDir: %{_basedir}
+%include default-depend.inc
+Requires: %{name}
+
+%prep
+%setup -q -n vlc-%version
+#%patch1 -p1
+#obsolete ticket 3027 - %patch2 -p1
+%patch3 -p1
+##1.1.4.1 %patch4 -p1
+##1.1.4.1 %patch5 -p1
+##1.1.4.1 %patch6 -p1
+##1.1.4.1 %patch7 -p1
+##1.1.4.1 %patch8 -p1
+#%patch9 -p1
+##1.1.4.1 %patch10 -p1
+##1.1.4.1 %patch12 -p1
+##1.1.4.1 %patch14 -p1
+##1.1.4.1 %patch16 -p1
+##1.1.4.1 %patch18 -p1
+#seems only relevant to older SunOS releases (5.10, eventuall older builds of 5.11)
+##TODO## need rework to test for already existing dirfd else define
+#%patch17 -p1
+%patch21 -p1
+%patch22 -p1
+%patch23 -p1
+%patch24 -p1
+
+perl -w -pi.bak -e "s,#\!\s*/bin/sh,#\!/usr/bin/bash," `find . -type f -exec grep -q "#\!.*/bin/sh" {} \; -print | egrep -v "/libtool"`
+
+##TODO## experimental
+# text references
+#perl -w -pi.bakztext -e "s, -z def,," libtool
+
+#especially for configure.in ....
+perl -w -pi.bak2 -e "s,hostname -s,hostname," configure*
+
+%build
+CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
+if test "x$CPUS" = "x" -o $CPUS = 0; then
+ CPUS=1
+fi
+# ffmpeg is build with g++, therefore we need to build with g++
+
+%if %build_l10n
+nlsopt=-enable-nls
+%else
+nlsopt=-disable-nls
+%endif
+
+X11LIB="-L/usr/X11/lib -R/usr/X11/lib"
+GNULIB="-L/usr/gnu/lib -R/usr/gnu/lib"
+
+##evil!!! export PATH=/usr/gnu/bin:$PATH
+export ACLOCAL_FLAGS="-I %{_datadir}/aclocal -I ./m4"
+export CC=/usr/gnu/bin/gcc
+export CXX=/usr/gnu/bin/g++
+#export CXXFLAGS="%cxx_optflags"
+#export CFLAGS="%optflags -D_XOPEN_SOURCE=500 -D__C99FEATURES__ -D__EXTENSIONS__"
+#export CPPFLAGS="-D_XOPEN_SOURCE=500 -D__C99FEATURES__ -D__EXTENSIONS__ -I/usr/X11/include -I/usr/gnu/include -I/usr/include/libavcodec -I./include"
+#
+#notes to flags:
+# Ticket #3040 (closed defect: fixed) https://trac.videolan.org/vlc/ticket/3040
+# need to define _XPG4_2 on Solaris
+#
+#this page mentions Solaris *FLAGS etc.
+#export CFLAGS="-D _XPG4_2 -D __SunOS -D __STDC_ISO_10646__ -D __EXTENSIONS__ -features=extensions -fast"
+export CXXFLAGS="%cxx_optflags -D_XPG4_2 -D__C99FEATURES__ -D__EXTENSIONS__ -L/lib -R/lib"
+#export CFLAGS="%optflags -D_XPG4_2 -D__C99FEATURES__ -D__EXTENSIONS__ -D__STDC_ISO_10646__ -L/lib -R/lib"
+export CFLAGS="%optflags -D_XPG4_2 -D__C99FEATURES__ -D__EXTENSIONS__ -L/lib -R/lib"
+#give these flags only to the C-Pre-Processor
+export CPPFLAGS="-I/usr/X11/include -I/usr/gnu/include -I/usr/include/libavcodec -I./include -D_XPG4_2 -D__C99FEATURES__ -D__STDC_ISO_10646__ -D__EXTENSIONS__"
+
+%if %debug_build
+export CFLAGS="$CFLAGS -g"
+%else
+export CFLAGS="$CFLAGS -O4"
+%endif
+##TODO## experime
+#export LD=/usr/gnu/bin/ld
+#export LDFLAGS="%_ldflags $X11LIB $GNULIB"
+##TODO## experime
+export LDFLAGS="%_ldflags $X11LIB $GNULIB -lsocket -lxnet"
+#export LDFLAGS=" $X11LIB $GNULIB -lsocket -lxnet"
+
+
+export CONFIG_SHELL=/usr/bin/bash
+
+ln -s /usr/include/libavcodec include/ffmpeg
+#rm ./configure
+#./bootstrap
+perl -w -pi.bak3 -e "s,#\!\s*/bin/sh,#\!/usr/bin/bash," configure
+export QTDIR=/usr/g++
+./configure --prefix=%{_prefix} \
+ --bindir=%{_bindir} \
+ --mandir=%{_mandir} \
+ --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} \
+ --sysconfdir=%{_sysconfdir} \
+ --enable-shared \
+ --disable-static \
+ --disable-rpath \
+ --enable-mkv \
+ --enable-live555 \
+ --enable-ffmpeg \
+ --enable-xvid \
+ --enable-real \
+ --enable-realrtsp \
+ --disable-dvb \
+%if %{enable_x11_xcb}
+ --enable-xcb \
+%else
+ --disable-xcb \
+%endif
+%if %debug_build
+ --enable-debug=yes \
+%endif
+ --disable-static \
+ $nlsopt
+
+# --with-gnu-ld \
+
+
+%if %build_l10n
+printf '%%%s/\/intl\/libintl.a/-lintl/\nwq\n' | ex - vlc-config
+%endif
+
+# spatializer fails to compile, disable for now
+# Ticket #3037 (reopened defect) https://trac.videolan.org/vlc/ticket/3037
+# spatializer does not compile on Solaris
+perl -w -pi.bakspatializer -e "s, spatializer , ," vlc-config
+##TODO## experime
+#perl -w -pi.bak420 -e "s, (i420_rgb_mmx|i420_ymga|i420_ymga_mmx|i420_yuy2|i420_yuy2_mmx|i422_i420|i422_yuy2|i422_yuy2_mmx|yuy2_i420|yuy2_i422) ,," vlc-config
+
+#/bin/false
+
+gmake -j$CPUS
+
+%install
+rm -rf $RPM_BUILD_ROOT
+gmake install DESTDIR=$RPM_BUILD_ROOT
+#rm -f $RPM_BUILD_ROOT%{_libdir}/lib*a
+find $RPM_BUILD_ROOT%{_libdir}/ -name '*.la' -exec rm {} \;
+rm -f $RPM_BUILD_ROOT%{_libdir}/charset.alias
+
+%if %build_l10n
+%else
+# REMOVE l10n FILES
+rm -rf $RPM_BUILD_ROOT%{_datadir}/locale
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+( echo 'test -x /usr/bin/update-desktop-database || exit 0';
+ echo '/usr/bin/update-desktop-database'
+) | $BASEDIR/lib/postrun -b -u -c JDS_wait
+( echo 'test -x %{_bindir}/update-mime-database || exit 0';
+ echo '%{_bindir}/update-mime-database %{_datadir}/mime'
+) | $BASEDIR/lib/postrun -b -u -c JDS_wait
+( touch %{_datadir}/icons/hicolor || :
+ if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+ %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+ fi
+) | $PKG_INSTALL_ROOT/usr/lib/postrun -b -u
+
+%postun
+test -x $BASEDIR/lib/postrun || exit 0
+( echo 'test -x /usr/bin/update-desktop-database || exit 0';
+ echo '/usr/bin/update-desktop-database'
+) | $BASEDIR/lib/postrun -b -u -c JDS
+( echo 'test -x %{_bindir}/update-mime-database || exit 0';
+ echo '%{_bindir}/update-mime-database %{_datadir}/mime'
+) | $BASEDIR/lib/postrun -b -u -c JDS
+( touch %{_datadir}/icons/hicolor || :
+ if [ -x %{_bindir}/gtk-update-icon-cache ]; then
+ %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
+ fi
+) | $PKG_INSTALL_ROOT/usr/lib/postrun -b -u
+
+%files
+%defattr (-, root, bin)
+%dir %attr (0755, root, bin) %{_bindir}
+%{_bindir}/*
+%dir %attr (0755, root, sys) %{_datadir}
+%{_datadir}/vlc
+%dir %attr (0755, root, other) %{_datadir}/applications
+%{_datadir}/applications/*
+%dir %attr (0755, root, other) %{_datadir}/doc
+%{_datadir}/doc/*
+%dir %attr (0755, root, bin) %{_mandir}
+%dir %attr (0755, root, bin) %{_mandir}/man1
+%{_mandir}/man1/*
+%dir %attr (0755, root, bin) %{_libdir}
+%{_libdir}/vlc*
+%{_libdir}/libvlc*
+%dir %attr (-, root, other) %{_datadir}/icons
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/16x16
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/16x16/apps
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/32x32
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/32x32/apps
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/48x48
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/48x48/apps
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/128x128
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/128x128/apps
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/256x256
+%dir %attr (-, root, other) %{_datadir}/icons/hicolor/256x256/apps
+%{_datadir}/icons/hicolor/16x16/apps/*
+%{_datadir}/icons/hicolor/32x32/apps/*
+%{_datadir}/icons/hicolor/48x48/apps/*
+%{_datadir}/icons/hicolor/128x128/apps/*
+%{_datadir}/icons/hicolor/256x256/apps/*
+%dir %attr (-, root, other) %{_datadir}/kde4
+%dir %attr (-, root, other) %{_datadir}/kde4/apps
+%dir %attr (-, root, other) %{_datadir}/kde4/apps/solid
+%dir %attr (-, root, other) %{_datadir}/kde4/apps/solid/actions
+%{_datadir}/kde4/apps/solid/actions/*
+
+%if %build_l10n
+%files l10n
+%defattr (-, root, bin)
+%dir %attr (0755, root, sys) %{_datadir}
+%attr (-, root, other) %{_datadir}/locale
+%endif
+
+%files devel
+%defattr (-, root, bin)
+%{_includedir}
+#%dir %attr (0755, root, bin) %{_libdir}
+#%{_libdir}/lib*.a
+%dir %attr (0755, root, other) %{_libdir}/pkgconfig
+%{_libdir}/pkgconfig/*
+
+%changelog
+* Sat Mar 26 2011 - Thomas Wagner
+- use SFEqt47-gpp with new Path layout, set QTDIR=/usr/g++
+- add (Build)Requires: SFElua
+* Nov 11 2011 - Thomas Wagner
+- bump tp 1.1.4.1
+- switch to gmake to have 3.81 version at least (old cbe 1.6.2 uses gmake 3.80)
+- adjust %install for icons (remove extra mkdir/copy), add new icon directories to %files
+- add patches ...... vlc-21-1114-filesystem.c-NAME_MAX.diff, vlc-22-remove-dirent.h-checks.diff
+ vlc-23-1114-dirfd.diff, vlc-24-1114-NAME_MAX-dirty-fix-need-rework-x11_factory.cpp.diff
+- rework/name_new patches vlc-03-1.1.4.1-oss.diff, ......
+- remove patches ......
+- build with mmx
+- build with mpeg2
+- enable or disbale new xcb of xorg has x11-xcb integrated (%osbuild >= 153, CR 6667057)
+- add (Build)Requires: SFElibxcb(-devel) if %osbuild >= 153
+- note: ts.c:2455:21: error: implicit declaration of function 'dvbpsi_SDTServiceAddDescriptor'
+ needs libdvbpsi >=0.1.6 - upgrade your package with SFElibdvbpsi.spec (updated to 0.1.7)
+* Aug 26 2009 - Gilles dauphin
+- add patch , avoid empty struct for SS12
+* Fri Aug 14 2009 - Thomas Wagner
+- copy to encumbered/SFEvlc-1.0.1-experimental.spec
+- remove patch11 libprostproc detection is upstream
+- rework some patches for vlc-1.0.1
+- still does not link correctly with sun and gnu linker - volunteers welcome, please get in contact
+* April 2009 - Gilles Dauphin
+- postprocess.h is in libpostproc
+- TODO upgrade vlc, that's a nightmare
+* Thu Dec 02 2008 - [email protected]
+- try to use the actual SFE ffmpeg , probleme in new ffmpeg API
+- I just resign now, but... later i will retry
+- TODO link to libpostproc: s/postproc/libpostproc/ .
+* Thu Aug 07 2008 - [email protected]
+- Rename SFElibdvdread dependency to SFElibdvdnav
+* Fri Aug 3 2007 - [email protected]
+- Added devel and l10n
+- Added options to better find codecs
+- Added icons for app
+* Tue Jul 31 2007 - [email protected]
+- added --disable-rpath option
+- added SFElibx264 to the requirements
+* Sun Jul 15 2007 - [email protected]
+- --with-debug enables --enable-debug, added some dependencies
+* Sat Jul 14 2007 - [email protected]
+- Build with gcc
+* Fri Mar 23 2007 - [email protected]
+- Add two patches, 01-configure-no-pipe and 02-solaris. Add multiple
+ dependencies. Getting closer but not quite building yet.
+ Patch 01-configure-no-pipe removes the '-pipe' test. It causes problems later
+ with -DSYS_SOLARIS being added after -pipe and being rejected by the linker.
+ Patch 02-solaris.diff fixes two compiler issues. First involves expansion of
+ ?: code; second changes AF_LOCAL to AF_UNIX as the former is not defined in
+ <sys/socket.h>.
+
+* Thu Mar 22 2007 - [email protected]
+- Initial version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/vlc-03-1141-oss.diff Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,12 @@
+--- vlc-1.1.4.1/modules/audio_output/oss.c.orig 2010-09-24 11:31:59.000000000 +0200
++++ vlc-1.1.4.1/modules/audio_output/oss.c 2010-11-06 23:35:32.537525437 +0100
+@@ -32,6 +32,9 @@
+ #endif
+
+ #include <fcntl.h> /* open(), O_WRONLY */
++#ifdef sun
++#include <sys/file.h>
++#endif
+ #include <sys/ioctl.h> /* ioctl() */
+ #include <unistd.h> /* write(), close() */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/vlc-21-1114-filesystem.c-NAME_MAX.diff Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,69 @@
+Source: http://mailman.videolan.org/pipermail/vlc-devel/2010-June/075315.html
+
+
+[vlc-devel] [PATCH 1/2] Use pathconf() as NAME_MAX might be undefined
+Francois Cartegnie fcvlcdev at free.fr
+Thu Jun 10 23:25:31 CEST 2010
+
+
+SunOS <limits.h> deprecates and comments the NAME_MAX declartion.
+The defined _POSIX_NAME_MAX does not reflect the real value (14).
+Posix says that the reentrant readdir can either take NAME_MAX or
+pathconf.
+
+--- vlc-1.1.4.1/src/text/filesystem.c.orig 2010-09-24 11:32:04.000000000 +0200
++++ vlc-1.1.4.1/src/text/filesystem.c 2010-11-06 22:46:23.808298542 +0100
+@@ -38,11 +38,15 @@
+
+ #include <stdio.h>
+ #include <limits.h> /* NAME_MAX */
++#if !defined(NAME_MAX) && defined(_POSIX_NAME_MAX)
++# define NAME_MAX _POSIX_NAME_MAX
++#endif
+ #include <errno.h>
+ #include <sys/types.h>
+ #ifdef HAVE_DIRENT_H
+ # include <dirent.h>
+ #endif
++#include <stddef.h>
+ #ifdef HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+ #endif
+@@ -322,13 +326,30 @@
+
+ return FromWide (ent->d_name);
+ #else
+- struct dirent *ent;
+- struct
+- {
+- struct dirent ent;
+- char buf[NAME_MAX + 1];
+- } buf;
+- int val = readdir_r (dir, &buf.ent, &ent);
++ struct dirent *ent, *buf;
++ int fd;
++ int name_max;
++ #ifdef __SunOS
++ fd = dir->dd_fd; /* no dirfd on solaris */
++ #else
++ fd = dirfd( dir );
++ #endif
++ if ( fd == -1 ) return NULL;
++
++ name_max = fpathconf( fd, _PC_NAME_MAX );
++ if ( name_max == -1 )
++ #ifdef NAME_MAX
++ name_max = NAME_MAX;
++ #else
++ name_max = 260; /* libvlc.h FILENAME_MAX */
++ #endif
++
++ buf = (struct dirent *) malloc( (size_t) offsetof(struct dirent, d_name)
++ + ++name_max * sizeof(char) );
++ if ( buf == NULL ) return NULL;
++ int val = readdir_r (dir, buf, &ent);
++ if ( !ent || val) free(buf);
++
+ if (val)
+ {
+ errno = val;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/vlc-22-remove-dirent.h-checks.diff Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,164 @@
+From: RĂ©mi Denis-Courmont <[email protected]>
+Date: Tue, 3 Aug 2010 16:00:32 +0000 (+0300)
+Subject: Remove useless <dirent.h> check
+X-Git-Url: http://git.videolan.org/gitweb.cgi?p=vlc.git;a=commitdiff_plain;h=1da8392047446063f48bfaa61c1dc08be4461df8;hp=744ff759b3e319b47fb4b2b58fac8e5d9d684d7a
+
+Remove useless <dirent.h> check
+
+note: removed configure.ac changes from original post
+---
+
+diff --git a/modules/access/directory.c b/modules/access/directory.c
+index 121f622..b778cf0 100644
+--- a/modules/access/directory.c
++++ b/modules/access/directory.c
+@@ -46,9 +46,6 @@
+ # include <io.h>
+ #endif
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+ #ifdef __sun__
+ static inline int dirfd (DIR *dir)
+ {
+diff --git a/modules/control/http/http.h b/modules/control/http/http.h
+index 0eb33f4..ebf1efa 100644
+--- a/modules/control/http/http.h
++++ b/modules/control/http/http.h
+@@ -49,10 +49,6 @@
+ # include <io.h>
+ #endif
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+ /* stat() support for large files on win32 */
+ #if defined( WIN32 ) && !defined( UNDER_CE )
+ # define stat _stati64
+diff --git a/modules/demux/mkv/mkv.hpp b/modules/demux/mkv/mkv.hpp
+index 6b46c2a..296ef13 100644
+--- a/modules/demux/mkv/mkv.hpp
++++ b/modules/demux/mkv/mkv.hpp
+@@ -62,10 +62,6 @@
+ #include <vector>
+ #include <algorithm>
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+ /* libebml and matroska */
+ #include "ebml/EbmlHead.h"
+ #include "ebml/EbmlSubHead.h"
+diff --git a/modules/gui/skins2/src/theme_loader.cpp b/modules/gui/skins2/src/theme_loader.cpp
+index d1f76f2..7a67113 100644
+--- a/modules/gui/skins2/src/theme_loader.cpp
++++ b/modules/gui/skins2/src/theme_loader.cpp
+@@ -42,11 +42,6 @@
+ # include <direct.h>
+ #endif
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+-
+ #if defined( HAVE_ZLIB_H )
+ # include <zlib.h>
+ # include <errno.h>
+diff --git a/modules/gui/skins2/src/theme_repository.cpp b/modules/gui/skins2/src/theme_repository.cpp
+index 1dc83b1..0e335c9 100644
+--- a/modules/gui/skins2/src/theme_repository.cpp
++++ b/modules/gui/skins2/src/theme_repository.cpp
+@@ -30,9 +30,6 @@
+ #elif defined( WIN32 ) && !defined( UNDER_CE )
+ # include <direct.h>
+ #endif
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+
+ #include <fstream>
+
+diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
+index 5b7a82b..5c527d2 100644
+--- a/modules/misc/gnutls.c
++++ b/modules/misc/gnutls.c
+@@ -36,9 +36,6 @@
+
+ #include <sys/types.h>
+ #include <errno.h>
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+ #ifdef HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+ #endif
+diff --git a/src/extras/libc.c b/src/extras/libc.c
+index 1be7fe8..b0d17d1 100644
+--- a/src/extras/libc.c
++++ b/src/extras/libc.c
+@@ -32,6 +32,7 @@
+ #include <vlc_common.h>
+
+ #include <errno.h>
++#include <dirent.h>
+
+ #undef iconv_t
+ #undef iconv_open
+@@ -42,10 +43,6 @@
+ # include <iconv.h>
+ #endif
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+ #ifdef HAVE_FORK
+ # include <signal.h>
+ # include <unistd.h>
+diff --git a/src/input/subtitles.c b/src/input/subtitles.c
+index 3881d2f..9c6843d 100644
+--- a/src/input/subtitles.c
++++ b/src/input/subtitles.c
+@@ -35,10 +35,6 @@
+ #include <vlc_fs.h>
+ #include <vlc_url.h>
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+ #ifdef HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+diff --git a/src/modules/modules.c b/src/modules/modules.c
+index 15feab1..f6f0e75 100644
+--- a/src/modules/modules.c
++++ b/src/modules/modules.c
+@@ -39,10 +39,6 @@
+ #include <string.h> /* strdup() */
+ #include <assert.h>
+
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
+-
+ #include <sys/types.h>
+ #ifdef HAVE_SYS_STAT_H
+ # include <sys/stat.h>
+--- a/src/text/filesystem.c.orig2 2010-11-07 02:52:49.965882930 +0100
++++ b/src/text/filesystem.c 2010-11-07 02:53:59.436312636 +0100
+@@ -43,9 +43,7 @@
+ #endif
+ #include <errno.h>
+ #include <sys/types.h>
+-#ifdef HAVE_DIRENT_H
+-# include <dirent.h>
+-#endif
++#include <dirent.h>
+ #include <stddef.h>
+ #ifdef HAVE_SYS_STAT_H
+ # include <sys/stat.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/vlc-23-1114-dirfd.diff Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,15 @@
+--- vlc-1.1.4.1/modules/access/directory.c.orig 2010-11-07 02:58:48.788190957 +0100
++++ vlc-1.1.4.1/modules/access/directory.c 2010-11-07 03:07:54.938642264 +0100
+@@ -46,12 +46,6 @@
+ # include <io.h>
+ #endif
+
+-#ifdef __sun__
+-static inline int dirfd (DIR *dir)
+-{
+- return dir->dd_fd;
+-}
+-#endif
+
+ #include <vlc_fs.h>
+ #include <vlc_url.h>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/vlc-24-1114-NAME_MAX-dirty-fix-need-rework-x11_factory.cpp.diff Sun Mar 27 01:01:04 2011 +0000
@@ -0,0 +1,11 @@
+--- vlc-1.1.4.1/modules/gui/skins2/x11/x11_factory.cpp.orig Fr. Sep 24 11:31:59 2010
++++ vlc-1.1.4.1/modules/gui/skins2/x11/x11_factory.cpp So. Nov 7 11:40:04 2010
+@@ -211,7 +211,7 @@
+ struct
+ {
+ struct dirent ent;
+- char buf[NAME_MAX + 1];
++ char buf[8192 + 1];
+ } buf;
+ struct dirent *file;
+ DIR *dir;