Your message dated Tue, 07 Sep 2010 20:48:53 +0000
with message-id <[email protected]>
and subject line Bug#591721: fixed in svgalib 1:1.4.3-30
has caused the Debian Bug report #591721,
regarding patch for kFreeBSD
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
591721: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591721
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: svgalib
Version: 1:1.4.3-29
Severity: important
Tags: patch
User: [email protected]
Usertags: kfreebsd
X-Debbugs-CC: [email protected]

Hi,
I made svgalib build on GNU/kFreeBSD, here is a patch.
diff -ur svgalib-1.4.3.orig/debian/control svgalib-1.4.3/debian/control
--- svgalib-1.4.3.orig/debian/control	2009-11-14 00:50:00.000000000 -0500
+++ svgalib-1.4.3/debian/control	2010-08-04 19:56:00.117398564 -0400
@@ -7,7 +7,7 @@
 Vcs-Browser: http://git.hadrons.org/?p=debian/pkgs/svgalib.git
 Vcs-Git: git://git.hadrons.org/git/debian/pkgs/svgalib.git
 Standards-Version: 3.8.3
-Build-Depends: debhelper (>= 7), libx86-dev [amd64 i386]
+Build-Depends: debhelper (>= 7), libx86-dev [amd64 i386 kfreebsd-amd64 kfreebsd-i386]
 
 Package: svgalib-bin
 Architecture: any
diff -ur svgalib-1.4.3.orig/src/keyboard/keyboard.c svgalib-1.4.3/src/keyboard/keyboard.c
--- svgalib-1.4.3.orig/src/keyboard/keyboard.c	2010-08-04 13:43:15.000000000 -0400
+++ svgalib-1.4.3/src/keyboard/keyboard.c	2010-08-04 19:54:40.714634914 -0400
@@ -33,7 +33,11 @@
 /* should also be useful for svgalib programs using the keyboard. It misses */
 /* a few KERNEL ifdefs around kernel data structures though. */
 #include "keyboard_lnx.h"
+#if defined(__linux__)
 #include <sys/vt.h>
+#elif defined(__FreeBSD_kernel__)
+#include <sys/consio.h>
+#endif
 /* Needed to check uid of keymap files */
 #include <sys/stat.h>
 #include <unistd.h>
@@ -385,6 +389,22 @@
     __svgalib_kbd_fd = -1;
 }
 
+static inline int vt_getactive(int fd)
+{
+    int v;
+#ifdef VT_GETSTATE
+    struct vt_stat vts;
+    if (ioctl(fd, VT_GETSTATE, &vts) == 0)
+        v = vts.v_active;
+    else
+        v = -1;
+#else
+    if (ioctl(fd, VT_GETACTIVE, &v) != 0)
+        v = -1;
+#endif
+    return v;
+}
+
 /* For now, we assume there's no console switching. */
 /* (Actually, there won't be any unless we catch the console switching */
 /* keys). */
@@ -578,7 +598,6 @@
 	    /* VT switch. */
 	    /* *** what about F11 & F12? */
 	    int j, vt = 0;
-	    struct vt_stat vts;
 	    for (j = 0; j < 12; j++)
 		if (functionkey_state & (1 << j)) {
 		    vt = j + 1;
@@ -587,9 +606,7 @@
 		}
 
 	    /* Do not switch vt's if need not to */
