File xorg-x11-driver-video-nouveau.spec of Package nouveau

#
# spec file for package xorg-x11-driver-video-nouveau (Version 0.10.1.20080423)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild
# icecream 0


Name:           xorg-x11-driver-video-nouveau
Url:            http://nouveau.freedesktop.org/
License:        LGPL v2.0 only; X11/MIT
Group:          System/X11/Servers/XF86_4
Summary:        Nouveau Open Source X11 driver for nVidia cards
Version:        0.10.1.20080807
Release:        1
%define	 drmver %nil
BuildRequires:  lzma
%define 	ext lzma
%define		 tarball nouveau
Source:         %tarball-%version.tar.%ext
Source30:       drm-%version%drmver.tar.%ext
Patch30:        drm-link_drm_into_nouveau.diff
Source1:        update-spec.sh
Source2:        clone-current-gits.sh
Source3:        preamble
Patch1:         xf86-video-nouveau-ppcwerror.diff
Patch3:         0001-s2disk-drm-suspend-support.patch
Patch4:         0001-s2disk-ddx-with-xorg-option.patch
Patch5:         gallium-st_feedback_draw_vbo-null.diff
Patch6:         gallium-checks.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++ kernel-syms module-init-tools xorg-x11-server-sdk
BuildRequires:  automake libtool
Obsoletes:      x11-video-nouveau
Requires:       nouveau-kmp xorg-x11-server
ExclusiveArch:  %ix86 x86_64 ppc ppc64
%suse_kernel_module_package -p %_sourcedir/preamble -n nouveau kdump um

%description
This package contains the Nouveau Open-Source driver for nVidia cards.

Any bugs and features supported by this driver are highly dependent on
the generation if the nVidia chip. NV4x chips (e.g. GeForce 4x/6x/7x)
work best with this driver. G80 chips  (Geforce 5x/8x/9x) are not
usable yet.

You can get some information about the chip on your your card with:
/sbin/lspci | grep VGA

3D support is provided in a separate package because it is very
experimental.

The accelerated 2D rendering provided by this package is (if it works
with your card and monitor configuration) considered stable and gives
the following benefits over the "nv" driver:

- Hardware-accelerated EXA rendering with RENDER extension for
   compositing: It allows to use transparency under KDE and xcompmgr
   with other window managers

- Improved Xvideo performance and feaures. On NV4x,
   hardware-filtered and video support using textures is the
   default.

- Support for RandR-1.2 (including dual-head), For more inforation,
   see: http://nouveau.freedesktop.org/wiki/Randr12Howto

Suspend is not working. As a workaround, you can  use 'Option
"ShadowFB" "on"', but this disables all hardware-acceleration.

Install xorg-x11-driver-video-nouveau-gallium3d for experimental 3D
support.



%package 3d
License:        LGPL v2.0 only; X11/MIT
Summary:        Nouveau Open Source X11 driver for nVidia cards
Group:          System/X11/Servers/XF86_4

%description 3d
This package contains the Gallium3D DRI driver of the Nouveau
Open-Source driver project for nVidia cards.

Only NV4x cards have Texture support at the moment, but NV4x IGP cards
have no 3D at all.

NV3x may has working primitives (e.g. glxgears runs) but no texture
support yet

3D support in general is highly experimentental but certain
applications and games like gl-117, torcs, bzflag, khunphan, briquolo,
chromium, neverputt, gearbox and vdrift may work flawlessy on NV4x
chips. Openarena runs but is said to crash after some playing. For
neverball, turn off reflections in neverball's options.

Google Earth crashes X.



%package -n nouveau-KMP
License:        GPL v2 only; X11/MIT
Summary:        Kernel modules for the nouveau X11 driver for nVidia cards (experimental)
Group:          System/Kernel

%description -n nouveau-KMP
This package contains the kernel modules which are required by the
nouveau driver for nVidia cards which is provided by
xorg-x11-driver-video-nouveau.



%prep
lzma -dc %{SOURCE0}  | tar x --recursive-unlink -f -
%setup -q -n %tarball-%{version} -T -D
lzma -dc %{SOURCE30} | tar x --recursive-unlink -f -
%patch1 -p1
%patch6 -p0
cd drm%drmver
%patch30 -p1
%patch3 -p1
cd ../xf86-video-nouveau
%patch4 -p1
cd ..
%define cflags %(optflags="%optflags";optflags="${optflags//-fstack-protector/}";echo "${optflags//-D_FORTIFY_SOURCE=?/} -fomit-frame-pointer")

%build
# kernel modules:
cd drm%drmver
export EXTRA_CFLAGS="-DVERSION=%version"
sed -i 's/TRUE/1/g;s/FALSE/0/g' linux-core/{drm_{agpsupport,crtc_helper},nv50_kms_wrapper}.c
for flavor in %flavors_to_build; do
    rm -rf $flavor
    cp -r linux-core $flavor
    make -C $flavor LINUXDIR=/usr/src/linux-obj/%_target_cpu/$flavor nouveau.o M=$PWD/$flavor %{?jobs:&}
done
#while nouveau's libdrm changes are not in upstream libdrm:
# libdrm for the ddx and mesa/dri (build-local install):
# We need explicit -fpic because we link libdrm.a into nouveau_drv.so:
CFLAGS="%cflags -fpic" ./autogen.sh --prefix=$PWD/install --enable-static --disable-shared
export PKG_CONFIG_PATH=$PWD/install/lib/pkgconfig
make SUBDIRS=libdrm install;cp shared-core/[dni]*.h install/include/
#endwhile
# DDX:
cd ../xf86-video-nouveau
export CFLAGS="%cflags"
./autogen.sh --prefix=%_prefix --libdir=%_libdir
make %{?jobs:-j%jobs}
# Mesa:
cd ../mesa
%ifarch %{ix86}
dri_arch=-x86
%endif
%ifarch x86_64
dri_arch=-x86-64
%endif
#In case 3D breaks, try:
#export CFLAGS="$CFLAGS -fno-strict-aliasing"
make linux-dri$dri_arch DRI_DIRS=nouveau OPT_FLAGS="${CFLAGS}" PIC_FLAGS=-fpic %{?jobs:-j%jobs}

%install
# kernel modules
pushd drm%drmver
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
#export INSTALL_MOD_DIR=weak-updates # needed because nouveau needs the drm.ko from nouveau's git tree
for flavor in %flavors_to_build; do
    make -C $flavor LINUXDIR=/usr/src/linux-obj/%_target_cpu/$flavor install M=$PWD/$flavor
done
cd ../xf86-video-nouveau
make DESTDIR=%{buildroot} install
%define ddxdir %_libdir/xorg/modules/drivers
%define dridir %_libdir/dri
install -D -m755 ../mesa/lib*/nouveau_dri.so %{buildroot}/%dridir/nouveau_dri.so

%files
%defattr(-,root,root)
%dir %{ddxdir}
%{ddxdir}/%{tarball}_drv.so
%_mandir/man4/%{tarball}.4.gz
%exclude %{ddxdir}/%{tarball}_drv.la

%files 3d
%defattr(-,root,root)
%dridir/nouveau_dri.so
%ifarch ppc64
%dir %dridir
%endif

%changelog
* Fri Aug 29 2008 bk@suse.de
- update to git of 
openSUSE Build Service is sponsored by