summaryrefslogtreecommitdiff
path: root/graphics/nvtv
diff options
context:
space:
mode:
authorcube <cube@pkgsrc.org>2003-10-05 09:16:16 +0000
committercube <cube@pkgsrc.org>2003-10-05 09:16:16 +0000
commita19b0aed9c07fa15c24d9044c04cd7f6906e4ae6 (patch)
treefede75e655f3ec90ced6f1d83f9d0d9781858190 /graphics/nvtv
parente349643e46fa9d9a7c9d960491404a96d94d4b20 (diff)
downloadpkgsrc-a19b0aed9c07fa15c24d9044c04cd7f6906e4ae6.tar.gz
Initial import of nvtv, version 0.4.5 into the NetBSD Package Collection,
from pkgsrc-wip. OK'd by seb@. This is a tool to enable TV-Out on Linux for NVidia cards. It does not need the kernel, supports multiple TV encoder chips. You may use all the features of the chip, down to direct register access, and all resolutions and sizes the chip supports.
Diffstat (limited to 'graphics/nvtv')
-rw-r--r--graphics/nvtv/DESCR6
-rw-r--r--graphics/nvtv/Makefile10
-rw-r--r--graphics/nvtv/Makefile.common27
-rw-r--r--graphics/nvtv/PLIST13
-rw-r--r--graphics/nvtv/distinfo12
-rw-r--r--graphics/nvtv/files/nvtvd.sh16
-rw-r--r--graphics/nvtv/patches/patch-aa14
-rw-r--r--graphics/nvtv/patches/patch-ab362
-rw-r--r--graphics/nvtv/patches/patch-ac13
-rw-r--r--graphics/nvtv/patches/patch-ad87
-rw-r--r--graphics/nvtv/patches/patch-ae42
-rw-r--r--graphics/nvtv/patches/patch-af56
-rw-r--r--graphics/nvtv/patches/patch-ag14
-rw-r--r--graphics/nvtv/patches/patch-ah55
14 files changed, 727 insertions, 0 deletions
diff --git a/graphics/nvtv/DESCR b/graphics/nvtv/DESCR
new file mode 100644
index 00000000000..ec8e8e845b7
--- /dev/null
+++ b/graphics/nvtv/DESCR
@@ -0,0 +1,6 @@
+This is a tool to enable TV-Out on Linux for NVidia
+cards. It does not need the kernel, supports
+multiple TV encoder chips. You may use all the
+features of the chip, down to direct register
+access, and all resolutions and sizes the chip
+supports.
diff --git a/graphics/nvtv/Makefile b/graphics/nvtv/Makefile
new file mode 100644
index 00000000000..bfbb1fb939f
--- /dev/null
+++ b/graphics/nvtv/Makefile
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1.1.1 2003/10/05 09:16:16 cube Exp $
+
+PKGNAME= ${DISTNAME}
+.include "Makefile.common"
+
+CONFLICTS= nvtv-gtk2-[0-9]*
+
+.include "../../x11/gtk/buildlink2.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/nvtv/Makefile.common b/graphics/nvtv/Makefile.common
new file mode 100644
index 00000000000..7ae6caaa9ac
--- /dev/null
+++ b/graphics/nvtv/Makefile.common
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile.common,v 1.1.1.1 2003/10/05 09:16:16 cube Exp $
+DISTNAME= nvtv-0.4.5
+CATEGORIES= graphics
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=nv-tv-out/}
+
+MAINTAINER= cube@NetBSD.org
+HOMEPAGE= http://sourceforge.net/projects/nv-tv-out/
+COMMENT= Tool to manipulate TV-Out settings on NVidia cards
+
+ONLY_FOR_PLATFORM= *-i386
+
+USE_BUILDLINK2= YES
+GNU_CONFIGURE= YES
+RCD_SCRIPTS= nvtvd
+USE_PKGINSTALL= YES
+
+post-patch:
+ ${CP} ${WRKSRC}/man/nvtv.1x ${WRKSRC}/man/nvtv.1
+
+post-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/nvtv
+ ${INSTALL_DATA} ${WRKSRC}/README ${WRKSRC}/FAQ ${WRKSRC}/doc/USAGE \
+ ${WRKSRC}/doc/chips.txt \
+ ${WRKSRC}/doc/overview.txt ${WRKSRC}/doc/timing.txt \
+ ${PREFIX}/share/doc/nvtv
+
+.include "../../sysutils/pciutils/buildlink2.mk"
diff --git a/graphics/nvtv/PLIST b/graphics/nvtv/PLIST
new file mode 100644
index 00000000000..b40d3bea272
--- /dev/null
+++ b/graphics/nvtv/PLIST
@@ -0,0 +1,13 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2003/10/05 09:16:16 cube Exp $
+etc/rc.d/nvtvd
+bin/nvtv
+bin/nvtvd
+share/doc/nvtv/FAQ
+share/doc/nvtv/README
+share/doc/nvtv/USAGE
+share/doc/nvtv/chips.txt
+share/doc/nvtv/overview.txt
+share/doc/nvtv/timing.txt
+man/man1/nvtv.1
+man/man8/nvtvd.8
+@dirrm share/doc/nvtv
diff --git a/graphics/nvtv/distinfo b/graphics/nvtv/distinfo
new file mode 100644
index 00000000000..1fdba3ebd06
--- /dev/null
+++ b/graphics/nvtv/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+SHA1 (nvtv-0.4.5.tar.gz) = 8b2791301da4af4894b136595fecad7ff91282e6
+Size (nvtv-0.4.5.tar.gz) = 383497 bytes
+SHA1 (patch-aa) = 28d37b601bf86d08f900ff90d4780bacfabbd6b8
+SHA1 (patch-ab) = e73103ebba3fab7da56aa7c77e94ee6a0a331e2c
+SHA1 (patch-ac) = af493d9f8209203b50379f93146ba6504eb39829
+SHA1 (patch-ad) = 0f0b7ab6df8581c4aed078b7e073f7562e123701
+SHA1 (patch-ae) = 9a79ed5920a006ba98db1e8bac312fcb1136c3ff
+SHA1 (patch-af) = 682dc4ef845c0b45116706a7e02689cc503e4abe
+SHA1 (patch-ag) = 6d200843ff83eff7bb4448478ea1940ef3d78b96
+SHA1 (patch-ah) = ba74f956b93b5afd971a499e8b97a1ef6929994e
diff --git a/graphics/nvtv/files/nvtvd.sh b/graphics/nvtv/files/nvtvd.sh
new file mode 100644
index 00000000000..68a3c65e86f
--- /dev/null
+++ b/graphics/nvtv/files/nvtvd.sh
@@ -0,0 +1,16 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: nvtvd.sh,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+#
+
+# PROVIDE: nvtvd
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nvtvd"
+rcvar=$name
+command="@PREFIX@/bin/nvtvd"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/graphics/nvtv/patches/patch-aa b/graphics/nvtv/patches/patch-aa
new file mode 100644
index 00000000000..b2d58de0559
--- /dev/null
+++ b/graphics/nvtv/patches/patch-aa
@@ -0,0 +1,14 @@
+$NetBSD: patch-aa,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- src/config.h.in.orig 2003-06-07 19:22:20.000000000 +0200
++++ src/config.h.in
+@@ -18,6 +18,9 @@
+ /* Define to 1 if pciutils available and used. */
+ #undef HAVE_PCI
+
++/* Define to 1 if pciutils library is named 'pciutils'. */
++#undef HAVE_PCIUTILS
++
+ /* Define to 1 if you have the <stdint.h> header file. */
+ #undef HAVE_STDINT_H
+
diff --git a/graphics/nvtv/patches/patch-ab b/graphics/nvtv/patches/patch-ab
new file mode 100644
index 00000000000..8c0a7d2a7c5
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ab
@@ -0,0 +1,362 @@
+$NetBSD: patch-ab,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- configure.orig 2003-05-30 11:36:48.000000000 +0200
++++ configure
+@@ -5101,7 +5101,7 @@ _ACEOF
+
+ OBJS_EXTRA="$OBJS_EXTRA actions.o"
+ if test ${have_gtk} != no ; then
+- have_gtk_version=`expr substr ${have_gtk} 4 1`
++ have_gtk_version=`expr ${have_gtk} : '^gtk\([12]\)'`
+
+ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_GTK 1
+@@ -5381,6 +5381,135 @@ echo "$as_me: error: math library requir
+ fi
+
+
++case ${host} in
++ *-*-netbsd*)
++ echo "$as_me:$LINENO: checking for i386_iopl in -li386" >&5
++echo $ECHO_N "checking for i386_iopl in -li386... $ECHO_C" >&6
++if test "${ac_cv_lib_i386_i386_iopl+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-li386 $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char i386_iopl ();
++int
++main ()
++{
++i386_iopl ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_i386_i386_iopl=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_i386_i386_iopl=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_i386_i386_iopl" >&5
++echo "${ECHO_T}$ac_cv_lib_i386_i386_iopl" >&6
++if test $ac_cv_lib_i386_i386_iopl = yes; then
++ LIBS="$LIBS -li386"
++else
++ { { echo "$as_me:$LINENO: error: NetBSD i386 library required" >&5
++echo "$as_me: error: NetBSD i386 library required" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++ echo "$as_me:$LINENO: checking for pcibus_conf_read in -lpci" >&5
++echo $ECHO_N "checking for pcibus_conf_read in -lpci... $ECHO_C" >&6
++if test "${ac_cv_lib_pci_pcibus_conf_read+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lpci $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char pcibus_conf_read ();
++int
++main ()
++{
++pcibus_conf_read ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_pci_pcibus_conf_read=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_pci_pcibus_conf_read=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_pci_pcibus_conf_read" >&5
++echo "${ECHO_T}$ac_cv_lib_pci_pcibus_conf_read" >&6
++if test $ac_cv_lib_pci_pcibus_conf_read = yes; then
++ LIBS="$LIBS -lpci"
++else
++ { { echo "$as_me:$LINENO: error: NetBSD pci library required" >&5
++echo "$as_me: error: NetBSD pci library required" >&2;}
++ { (exit 1); exit 1; }; }
++fi
++
++ ;;
++esac
++
+ if test ${with_winio} = yes ; then
+ echo "$as_me:$LINENO: checking for winio_init in -lwinio" >&5
+ echo $ECHO_N "checking for winio_init in -lwinio... $ECHO_C" >&6
+@@ -5502,7 +5631,64 @@ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_pci_pci_init" >&5
+ echo "${ECHO_T}$ac_cv_lib_pci_pci_init" >&6
+ if test $ac_cv_lib_pci_pci_init = yes; then
+- LIBS="$LIBS -lpci"
++ LIBS="$LIBS -lpci" pciutils_libname="pci"
++else
++ echo "$as_me:$LINENO: checking for pci_init in -lpciutils" >&5
++echo $ECHO_N "checking for pci_init in -lpciutils... $ECHO_C" >&6
++if test "${ac_cv_lib_pciutils_pci_init+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-lpciutils $LIBS"
++cat >conftest.$ac_ext <<_ACEOF
++#line $LINENO "configure"
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++/* Override any gcc2 internal prototype to avoid an error. */
++#ifdef __cplusplus
++extern "C"
++#endif
++/* We use char because int might match the return type of a gcc2
++ builtin and then its argument prototype would still apply. */
++char pci_init ();
++int
++main ()
++{
++pci_init ();
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++ (eval $ac_link) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -s conftest$ac_exeext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ ac_cv_lib_pciutils_pci_init=yes
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_lib_pciutils_pci_init=no
++fi
++rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++echo "$as_me:$LINENO: result: $ac_cv_lib_pciutils_pci_init" >&5
++echo "${ECHO_T}$ac_cv_lib_pciutils_pci_init" >&6
++if test $ac_cv_lib_pciutils_pci_init = yes; then
++ LIBS="$LIBS -lpciutils" pciutils_libname="pciutils"
+ else
+ { { echo "$as_me:$LINENO: error: pci library required" >&5
+ echo "$as_me: error: pci library required" >&2;}
+@@ -5511,6 +5697,8 @@ fi
+
+ fi
+
++fi
++
+
+ if test ${with_x} = yes ; then
+ echo "$as_me:$LINENO: checking for XF86VidModeQueryVersion in -lXxf86vm" >&5
+@@ -6029,18 +6217,19 @@ done
+
+
+ if test ${host_flag} = unix -o ${with_winio} = yes ; then
+- if test "${ac_cv_header_pci_pci_h+set}" = set; then
+- echo "$as_me:$LINENO: checking for pci/pci.h" >&5
+-echo $ECHO_N "checking for pci/pci.h... $ECHO_C" >&6
+-if test "${ac_cv_header_pci_pci_h+set}" = set; then
++ as_ac_Header=`echo "ac_cv_header_${pciutils_libname}/pci.h" | $as_tr_sh`
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
++ echo "$as_me:$LINENO: checking for ${pciutils_libname}/pci.h" >&5
++echo $ECHO_N "checking for ${pciutils_libname}/pci.h... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_pci_pci_h" >&5
+-echo "${ECHO_T}$ac_cv_header_pci_pci_h" >&6
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ else
+ # Is the header compilable?
+-echo "$as_me:$LINENO: checking pci/pci.h usability" >&5
+-echo $ECHO_N "checking pci/pci.h usability... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking ${pciutils_libname}/pci.h usability" >&5
++echo $ECHO_N "checking ${pciutils_libname}/pci.h usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h. */
+@@ -6049,7 +6238,7 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ $ac_includes_default
+-#include <pci/pci.h>
++#include <${pciutils_libname}/pci.h>
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+@@ -6075,8 +6264,8 @@ echo "$as_me:$LINENO: result: $ac_header
+ echo "${ECHO_T}$ac_header_compiler" >&6
+
+ # Is the header present?
+-echo "$as_me:$LINENO: checking pci/pci.h presence" >&5
+-echo $ECHO_N "checking pci/pci.h presence... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking ${pciutils_libname}/pci.h presence" >&5
++echo $ECHO_N "checking ${pciutils_libname}/pci.h presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+ #line $LINENO "configure"
+ /* confdefs.h. */
+@@ -6084,7 +6273,7 @@ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <pci/pci.h>
++#include <${pciutils_libname}/pci.h>
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -6117,10 +6306,10 @@ echo "${ECHO_T}$ac_header_preproc" >&6
+ # So? What about this header?
+ case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+- { echo "$as_me:$LINENO: WARNING: pci/pci.h: accepted by the compiler, rejected by the preprocessor!" >&5
+-echo "$as_me: WARNING: pci/pci.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+- { echo "$as_me:$LINENO: WARNING: pci/pci.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: pci/pci.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: ${pciutils_libname}/pci.h: accepted by the compiler, rejected by the preprocessor!" >&5
++echo "$as_me: WARNING: ${pciutils_libname}/pci.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
++ { echo "$as_me:$LINENO: WARNING: ${pciutils_libname}/pci.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: ${pciutils_libname}/pci.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+ ## ------------------------------------ ##
+@@ -6131,12 +6320,12 @@ _ASBOX
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+- { echo "$as_me:$LINENO: WARNING: pci/pci.h: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: pci/pci.h: present but cannot be compiled" >&2;}
+- { echo "$as_me:$LINENO: WARNING: pci/pci.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: pci/pci.h: check for missing prerequisite headers?" >&2;}
+- { echo "$as_me:$LINENO: WARNING: pci/pci.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: pci/pci.h: proceeding with the preprocessor's result" >&2;}
++ { echo "$as_me:$LINENO: WARNING: ${pciutils_libname}/pci.h: present but cannot be compiled" >&5
++echo "$as_me: WARNING: ${pciutils_libname}/pci.h: present but cannot be compiled" >&2;}
++ { echo "$as_me:$LINENO: WARNING: ${pciutils_libname}/pci.h: check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: ${pciutils_libname}/pci.h: check for missing prerequisite headers?" >&2;}
++ { echo "$as_me:$LINENO: WARNING: ${pciutils_libname}/pci.h: proceeding with the preprocessor's result" >&5
++echo "$as_me: WARNING: ${pciutils_libname}/pci.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+ ## ------------------------------------ ##
+@@ -6147,23 +6336,22 @@ _ASBOX
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ esac
+-echo "$as_me:$LINENO: checking for pci/pci.h" >&5
+-echo $ECHO_N "checking for pci/pci.h... $ECHO_C" >&6
+-if test "${ac_cv_header_pci_pci_h+set}" = set; then
++echo "$as_me:$LINENO: checking for ${pciutils_libname}/pci.h" >&5
++echo $ECHO_N "checking for ${pciutils_libname}/pci.h... $ECHO_C" >&6
++if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- ac_cv_header_pci_pci_h=$ac_header_preproc
++ eval "$as_ac_Header=$ac_header_preproc"
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_header_pci_pci_h" >&5
+-echo "${ECHO_T}$ac_cv_header_pci_pci_h" >&6
++echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
++echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+ fi
+-if test $ac_cv_header_pci_pci_h = yes; then
++if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ :
+ else
+- { { echo "$as_me:$LINENO: error: pci library header 'pci/pci.h' required" >&5
+-echo "$as_me: error: pci library header 'pci/pci.h' required" >&2;}
+- { (exit 1); exit 1; }; }
++ { echo "$as_me:$LINENO: WARNING: pci library header \'${pciutils_libname}/pci.h\' required" >&5
++echo "$as_me: WARNING: pci library header \'${pciutils_libname}/pci.h\' required" >&2;}
+ fi
+
+
+@@ -6172,6 +6360,13 @@ cat >>confdefs.h <<\_ACEOF
+ #define HAVE_PCI 1
+ _ACEOF
+
++ if test ${pciutils_libname} = pciutils ; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_PCIUTILS 1
++_ACEOF
++
++ fi
+ fi
+
+ if test ${with_winio} = yes ; then
diff --git a/graphics/nvtv/patches/patch-ac b/graphics/nvtv/patches/patch-ac
new file mode 100644
index 00000000000..c57bea66609
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- man/Makefile.in.orig 2003-06-02 17:57:33.000000000 +0200
++++ man/Makefile.in
+@@ -79,7 +79,7 @@ WX_LIBS = @WX_LIBS@
+ WX_LIBS_STATIC = @WX_LIBS_STATIC@
+ WX_VERSION = @WX_VERSION@
+
+-man_MANS = nvtv.1x nvtvd.8
++man_MANS = nvtv.1 nvtvd.8
+
+ EXTRA_DIST = $(man_MANS)
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
diff --git a/graphics/nvtv/patches/patch-ad b/graphics/nvtv/patches/patch-ad
new file mode 100644
index 00000000000..97199011742
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ad
@@ -0,0 +1,87 @@
+$NetBSD: patch-ad,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- src/card_direct.c.orig 2003-05-08 17:42:44.000000000 +0200
++++ src/card_direct.c
+@@ -44,8 +44,12 @@
+ #include <fcntl.h>
+
+ #ifdef HAVE_PCI
++#ifdef HAVE_PCIUTILS
++#include <pciutils/pci.h>
++#else
+ #include <pci/pci.h>
+ #endif
++#endif
+ #include <sys/mman.h>
+ #include <sys/ioctl.h>
+ #ifdef HAVE_SYS_IO_H
+@@ -164,6 +168,56 @@ void unmapDevMem (CardPtr card, unsigned
+
+ /* -------- Common -------- */
+
++#ifdef __NetBSD__
++static int
++ioperm(from, num, turn_on)
++ unsigned long from;
++ unsigned long num;
++ int turn_on;
++{
++ u_long *bitmap, mask, value;
++ int r = -1;
++ int first_index, last_index, i;
++
++ if((bitmap = (u_long *)malloc(1024*sizeof(u_long))) == NULL)
++ return -1;
++
++ if(i386_get_ioperm(bitmap) != 0)
++ goto ioperm_fail;
++
++ first_index = from / 32;
++ last_index = (from + num) / 32;
++
++ /* First set */
++ mask = 0xffffffff << (from % 32);
++ if(turn_on)
++ bitmap[first_index] |= mask;
++ else
++ bitmap[first_index] &= ~mask;
++
++ /* Last set */
++ mask = 0xffffffff >> (31 - (from + num) % 32);
++ if(turn_on)
++ bitmap[last_index] |= mask;
++ else
++ bitmap[last_index] &= ~mask;
++
++ if(last_index > first_index + 1) {
++ /* Complete sets */
++ value = turn_on ? 0xffffffff : 0;
++
++ for(i = first_index+1; i<last_index; i++)
++ bitmap[i] = value;
++ }
++
++ r = i386_set_ioperm(bitmap);
++
++ioperm_fail:
++ free(bitmap);
++ return r;
++}
++#endif
++
+ /*
+ * Test if card is supported, and create entry for it if it is.
+ */
+@@ -193,8 +247,12 @@ void test_card (CardPtr *card_list, char
+ /* FIXME get PIO base from device w/ id 01B4 (SMBus controller) */
+ pio_base = 0xC000;
+ #ifndef HAVE_WINIO
++#ifdef __NetBSD__
++ i386_iopl (3);
++#else
+ iopl (3);
+ #endif
++#endif
+ }
+ reg_base = base0;
+ break;
diff --git a/graphics/nvtv/patches/patch-ae b/graphics/nvtv/patches/patch-ae
new file mode 100644
index 00000000000..187f5b49ec1
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ae
@@ -0,0 +1,42 @@
+$NetBSD: patch-ae,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- src/tv_tdfx.c.orig 2003-02-05 17:33:10.000000000 +0100
++++ src/tv_tdfx.c
+@@ -233,6 +233,7 @@ VSyncEnd --- --- --- --- ---
+ /* FIXME: Put that somewhere else */
+ /* from xfree common/compiler.h */
+
++#ifndef __NetBSD__
+ #ifdef linux
+ #include <sys/io.h>
+
+@@ -265,6 +266,29 @@ inb (unsigned short int port)
+
+ #endif
+
++#else
++static __inline__ u_int8_t
++inb(port)
++ u_int16_t port;
++{
++ u_int8_t r;
++
++ __asm__ __volatile__ ("inb %w1,%0" : "=a" (r) : "Nd" (port));
++
++ return r;
++}
++
++static __inline__ void
++outb(value, port)
++ u_int8_t value;
++ u_int16_t port;
++{
++ __asm__ __volatile__ ("outb %b0,%w1" : : "a" (value), "Nd" (port));
++}
++
++#define OUTB(p,v) outb(v,p)
++#define INB(p) inb(p)
++#endif
+ /* FIXME: variable port addr */
+
+ CARD8 readCrtTdfx (TDFXPtr hwp, CARD8 index)
diff --git a/graphics/nvtv/patches/patch-af b/graphics/nvtv/patches/patch-af
new file mode 100644
index 00000000000..2d2288b3103
--- /dev/null
+++ b/graphics/nvtv/patches/patch-af
@@ -0,0 +1,56 @@
+$NetBSD: patch-af,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- src/nvtvd.c.orig 2003-02-10 15:50:44.000000000 +0100
++++ src/nvtvd.c
+@@ -27,6 +27,7 @@
+ #include "local.h" /* before everything else */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <getopt.h>
+
+ #ifdef HAVE_UNISTD_H
+@@ -51,6 +52,7 @@ BackCardPtr back_card = NULL;
+
+ Bool opt_null = FALSE;
+ Bool opt_nvdev = FALSE;
++Bool opt_debug = FALSE;
+
+ static const char *short_options = "?hnN";
+
+@@ -58,6 +60,7 @@ static struct option long_options[] =
+ {{"help", no_argument, NULL, 'h'},
+ {"null", no_argument, NULL, 'n'},
+ {"nvdev", no_argument, NULL, 'N'},
++ {"debug", no_argument, NULL, 'd'},
+ {NULL, 0, NULL, 0}
+ };
+
+@@ -77,6 +80,8 @@ void usage (void)
+ " -N --nvdev enable usage of /dev/nv* devices\n");
+ fprintf (stderr,
+ " -n --null use null backend (for debugging)\n");
++ fprintf (stderr,
++ " -d --debug don't detach from controlling terminal\n");
+ }
+
+ /* -------- Server state -------- */
+@@ -581,6 +586,9 @@ int main (int argc, char *argv[])
+ case 'N':
+ opt_nvdev = TRUE;
+ break;
++ case 'd':
++ opt_debug = TRUE;
++ break;
+ }
+ }
+
+@@ -618,6 +626,8 @@ int main (int argc, char *argv[])
+ }
+
+ DPRINTF ("server loop.\n");
++ if (!opt_debug)
++ daemon(0,0);
+ srv_loop ();
+
+ fclose (pipe_in);
diff --git a/graphics/nvtv/patches/patch-ag b/graphics/nvtv/patches/patch-ag
new file mode 100644
index 00000000000..aa7156f1672
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ag
@@ -0,0 +1,14 @@
+$NetBSD: patch-ag,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- man/nvtvd.8.orig 2002-09-18 13:12:42.000000000 +0200
++++ man/nvtvd.8
+@@ -15,6 +15,9 @@ enable usage of /dev/nv* devices
+ .TP
+ \fB\-n\fR \fB\-\-null\fR
+ use null backend (for debugging)
++.TP
++\fB\-d\fR \fB\-\-debug\fR
++don't detach from controlling terminal
+ .SH "AUTHOR"
+ .PP
+ This manual page was written by Eduard Bloch blade@debian.org for
diff --git a/graphics/nvtv/patches/patch-ah b/graphics/nvtv/patches/patch-ah
new file mode 100644
index 00000000000..b0c18677544
--- /dev/null
+++ b/graphics/nvtv/patches/patch-ah
@@ -0,0 +1,55 @@
+$NetBSD: patch-ah,v 1.1.1.1 2003/10/05 09:16:17 cube Exp $
+
+--- configure.in.orig 2003-05-30 11:33:51.000000000 +0200
++++ configure.in
+@@ -172,7 +172,7 @@ if test ${with_x} = yes ; then
+ AC_DEFINE(HAVE_X,1,[Define to 1 if X is available and used.])
+ OBJS_EXTRA="$OBJS_EXTRA actions.o"
+ if test ${have_gtk} != no ; then
+- have_gtk_version=`expr substr ${have_gtk} 4 1`
++ have_gtk_version=`expr ${have_gtk} : '^gtk\([[12]]\)'`
+ AC_DEFINE(HAVE_GTK,1,[Define to 1 if GTK is available and used.])
+ AC_DEFINE_UNQUOTED(HAVE_GTK_VERSION,${have_gtk_version},[Define to 1/2 for GTK major version.])
+ OBJS_GUI="gui.o gui_bt.o gui_cx.o gui_ch.o gui_ph.o gui_nv.o gui_tdfx.o gui_i810.o"
+@@ -240,14 +240,24 @@ dnl
+ AC_CHECK_LIB(m,sin,LIBS="$LIBS -lm",
+ AC_MSG_ERROR(math library required))
+
++case ${host} in
++ *-*-netbsd*)
++ AC_CHECK_LIB(i386,i386_iopl,LIBS="$LIBS -li386",
++ AC_MSG_ERROR(NetBSD i386 library required))
++ AC_CHECK_LIB(pci,pcibus_conf_read,LIBS="$LIBS -lpci",
++ AC_MSG_ERROR(NetBSD pci library required))
++ ;;
++esac
++
+ if test ${with_winio} = yes ; then
+ AC_CHECK_LIB(winio,winio_init,LIBS="$LIBS -lwinio",
+ AC_MSG_ERROR(winio wrapper library required))
+ fi
+
+ if test ${host_flag} = unix -o ${with_winio} = yes ; then
+- AC_CHECK_LIB(pci,pci_init,LIBS="$LIBS -lpci",
+- AC_MSG_ERROR(pci library required))
++ AC_CHECK_LIB(pci,pci_init,LIBS="$LIBS -lpci" pciutils_libname="pci",
++ AC_CHECK_LIB(pciutils,pci_init,LIBS="$LIBS -lpciutils" pciutils_libname="pciutils",
++ AC_MSG_ERROR(pci library required)))
+ fi
+
+ dnl
+@@ -272,9 +282,12 @@ AC_HEADER_STDC
+ AC_CHECK_HEADERS(sys/io.h)
+
+ if test ${host_flag} = unix -o ${with_winio} = yes ; then
+- AC_CHECK_HEADER(pci/pci.h,,
+- AC_MSG_ERROR(pci library header 'pci/pci.h' required))
++ AC_CHECK_HEADER(${pciutils_libname}/pci.h,,
++ AC_MSG_WARN(pci library header \'${pciutils_libname}/pci.h\' required))
+ AC_DEFINE(HAVE_PCI,1,[Define to 1 if pciutils available and used.])
++ if test ${pciutils_libname} = pciutils ; then
++ AC_DEFINE(HAVE_PCIUTILS,1,[Define to 1 if pciutils library is named 'pciutils'.])
++ fi
+ fi
+
+ if test ${with_winio} = yes ; then