git.iko.soy/typeable/nixpkgs
on master help sign in
* Added gtk-gnutella.

* Added a patch to MPlayer to fix the aspect ratio on screens rotated with Xrandr. * Disable toolbus for now because it requires a non-existant package (tcltk). svn path=/nixpkgs/trunk/; revision=5171

commitcce11c4f1f5dd041feb95e16c8afb5bbcef2dcf5 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateTue 18 Apr 2006, 18:46 (21 years ago) parentba18de0
6 files changed+227−3
pkgs/applications/video/MPlayer/default.nix+10−2 pkgs/applications/video/MPlayer/mplayer-aspect.patch+76 pkgs/applications/video/MPlayer/mplayer-pivot.patch+112 pkgs/tools/networking/p2p/gtk-gnutella/builder.sh+9 pkgs/tools/networking/p2p/gtk-gnutella/default.nix+11 pkgs/top-level/all-packages.nix+9−1
pkgs/applications/video/MPlayer/default.nix+10−2
@@ -1,7 +1,8 @@
11{ alsaSupport ? false, xvSupport ? true, theoraSupport ? false, cacaSupport ? false
2−, xineramaSupport ? false
2+, xineramaSupport ? false, randrSupport ? false
33, stdenv, fetchurl, x11, freetype, zlib
4−, alsa ? null, libXv ? null, libtheora ? null, libcaca ? null, libXinerama ? null
4+, alsa ? null, libXv ? null, libtheora ? null, libcaca ? null
5+, libXinerama ? null, libXrandr ? null
56}:
67
78assert alsaSupport -> alsa != null;
@@ -9,6 +10,7 @@ assert xvSupport -> libXv != null;
910assert theoraSupport -> libtheora != null;
1011assert cacaSupport -> libcaca != null;
1112assert xineramaSupport -> libXinerama != null;
13+assert randrSupport -> libXrandr != null;
1214
1315stdenv.mkDerivation {
1416 name = "MPlayer-1.0pre7";
@@ -34,7 +36,13 @@ stdenv.mkDerivation {
3436 (if theoraSupport then libtheora else null)
3537 (if cacaSupport then libcaca else null)
3638 (if xineramaSupport then libXinerama else null)
39+ (if randrSupport then libXrandr else null)
3740 ];
3841
3942 configureFlags = if cacaSupport then "--enable-caca" else "--disable-caca";
43+
44+ # These fix MPlayer's aspect ratio when run in a screen rotated with
45+ # Xrandr.
46+ # See: http://itdp.de/~itdp/html/mplayer-dev-eng/2005-08/msg00427.html
47+ patches = [./mplayer-aspect.patch ./mplayer-pivot.patch];
4048}
pkgs/applications/video/MPlayer/mplayer-aspect.patchnew file+76
@@ -0,0 +1,76 @@
1+diff -Nur MPlayer.orig/libvo/aspect.c MPlayer/libvo/aspect.c
2+--- MPlayer.orig/libvo/aspect.c 2004-10-28 03:15:51.000000000 +0200
3++++ MPlayer/libvo/aspect.c 2005-08-24 15:34:14.000000000 +0200
4+@@ -11,13 +11,16 @@
5+ #include <stdio.h>
6+ #endif
7+
8++int vo_physical_width = 0;
9++int vo_physical_height = 0;
10++
11+ int vo_panscan_x = 0;
12+ int vo_panscan_y = 0;
13+ float vo_panscan_amount = 0;
14+
15+ #include "video_out.h"
16+
17+-float monitor_aspect=4.0/3.0;
18++float monitor_aspect=-1.0f;
19+ extern float movie_aspect;
20+
21+ static struct {
22+@@ -47,11 +50,24 @@
23+ aspdat.preh = preh;
24+ }
25+
26++static void init_monitor_aspect( void )
27++{
28++ if (monitor_aspect != -1.0f) return;
29++ if (vo_physical_width == 0 || vo_physical_height == 0) {
30++ // if there's no other indication, assume square pixels
31++ vo_physical_width = aspdat.scrw;
32++ vo_physical_height = aspdat.scrh;
33++ }
34++ mp_msg(MSGT_VO,MSGL_V,"\naspect: monitor aspect detected %d:%d\n", vo_physical_width, vo_physical_height);
35++ monitor_aspect = 1.0f * vo_physical_width / vo_physical_height;
36++}
37++
38+ void aspect_save_screenres(int scrw, int scrh){
39+ #ifdef ASPECT_DEBUG
40+ printf("aspect_save_screenres %dx%d \n",scrw,scrh);
41+ #endif
42+ aspdat.scrw = scrw;
43+ aspdat.scrh = scrh;
44++ init_monitor_aspect(); // now is a good time
45+ }
46+
47+ /* aspect is called with the source resolution and the
48+diff -Nur MPlayer.orig/libvo/aspect.h MPlayer/libvo/aspect.h
49+--- MPlayer.orig/libvo/aspect.h 2002-06-05 21:35:54.000000000 +0200
50++++ MPlayer/libvo/aspect.h 2005-08-24 00:08:35.000000000 +0200
51+@@ -2,6 +2,9 @@
52+ #define __ASPECT_H
53+ /* Stuff for correct aspect scaling. */
54+
55++extern int vo_physical_width;
56++extern int vo_physical_height;
57++
58+ extern int vo_panscan_x;
59+ extern int vo_panscan_y;
60+ extern float vo_panscan_amount;
61+diff -Nur MPlayer.orig/libvo/x11_common.c MPlayer/libvo/x11_common.c
62+--- MPlayer.orig/libvo/x11_common.c 2005-08-23 23:07:07.000000000 +0200
63++++ MPlayer/libvo/x11_common.c 2005-08-23 23:42:31.000000000 +0200
64+@@ -464,6 +464,12 @@
65+ if (!vo_screenheight)
66+ vo_screenheight = DisplayHeight(mDisplay, mScreen);
67+ }
68++ if (vo_physical_width == 0) {
69++ vo_physical_width = DisplayWidthMM(mDisplay, mScreen);
70++ }
71++ if (vo_physical_height == 0) {
72++ vo_physical_height = DisplayHeightMM(mDisplay, mScreen);
73++ }
74+ // get color depth (from root window, or the best visual):
75+ XGetWindowAttributes(mDisplay, mRootWin, &attribs);
76+ depth = attribs.depth;
pkgs/applications/video/MPlayer/mplayer-pivot.patchnew file+112
@@ -0,0 +1,112 @@
1+--- MPlayer/configure.orig 2005-08-21 23:47:47.000000000 +0200
2++++ MPlayer/configure 2005-08-21 23:55:02.000000000 +0200
3+@@ -162,6 +162,7 @@
4+ --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
5+ --enable-joystick enable joystick support [disable]
6+ --disable-vm disable support X video mode extensions [autodetect]
7++ --disable-randr disable support for X resize and rotate extension [autodetect]
8+ --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
9+ --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
10+ --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
11+@@ -252,6 +253,7 @@
12+ --enable-xv build with Xv render support for X 4.x [autodetect]
13+ --enable-xvmc build with XvMC acceleration for X 4.x [disable]
14+ --enable-vm build with XF86VidMode support for X11 [autodetect]
15++ --enable-randr build with XRandR support for X11 [autodetect]
16+ --enable-xinerama build with Xinerama support for X11 [autodetect]
17+ --enable-x11 build with X11 render support [autodetect]
18+ --enable-fbdev build with FBDev render support [autodetect]
19+@@ -1351,6 +1353,7 @@
20+ _mga=auto
21+ _xmga=auto
22+ _vm=auto
23++_randr=auto
24+ _xf86keysym=auto
25+ _mlib=auto
26+ _sgiaudio=auto
27+@@ -1562,6 +1565,8 @@
28+ --disable-xmga) _xmga=no ;;
29+ --enable-vm) _vm=yes ;;
30+ --disable-vm) _vm=no ;;
31++ --enable-randr) _randr=yes ;;
32++ --disable-randr) _randr=no ;;
33+ --enable-xf86keysym) _xf86keysym=yes ;;
34+ --disable-xf86keysym) _xf86keysym=no ;;
35+ --enable-mlib) _mlib=yes ;;
36+@@ -3603,6 +3608,25 @@
37+ fi
38+ echores "$_vm"
39+
40++# X Resize, Rotate and Reflect extension
41++echocheck "Xrandr"
42++if test "$_x11" = yes && test "$_randr" = auto; then
43++ cat > $TMPC <<EOF
44++#include <X11/Xlib.h>
45++#include <X11/extensions/Xrandr.h>
46++int main(void) { (void) XRRQueryExtension(0, 0, 0); return 0; }
47++EOF
48++ _randr=no
49++ cc_check $_inc_x11 -lXrandr $_ld_x11 && _randr=yes
50++fi
51++if test "$_randr" = yes ; then
52++ _def_randr='#define HAVE_XRANDR 1'
53++ _ld_randr='-lXrandr'
54++else
55++ _def_randr='#undef HAVE_XRANDR'
56++fi
57++echores "$_randr"
58++
59+ # Check for the presence of special keycodes, like audio control buttons
60+ # that XFree86 might have. Used to be bundled with the xf86vm check, but
61+ # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
62+@@ -6762,7 +6786,7 @@
63+ SLIBSUF=.so
64+
65+ # video output
66+-X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
67++X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_randr $_ld_xinerama $_ld_x11 $_ld_sock
68+ GGI_LIB = $_ld_ggi
69+ MLIB_LIB = $_ld_mlib
70+ MLIB_INC = $_inc_mlib
71+@@ -7465,6 +7489,7 @@
72+ $_def_xv
73+ $_def_xvmc
74+ $_def_vm
75++$_def_randr
76+ $_def_xf86keysym
77+ $_def_xinerama
78+ $_def_gl
79+--- MPlayer/libvo/x11_common.c.orig 2005-08-21 23:56:20.000000000 +0200
80++++ MPlayer/libvo/x11_common.c 2005-08-22 00:05:17.000000000 +0200
81+@@ -39,6 +39,10 @@
82+ #include <X11/extensions/xf86vmode.h>
83+ #endif
84+
85++#ifdef HAVE_XRANDR
86++#include <X11/extensions/Xrandr.h>
87++#endif
88++
89+ #ifdef HAVE_XF86XK
90+ #include <X11/XF86keysym.h>
91+ #endif
92+@@ -434,6 +438,20 @@
93+ int clock;
94+
95+ XF86VidModeGetModeLine(mDisplay, mScreen, &clock, &modeline);
96++#ifdef HAVE_XRANDR
97++ {
98++ Rotation current_rotation;
99++
100++ XRRRotations(mDisplay, mScreen, &current_rotation);
101++ if ((current_rotation&RR_Rotate_90) != 0 ||
102++ (current_rotation&RR_Rotate_270) != 0) {
103++ unsigned short tmp;
104++ tmp = modeline.hdisplay;
105++ modeline.hdisplay = modeline.vdisplay;
106++ modeline.vdisplay = tmp;
107++ }
108++ }
109++#endif
110+ if (!vo_screenwidth)
111+ vo_screenwidth = modeline.hdisplay;
112+ if (!vo_screenheight)
pkgs/tools/networking/p2p/gtk-gnutella/builder.shnew file+9
@@ -0,0 +1,9 @@
1+source $stdenv/setup
2+
3+configureScript="./Configure"
4+
5+dontAddPrefix=1
6+
7+configureFlags="-d -e -D prefix=$out -D gtkversion=2 -D official=true"
8+
9+genericBuild
pkgs/tools/networking/p2p/gtk-gnutella/default.nixnew file+11
@@ -0,0 +1,11 @@
1+{stdenv, fetchurl, pkgconfig, glib, gtk, libxml2}:
2+
3+stdenv.mkDerivation {
4+ name = "gtk-gnutella-0.96.1";
5+ builder = ./builder.sh;
6+ src = fetchurl {
7+ url = http://surfnet.dl.sourceforge.net/sourceforge/gtk-gnutella/gtk-gnutella-0.96.1.tar.bz2;
8+ md5 = "6529379cc105c1e98f501a67e8e875fd";
9+ };
10+ buildInputs = [pkgconfig glib gtk libxml2];
11+}
pkgs/top-level/all-packages.nix+9−1
@@ -262,6 +262,11 @@ rec {
262262 inherit fetchurl stdenv jdk swt;
263263 };
264264
265+ gtkgnutella = (import ../tools/networking/p2p/gtk-gnutella) {
266+ inherit fetchurl stdenv pkgconfig libxml2;
267+ inherit (gtkLibs) glib gtk;
268+ };
269+
265270 dhcp = (import ../tools/networking/dhcp) {
266271 inherit fetchurl stdenv groff nettools coreutils iputils gnused bash;
267272 };
@@ -2078,12 +2083,13 @@ rec {
20782083
20792084 MPlayer = (import ../applications/video/MPlayer) {
20802085 inherit fetchurl stdenv freetype x11 zlib libtheora libcaca;
2081− inherit (xlibs) libXv libXinerama;
2086+ inherit (xlibs) libXv libXinerama libXrandr;
20822087 alsaSupport = true;
20832088 alsa = alsaLib;
20842089 theoraSupport = true;
20852090 cacaSupport = true;
20862091 xineramaSupport = true;
2092+ randrSupport = true;
20872093 };
20882094
20892095 MPlayerPlugin = (import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in) {
@@ -2399,9 +2405,11 @@ rec {
23992405 inherit stdenv fetchurl aterm;
24002406 };
24012407
2408+ /*
24022409 toolbus = (import ../development/interpreters/toolbus) {
24032410 inherit stdenv fetchurl atermjava toolbuslib aterm yacc flex;
24042411 };
2412+ */
24052413
24062414 joe = (import ../applications/editors/joe) {
24072415 inherit stdenv fetchurl;