tvtime is now on nixos, thanks to the patches taken from the portage team!

svn path=/nixpkgs/trunk/; revision=32962
This commit is contained in:
Joachim Schiele 2012-03-09 18:21:10 +00:00
parent 6552ea2ddb
commit 92c04c80c7
10 changed files with 310 additions and 0 deletions

View File

@ -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;
};
}

View File

@ -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 <linux/videodev.h>
+#include <linux/videodev2.h>
#include "videoinput.h"
#include "mixer.h"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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],

View File

@ -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 <stdio.h>
#include <stdlib.h>
+#include <zlib.h>
#include <png.h>
#include "pngoutput.h"

View File

@ -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), \

View File

@ -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 {