From b180d4c5b30e1b64270556c78a3490c9f5039744 Mon Sep 17 00:00:00 2001 From: IgnorantGuru Date: Mon, 9 Mar 2015 13:22:15 -0600 Subject: [PATCH] [hand] optional video thumbnail support #384 --- Makefile.in | 2 + README | 33 +++--- aclocal.m4 | 82 ++++++++------ configure | 188 ++++++++++++++++++++++++++++----- configure.ac | 13 +++ data/Makefile.in | 2 + distros/debian/control | 6 +- distros/debian/control-gtk3 | 6 +- ltmain.sh | 32 +++--- src/Makefile.am | 3 +- src/Makefile.in | 5 +- src/ptk/ptk-file-list.c | 6 +- src/vfs/vfs-file-info.c | 4 +- src/vfs/vfs-thumbnail-loader.c | 11 +- 14 files changed, 294 insertions(+), 99 deletions(-) diff --git a/Makefile.in b/Makefile.in index ae031f6bd..2d9c44eb6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -250,6 +250,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FAM_CFLAGS = @FAM_CFLAGS@ FAM_LIBS = @FAM_LIBS@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ diff --git a/README b/README index ce4883bf3..b12b7db82 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for SpaceFM v0.9.4+ +README for SpaceFM v0.9.9+ Homepage: http://ignorantguru.github.io/spacefm/ @@ -81,16 +81,20 @@ BUILD GTK2 packages names on your distro may vary but should be similar): autotools-dev bash build-essential desktop-file-utils libc6 libcairo2 - libglib2.0-0 libglib2.0-dev libgtk2.0-0 (>=2.18) libgtk2.0-dev - libgtk2.0-bin libpango1.0-0 libx11-6 shared-mime-info intltool - pkg-config fakeroot libudev0 (>=143) libudev-dev + libffmpegthumbnailer-dev libglib2.0-0 libglib2.0-dev + libgtk2.0-0 (>=2.18) libgtk2.0-dev libgtk2.0-bin libpango1.0-0 + libx11-6 shared-mime-info intltool pkg-config fakeroot libudev0 (>=143) + libudev-dev Also Recommended: udevil|pmount|udisks eject lsof wget ktsuss|gksu|kdesu libstartup-notification0 libstartup-notification0-dev - dbus libdbus-1-3 libdbus-1-dev + dbus libdbus-1-3 libdbus-1-dev jmtpfs fuseiso configure will report anything missing when you run it as shown below. + Note: If you don't want video thumbnail support, add configure option + --disable-video-thumbnails and libffmpegthumbnailer is not required. + 2) Use these commands to download the SpaceFM tarball and build: # Download & Extract @@ -139,16 +143,19 @@ spacefm-gtk3 packages for your users. packages names on your distro may vary but should be similar): autotools-dev bash build-essential desktop-file-utils libc6 libcairo2 - libglib2.0-0 libglib2.0-dev libgtk-3-0 libgtk-3-dev libgtk-3-bin - libpango1.0-0 libx11-6 shared-mime-info intltool pkg-config fakeroot - libudev0 (>=143) libudev-dev + libffmpegthumbnailer-dev libglib2.0-0 libglib2.0-dev libgtk-3-0 + libgtk-3-dev libgtk-3-bin libpango1.0-0 libx11-6 shared-mime-info + intltool pkg-config fakeroot libudev0 (>=143) libudev-dev Also Recommended: udevil|pmount|udisks eject lsof wget ktsuss|gksu|kdesu libstartup-notification0 libstartup-notification0-dev - dbus libdbus-1-3 libdbus-1-dev + dbus libdbus-1-3 libdbus-1-dev jmtpfs fuseiso configure will report anything missing when you run it as shown below. + Note: If you don't want video thumbnail support, add configure option + --disable-video-thumbnails and libffmpegthumbnailer is not required. + 2) Use these commands to download the SpaceFM tarball and build: # Download & Extract @@ -192,9 +199,9 @@ actively developed, yet please report any build problems. packages names on your distro may vary but should be similar): autotools-dev bash build-essential desktop-file-utils libc6 libcairo2 - libglib2.0-0 libglib2.0-dev libgtk2.0-0 (>=2.18) libgtk2.0-dev - libgtk2.0-bin libpango1.0-0 libx11-6 shared-mime-info intltool - pkg-config fakeroot + libffmpegthumbnailer-dev libglib2.0-0 libglib2.0-dev + libgtk2.0-0 (>=2.18) libgtk2.0-dev libgtk2.0-bin libpango1.0-0 libx11-6 + shared-mime-info intltool pkg-config fakeroot hal libhal-dev libhal-storage-dev libhal-storage1 libhal1 dbus libdbus-1-3 libdbus-1-dev libdbus-glib-1-2 libdbus-glib-1-dev @@ -456,7 +463,7 @@ TRANSLATE LICENSE - SpaceFM - Copyright (C) 2014 GPL3+ + SpaceFM - Copyright (C) 2015 GPL3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the diff --git a/aclocal.m4 b/aclocal.m4 index 14466a496..325a66d8d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1977,7 +1977,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1989,9 +1989,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -2010,7 +2020,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -2353,7 +2366,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -3177,17 +3191,6 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -3304,7 +3307,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -3349,6 +3352,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -3908,10 +3923,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3950,11 +3961,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4702,7 +4713,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4766,7 +4777,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -5001,7 +5012,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -5243,6 +5254,9 @@ m4_if([$1], [CXX], [ ;; esac ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -5305,6 +5319,9 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -5526,7 +5543,7 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5703,6 +5720,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -6007,7 +6025,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6883,9 +6901,6 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -7047,7 +7062,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -10059,7 +10074,8 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further diff --git a/configure b/configure index c932ef9e3..7a145e802 100755 --- a/configure +++ b/configure @@ -648,6 +648,8 @@ MSGFMT_OPTS GETTEXT_PACKAGE NO_PIXMAPS_FALSE NO_PIXMAPS_TRUE +FFMPEG_LIBS +FFMPEG_CFLAGS DESKTOP_INTEGRATION_FALSE DESKTOP_INTEGRATION_TRUE FAM_LIBS @@ -843,6 +845,7 @@ enable_largefile enable_superuser_checks with_preferable_sudo enable_desktop_integration +enable_video_thumbnails enable_pixmaps ' ac_precious_vars='build_alias @@ -864,7 +867,9 @@ SN_LIBS HAL_CFLAGS HAL_LIBS LIBUDEV_CFLAGS -LIBUDEV_LIBS' +LIBUDEV_LIBS +FFMPEG_CFLAGS +FFMPEG_LIBS' # Initialize some variables set by options. @@ -1513,6 +1518,9 @@ Optional Features: --disable-desktop-integration disable desktop manager integration (default: enable) + --disable-video-thumbnails + disable libffmpegthumbnailer video thumbnails + (default: enable) --enable-pixmaps use share/pixmaps dir instead of share/icons dir to store icons (default: disable) @@ -1557,6 +1565,9 @@ Some influential environment variables: C compiler flags for LIBUDEV, overriding pkg-config LIBUDEV_LIBS linker flags for LIBUDEV, overriding pkg-config + FFMPEG_CFLAGS + C compiler flags for FFMPEG, overriding pkg-config + FFMPEG_LIBS linker flags for FFMPEG, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -2949,6 +2960,7 @@ END fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. @@ -5711,7 +5723,8 @@ else ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -6112,10 +6125,6 @@ freebsd* | dragonfly*) fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -6154,11 +6163,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -7235,7 +7244,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -7251,9 +7260,19 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -7272,7 +7291,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -9046,7 +9068,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9524,6 +9546,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; esac ld_shlibs=yes @@ -9745,7 +9770,7 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9922,6 +9947,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -10375,7 +10401,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -11212,17 +11238,6 @@ freebsd* | dragonfly*) esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -11339,7 +11354,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -11403,6 +11418,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -15425,6 +15452,112 @@ else fi +# Check whether --enable-video-thumbnails was given. +if test "${enable_video_thumbnails+set}" = set; then : + enableval=$enable_video_thumbnails; video_thumbnails=$enableval +else + video_thumbnails="yes" +fi + +if test x"$video_thumbnails" = "xyes"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FFMPEG" >&5 +$as_echo_n "checking for FFMPEG... " >&6; } + +if test -n "$FFMPEG_CFLAGS"; then + pkg_cv_FFMPEG_CFLAGS="$FFMPEG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffmpegthumbnailer\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libffmpegthumbnailer") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FFMPEG_CFLAGS=`$PKG_CONFIG --cflags "libffmpegthumbnailer" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FFMPEG_LIBS"; then + pkg_cv_FFMPEG_LIBS="$FFMPEG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libffmpegthumbnailer\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libffmpegthumbnailer") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FFMPEG_LIBS=`$PKG_CONFIG --libs "libffmpegthumbnailer" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FFMPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libffmpegthumbnailer" 2>&1` + else + FFMPEG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libffmpegthumbnailer" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FFMPEG_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libffmpegthumbnailer) were not met: + +$FFMPEG_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables FFMPEG_CFLAGS +and FFMPEG_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables FFMPEG_CFLAGS +and FFMPEG_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + FFMPEG_CFLAGS=$pkg_cv_FFMPEG_CFLAGS + FFMPEG_LIBS=$pkg_cv_FFMPEG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_FFMPEG=yes +fi + + + +$as_echo "#define HAVE_FFMPEG 1" >>confdefs.h + +fi + # Check whether --enable-pixmaps was given. if test "${enable_pixmaps+set}" = set; then : enableval=$enable_pixmaps; use_pixmaps=$enableval @@ -18509,6 +18642,7 @@ echo 'GTK+ Version................................. : GTK 2' fi echo Desktop manager integration.................. : $desktop_integration echo Startup notification......................... : $use_sn +echo Video thumbnail support...................... : $video_thumbnails echo echo 'Homepage: http://ignorantguru.github.com/spacefm/' echo diff --git a/configure.ac b/configure.ac index b5ba7ae18..5ce44efec 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,18 @@ if test x"$desktop_integration" = "xyes"; then fi AM_CONDITIONAL(DESKTOP_INTEGRATION, test "$desktop_integration" = "yes") +AC_ARG_ENABLE( + [video-thumbnails], + AS_HELP_STRING([--disable-video-thumbnails], + [disable libffmpegthumbnailer video thumbnails (default: enable)]), + video_thumbnails=$enableval, video_thumbnails="yes") +if test x"$video_thumbnails" = "xyes"; then + PKG_CHECK_MODULES( FFMPEG, libffmpegthumbnailer, HAVE_FFMPEG=yes) + AC_SUBST(FFMPEG_CFLAGS) + AC_SUBST(FFMPEG_LIBS) + AC_DEFINE(HAVE_FFMPEG, 1, [Whether to use video thumbnails or not.]) +fi + AC_ARG_ENABLE( [pixmaps], AS_HELP_STRING([--enable-pixmaps], @@ -334,6 +346,7 @@ echo 'GTK+ Version................................. : GTK 2' fi echo Desktop manager integration.................. : $desktop_integration echo Startup notification......................... : $use_sn +echo Video thumbnail support...................... : $video_thumbnails echo echo 'Homepage: http://ignorantguru.github.com/spacefm/' echo diff --git a/data/Makefile.in b/data/Makefile.in index 8c42aa8a1..c1b09d83c 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -172,6 +172,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FAM_CFLAGS = @FAM_CFLAGS@ FAM_LIBS = @FAM_LIBS@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ diff --git a/distros/debian/control b/distros/debian/control index 7af110eb3..5fbf28894 100644 --- a/distros/debian/control +++ b/distros/debian/control @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 7.0.50~), autotools-dev, bash, build-essential, desktop-file-utils, libc6, libcairo2, libglib2.0-0, libglib2.0-dev, libgtk2.0-0 (>= 2.18), libgtk2.0-dev, libgtk2.0-bin, libpango1.0-0, libx11-6, shared-mime-info, intltool, pkg-config, fakeroot, - libudev0 (>=143) | libudev1, libudev-dev + libudev0 (>=143) | libudev1, libudev-dev, libffmpegthumbnailer-dev Standards-Version: 3.9.1 Homepage: http://ignorantguru.github.com/spacefm/ @@ -14,11 +14,11 @@ Package: spacefm Architecture: any Depends: desktop-file-utils, bash (>=2.0), libc6, libcairo2, libglib2.0-0, libgtk2.0-0 (>= 2.18), libgtk2.0-bin, libpango1.0-0, libx11-6, - shared-mime-info, libudev0 (>=143) | libudev1 + shared-mime-info, libudev0 (>=143) | libudev1, libffmpegthumbnailer4 Recommends: Suggests: udevil, pmount, eject, udisks, lsof, wget, ktsuss, gksu, dbus, libdbus-1-3, libdbus-1-dev, libstartup-notification0, - libstartup-notification0-dev + libstartup-notification0-dev, jmtpfs, fuseiso Conflicts: spacefm-hal, spacefm-gtk3, spacefm-common Description: A multi-panel tabbed file manager with built-in VFS, udev-based device manager, customizable menu system, and bash integration. diff --git a/distros/debian/control-gtk3 b/distros/debian/control-gtk3 index e4d6e1425..25406033b 100644 --- a/distros/debian/control-gtk3 +++ b/distros/debian/control-gtk3 @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 7.0.50~), autotools-dev, build-essential, desktop-file-utils, libc6, libcairo2, libglib2.0-0, libglib2.0-dev, libgtk-3-0, libgtk-3-dev, libgtk-3-bin, libpango1.0-0, libx11-6, shared-mime-info, intltool, pkg-config, fakeroot, - libudev0 (>=143) | libudev1, libudev-dev + libudev0 (>=143) | libudev1, libudev-dev, libffmpegthumbnailer-dev Standards-Version: 3.9.1 Homepage: http://ignorantguru.github.com/spacefm/ @@ -14,11 +14,11 @@ Package: spacefm-gtk3 Architecture: any Depends: desktop-file-utils, bash (>=2.0), libc6, libcairo2, libglib2.0-0, libgtk-3-0, libgtk-3-bin, libpango1.0-0, libx11-6, shared-mime-info, - libudev0 (>=143) | libudev1 + libudev0 (>=143) | libudev1, libffmpegthumbnailer4 Recommends: Suggests: udevil, pmount, eject, udisks, lsof, wget, ktsuss, gksu, dbus, libdbus-1-3, libdbus-1-dev, libstartup-notification0, - libstartup-notification0-dev + libstartup-notification0-dev, jmtpfs, fuseiso Conflicts: spacefm, spacefm-hal, spacefm-common Description: A multi-panel tabbed file manager with built-in VFS, udev-based device manager, customizable menu system, and bash integration. GTK3 version. diff --git a/ltmain.sh b/ltmain.sh index 63ae69dc6..bb5fa024d 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.2 +VERSION="2.4.2 Debian-2.4.2-1.7" TIMESTAMP="" package_revision=1.3337 @@ -6124,7 +6124,10 @@ func_mode_link () case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6444,19 +6447,19 @@ func_mode_link () # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv @@ -7349,6 +7352,9 @@ func_mode_link () revision="$number_minor" lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; esac ;; no) diff --git a/src/Makefile.am b/src/Makefile.am index fe3ca6603..079637659 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,6 +119,7 @@ spacefm_CFLAGS = \ @SN_CFLAGS@ \ @HAL_CFLAGS@ \ @LIBUDEV_CFLAGS@ \ + @FFMPEG_CFLAGS@ \ @G_CAST_CHECKS@ \ -Werror-implicit-function-declaration @@ -129,7 +130,7 @@ spacefm_LDADD = \ @HAL_LIBS@ \ @SN_LIBS@ \ @LIBUDEV_LIBS@ \ - -lffmpegthumbnailer + @FFMPEG_LIBS@ noinst_PROGRAMS=xml-purge xml_purge_SOURCES=xml-purge.c diff --git a/src/Makefile.in b/src/Makefile.in index ea71c5227..8b8956fa8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -325,6 +325,8 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FAM_CFLAGS = @FAM_CFLAGS@ FAM_LIBS = @FAM_LIBS@ +FFMPEG_CFLAGS = @FFMPEG_CFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ @@ -565,6 +567,7 @@ spacefm_CFLAGS = \ @SN_CFLAGS@ \ @HAL_CFLAGS@ \ @LIBUDEV_CFLAGS@ \ + @FFMPEG_CFLAGS@ \ @G_CAST_CHECKS@ \ -Werror-implicit-function-declaration @@ -575,7 +578,7 @@ spacefm_LDADD = \ @HAL_LIBS@ \ @SN_LIBS@ \ @LIBUDEV_LIBS@ \ - -lffmpegthumbnailer + @FFMPEG_LIBS@ xml_purge_SOURCES = xml-purge.c xml_purge_CFLAGS = @GTK_CFLAGS@ diff --git a/src/ptk/ptk-file-list.c b/src/ptk/ptk-file-list.c index b14cd2268..092449f7d 100644 --- a/src/ptk/ptk-file-list.c +++ b/src/ptk/ptk-file-list.c @@ -448,7 +448,8 @@ void ptk_file_list_get_value ( GtkTreeModel *tree_model, case COL_FILE_BIG_ICON: icon = NULL; /* special file can use special icons saved as thumbnails*/ - if( vfs_file_info_is_video( info ) || list->max_thumbnail > vfs_file_info_get_size( info ) + if( vfs_file_info_is_video( info ) || + list->max_thumbnail > vfs_file_info_get_size( info ) && info->flags == VFS_FILE_INFO_NONE ) icon = vfs_file_info_get_big_thumbnail( info ); @@ -463,7 +464,8 @@ void ptk_file_list_get_value ( GtkTreeModel *tree_model, case COL_FILE_SMALL_ICON: icon = NULL; /* special file can use special icons saved as thumbnails*/ - if( vfs_file_info_is_video( info ) || list->max_thumbnail > vfs_file_info_get_size( info ) ) + if( vfs_file_info_is_video( info ) || + list->max_thumbnail > vfs_file_info_get_size( info ) ) icon = vfs_file_info_get_small_thumbnail( info ); if( !icon ) icon = vfs_file_info_get_small_icon( info ); diff --git a/src/vfs/vfs-file-info.c b/src/vfs/vfs-file-info.c index 8db6c3ebf..fb45e3cc9 100644 --- a/src/vfs/vfs-file-info.c +++ b/src/vfs/vfs-file-info.c @@ -663,8 +663,10 @@ gboolean vfs_file_info_is_image( VFSFileInfo* fi ) gboolean vfs_file_info_is_video( VFSFileInfo* fi ) { /* FIXME: We had better use functions of xdg_mime to check this */ - if ( ! strncmp( "video/", vfs_mime_type_get_type( fi->mime_type ), 6 )) +#ifdef HAVE_FFMPEG + if ( ! strncmp( "video/", vfs_mime_type_get_type( fi->mime_type ), 6 ) ) return TRUE; +#endif return FALSE; } diff --git a/src/vfs/vfs-thumbnail-loader.c b/src/vfs/vfs-thumbnail-loader.c index bd2d6c112..28bb2e069 100644 --- a/src/vfs/vfs-thumbnail-loader.c +++ b/src/vfs/vfs-thumbnail-loader.c @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_FFMPEG #include +#endif #if GLIB_CHECK_VERSION(2, 16, 0) #include "md5.h" /* for thumbnails */ @@ -331,14 +333,17 @@ static GdkPixbuf* _vfs_thumbnail_load( const char* file_path, const char* uri, int i, w, h; struct stat statbuf; GdkPixbuf* thumbnail, *result = NULL; - VFSMimeType* mimetype = vfs_mime_type_get_from_file_name( file_path ); - gboolean file_is_video = FALSE; + gboolean file_is_video = FALSE; +#ifdef HAVE_FFMPEG + VFSMimeType* mimetype = vfs_mime_type_get_from_file_name( file_path ); if ( mimetype ) { if ( strncmp( vfs_mime_type_get_type( mimetype ), "video/", 6 ) == 0 ) file_is_video = TRUE; + vfs_mime_type_unref( mimetype ); } +#endif if ( file_is_video == FALSE ) { @@ -400,6 +405,7 @@ static GdkPixbuf* _vfs_thumbnail_load( const char* file_path, const char* uri, chmod( thumbnail_file, 0600 ); /* only the owner can read it. */ } } +#ifdef HAVE_FFMPEG else { video_thumbnailer* video_thumb = video_thumbnailer_create(); @@ -414,6 +420,7 @@ static GdkPixbuf* _vfs_thumbnail_load( const char* file_path, const char* uri, thumbnail = gdk_pixbuf_new_from_file( thumbnail_file, NULL ); } } +#endif } if ( thumbnail )