-	    ioctl(__svgalib_tty_fd, VT_GETSTATE, &vts);
-
-	    if(vt != vts.v_active) { 
+	    if(vt != vt_getactive(__svgalib_tty_fd)) { 
 	        /* if switching vt's, need to clear keystates */
 	        keyboard_clearstate();
 	        /*
diff -ur svgalib-1.4.3.orig/src/mouse/ms.c svgalib-1.4.3/src/mouse/ms.c
--- svgalib-1.4.3.orig/src/mouse/ms.c	2010-08-04 13:43:15.000000000 -0400
+++ svgalib-1.4.3/src/mouse/ms.c	2010-08-04 19:49:23.495541626 -0400
@@ -117,7 +117,9 @@
     tty.c_iflag = IGNBRK | IGNPAR;
     tty.c_oflag = 0;
     tty.c_lflag = 0;
+#ifdef __linux__
     tty.c_line  = 0;
+#endif
     tty.c_cc[VTIME] = 0;
     tty.c_cc[VMIN]  = 1;
 
@@ -527,7 +529,9 @@
 	tty.c_iflag = IGNBRK | IGNPAR;
 	tty.c_oflag = 0;
 	tty.c_lflag = 0;
+#ifdef __linux__
 	tty.c_line = 0;
+#endif
 	tty.c_cc[VTIME] = 0;
 	tty.c_cc[VMIN] = 1;
 	tty.c_cflag = cflag[m_type] | B1200;
diff -ur svgalib-1.4.3.orig/src/vga.c svgalib-1.4.3/src/vga.c
--- svgalib-1.4.3.orig/src/vga.c	2010-08-04 13:43:15.000000000 -0400
+++ svgalib-1.4.3/src/vga.c	2010-08-04 19:53:16.757293455 -0400
@@ -25,7 +25,11 @@
 #include <sys/kd.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
+#if defined(__linux__)
 #include <sys/vt.h>
+#elif defined(__FreeBSD_kernel__)
+#include <sys/consio.h>
+#endif
 #include <sys/wait.h>
 #include <errno.h>
 #include <ctype.h>
@@ -781,7 +785,7 @@
     /* Leave keyboard alone when rawkeyboard is enabled! */
     if (__svgalib_kbd_fd < 0) {
 	/* set graphics mode termio parameters */
-	ioctl(0, TCSETSW, &graph_termio);
+	tcsetattr(0, TCSADRAIN, &graph_termio);
     }
 }
 
@@ -791,7 +795,7 @@
     /* Leave keyboard alone when rawkeyboard is enabled! */
     if (__svgalib_kbd_fd < 0) {
 	/* restore text mode termio parameters */
-	ioctl(0, TCSETSW, &text_termio);
+	tcsetattr(0, TCSADRAIN, &text_termio);
     }
 }
 
@@ -802,9 +806,9 @@
 
     /* Well, one could argue that sigint is not enabled at all when in __svgalib_nosigint
        but sometimes they *still* are enabled b4 graph_termio is set.. */
-    ioctl(0, TCGETS, &cur_termio);
+    tcgetattr(0, &cur_termio);
     cur_termio.c_lflag &= ~ISIG;
-    ioctl(0, TCSETSW, &cur_termio);
+    tcsetattr(0, TCSADRAIN, &cur_termio);
 }
 
 
@@ -814,9 +818,9 @@
 
     if (__svgalib_nosigint) /* do not reenable, they are often reenabled by text_termio */
 	return; 
-    ioctl(0, TCGETS, &cur_termio);
+    tcgetattr(0, &cur_termio);
     cur_termio.c_lflag |= ISIG;
-    ioctl(0, TCSETSW, &cur_termio);
+    tcsetattr(0, TCSADRAIN, &cur_termio);
 }
 
 /* The following is rather messy and inelegant. The only solution I can */
@@ -938,10 +942,26 @@
     return 0;
 }
 
+static inline int vt_getactive(int fd)
+{
+    int v;
+#ifdef VT_GETSTATE
+    struct vt_stat vts;
+    if (ioctl(fd, VT_GETSTATE, &vts) == 0)
+        v = vts.v_active;
+    else
+        v = -1;
+#else
+    if (ioctl(fd, VT_GETACTIVE, &v) != 0)
+        v = -1;
+#endif
+    return v;
+}
+
 void __svgalib_open_devconsole(void)
 {
     struct vt_mode vtm;
-    struct vt_stat vts;
+    int v_active;
     struct stat sbuf;
     char fname[30];
 
@@ -998,8 +1018,8 @@
     setsid();
     /* We must use RDWR to allow for output... */
     if (((__svgalib_tty_fd = open(fname, O_RDWR)) >= 0) &&
-        (ioctl(__svgalib_tty_fd, VT_GETSTATE, &vts) >= 0)) {
-        if (!check_owner(vts.v_active))
+        (v_active = vt_getactive(__svgalib_tty_fd)) >= 0) {
+        if (!check_owner(v_active))
             goto error;
         /* success, redirect all stdios */
         if (DREP)
@@ -1016,8 +1036,8 @@
         /* clear screen and switch to it */
         fwrite("\e[H\e[J", 6, 1, stderr);
         fflush(stderr);
-        if (svgalib_vc != vts.v_active) {
-            startup_vc = vts.v_active;
+        if (svgalib_vc != v_active) {
+            startup_vc = v_active;
 	    ioctl(__svgalib_tty_fd, VT_ACTIVATE, svgalib_vc);
             __svgalib_waitvtactive();
 	}
@@ -1329,7 +1349,11 @@
  SIGTRAP, SIGIOT, SIGBUS, SIGFPE,
  SIGSEGV, SIGPIPE, SIGALRM, SIGTERM,
  SIGXCPU, SIGXFSZ, SIGVTALRM,
-/* SIGPROF ,*/ SIGPWR};
+/* SIGPROF ,*/
+#ifdef SIGPWR
+SIGPWR
+#endif
+};
 static struct sigaction old_signal_handler[sizeof(sig2catch)];
 
 struct vt_mode __svgalib_oldvtmode;
@@ -1939,12 +1963,16 @@
 #endif
 
     /* save text mode termio parameters */
-    ioctl(0, TCGETS, &text_termio);
+    tcgetattr(0, &text_termio);
 
     graph_termio = text_termio;
 
     /* change termio parameters to allow our own I/O processing */
-    graph_termio.c_iflag &= ~(BRKINT | PARMRK | INPCK | IUCLC | IXON | IXOFF);
+    graph_termio.c_iflag &= ~(BRKINT | PARMRK | INPCK
+#ifdef IUCLC
+| IUCLC
+#endif
+| IXON | IXOFF);
     graph_termio.c_iflag |= (IGNBRK | IGNPAR);
 
     graph_termio.c_oflag &= ~(ONOCR);
diff -ur svgalib-1.4.3.orig/src/vgamisc.c svgalib-1.4.3/src/vgamisc.c
--- svgalib-1.4.3.orig/src/vgamisc.c	2010-08-04 13:43:15.000000000 -0400
+++ svgalib-1.4.3/src/vgamisc.c	2010-08-04 19:47:52.858115087 -0400
@@ -73,18 +73,40 @@
     return __svgalib_graph_mem;
 }
 
