Add tsc fix by Tobias Klausmann #109161.
authorMike Frysinger <vapier@gentoo.org>
Fri, 14 Oct 2005 00:36:14 +0000 (00:36 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 14 Oct 2005 00:36:14 +0000 (00:36 +0000)
Package-Manager: portage-2.0.53_rc5

media-video/SDLcam/ChangeLog
media-video/SDLcam/Manifest
media-video/SDLcam/SDLcam-0.7.3-r2.ebuild [new file with mode: 0644]
media-video/SDLcam/files/SDLcam-0.7.3-prototypes.patch [new file with mode: 0644]
media-video/SDLcam/files/SDLcam-0.7.3-tsc.patch [new file with mode: 0644]
media-video/SDLcam/files/digest-SDLcam-0.7.3-r2 [new file with mode: 0644]

index 39cd74b3abfae9030b156af69fc5b463fe4b4466..0c67c2b0291cd2bf7e1f14ecd2cf4985bfeaf814 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for media-video/SDLcam
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/SDLcam/ChangeLog,v 1.5 2004/06/25 00:49:40 agriffis Exp $
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/SDLcam/ChangeLog,v 1.6 2005/10/14 00:36:14 vapier Exp $
+
+*SDLcam-0.7.3-r2 (14 Oct 2005)
+
+  14 Oct 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/SDLcam-0.7.3-prototypes.patch, +files/SDLcam-0.7.3-tsc.patch,
+  +SDLcam-0.7.3-r2.ebuild:
+  Add tsc fix by Tobias Klausmann #109161.
 
 *SDLcam-0.7.3-r1 (30 Jan 2004)
 
index ad2eebf07a73a6f7bb2c6839677e78f473126e96..5e9f98e0a456425b6ca6cd94811c2ada07d74cf1 100644 (file)
@@ -1,17 +1,21 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 604fa3f460ad81bae5763faca26059b0 ChangeLog 752
-MD5 9c86830b089cab3e08a1f927b14d78b9 metadata.xml 579
+MD5 afb9134e4f2a677d88851973c1a88dab ChangeLog 974
 MD5 7b80507b7eb8ac2429c56569cd60cc3d SDLcam-0.7.3-r1.ebuild 1517
+MD5 683da4b3fc1258de05b95134b1a43471 SDLcam-0.7.3-r2.ebuild 1626
 MD5 2357ecf5188cac42c1b2d985a8f4a036 files/0.7.3-gcc3.patch 3271
+MD5 eb83f71dceccfba016349f3f2cf22538 files/0.7.3-linux-2.6.patch 517
 MD5 a523b1e156a6131b8713b7d1e1206d9b files/0.7.3-no-divx.patch 395
+MD5 f0dcf5387852f05d423f26f645d4df43 files/SDLcam-0.7.3-prototypes.patch 1045
+MD5 6a6efe94d07cda44c908c7cf8fcfcc2a files/SDLcam-0.7.3-tsc.patch 1172
 MD5 0c1ad55a2817e3ef4a1141f8ba9ccefb files/digest-SDLcam-0.7.3-r1 64
-MD5 eb83f71dceccfba016349f3f2cf22538 files/0.7.3-linux-2.6.patch 517
+MD5 0c1ad55a2817e3ef4a1141f8ba9ccefb files/digest-SDLcam-0.7.3-r2 64
+MD5 9c86830b089cab3e08a1f927b14d78b9 metadata.xml 579
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.9.10 (GNU/Linux)
+Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFBjBidHTu7gpaalycRAo5mAJ43rvXFyxreDYgjl2Ddggv5tSiciQCgkWg1
-y/70ur6k+Hwj8W6kZv8+r8g=
-=s/gi
+iD8DBQFDTv39gIKl8Uu19MoRAgyoAJwLm2SMaAxZndF08+u/N/5UxVH3igCfX3Or
+lly6fz7IlMvV0kNxMLCEs/w=
+=oNwr
 -----END PGP SIGNATURE-----
diff --git a/media-video/SDLcam/SDLcam-0.7.3-r2.ebuild b/media-video/SDLcam/SDLcam-0.7.3-r2.ebuild
new file mode 100644 (file)
index 0000000..744412b
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/SDLcam/SDLcam-0.7.3-r2.ebuild,v 1.1 2005/10/14 00:36:14 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="Webcam application that uses the SDL library"
+HOMEPAGE="http://sdlcam.raphnet.net/"
+SRC_URI="http://sdlcam.raphnet.net/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND="dev-libs/libxml2
+       media-libs/libfame
+       media-libs/libsdl
+       media-libs/sdl-image
+       media-libs/sdl-ttf"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+       epatch "${FILESDIR}"/${PV}-gcc3.patch
+       epatch "${FILESDIR}"/${PV}-no-divx.patch
+       rm capture/divx.c   # the divx.so needs to be ported to newer avifile
+       epatch "${FILESDIR}"/${PV}-linux-2.6.patch
+       epatch "${FILESDIR}"/${P}-tsc.patch #109161
+       epatch "${FILESDIR}"/${P}-prototypes.patch
+       sed -i \
+               -e "s: -g: ${CFLAGS} `avifile-config --cflags`:" \
+               -e 's:-Wstrict-prototypes::' \
+               Makefile
+       sed -i "/#include/s:avifile/::" capture/divx2.cpp
+
+       # Don't you love hardcoded vars?
+       sed -i \
+               -e 's:/usr/local/share/SDLcam/:/usr/share/SDLcam/:' \
+               -e 's:/usr/local/lib/SDLcam:/usr/lib/SDLcam:' \
+               -e 's:sources/:/usr/lib/SDLcam/sources/:' \
+               configuration.h interface.cpp SDL_v4l_filters.c main.cpp
+}
+
+src_install() {
+       dobin SDLcam || die
+       insinto /usr/share/SDLcam
+       doins LucidaSansRegular.ttf LucidaTypewriterRegular.ttf SDLcam.xml SDLcam.cfg || die
+       insinto /usr/lib/SDLcam/filters
+       doins filter/*.so || die
+       insinto /usr/lib/SDLcam/capture
+       doins capture/*.so || die
+       insinto /usr/lib/SDLcam/sources
+       doins sources/*.so || die
+}
diff --git a/media-video/SDLcam/files/SDLcam-0.7.3-prototypes.patch b/media-video/SDLcam/files/SDLcam-0.7.3-prototypes.patch
new file mode 100644 (file)
index 0000000..c636789
--- /dev/null
@@ -0,0 +1,21 @@
+--- SDL_v4l_filters_thomas.h
++++ SDL_v4l_filters_thomas.h
+@@ -18,6 +18,7 @@
+ */
+ #ifndef FILTER_THOMAS_H
+ #define FILTER_THOMAS_H
++#include <sys/types.h>
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -29,8 +30,8 @@
+ #ifdef MMX
+ int MMX_add_sub_shr   (unsigned char *bild, unsigned char *buf, unsigned short *summe, unsigned int len, unsigned int shr);
+ #endif
+-void yuv420p_to_rgb32(unsigned int width,unsigned int height,unsigned char *y,unsigned char *u,unsigned char *v,unsigned char *d);
+-void yuv420p_to_bgr32(unsigned int width,unsigned int height,unsigned char *y,unsigned char *u,unsigned char *v,unsigned char *d);
++void yuv420p_to_rgb32(size_t width,size_t height,unsigned char *y,unsigned char *u,unsigned char *v,unsigned char *d);
++void yuv420p_to_bgr32(size_t width,size_t height,unsigned char *y,unsigned char *u,unsigned char *v,unsigned char *d);
+ void SDL_v4l_Reorder_cleanup (void);
+ int SDL_v4l_Reorder     (const SDL_v4l_image *SRC, SDL_v4l_image *DST,int off_x,int off_y,int typ,int radius,double effekt);
+ #ifdef __cplusplus
diff --git a/media-video/SDLcam/files/SDLcam-0.7.3-tsc.patch b/media-video/SDLcam/files/SDLcam-0.7.3-tsc.patch
new file mode 100644 (file)
index 0000000..807667b
--- /dev/null
@@ -0,0 +1,51 @@
+Patch by Tobias Klausmann to fix TSC issues on Pentium M's
+
+http://bugs.gentoo.org/109161
+
+--- misc.c
++++ misc.c
+@@ -25,6 +25,11 @@
+ #include "dyn_misc.h"
+ #include "misc.h"
+ 
++#define rdtsc(low,high) \
++     __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
++
++
++
+ char *xStrdup (const char *t) {{{
+   char *ret;
+   ret = strdup (t);
+@@ -42,18 +47,9 @@
+ 
+ void getTimeStampCounter ( TimeStampCounter *t ) {{{
+ #ifdef TIMER  
+-      unsigned int h=t->high;
+-      unsigned int l=t->low ;
+-      asm (   
+-              "push %%eax     \n"
+-              "push %%edx     \n"
+-              "rdtsc          \n"
+-              "movl %%eax,%1  \n"
+-              "movl %%edx,%0  \n"
+-              "pop  %%edx     \n"
+-              "pop  %%edx     \n"
+-              : "=m" (h) , "=m" (l)
+-          );
++      unsigned long h=t->high;
++      unsigned long l=t->low ;
++      rdtsc(l,h);
+       t->high = h;
+       t->low  = l;
+ #else 
+--- misc.h.orig        2005-10-08 13:52:05.000000000 +0200
++++ misc.h     2005-10-08 13:52:18.000000000 +0200
+@@ -24,7 +24,7 @@
+ 
+ char *xStrdup (const char *t);
+ 
+-typedef struct { unsigned int high, low; } TimeStampCounter;
++typedef struct { unsigned long high, low; } TimeStampCounter;
+ void getTimeStampCounter ( TimeStampCounter *t );
+ void Start_Timer (unsigned int idx);
+ void Ende_Timer  (unsigned int idx);
diff --git a/media-video/SDLcam/files/digest-SDLcam-0.7.3-r2 b/media-video/SDLcam/files/digest-SDLcam-0.7.3-r2
new file mode 100644 (file)
index 0000000..a9c2256
--- /dev/null
@@ -0,0 +1 @@
+MD5 82b7d7e7e6f4d6fe1cd2c4ab97232fd8 SDLcam-0.7.3.tar.gz 299421