From 92c04c80c74628394cb11446456c9db08a917998 Mon Sep 17 00:00:00 2001 From: Joachim Schiele Date: Fri, 9 Mar 2012 18:21:10 +0000 Subject: [PATCH] tvtime is now on nixos, thanks to the patches taken from the portage team! svn path=/nixpkgs/trunk/; revision=32962 --- pkgs/applications/video/tvtime/default.nix | 64 ++++++++++++++++ .../tvtime-1.0.2+linux-headers-2.6.18.patch | 15 ++++ .../video/tvtime/tvtime-1.0.2-autotools.patch | 73 +++++++++++++++++++ .../video/tvtime/tvtime-1.0.2-gcc41.patch | 57 +++++++++++++++ .../tvtime/tvtime-1.0.2-glibc-2.10.patch | 24 ++++++ .../video/tvtime/tvtime-1.0.2-libsupc++.patch | 16 ++++ .../video/tvtime/tvtime-1.0.2-xinerama.patch | 32 ++++++++ .../video/tvtime/tvtime-libpng-1.5.patch | 14 ++++ .../video/tvtime/tvtime-pic.patch | 11 +++ pkgs/top-level/all-packages.nix | 4 + 10 files changed, 310 insertions(+) create mode 100644 pkgs/applications/video/tvtime/default.nix create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2-autotools.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2-gcc41.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2-glibc-2.10.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2-libsupc++.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-1.0.2-xinerama.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-libpng-1.5.patch create mode 100644 pkgs/applications/video/tvtime/tvtime-pic.patch diff --git a/pkgs/applications/video/tvtime/default.nix b/pkgs/applications/video/tvtime/default.nix new file mode 100644 index 00000000000..eef6e9caf16 --- /dev/null +++ b/pkgs/applications/video/tvtime/default.nix @@ -0,0 +1,64 @@ +{stdenv, fetchurl, xlibs, libX11, libXtst, libSM, libXext, libXv, libXxf86vm, libXau, + libXdmcp, zlib, libpng, libxml2, freetype, libICE, intltool, libXinerama, gettext, + pkgconfig, kernel, file, libXi}: + +stdenv.mkDerivation rec { + name = "tvtime-1.0.2"; + + src = fetchurl { + url = "mirror://sourceforge/tvtime/${name}.tar.gz"; + sha256 = "aef2a4bab084df252428d66cabec61b4c63fab32cdfc0cc6599d82efd77f0523"; + }; + + # many of these patches were copied from gentoo's portage team (maybe all?!) + patchPhase = '' + # to avoid this error message: + # ...-glibc-2.12.2/include/xlocale.h:43:20: note: previous declaration of 'locale_t' was here + patch -p1 < ${ ./tvtime-1.0.2-glibc-2.10.patch} + + # to avoid this error message: + # videodev2.h:19:46: fatal error: linux/compiler.h: No such file or directory + sed -i -e "s/videodev.h/linux\/videodev.h/" src/videoinput.c + sed -i -e "s/videodev2.h/linux\/videodev2.h/" src/videoinput.c + + # to avoid this error message: + # 1 out of 2 hunks FAILED -- saving rejects to file src/Makefile.am.rej + patch -p1 < ${ ./tvtime-1.0.2-libsupc++.patch } + + # to avoid this error message: + # ../plugins/greedyh.asm:21:6: error: extra qualification 'DScalerFilterGreedyH::' on member 'filterDScaler_SSE' + patch -p1 < ${ ./tvtime-1.0.2-gcc41.patch } + + # compiles without this patch + patch -p1 < ${ ./tvtime-pic.patch } + + # compiles without this patch + patch -p1 < ${ ./tvtime-1.0.2-autotools.patch } + + # compiles without this patch + patch -p1 < ${ ./tvtime-1.0.2-xinerama.patch } + + # libpng 1.5 patch (gentoo) + patch -p1 < ${ ./tvtime-libpng-1.5.patch } + + # /usr/bin/file - ltmain.sh configure aclocal.m4 + sed -i -e "s%/usr/bin/file%/nix/store/f92pyxmbi274q7fzrfnlc2xiy6d3cyi1-file-5.04/bi/file%g" ltmain.sh + sed -i -e "s%/usr/bin/file%/nix/store/f92pyxmbi274q7fzrfnlc2xiy6d3cyi1-file-5.04/bin/file%g" configure + sed -i -e "s%/usr/bin/file%/nix/store/f92pyxmbi274q7fzrfnlc2xiy6d3cyi1-file-5.04/bin/file%g" aclocal.m4 + ''; + + configureFlags = '' + --x-includes=${xlibs.libX11}/include + --x-libraries=${xlibs.libX11}/lib + ''; + + buildInputs = [ libX11 libXtst libSM libXext libXv libXxf86vm libXau libXdmcp zlib libpng libxml2 freetype libICE intltool libXinerama gettext pkgconfig file libXi ]; + + meta = { + description = "High quality television application for use with video capture cards"; + homepage = lhttp://tvtime.sourceforge.net/; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [qknight]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch new file mode 100644 index 00000000000..b1cfd49f1ba --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch @@ -0,0 +1,15 @@ +Index: tvtime-1.0.2/src/videoinput.c +=================================================================== +--- tvtime-1.0.2.orig/src/videoinput.c ++++ tvtime-1.0.2/src/videoinput.c +@@ -35,8 +35,8 @@ + #ifdef HAVE_CONFIG_H + # include "config.h" + #endif +-#include "videodev.h" +-#include "videodev2.h" ++#include ++#include + #include "videoinput.h" + #include "mixer.h" + diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2-autotools.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2-autotools.patch new file mode 100644 index 00000000000..bf02ebefa52 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2-autotools.patch @@ -0,0 +1,73 @@ +Index: tvtime-1.0.2/src/Makefile.am +=================================================================== +--- tvtime-1.0.2.orig/src/Makefile.am ++++ tvtime-1.0.2/src/Makefile.am +@@ -19,9 +19,6 @@ pkgsysconfdir = $(sysconfdir)/@PACKAGE@ + tmpdir = /tmp + localedir = $(datadir)/locale + +-TTF_CFLAGS = `$(FREETYPE_CONFIG) --cflags` +-TTF_LIBS = `$(FREETYPE_CONFIG) --libs` +- + # Set the following if you want to specify an additional font directory + # FONT_CFLAGS = -DFONTDIR='/usr/share/fonts/truetype/freefont/' + +@@ -76,20 +73,20 @@ tvtime_SOURCES = $(COMMON_SRCS) $(OUTPUT + tvtime_CFLAGS = $(TTF_CFLAGS) $(PNG_CFLAGS) $(OPT_CFLAGS) \ + $(PLUGIN_CFLAGS) $(X11_CFLAGS) $(XML2_FLAG) \ + $(FONT_CFLAGS) $(AM_CFLAGS) +-tvtime_LDFLAGS = $(TTF_LIBS) $(ZLIB_LIBS) $(PNG_LIBS) \ ++tvtime_LDADD = $(TTF_LIBS) $(ZLIB_LIBS) $(PNG_LIBS) \ + $(X11_LIBS) $(XML2_LIBS) -lm -lsupc++ + + tvtime_command_SOURCES = utils.h utils.c tvtimeconf.h tvtimeconf.c \ + tvtime-command.c + tvtime_command_CFLAGS = $(OPT_CFLAGS) $(XML2_FLAG) $(AM_CFLAGS) +-tvtime_command_LDFLAGS = $(ZLIB_LIBS) $(XML2_LIBS) ++tvtime_command_LDADD = $(ZLIB_LIBS) $(XML2_LIBS) + tvtime_configure_SOURCES = utils.h utils.c tvtimeconf.h tvtimeconf.c \ + tvtime-configure.c + tvtime_configure_CFLAGS = $(OPT_CFLAGS) $(XML2_FLAG) $(AM_CFLAGS) +-tvtime_configure_LDFLAGS = $(ZLIB_LIBS) $(XML2_LIBS) ++tvtime_configure_LDADD = $(ZLIB_LIBS) $(XML2_LIBS) + tvtime_scanner_SOURCES = utils.h utils.c videoinput.h videoinput.c \ + tvtimeconf.h tvtimeconf.c station.h station.c tvtime-scanner.c \ + mixer.h mixer.c + tvtime_scanner_CFLAGS = $(OPT_CFLAGS) $(XML2_FLAG) $(AM_CFLAGS) +-tvtime_scanner_LDFLAGS = $(ZLIB_LIBS) $(XML2_LIBS) ++tvtime_scanner_LDADD = $(ZLIB_LIBS) $(XML2_LIBS) + +Index: tvtime-1.0.2/configure.ac +=================================================================== +--- tvtime-1.0.2.orig/configure.ac ++++ tvtime-1.0.2/configure.ac +@@ -10,6 +10,7 @@ if test x"$host_alias" = x""; then host_ + + # Check for compilers. + AC_PROG_CC ++AM_PROG_CC_C_O + AC_CHECK_PROG(found_cc, "$CC", yes, no) + test "x$found_cc" = "xyes" || exit 1 + +@@ -17,9 +18,6 @@ AC_PROG_CXX + AC_CHECK_PROG(found_cxx, "$CXX", yes, no) + test "x$found_cxx" = "xyes" || exit 1 + +-# Check for libtool. +-AC_PROG_LIBTOOL +- + # Checks for header files. + AC_HEADER_STDC + AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h langinfo.h math.h netinet/in.h pwd.h signal.h stdint.h stdio.h stdlib.h string.h sys/ioctl.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/wait.h sys/types.h unistd.h wordexp.h locale.h]) +@@ -65,10 +63,7 @@ dnl ------------------------------------ + dnl freetype + dnl --------------------------------------------- + dnl Test for freetype +-AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no) +-if test "$FREETYPE_CONFIG" = "no" ; then +- AC_MSG_ERROR(freetype2 needed and freetype-config not found) +-fi ++PKG_CHECK_MODULES([TTF], [freetype2]) + + dnl --------------------------------------------- + dnl libxml2 diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2-gcc41.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2-gcc41.patch new file mode 100644 index 00000000000..58e9bb204e1 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2-gcc41.patch @@ -0,0 +1,57 @@ +diff -Naur tvtime-1.0.1/plugins/greedyh.asm tvtime-1.0.1-gcc41/plugins/greedyh.asm +--- tvtime-1.0.1/plugins/greedyh.asm 2005-08-14 18:16:43.000000000 +0200 ++++ tvtime-1.0.1-gcc41/plugins/greedyh.asm 2005-11-28 17:53:09.210774544 +0100 +@@ -18,7 +18,7 @@ + + #include "x86-64_macros.inc" + +-void DScalerFilterGreedyH::FUNCT_NAME(TDeinterlaceInfo* pInfo) ++void FUNCT_NAME(TDeinterlaceInfo* pInfo) + { + int64_t i; + bool InfoIsOdd = (pInfo->PictureHistory[0]->Flags & PICTURE_INTERLACED_ODD) ? 1 : 0; +diff -Naur tvtime-1.0.1/plugins/tomsmocomp/TomsMoCompAll2.inc tvtime-1.0.1-gcc41/plugins/tomsmocomp/TomsMoCompAll2.inc +--- tvtime-1.0.1/plugins/tomsmocomp/TomsMoCompAll2.inc 2004-10-20 17:31:05.000000000 +0200 ++++ tvtime-1.0.1-gcc41/plugins/tomsmocomp/TomsMoCompAll2.inc 2005-11-28 17:53:33.251119856 +0100 +@@ -5,9 +5,9 @@ + #endif + + #ifdef USE_STRANGE_BOB +-#define SEARCH_EFFORT_FUNC(n) DScalerFilterTomsMoComp::SEFUNC(n##_SB) ++#define SEARCH_EFFORT_FUNC(n) SEFUNC(n##_SB) + #else +-#define SEARCH_EFFORT_FUNC(n) DScalerFilterTomsMoComp::SEFUNC(n) ++#define SEARCH_EFFORT_FUNC(n) SEFUNC(n) + #endif + + int SEARCH_EFFORT_FUNC(0) // we don't try at all ;-) +diff -Naur tvtime-1.0.1/plugins/tomsmocomp.cpp tvtime-1.0.1-gcc41/plugins/tomsmocomp.cpp +--- tvtime-1.0.1/plugins/tomsmocomp.cpp 2004-10-20 19:38:04.000000000 +0200 ++++ tvtime-1.0.1-gcc41/plugins/tomsmocomp.cpp 2005-11-28 17:52:53.862107896 +0100 +@@ -31,7 +31,7 @@ + + #define IS_MMX + #define SSE_TYPE MMX +-#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_MMX ++#define FUNCT_NAME filterDScaler_MMX + #include "tomsmocomp/TomsMoCompAll.inc" + #undef IS_MMX + #undef SSE_TYPE +@@ -39,7 +39,7 @@ + + #define IS_3DNOW + #define SSE_TYPE 3DNOW +-#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_3DNOW ++#define FUNCT_NAME filterDScaler_3DNOW + #include "tomsmocomp/TomsMoCompAll.inc" + #undef IS_3DNOW + #undef SSE_TYPE +@@ -47,7 +47,7 @@ + + #define IS_SSE + #define SSE_TYPE SSE +-#define FUNCT_NAME DScalerFilterTomsMoComp::filterDScaler_SSE ++#define FUNCT_NAME filterDScaler_SSE + #include "tomsmocomp/TomsMoCompAll.inc" + #undef IS_SSE + #undef SSE_TYPE diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2-glibc-2.10.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2-glibc-2.10.patch new file mode 100644 index 00000000000..c3d8ad87d73 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2-glibc-2.10.patch @@ -0,0 +1,24 @@ +diff -Naur tvtime-1.0.2.org/src/xmltv.c tvtime-1.0.2/src/xmltv.c +--- tvtime-1.0.2.org/src/xmltv.c 2009-07-02 21:48:49.426191088 +0200 ++++ tvtime-1.0.2/src/xmltv.c 2009-07-02 21:50:20.842066085 +0200 +@@ -118,9 +118,9 @@ + typedef struct { + const char *code; + const char *name; +-} locale_t; ++} tvtime_locale_t; + +-static locale_t locale_table[] = { ++static tvtime_locale_t locale_table[] = { + {"AA", "Afar"}, {"AB", "Abkhazian"}, {"AF", "Afrikaans"}, + {"AM", "Amharic"}, {"AR", "Arabic"}, {"AS", "Assamese"}, + {"AY", "Aymara"}, {"AZ", "Azerbaijani"}, {"BA", "Bashkir"}, +@@ -168,7 +168,7 @@ + {"XH", "Xhosa"}, {"YO", "Yoruba"}, {"ZH", "Chinese"}, + {"ZU", "Zulu"} }; + +-const int num_locales = sizeof( locale_table ) / sizeof( locale_t ); ++const int num_locales = sizeof( locale_table ) / sizeof( tvtime_locale_t ); + + /** + * Timezone parsing code based loosely on the algorithm in diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2-libsupc++.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2-libsupc++.patch new file mode 100644 index 00000000000..cc76d2decc6 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2-libsupc++.patch @@ -0,0 +1,16 @@ +Link to libsupc++ instead of bringing in libstdc++ just because tomsocomp +is written in C++. It does not use STL so it needs not the whole standard +library. +Index: tvtime-1.0.2/src/Makefile.am +=================================================================== +--- tvtime-1.0.2.orig/src/Makefile.am ++++ tvtime-1.0.2/src/Makefile.am +@@ -77,7 +77,7 @@ tvtime_CFLAGS = $(TTF_CFLAGS) $(PNG_CFLA + $(PLUGIN_CFLAGS) $(X11_CFLAGS) $(XML2_FLAG) \ + $(FONT_CFLAGS) $(AM_CFLAGS) + tvtime_LDFLAGS = $(TTF_LIBS) $(ZLIB_LIBS) $(PNG_LIBS) \ +- $(X11_LIBS) $(XML2_LIBS) -lm -lstdc++ ++ $(X11_LIBS) $(XML2_LIBS) -lm -lsupc++ + + tvtime_command_SOURCES = utils.h utils.c tvtimeconf.h tvtimeconf.c \ + tvtime-command.c diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2-xinerama.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2-xinerama.patch new file mode 100644 index 00000000000..0964d055768 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-1.0.2-xinerama.patch @@ -0,0 +1,32 @@ +Index: tvtime-1.0.2/configure.ac +=================================================================== +--- tvtime-1.0.2.orig/configure.ac ++++ tvtime-1.0.2/configure.ac +@@ -99,6 +99,8 @@ dnl ------------------------------------ + dnl check for X11, Xv and XF86VidModeExtension + dnl --------------------------------------------- + AC_PATH_XTRA ++AC_ARG_WITH([xinerama], ++ [AS_HELP_STRING([--without-xinerama], [Disable Xinerama extension support (default: check)])]) + if test x"$no_x" != x"yes"; then + dnl check for Xshm + AC_CHECK_LIB([Xext],[XShmCreateImage], +@@ -112,11 +114,13 @@ if test x"$no_x" != x"yes"; then + X11_LIBS="$X11_LIBS -lXv"],, + [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext]) + +- dnl check for Xinerama +- AC_CHECK_LIB([Xinerama],[XineramaQueryScreens], +- [AC_DEFINE([HAVE_XINERAMA],,[Xinerama support]) +- X11_LIBS="$X11_LIBS -lXinerama"],, +- [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext]) ++ if test "x$with_xinerama" != "xno"; then ++ dnl check for Xinerama ++ AC_CHECK_LIB([Xinerama],[XineramaQueryScreens], ++ [AC_DEFINE([HAVE_XINERAMA],,[Xinerama support]) ++ X11_LIBS="$X11_LIBS -lXinerama"],, ++ [$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS -lXext]) ++ fi + + dnl check for XTest + AC_CHECK_LIB([Xtst],[XTestFakeKeyEvent], diff --git a/pkgs/applications/video/tvtime/tvtime-libpng-1.5.patch b/pkgs/applications/video/tvtime/tvtime-libpng-1.5.patch new file mode 100644 index 00000000000..bfa22ed98d0 --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-libpng-1.5.patch @@ -0,0 +1,14 @@ +Include zlib.h which is no longer implicitly included with libpng-1.5 +Bug 369663 + +diff -ru tvtime-111b28cca42d.orig/src/pngoutput.c tvtime-111b28cca42d/src/pngoutput.c +--- tvtime-111b28cca42d.orig/src/pngoutput.c 2011-02-01 02:35:26.000000000 +0100 ++++ tvtime-111b28cca42d/src/pngoutput.c 2011-06-02 13:36:55.965999463 +0200 +@@ -18,6 +18,7 @@ + + #include + #include ++#include + #include + #include "pngoutput.h" + diff --git a/pkgs/applications/video/tvtime/tvtime-pic.patch b/pkgs/applications/video/tvtime/tvtime-pic.patch new file mode 100644 index 00000000000..00b040e60af --- /dev/null +++ b/pkgs/applications/video/tvtime/tvtime-pic.patch @@ -0,0 +1,11 @@ +--- tvtime/src/cpu_accel.c ++++ tvtime/src/cpu_accel.c +@@ -35,7 +35,7 @@ + int AMD; + uint32_t caps; + +-#ifndef PIC ++#if !defined(__PIC__) || defined(__x86_64__) + #define cpuid(op,eax,ebx,ecx,edx) \ + __asm__ ("cpuid" \ + : "=a" (eax), \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 69e100e4773..8676a381eb5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7107,6 +7107,10 @@ let mythtv = callPackage ../applications/video/mythtv { }; + tvtime = callPackage ../applications/video/tvtime { + kernel = linux; + }; + nano = callPackage ../applications/editors/nano { }; navipowm = callPackage ../applications/misc/navipowm {