+#if defined(__linux__)
+
 #include <sys/sysinfo.h>
 
+static inline int get_totalram(void)
+{
+    struct sysinfo si;
+    si.totalram = 0;
+    sysinfo(&si);
+    return si.totalram;
+}
+
+#elif defined(__FreeBSD_kernel__)
+
+#include <sys/sysctl.h>
+
+static inline int get_totalram(void)
+{
+    int totalram;
+    size_t totalram_size = sizeof(totalram);
+    if (sysctlbyname("vm.stats.vm.v_page_count", &totalram, &totalram_size, NULL, 0) == -1)
+        return -1;
+    return totalram * getpagesize() / 1024;
+}
+
+#endif
+
 int __svgalib_physmem(void)
 {
 #ifdef __alpha__
     printf("__svgalib_physmem: are you sure you wanna do this??\n");
     return -1;
 #else
-    struct sysinfo si;
-    si.totalram = 0;
-    sysinfo(&si);
-    return si.totalram;
+    return get_totalram();
 #endif
 }
 
@@ -303,18 +325,18 @@
 
 int vga_getkey(void)
 {
-    struct termio zap, original;
+    struct termios zap, original;
     int e;
     char c;
 
-    ioctl(fileno(stdin), TCGETA, &original);	/* Get termio */
+    tcgetattr(fileno(stdin), &original);	/* Get termio */
     zap = original;
     zap.c_cc[VMIN] = 0;		/* Modify termio  */
     zap.c_cc[VTIME] = 0;
     zap.c_lflag = 0;
-    ioctl(fileno(stdin), TCSETA, &zap);		/* Set new termio */
+    tcsetattr(fileno(stdin), TCSANOW, &zap);		/* Set new termio */
     e = read(fileno(stdin), &c, 1);	/* Read one char */
-    ioctl(fileno(stdin), TCSETA, &original);	/* Restore termio */
+    tcsetattr(fileno(stdin), TCSANOW, &original);	/* Restore termio */
     if (e != 1)
 	return 0;		/* No key pressed. */
     return c;			/* Return key. */
diff -ur svgalib-1.4.3.orig/utils/gtf/scitech.h svgalib-1.4.3/utils/gtf/scitech.h
--- svgalib-1.4.3.orig/utils/gtf/scitech.h	2010-08-04 13:43:15.000000000 -0400
+++ svgalib-1.4.3/utils/gtf/scitech.h	2010-08-04 20:01:14.814950032 -0400
@@ -216,7 +216,7 @@
 #endif
 
 /* 32-bit Linux compile environment */
-#elif	defined(__LINUX__) || defined(linux)
+#elif	defined(__LINUX__) || defined(linux) || defined(__GLIBC__)
 #ifndef	__LINUX__
 #define	__LINUX__
 #endif

--- End Message ---
--- Begin Message ---
Source: svgalib
Source-Version: 1:1.4.3-30

We believe that the bug you reported is fixed in the latest version of
svgalib, which is due to be installed in the Debian FTP archive:

libsvga1-dev_1.4.3-30_amd64.deb
  to main/s/svgalib/libsvga1-dev_1.4.3-30_amd64.deb
libsvga1_1.4.3-30_amd64.deb
  to main/s/svgalib/libsvga1_1.4.3-30_amd64.deb
svgalib-bin_1.4.3-30_amd64.deb
  to main/s/svgalib/svgalib-bin_1.4.3-30_amd64.deb
svgalib_1.4.3-30.debian.tar.gz
  to main/s/svgalib/svgalib_1.4.3-30.debian.tar.gz
svgalib_1.4.3-30.dsc
  to main/s/svgalib/svgalib_1.4.3-30.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Guillem Jover <[email protected]> (supplier of updated svgalib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 07 Sep 2010 13:52:51 +0200
Source: svgalib
Binary: svgalib-bin libsvga1 libsvga1-dev
Architecture: source amd64
Version: 1:1.4.3-30
Distribution: unstable
Urgency: low
Maintainer: Guillem Jover <[email protected]>
Changed-By: Guillem Jover <[email protected]>
Description: 
 libsvga1   - console SVGA display libraries
 libsvga1-dev - console SVGA display development libraries and headers
 svgalib-bin - console SVGA display utilities
Closes: 291082 591721
Changes: 
 svgalib (1:1.4.3-30) unstable; urgency=low
 .
   * Now using Standards-Version 3.9.1 (no changes needed).
   * Use architecture wildcards:
     - Use linux-any instead of any in binary package Architecture fields.
     - Use any-amd64 and any-i386 in libx86-dev Build-Depends architecture
       restrictions.
   * Port svgalib to GNU/kFreeBSD:
     - Use portable termios instead of termio.
     - Use VT_GETACTIVE instead of VT_GETSTATE on kFreeBSD.
     - Only use c_line member in struct termios on Linux.
     - Handle systems with no SIGPWR.
     - Implement __svgalib_physmem for kFreeBSD.
     Thanks to Tuco <[email protected]>. (Closes: #291082, #591721)
     - Define IUCLC to 0 if not pre-defined.
     - Error out if there's no known way to get the current VT active state.
     - Add kfreebsd-any to binary package Architecture fields.
   * Add ${misc:Depends} substvars to all binary package Depends fields.
Checksums-Sha1: 
 84613c1027aa4a0f27a842f0bc3175df09c56a69 1273 svgalib_1.4.3-30.dsc
 d6e9617cd63f8a184edba7529bc5864dbe54aa2d 65306 svgalib_1.4.3-30.debian.tar.gz
 54d15b114ab0850babb3f3d000fe80efbcf24577 21376 svgalib-bin_1.4.3-30_amd64.deb
 4b3ce37f0409e7a803ea72c0c1aadfd9c5a0981a 305224 libsvga1_1.4.3-30_amd64.deb
 f523dcdc1936c31ab78532bf47c06cf356b55c3d 562622 libsvga1-dev_1.4.3-30_amd64.deb
Checksums-Sha256: 
 9d621fbb2bc32babbdcd9ba4f81839aa50c75561d9c482396f12f3eec4a58ba5 1273 
svgalib_1.4.3-30.dsc
 61cf6b363166dbb7ecb9eafe5fddb3ffdaf48130b84a3e9186c28ac51d3ac390 65306 
svgalib_1.4.3-30.debian.tar.gz
 55ff6f6e916646debe2d6f1ce18899da679eee3e9590d681a722268cd04a3c65 21376 
svgalib-bin_1.4.3-30_amd64.deb
 4b1888e84db7c05900b2be8ecc3dc1c2165ac6c740a4c6e084f8c0077d8dbc23 305224 
libsvga1_1.4.3-30_amd64.deb
 08b38ec9f177bcdffb02eeb7e54b0b700a513009311f7a952e4ebee93870993b 562622 
libsvga1-dev_1.4.3-30_amd64.deb
Files: 
 0bc7e860ea31072e950f893f54be2c06 1273 graphics optional svgalib_1.4.3-30.dsc
 1dae30a260118e731c2e54c72f01f6d7 65306 graphics optional 
svgalib_1.4.3-30.debian.tar.gz
 e74215abc45e0fd75f3165460c17dfce 21376 graphics optional 
svgalib-bin_1.4.3-30_amd64.deb
 eec4bb262d0c583e83720317318c791a 305224 libs optional 
libsvga1_1.4.3-30_amd64.deb
 07adf130196ee8952e3cc2b3260ca434 562622 libdevel optional 
libsvga1-dev_1.4.3-30_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkyGKr4ACgkQuW9ciZ2SjJuCkQCg9XVsCEWr5FNF5cMw79B3mmiO
t60An3yiUfXLMdmLoMglatoPlYCsWm0l
=HkMc
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to