summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2004-02-22 21:48:55 +0000
committerMartin Schlemmer <azarah@gentoo.org>2004-02-22 21:48:55 +0000
commit66cfe323a1c006180851e66d7e2c8104c4259c01 (patch)
treeb21843b15d0af2c0922bd6037c7dd0da2e6936ff /media-libs/svgalib
parenthppa repoman (diff)
downloadgentoo-2-66cfe323a1c006180851e66d7e2c8104c4259c01.tar.gz
gentoo-2-66cfe323a1c006180851e66d7e2c8104c4259c01.tar.bz2
gentoo-2-66cfe323a1c006180851e66d7e2c8104c4259c01.zip
Update version. Fix compiles on 2.6 kernels. Add simple sysfs support for udev
enabled systems.
Diffstat (limited to 'media-libs/svgalib')
-rw-r--r--media-libs/svgalib/ChangeLog10
-rw-r--r--media-libs/svgalib/Manifest11
-rw-r--r--media-libs/svgalib/files/digest-svgalib-1.9.181
-rw-r--r--media-libs/svgalib/files/svgalib-1.9.18-gcc33.patch13
-rw-r--r--media-libs/svgalib/files/svgalib-1.9.18-gentoo.patch99
-rw-r--r--media-libs/svgalib/files/svgalib-1.9.18-linux2.6.patch475
-rw-r--r--media-libs/svgalib/svgalib-1.9.18.ebuild125
7 files changed, 729 insertions, 5 deletions
diff --git a/media-libs/svgalib/ChangeLog b/media-libs/svgalib/ChangeLog
index f1ac4a51ceb0..ee331e5eea77 100644
--- a/media-libs/svgalib/ChangeLog
+++ b/media-libs/svgalib/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for media-libs/svgalib
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/svgalib/ChangeLog,v 1.25 2004/02/01 22:16:00 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/svgalib/ChangeLog,v 1.26 2004/02/22 21:48:55 azarah Exp $
+
+*svgalib-1.9.18 (22 Feb 2004)
+
+ 22 Feb 2004; Martin Schlemmer <azarah@gentoo.org> svgalib-1.9.18.ebuild,
+ files/svgalib-1.9.18-gcc33.patch, files/svgalib-1.9.18-gentoo.patch,
+ files/svgalib-1.9.18-linux2.6.patch:
+ Update version. Fix compiles on 2.6 kernels. Add simple sysfs support for udev
+ enabled systems.
01 Feb 2004; <plasmaroo@gentoo.org> files/svgalib-1.9.17-linux2.6.patch:
Updated the 2.6 patch to solve compilation issues on 2.6 headers. Closes bug
diff --git a/media-libs/svgalib/Manifest b/media-libs/svgalib/Manifest
index f5eb7aa42325..25b44642a69f 100644
--- a/media-libs/svgalib/Manifest
+++ b/media-libs/svgalib/Manifest
@@ -1,12 +1,15 @@
+MD5 e3d20a98bb4f6f2df9077ff46ba074aa .svgalib-1.9.18.ebuild.swp 12288
MD5 f17014dac0a8ca1dedd613e46f4f2fad ChangeLog 4152
MD5 b3845e961f29a0e3754831e90ff5e798 svgalib-1.4.3-r4.ebuild 2566
MD5 7aae39539c1f87ab37a6d216f9f9be87 svgalib-1.9.17-r3.ebuild 3180
-MD5 c4b69ccaea188c0ee4b32111b769ae6d files/svgalib-1.4.3-userpriv.patch 1267
+MD5 da6d06630cf88be848f1961eb4952590 svgalib-1.9.18.ebuild 3183
MD5 19b74fedfd6953bd3537a803abecc4d3 files/svgalib-1.4.3-gentoo.diff 10364
-MD5 72bba0fb5841145da689fda817c7e2d9 files/svgalib-1.4.3-gcc3.patch 303
+MD5 0d7d045fc55ccf3f4a26bc54286a3b8a files/digest-svgalib-1.9.18 66
+MD5 0ded96494b4c3f4f744474ff89033c18 files/svgalib-1.9.17-linux2.6.patch 38611
MD5 3538c97a42a76d7c1b210319171d3daa files/svgalib-1.4.3-linux2.6.patch 195
MD5 e4ead3e3192f5a945ff177331122d7ae files/digest-svgalib-1.9.17-r3 66
+MD5 c2977469108170b5851b7706829ad646 files/svgalib-1.9.17-gentoo.patch 11536
+MD5 c4b69ccaea188c0ee4b32111b769ae6d files/svgalib-1.4.3-userpriv.patch 1267
MD5 9e8f47b421194ae42b3ff7e3a8ba8aed files/svgalib-1.9.17-modversions_h.patch 2414
MD5 ae00198d9110c4de5bc6dd4d6424ab26 files/digest-svgalib-1.4.3-r4 132
-MD5 0ded96494b4c3f4f744474ff89033c18 files/svgalib-1.9.17-linux2.6.patch 38611
-MD5 c2977469108170b5851b7706829ad646 files/svgalib-1.9.17-gentoo.patch 11536
+MD5 72bba0fb5841145da689fda817c7e2d9 files/svgalib-1.4.3-gcc3.patch 303
diff --git a/media-libs/svgalib/files/digest-svgalib-1.9.18 b/media-libs/svgalib/files/digest-svgalib-1.9.18
new file mode 100644
index 000000000000..0c2fdc8d9e53
--- /dev/null
+++ b/media-libs/svgalib/files/digest-svgalib-1.9.18
@@ -0,0 +1 @@
+MD5 5a1dc3dbf3182fb560959678dfba6181 svgalib-1.9.18.tar.gz 933786
diff --git a/media-libs/svgalib/files/svgalib-1.9.18-gcc33.patch b/media-libs/svgalib/files/svgalib-1.9.18-gcc33.patch
new file mode 100644
index 000000000000..e6c450b8d158
--- /dev/null
+++ b/media-libs/svgalib/files/svgalib-1.9.18-gcc33.patch
@@ -0,0 +1,13 @@
+--- svgalib-1.9.18/demos/lineart.c.orig 2004-02-22 23:34:04.093602664 +0200
++++ svgalib-1.9.18/demos/lineart.c 2004-02-22 23:32:00.317419504 +0200
+@@ -19,8 +19,8 @@
+
+ if(mode == 0)
+ {
+- printf("Usage:linp [mode mode ...]\n
+- where mode is an integer.\n");
++ printf("Usage:linp [mode mode ...]\n"\
++ "where mode is an integer.\n");
+ return;
+ }
+ if(! vga_hasmode(mode)) {
diff --git a/media-libs/svgalib/files/svgalib-1.9.18-gentoo.patch b/media-libs/svgalib/files/svgalib-1.9.18-gentoo.patch
new file mode 100644
index 000000000000..859144307d24
--- /dev/null
+++ b/media-libs/svgalib/files/svgalib-1.9.18-gentoo.patch
@@ -0,0 +1,99 @@
+--- svgalib-1.9.18/Makefile 2004-02-22 20:16:50.506825616 +0200
++++ svgalib-1.9.18/Makefile 2004-02-22 20:18:55.028895384 +0200
+@@ -78,10 +78,6 @@
+
+ installheaders:
+ @echo Installing header files in $(includedir).
+- @if [ -f /usr/include/vga.h ]; then \
+- rm -f /usr/include/vga.h /usr/include/vgagl.h; \
+- echo Old header files in /usr/include removed.; \
+- fi
+ @mkdir -p $(includedir)
+ @cp $(srcdir)/src/vga.h $(includedir)/vga.h
+ @chmod a+r $(includedir)/vga.h
+@@ -95,16 +91,6 @@
+ @chmod a+r $(includedir)/vgakeyboard.h
+
+ installsharedlib: $(SHAREDLIBS) $(SVGALIBSHAREDSTUBS)
+- @if [ -f /usr/lib/libvga.sa ]; then \
+- rm -f /usr/lib/libvga.sa /usr/lib/libvgagl.sa; \
+- echo Old stubs in /usr/lib removed.; \
+- fi
+-ifndef KEEPSHAREDLIBS
+- @echo "Removing shared library images (old & current)..."
+- @for i in $(OBSOLETELDIRS); do \
+- rm -f `echo $(OBSOLETESHAREDIMAGES) | sed s?/lib/?$$i?g`; \
+- done
+-endif
+ @echo Installing shared library image as \
+ $(addprefix $(sharedlibdir)/,$(notdir $(SHAREDLIBS))).
+ @for foo in $(notdir $(SHAREDLIBS)); do \
+@@ -118,10 +104,8 @@
+ installstaticlib: static
+ @echo Installing static libraries in $(libdir).
+ @mkdir -p $(libdir)
+- @rm -f /usr/lib/libvga.a
+ @$(INSTALL_DATA) staticlib/libvga.a $(libdir)/libvga.a
+ @chmod a+r $(libdir)/libvga.a
+- @rm -f /usr/lib/libvgagl.a
+ @$(INSTALL_DATA) staticlib/libvgagl.a $(libdir)/libvgagl.a
+ @chmod a+r $(libdir)/libvgagl.a
+
+@@ -130,14 +114,6 @@
+ echo No $(bindir) directory, creating it.; \
+ mkdir -p $(bindir); \
+ fi
+- @if [ -f /usr/bin/restorefont ]; then \
+- echo Removing old utilities in /usr/bin.; \
+- for x in $(UTILS); do rm -f /usr/bin/$$x; done; \
+- fi
+- @if [ -f /usr/bin/convfont ]; then \
+- echo Removing inappropriate utilities in /usr/bin.; \
+- rm -f /usr/bin/convfont /usr/bin/setmclk; \
+- fi
+ @echo Installing textmode utilities in $(bindir):
+ @echo "restorefont: Save/restore textmode font."
+ @cp utils/restorefont $(bindir)
+@@ -210,7 +186,7 @@
+ lib3dkit-install:
+ (cd threeDKit/; $(MAKE) install)
+
+-install: uninstall installheaders $(INSTALLSHAREDLIB) installconfig \
++install: installheaders $(INSTALLSHAREDLIB) installconfig \
+ $(INSTALLSTATICLIB) $(INSTALLUTILS) $(INSTALLMAN) installmodule $(INSTALLDEV) \
+ lib3dkit-install
+ @echo
+--- svgalib-1.9.18/kernel/svgalib_helper/Makefile 2004-02-22 20:24:57.921727288 +0200
++++ svgalib-1.9.18/kernel/svgalib_helper/Makefile 2004-02-22 20:23:34.654385848 +0200
+@@ -45,8 +45,8 @@
+ svgalib_helper.o: $(svgalib_helper-objs)
+ $(LD) -r -o $@ $(svgalib_helper-objs)
+
+-install: device modules_install
++install: modules_install
+
+ modules_install: $(TARGET).o
+- mkdir -p /lib/modules/$(VER)/kernel/misc
+- install -m 0644 -c $(TARGET).o /lib/modules/$(VER)/kernel/misc
++ mkdir -p $(TOPDIR)/lib/modules/$(VER)/kernel/misc
++ install -m 0644 -c $(TARGET).o $(TOPDIR)/lib/modules/$(VER)/kernel/misc
+--- svgalib-1.9.18/Makefile.cfg 2004-02-22 20:38:09.813341464 +0200
++++ svgalib-1.9.18/Makefile.cfg 2004-02-22 20:41:45.480555064 +0200
+@@ -44,7 +44,7 @@
+ # Common prefix for installation directories.
+ # NOTE: This directory must exist when you start the install.
+ TOPDIR=
+-prefix = $(TOPDIR)/usr/local
++prefix = $(TOPDIR)/usr
+ exec_prefix = $(prefix)
+
+ # Directory where the shared stubs and static library will be installed.
+@@ -126,7 +126,7 @@
+ # MAKEWHATIS = makewhatis # Beware, this will really need a few minutes!
+
+ # Comment this out if you use devfs only and don't want to make svga nodes
+-INSTALLDEV = installdev
++#INSTALLDEV = installdev
+
+ #
+ # Comment out any driver that you don't want included in the library.
diff --git a/media-libs/svgalib/files/svgalib-1.9.18-linux2.6.patch b/media-libs/svgalib/files/svgalib-1.9.18-linux2.6.patch
new file mode 100644
index 000000000000..4bde429b23fe
--- /dev/null
+++ b/media-libs/svgalib/files/svgalib-1.9.18-linux2.6.patch
@@ -0,0 +1,475 @@
+diff -urpN svgalib-1.9.18/kernel/svgalib_helper/Makefile svgalib-1.9.18/kernel/svgalib_helper/Makefile
+--- svgalib-1.9.18/kernel/svgalib_helper/Makefile 2004-02-22 20:52:42.000000000 +0200
++++ svgalib-1.9.18/kernel/svgalib_helper/Makefile 2004-02-22 23:19:39.617023080 +0200
+@@ -13,15 +13,32 @@ EXTRA_CFLAGS := -DSVGALIB_HELPER_MAJOR=$
+
+ ifeq ($(PATCHLEVEL),4)
+ include $(TOPDIR)/Rules.make
++ OBJEXT := o
++else
++ OBJEXT := ko
+ endif
+
+ else
+
+-VER = $(shell uname -r)
++# Extract version number from headers.
++VER = $(shell awk -F\" '/REL/ {print $$2}' $(INCLUDEDIR)/linux/version.h 2>/dev/null)
++
++# Use version of current running kernel
++ifeq ($(VER),)
++ VER = $(shell uname -r)
++endif
++
++PATCHLEVEL := $(shell echo $(VER) | cut -d. -f2)
+ KDIR := /lib/modules/$(VER)/build
+ PWD := $(shell pwd)
+ TARGET := svgalib_helper
+
++ifeq ($(PATCHLEVEL),4)
++ OBJEXT := o
++else
++ OBJEXT := ko
++endif
++
+ default:
+ $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+
+@@ -41,4 +58,4 @@ install: modules_install
+
+ modules_install: $(TARGET).o
+ mkdir -p $(TOPDIR)/lib/modules/$(VER)/kernel/misc
+- install -m 0644 -c $(TARGET).o $(TOPDIR)/lib/modules/$(VER)/kernel/misc
++ install -m 0644 -c $(TARGET).$(OBJEXT) $(TOPDIR)/lib/modules/$(VER)/kernel/misc
+diff -urpN svgalib-1.9.18/kernel/svgalib_helper/kernel26compat.h svgalib-1.9.18/kernel/svgalib_helper/kernel26compat.h
+--- svgalib-1.9.18/kernel/svgalib_helper/kernel26compat.h 2004-02-22 20:52:42.000000000 +0200
++++ svgalib-1.9.18/kernel/svgalib_helper/kernel26compat.h 2004-02-22 22:55:13.813859032 +0200
+@@ -43,11 +43,41 @@ static inline int devfs_unregister_chrde
+ }
+ #endif
+
++#if defined(KERNEL_2_6) && !defined(CONFIG_DEVFS_FS)
++# define SLH_SYSFS_REGISTER \
++ svgalib_helper_class = class_simple_create(THIS_MODULE, "svgalib_helper");
++
++# define SLH_SYSFS_ADD_CONTROL \
++ class_simple_device_add(svgalib_helper_class, \
++ MKDEV(SVGALIB_HELPER_MAJOR, 0), \
++ NULL, "svga");
++
++# define SLH_SYSFS_ADD_DEVICE(_name, _minor) \
++ class_simple_device_add(svgalib_helper_class, \
++ MKDEV(SVGALIB_HELPER_MAJOR, _minor), \
++ &sh_pci_devs[_minor]->dev->dev, _name);
++
++# define SLH_SYSFS_REMOVE_DEVICE(i) \
++ class_simple_device_remove(MKDEV(SVGALIB_HELPER_MAJOR, i));
++
++# define SLH_SYSFS_UNREGISTER \
++ class_simple_destroy(svgalib_helper_class);
++#else
++# define SLH_SYSFS_REGISTER
++# define SLH_SYSFS_ADD_CONTROL
++# define SLH_SYSFS_ADD_DEVICE(_name, _minor)
++# define SLH_SYSFS_REMOVE_DEVICE(i)
++# define SLH_SYSFS_UNREGISTER
++#endif
++
+
+ /* Our main.c really do not like MINOR from 2.6 kernels ... */
+ #if (defined MINOR) && (!defined KERNEL_2_6)
+ # define my_minor(x) MINOR(x)
+ #else
++# ifndef minor
++# define minor(x) MINOR(x)
++# endif
+ # define my_minor(x) minor(x)
+ #endif
+
+diff -urpN svgalib-1.9.18/kernel/svgalib_helper/main.c svgalib-1.9.18/kernel/svgalib_helper/main.c
+--- svgalib-1.9.18/kernel/svgalib_helper/main.c 2004-02-22 23:01:50.113612312 +0200
++++ svgalib-1.9.18/kernel/svgalib_helper/main.c 2004-02-22 22:59:25.451604280 +0200
+@@ -53,15 +53,19 @@ static int irqs[MAX_NR_DEVICES];
+ static devfs_handle_t devfs_handle;
+ #endif
+
++#if defined(KERNEL_2_6) && !defined(CONFIG_DEVFS_FS)
++struct class_simple *svgalib_helper_class;
++#endif
++
+ static int check_io_range(int port, int device) {
+ return 1;
+ }
+
+-static struct pci_dev *get_pci_dev(int pcipos, int minor) {
++static struct pci_dev *get_pci_dev(int pcipos, int _minor) {
+
+- if(minor>=num_devices) return NULL;
+- if(minor>0) {
+- return sh_pci_devs[minor]->dev;
++ if(_minor>=num_devices) return NULL;
++ if(_minor>0) {
++ return sh_pci_devs[_minor]->dev;
+ } else {
+ if(pcipos>0 && pcipos<num_devices)
+ return sh_pci_devs[pcipos]->dev;
+@@ -70,11 +74,11 @@ static struct pci_dev *get_pci_dev(int p
+
+ }
+
+-static int get_dev(int pcipos, int minor) {
++static int get_dev(int pcipos, int _minor) {
+
+- if(minor>=num_devices) return 0;
+- if(minor>0) {
+- return minor;
++ if(_minor>=num_devices) return 0;
++ if(_minor>0) {
++ return _minor;
+ } else {
+ if(pcipos>=num_devices || pcipos<1) return 0;
+ return pcipos;
+@@ -111,7 +115,7 @@ static int svgalib_helper_ioctl( struct
+
+ io_t iov;
+ pcic_t pciv;
+- int minor = my_minor(inode->i_rdev);
++ int _minor = my_minor(inode->i_rdev);
+ struct pci_dev *pdev;
+ io_string_t iostr;
+ int i=0, ret;
+@@ -134,7 +138,7 @@ static int svgalib_helper_ioctl( struct
+ if (iostr.length>4096) return -EINVAL;
+ if ( (outb_str = kmalloc(iostr.length, GFP_KERNEL )) == NULL ) return -ENOMEM;
+ copy_from_user(outb_str,iostr.string,iostr.length);
+- if(check_io_range(iostr.port,minor)) {
++ if(check_io_range(iostr.port,_minor)) {
+ for(i=0; i<iostr.length; i++) outb(outb_str[i], iostr.port);
+ } else ret = -EPERM;
+ kfree (outb_str);
+@@ -142,28 +146,28 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_OUTB):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ outb(iov.val,iov.port);
+ else ret = -EPERM;
+ break;
+
+ case _IOC_NR(SVGAHELPER_OUTW):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ outw(iov.val,iov.port);
+ else ret = -EPERM;
+ break;
+
+ case _IOC_NR(SVGAHELPER_OUTL):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ outl(iov.val,iov.port);
+ else ret = -EPERM;
+ break;
+
+ case _IOC_NR(SVGAHELPER_INB):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ iov.val=inb(iov.port);
+ else ret = -EPERM;
+ copy_to_user((char *)arg,&iov,sizeof(iov));
+@@ -171,7 +175,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_INW):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ iov.val=inw(iov.port);
+ else ret = -EPERM;
+ copy_to_user((char *)arg,&iov,sizeof(iov));
+@@ -179,7 +183,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_INL):
+ copy_from_user(&iov,(char *)arg,sizeof(iov));
+- if(check_io_range(iov.port,minor))
++ if(check_io_range(iov.port,_minor))
+ iov.val=inl(iov.port);
+ else ret = -EPERM;
+ copy_to_user((char *)arg,&iov,sizeof(iov));
+@@ -220,7 +224,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIINB):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pci_read_config_byte(pdev, pciv.address, &pb);
+ pciv.val=pb;
+@@ -229,7 +233,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIINW):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pci_read_config_word(pdev, pciv.address, &pw);
+ pciv.val=pw;
+@@ -238,7 +242,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIINL):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pci_read_config_dword(pdev, pciv.address, &pl);
+ pciv.val=pl;
+@@ -247,7 +251,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIAPLEN):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- i = get_dev(pciv.pcipos, minor);
++ i = get_dev(pciv.pcipos, _minor);
+ if((i==0) | (pciv.address>5)) return -EINVAL;
+ pciv.val=sh_pci_devs[i]->len[pciv.address];
+ copy_to_user((char *)arg,&pciv,sizeof(pciv));
+@@ -255,7 +259,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIOUTB):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pb=pciv.val;
+ pci_write_config_byte(pdev, pciv.address, pb);
+@@ -263,7 +267,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIOUTW):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pw=pciv.val;
+ pci_write_config_word(pdev, pciv.address, pw);
+@@ -271,7 +275,7 @@ static int svgalib_helper_ioctl( struct
+
+ case _IOC_NR(SVGAHELPER_PCIOUTL):
+ copy_from_user(&pciv,(char *)arg,sizeof(pciv));
+- pdev = get_pci_dev(pciv.pcipos, minor);
++ pdev = get_pci_dev(pciv.pcipos, _minor);
+ if(!pdev) return -EINVAL;
+ pl=pciv.val;
+ pci_write_config_dword(pdev, pciv.address, pl);
+@@ -292,17 +296,17 @@ static int svgalib_helper_ioctl( struct
+ case _IOC_NR(SVGAHELPER_WAITRETRACE):
+
+ /* Workaround for nvidia cards, which are not vga compatible */
+-// if(!minor && num_devices==2) minor=1;
++// if(!_minor && num_devices==2) _minor=1;
+
+- if(minor) {
+- i=sh_pci_devs[minor]->dev->irq;
+- dev_id = sh_pci_devs[minor];
++ if(_minor) {
++ i=sh_pci_devs[_minor]->dev->irq;
++ dev_id = sh_pci_devs[_minor];
+ if(i==0 || i==-1 || i==255) return -EINVAL;
+ } else dev_id = sdev_id;
+
+ vsync=1;
+
+- if(minor) {
++ if(_minor) {
+ request_irq(i, vsync_interrupt, SA_SHIRQ, "svgalib_helper", dev_id);
+ } else {
+ i=0;
+@@ -310,16 +314,16 @@ static int svgalib_helper_ioctl( struct
+ request_irq(irqs[i++], vsync_interrupt, SA_SHIRQ, "svgalib_helper", dev_id);
+ }
+
+- if(minor) {
+- sh_pci_devs[minor]->enable_vsync(sh_pci_devs[minor]);
++ if(_minor) {
++ sh_pci_devs[_minor]->enable_vsync(sh_pci_devs[_minor]);
+ } else {
+- vga_enable_vsync(sh_pci_devs[minor]);
++ vga_enable_vsync(sh_pci_devs[_minor]);
+ }
+
+ interruptible_sleep_on(&vsync_wait);
+
+- if(minor) {
+- if(vsync) sh_pci_devs[minor]->ack_vsync(dev_id);
++ if(_minor) {
++ if(vsync) sh_pci_devs[_minor]->ack_vsync(dev_id);
+ free_irq(i, dev_id);
+ } else {
+ i=0;
+@@ -354,9 +358,9 @@ static int svgalib_helper_ioctl( struct
+
+ static int svgalib_helper_open( struct inode *inode, struct file * filp) {
+
+- int minor = my_minor(inode->i_rdev);
++ int _minor = my_minor(inode->i_rdev);
+
+- if(minor>=num_devices) return -ENODEV;
++ if(_minor>=num_devices) return -ENODEV;
+
+ #ifndef KERNEL_2_6
+ MOD_INC_USE_COUNT;
+@@ -470,14 +474,14 @@ int check_mem(int card, unsigned long st
+ static int svgalib_helper_mmap(struct file *filp, struct vm_area_struct *vma) {
+ unsigned long start=vma->vm_start;
+ unsigned long end=vma->vm_end;
+- unsigned long minor = my_minor(filp->f_dentry->d_inode->i_rdev);
++ unsigned long _minor = my_minor(filp->f_dentry->d_inode->i_rdev);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+ unsigned long ofs=vma->vm_pgoff*PAGE_SIZE;
+ #else
+ unsigned long ofs=vma->vm_offset;
+ #endif
+
+- if(check_mem(minor, ofs, end-start)) return -EPERM;
++ if(check_mem(_minor, ofs, end-start)) return -EPERM;
+ if(remap_cache(vma, ofs)) return -EAGAIN;
+ return 0;
+ }
+@@ -502,6 +506,7 @@ int init_module(void)
+ {
+ int result, i, j;
+ struct pci_dev *dev=NULL;
++ char name[255];
+ #ifdef CONFIG_DEVFS_FS
+ # ifndef KERNEL_2_6
+ devfs_handle_t slave_handle;
+@@ -513,9 +518,9 @@ int init_module(void)
+
+ printk(KERN_INFO "svgalib_helper: Initializing, version %s\n", versionstr);
+
+- result = devfs_register_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper", &svgalib_helper_fops);
++ result = devfs_register_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper", &svgalib_helper_fops);
+
+- if (result < 0) {
++ if (result < 0) {
+ printk(KERN_WARNING "svgalib_helper: can't get major %d\n",SVGALIB_HELPER_MAJOR);
+ return result;
+ }
+@@ -523,7 +528,7 @@ int init_module(void)
+ if((sh_pci_devs[0]=kmalloc(sizeof(struct sh_pci_device),GFP_KERNEL))==NULL) {
+ goto nomem_error;
+ }
+-
++
+ memset(sh_pci_devs[0],0,sizeof(struct sh_pci_device));
+ num_devices=1;
+ for(i=1;i<MAX_NR_DEVICES;i++) sh_pci_devs[i]=NULL;
+@@ -537,19 +542,22 @@ int init_module(void)
+ devfs_mk_symlink( NULL, "svga", 0, "svga_helper/0", &slave_handle, NULL );
+ devfs_auto_unregister( devfs_handle, slave_handle );
+ # else
+- devfs_mk_dir ("svga_helper");
+- for (i = 0; i < 8; i++) {
+- devfs_mk_cdev(MKDEV(SVGALIB_HELPER_MAJOR, i),
+- S_IFCHR | S_IRUGO | S_IRWXU, "svga_helper/%d", i);
+- }
+- devfs_mk_symlink("svga", "svga_helper/0");
++ devfs_mk_dir ("svga_helper");
++ for (i = 0; i < 8; i++) {
++ devfs_mk_cdev(MKDEV(SVGALIB_HELPER_MAJOR, i),
++ S_IFCHR | S_IRUGO | S_IRWXU, "svga_helper/%d", i);
++ }
++ devfs_mk_symlink("svga", "svga_helper/0");
+ # endif
+ #endif /* devfsd support */
+
++ SLH_SYSFS_REGISTER;
++ SLH_SYSFS_ADD_CONTROL;
++
+ if(pci_present()) {
+ while((dev= all_devices ?
+- pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev) :
+- pci_find_class(PCI_CLASS_DISPLAY_VGA<<8,dev)) &&
++ pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev) :
++ pci_find_class(PCI_CLASS_DISPLAY_VGA<<8,dev)) &&
+ (num_devices<=MAX_NR_DEVICES)) {
+ if((sh_pci_devs[num_devices]=kmalloc(sizeof(struct sh_pci_device),GFP_KERNEL))==NULL) {
+ goto nomem_error;
+@@ -581,6 +589,10 @@ int init_module(void)
+ }
+ }
+ vga_init_vsync(sh_pci_devs[num_devices]);
++
++ sprintf(name, "svga%d", num_devices);
++ SLH_SYSFS_ADD_DEVICE(name, num_devices);
++
+ num_devices++;
+ }
+ }
+@@ -600,39 +612,51 @@ int init_module(void)
+ init_waitqueue_head(&vsync_wait);
+
+ #ifndef KERNEL_2_6
+- EXPORT_NO_SYMBOLS;
++ EXPORT_NO_SYMBOLS;
+ #endif
+-
++
+ return 0; /* succeed */
+
+ nomem_error:
+- for(i=0;i<MAX_NR_DEVICES;i++)
+- if(sh_pci_devs[i])kfree(sh_pci_devs[i]);
++ for(i=0;i<MAX_NR_DEVICES;i++) {
++ if(sh_pci_devs[i]) {
++ SLH_SYSFS_REMOVE_DEVICE(i);
++ kfree(sh_pci_devs[i]);
++ }
++ }
++
++ SLH_SYSFS_REMOVE_DEVICE(0);
++ SLH_SYSFS_UNREGISTER;
++
++ devfs_unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
+
+- devfs_unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
+-
+- return result;
++ return result;
+ }
+
+ void cleanup_module(void)
+ {
+ int i;
+- for(i=0;i<MAX_NR_DEVICES;i++)
++ for(i=0;i<MAX_NR_DEVICES;i++) {
+ if(sh_pci_devs[i]) {
++ SLH_SYSFS_REMOVE_DEVICE(i);
+ kfree(sh_pci_devs[i]);
+ }
++ }
++
++ SLH_SYSFS_REMOVE_DEVICE(0);
++ SLH_SYSFS_UNREGISTER;
+
+ #ifdef CONFIG_DEVFS_FS
+ # ifndef KERNEL_2_6
+- devfs_unregister(devfs_handle);
++ devfs_unregister(devfs_handle);
+ # else
+- for (i = 0; i < 8; i++)
+- devfs_remove("svga_helper/%d", i);
+- devfs_remove("svga_helper");
+- devfs_remove("svga");
+-# endif
++ for (i = 0; i < 8; i++)
++ devfs_remove("svga_helper/%d", i);
++ devfs_remove("svga_helper");
++ devfs_remove("svga");
++# endif
+ #endif
+-
++
+ devfs_unregister_chrdev(SVGALIB_HELPER_MAJOR, "svgalib_helper");
+
+ }
diff --git a/media-libs/svgalib/svgalib-1.9.18.ebuild b/media-libs/svgalib/svgalib-1.9.18.ebuild
new file mode 100644
index 000000000000..30986b624e12
--- /dev/null
+++ b/media-libs/svgalib/svgalib-1.9.18.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/svgalib/svgalib-1.9.18.ebuild,v 1.1 2004/02/22 21:48:55 azarah Exp $
+
+inherit eutils
+
+DESCRIPTION="A library for running svga graphics on the console"
+HOMEPAGE="http://www.svgalib.org/"
+SRC_URI="http://www.arava.co.il/matan/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="-* ~x86"
+IUSE="build"
+
+DEPEND="virtual/glibc"
+
+pkg_setup() {
+ use build || check_KV
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ epatch ${FILESDIR}/${P}-gentoo.patch
+
+ # Fix a small gcc33 issue
+ epatch ${FILESDIR}/${P}-gcc33.patch
+
+ # Get it to work with kernel 2.6
+ epatch ${FILESDIR}/${P}-linux2.6.patch
+
+ # Disable kernel module support while building stages #38403
+ if [ -z "`use build`" ]
+ then
+ sed -i 's:installmodule ::' Makefile
+ fi
+}
+
+src_compile() {
+ # http://www.gentoo.org/proj/en/hardened/etdyn-ssp.xml or #gentoo-hardened/irc.freenode
+ has_version "sys-devel/hardened-gcc" && CC="${CC} -yet_exec"
+
+ make OPTIMIZE="${CFLAGS}" static \
+ || die "Failed to build static libraries!"
+ rm -f src/svgalib_helper.h
+ make OPTIMIZE="${CFLAGS}" shared textutils lrmi utils \
+ || die "Failed to build libraries and utils!"
+ # Build the gl stuff tpp
+ make OPTIMIZE="${CFLAGS}" -C gl || die "Failed to build gl!"
+ make OPTIMIZE="${CFLAGS}" -C gl libvgagl.so.${PV} \
+ || die "Failed to build libvgagl.so.${PV}!"
+ rm -f src/svgalib_helper.h
+ make OPTIMIZE="${CFLAGS}" -C src libvga.so.${PV} \
+ || die "Failed to build libvga.so.${PV}!"
+ cp -a src/libvga.so.${PV} sharedlib/
+ make OPTIMIZE="${CFLAFS}" LDFLAGS='-L ../sharedlib' \
+ -C threeDKit lib3dkit.a || die "Failed to build threeDKit!"
+
+ if [ -z "`use build`" ]
+ then
+ unset ARCH
+ cd ${S}/kernel/svgalib_helper
+ make -C /usr/src/linux SUBDIRS=`pwd` clean modules \
+ || die "Failed to build kernel module!"
+ cd ${S}
+ fi
+
+ make OPTIMIZE="${CFLAGS}" LDFLAGS='-L ../sharedlib' demoprogs \
+ || die "Failed to build demoprogs!"
+
+ cp Makefile Makefile.orig
+ sed -e 's/\(install: $(INSTALLAOUTLIB) \)installheaders \(.*\)/\1\2/g' \
+ Makefile.orig > Makefile
+}
+
+src_install() {
+ local x=
+
+ dodir /etc/svgalib /usr/{include,lib,bin,share/man}
+
+ make TOPDIR=${D} OPTIMIZE="${CFLAGS}" \
+ INCLUDEDIR="/usr/src/linux/include" install \
+ || die "Failed to install svgalib!"
+
+ insinto /usr/include
+ doins gl/vgagl.h
+ dolib.a staticlib/libvga.a
+ dolib.a gl/libvgagl.a
+ dolib.a threeDKit/lib3dkit.a
+ dolib.so gl/libvgagl.so.${PV}
+ dosym libvgagl.so.${PV} /usr/lib/libvgagl.so
+ preplib
+
+ insinto /usr/include
+ doins src/vga.h gl/vgagl.h src/mouse/vgamouse.h src/joystick/vgajoystick.h
+ doins src/keyboard/vgakeyboard.h
+
+ dodir /etc/modules.d
+ echo "probeall /dev/svga svgalib_helper" > ${D}/etc/modules.d/svgalib
+
+ exeinto /usr/lib/svgalib/demos
+ for x in ${S}/demos/*
+ do
+ [ -x "${x}" ] && doexe ${x}
+ done
+
+ cd ${S}/threeDKit
+ exeinto /usr/lib/svgalib/theeDKit
+ local THREED_PROGS="plane wrapdemo"
+ doexe ${THREED_PROGS}
+
+ cd ${S}
+ dodoc 0-README LICENSE
+ cd ${S}/doc
+ dodoc CHANGES DESIGN TODO
+ docinto txt
+ dodoc Driver-programming-HOWTO README.* add_driver svgalib.lsm
+}
+
+pkg_postinst() {
+ [ "${ROOT}" = "/" ] && /sbin/modules-update &> /dev/null
+ einfo "When upgrading your kernel you'll need to rebuild the kernel module."
+}