From 54ae9c00c2954ae6a86b8d469f077929f58ed3a5 Mon Sep 17 00:00:00 2001 From: PHO Date: Sat, 28 Feb 2009 11:58:34 +0900 Subject: [PATCH] The original wip/modular-xorg-server --- .gitignore | 1 + DESCR | 2 + Makefile | 145 ++++++++++++++++++++++++++ PLIST | 237 +++++++++++++++++++++++++++++++++++++++++++ README | 16 +++ buildlink3.mk | 30 ++++++ distinfo | 20 ++++ files/modeline2c.awk | 97 ++++++++++++++++++ files/patch-mesa | 23 +++++ files/prim_x86_gcc.h | 79 +++++++++++++++ mesaconfig.mk | 31 ++++++ options.mk | 55 ++++++++++ patches/patch-ad | 13 +++ patches/patch-ae | 22 ++++ patches/patch-af | 13 +++ patches/patch-ag | 13 +++ patches/patch-ah | 13 +++ patches/patch-aj | 33 ++++++ patches/patch-ak | 16 +++ patches/patch-am | 15 +++ patches/patch-an | 15 +++ 21 files changed, 889 insertions(+) create mode 100644 .gitignore create mode 100644 DESCR create mode 100644 Makefile create mode 100644 PLIST create mode 100644 README create mode 100644 buildlink3.mk create mode 100644 distinfo create mode 100644 files/modeline2c.awk create mode 100644 files/patch-mesa create mode 100644 files/prim_x86_gcc.h create mode 100644 mesaconfig.mk create mode 100644 options.mk create mode 100644 patches/patch-ad create mode 100644 patches/patch-ae create mode 100644 patches/patch-af create mode 100644 patches/patch-ag create mode 100644 patches/patch-ah create mode 100644 patches/patch-aj create mode 100644 patches/patch-ak create mode 100644 patches/patch-am create mode 100644 patches/patch-an diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ac83b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +CVS diff --git a/DESCR b/DESCR new file mode 100644 index 0000000..232af80 --- /dev/null +++ b/DESCR @@ -0,0 +1,2 @@ +The X.org X11 Server from the modularized source tree of +X.org X11. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..17ed2a7 --- /dev/null +++ b/Makefile @@ -0,0 +1,145 @@ +# $NetBSD$ + +DISTNAME= xorg-server-1.4.2 +PKGNAME= modular-${DISTNAME} +PKGREVISION= 4 +CATEGORIES= x11 + +MASTER_SITES= ${MASTER_SITE_XORG:=xserver/} +EXTRACT_SUFX= .tar.bz2 + +PATCHFILES= xserver-1.4.2-pkgsrc.patch +PATCH_DIST_STRIP= -p1 +SITES.xserver-1.4.2-pkgsrc.patch=\ + ftp://ftp.NetBSD.org/pub/NetBSD/misc/bjs/patchfiles/ + +SPECIAL_PERMS+= bin/Xorg ${SETUID_ROOT_PERMS} + +PKG_DESTDIR_SUPPORT= user-destdir + +MAINTAINER= bjs@NetBSD.org +COMMENT= Xorg X11 Server from modular X.org X11 + +# XXX this package should be upgraded to 1.1.6, I think. +BUILD_DEPENDS+= xorg-util-macros>=1.1.5:../../devel/xorg-util-macros +DEPENDS+= xkbcomp-[0-9]*:../../x11/xkbcomp + +USE_LIBTOOL= yes +GNU_CONFIGURE= yes +PKGCONFIG_OVERRIDE+= xorg-server.pc.in +USE_TOOLS+= gmake pkg-config autoconf automake + +BUILD_DEFS+= VARBASE +BUILD_DEFS_EFFECTS+= XKB_OUTPUT_DIR + +OWN_DIRS+= ${XKB_OUTPUT_DIR} +XKB_OUTPUT_DIR?= ${VARBASE}/db/xkb + +CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q} +CONFIGURE_ARGS+= --with-xkb-output=${XKB_OUTPUT_DIR:Q} + +WRKSRC= ${WRKDIR}/xorg-server-1.4.2 + +.include "../../mk/bsd.prefs.mk" + +CONFIGURE_ARGS+= --with-release-version=${PKGNAME} +CONFIGURE_ARGS+= --with-vendor-name="The NetBSD Foundation" +CONFIGURE_ARGS+= --with-vendor-name-short="pkgsrc" +.if ${OPSYS} == "NetBSD" +CONFIGURE_ARGS+= --with-builder-addr="tech-x11@NetBSD.org" +CONFIGURE_ARGS+= --with-os-vendor="The NetBSD Foundation" +.endif +CONFIGURE_ARGS+= --with-os-name=${MACHINE_PLATFORM} +CONFIGURE_ARGS+= --with-vendor-web="http://www.pkgsrc.org/" + +CONFIGURE_ARGS+= --enable-xorg +CONFIGURE_ARGS+= --disable-config-hal +CONFIGURE_ARGS+= --disable-dmx +CONFIGURE_ARGS+= --disable-xprint +CONFIGURE_ARGS+= --disable-xwin +CONFIGURE_ARGS+= --disable-xephyr +CONFIGURE_ARGS+= --disable-kdrive +CONFIGURE_ARGS+= --disable-kdrive-vesa +CONFIGURE_ARGS+= --disable-xfake +CONFIGURE_ARGS+= --disable-xsdl +CONFIGURE_ARGS+= --disable-xfbdev +CONFIGURE_ARGS+= --disable-kbd_mode # deprecated +CONFIGURE_ARGS+= --enable-builtin-fonts +CONFIGURE_ARGS+= --enable-dri + +CONFIGURE_ARGS+= --with-int10=x86emu + +CONFIGURE_ENV+= APP_MAN_SUFFIX=1 FILE_MAN_SUFFIX=5 + +DEPENDS+= xkeyboard-config-[0-9]*:../../x11/xkeyboard-config + +BUILDLINK_API_DEPENDS.compositeproto+= compositeproto>=0.4 +BUILDLINK_API_DEPENDS.fixesproto+= fixesproto>=4.0 +BUILDLINK_API_DEPENDS.glproto+= glproto>=1.4.8 +BUILDLINK_API_DEPENDS.kbproto+= kbproto>=1.0.3 +BUILDLINK_API_DEPENDS.randrproto+= randrproto>=1.2.1 +### +### If we're using a 64-bit architecture, randrproto>=0.9.3 and +### xf86dgaproto>=2.0.3 are required. +### +.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \ + ${MACHINE_ARCH} == "alpha" +BUILDLINK_API_DEPENDS.renderproto+= renderproto>=0.9.3 +BUILDLINK_API_DEPENDS.xf86dgaproto+= xf86dgaproto>=2.0.3 +.endif +BUILDLINK_API_DEPENDS.inputproto+= inputproto>=1.4.2 + +post-extract: dri-post-extract + ${CP} ${FILESDIR}/modeline2c.awk ${WRKSRC}/hw/xfree86/common +# ${RM} -f ${WRKDIR}/Mesa-7.0.2/src/mesa/Makefile.orig +# ${RM} -f ${WRKDIR}/Mesa-7.0.2/docs/README.MINGW32.orig +# ${CP} ${FILESDIR}/prim_x86_gcc.h ${WRKSRC}/hw/xfree86/x86emu/x86emu/ + +.include "options.mk" + +.include "../../devel/ncurses/buildlink3.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../fonts/libfontenc/buildlink3.mk" +.include "../../x11/bigreqsproto/buildlink3.mk" +.include "../../x11/compositeproto/buildlink3.mk" +.include "../../x11/damageproto/buildlink3.mk" +.include "../../x11/evieext/buildlink3.mk" +.include "../../x11/fixesproto/buildlink3.mk" +.include "../../x11/fontsproto/buildlink3.mk" +.include "../../x11/glproto/buildlink3.mk" +.include "../../x11/inputproto/buildlink3.mk" +.include "../../x11/libX11/buildlink3.mk" +.include "../../x11/libXau/buildlink3.mk" +.include "../../x11/libXaw/buildlink3.mk" +.include "../../x11/libXext/buildlink3.mk" +.include "../../x11/libXfixes/buildlink3.mk" +.include "../../x11/libXfont/buildlink3.mk" +.include "../../x11/libXt/buildlink3.mk" +.include "../../x11/libXxf86misc/buildlink3.mk" +.include "../../x11/libXxf86vm/buildlink3.mk" +.include "../../x11/libdrm/buildlink3.mk" +.include "../../x11/libxkbfile/buildlink3.mk" +.include "../../x11/libxkbui/buildlink3.mk" +.include "../../x11/pixman/buildlink3.mk" +.include "../../x11/randrproto/buildlink3.mk" +.include "../../x11/recordproto/buildlink3.mk" +.include "../../x11/renderproto/buildlink3.mk" +.include "../../x11/resourceproto/buildlink3.mk" +.include "../../x11/scrnsaverproto/buildlink3.mk" +.include "../../x11/trapproto/buildlink3.mk" +.include "../../x11/videoproto/buildlink3.mk" +.include "../../x11/xcmiscproto/buildlink3.mk" +.include "../../x11/xextproto/buildlink3.mk" +.include "../../x11/xf86bigfontproto/buildlink3.mk" +.include "../../x11/xf86dgaproto/buildlink3.mk" +.include "../../x11/xf86driproto/buildlink3.mk" +.include "../../x11/xf86miscproto/buildlink3.mk" +.include "../../x11/xf86vidmodeproto/buildlink3.mk" +.include "../../x11/xineramaproto/buildlink3.mk" +.include "../../x11/xproto/buildlink3.mk" +.include "../../x11/xtrans/buildlink3.mk" + +pre-configure: + cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} autoreconf -v -i -f + +.include "../../mk/bsd.pkg.mk" diff --git a/PLIST b/PLIST new file mode 100644 index 0000000..5e6d532 --- /dev/null +++ b/PLIST @@ -0,0 +1,237 @@ +@comment $NetBSD$ +bin/X +bin/Xnest +bin/Xorg +bin/Xvfb +bin/cvt +bin/gtf +bin/inb +bin/inl +bin/inw +bin/ioport +bin/outb +bin/outl +bin/outw +bin/pcitweak +bin/xorgconfig +include/xorg/BT.h +include/xorg/IBM.h +include/xorg/TI.h +include/xorg/XIstubs.h +include/xorg/afb.h +include/xorg/assyntax.h +include/xorg/atKeynames.h +include/xorg/bstore.h +include/xorg/bstorestr.h +include/xorg/bt829.h +include/xorg/cfb.h +include/xorg/cfb16.h +include/xorg/cfb32.h +include/xorg/cfb8_16.h +include/xorg/cfb8_32.h +include/xorg/cfbmap.h +include/xorg/cfbmskbits.h +include/xorg/cfbunmap.h +include/xorg/closestr.h +include/xorg/closure.h +include/xorg/colormap.h +include/xorg/colormapst.h +include/xorg/compiler.h +include/xorg/cursor.h +include/xorg/cursorstr.h +include/xorg/damage.h +include/xorg/damagestr.h +include/xorg/dbestruct.h +include/xorg/dgaproc.h +include/xorg/dix.h +include/xorg/dixevents.h +include/xorg/dixfont.h +include/xorg/dixfontstr.h +include/xorg/dixgrabs.h +include/xorg/dixstruct.h +include/xorg/dri.h +include/xorg/dristruct.h +include/xorg/edid.h +include/xorg/exa.h +include/xorg/exevents.h +include/xorg/extension.h +include/xorg/extinit.h +include/xorg/extnsionst.h +include/xorg/fb.h +include/xorg/fbdevhw.h +include/xorg/fboverlay.h +include/xorg/fbpseudocolor.h +include/xorg/fbrop.h +include/xorg/fi1236.h +include/xorg/fourcc.h +include/xorg/gc.h +include/xorg/gcstruct.h +include/xorg/globals.h +include/xorg/glyphstr.h +include/xorg/hotplug.h +include/xorg/i2c_def.h +include/xorg/input.h +include/xorg/inputstr.h +include/xorg/mfb.h +include/xorg/mfbmap.h +include/xorg/mfbunmap.h +include/xorg/mi.h +include/xorg/mibank.h +include/xorg/mibstore.h +include/xorg/micmap.h +include/xorg/micoord.h +include/xorg/mifillarc.h +include/xorg/mifpoly.h +include/xorg/migc.h +include/xorg/miline.h +include/xorg/mipict.h +include/xorg/mipointer.h +include/xorg/mipointrst.h +include/xorg/misc.h +include/xorg/miscstruct.h +include/xorg/mispans.h +include/xorg/mistruct.h +include/xorg/miwideline.h +include/xorg/mizerarc.h +include/xorg/msp3430.h +include/xorg/opaque.h +include/xorg/os.h +include/xorg/picture.h +include/xorg/picturestr.h +include/xorg/pixmap.h +include/xorg/pixmapstr.h +include/xorg/property.h +include/xorg/propertyst.h +include/xorg/randrstr.h +include/xorg/region.h +include/xorg/regionstr.h +include/xorg/renderedge.h +include/xorg/resource.h +include/xorg/rgb.h +include/xorg/sarea.h +include/xorg/screenint.h +include/xorg/scrnintstr.h +include/xorg/selection.h +include/xorg/servermd.h +include/xorg/shadow.h +include/xorg/shadowfb.h +include/xorg/site.h +include/xorg/swaprep.h +include/xorg/swapreq.h +include/xorg/tda8425.h +include/xorg/tda9850.h +include/xorg/tda9885.h +include/xorg/uda1380.h +include/xorg/validate.h +include/xorg/vbe.h +include/xorg/vbeModes.h +include/xorg/vgaHW.h +include/xorg/wfbrename.h +include/xorg/window.h +include/xorg/windowstr.h +include/xorg/xaa.h +include/xorg/xaaWrapper.h +include/xorg/xaalocal.h +include/xorg/xaarop.h +include/xorg/xf1bpp.h +include/xorg/xf4bpp.h +include/xorg/xf86.h +include/xorg/xf86Crtc.h +include/xorg/xf86Cursor.h +include/xorg/xf86DDC.h +include/xorg/xf86Modes.h +include/xorg/xf86Module.h +include/xorg/xf86OSmouse.h +include/xorg/xf86Opt.h +include/xorg/xf86Optrec.h +include/xorg/xf86Parser.h +include/xorg/xf86Pci.h +include/xorg/xf86PciInfo.h +include/xorg/xf86Priv.h +include/xorg/xf86Privstr.h +include/xorg/xf86RAC.h +include/xorg/xf86RamDac.h +include/xorg/xf86RandR12.h +include/xorg/xf86Rename.h +include/xorg/xf86Resources.h +include/xorg/xf86Version.h +include/xorg/xf86Xinput.h +include/xorg/xf86_OSlib.h +include/xorg/xf86_OSproc.h +include/xorg/xf86_ansic.h +include/xorg/xf86_libc.h +include/xorg/xf86cmap.h +include/xorg/xf86fbman.h +include/xorg/xf86i2c.h +include/xorg/xf86int10.h +include/xorg/xf86sbusBus.h +include/xorg/xf86str.h +include/xorg/xf86xv.h +include/xorg/xf86xvmc.h +include/xorg/xf86xvpriv.h +include/xorg/xisb.h +include/xorg/xkbsrv.h +include/xorg/xorg-server.h +include/xorg/xorgVersion.h +include/xorg/xvdix.h +include/xorg/xvmcext.h +lib/X11/Cards +lib/X11/Options +lib/libxf86config.la +lib/pkgconfig/xorg-server.pc +${PLIST.dri}lib/xorg/modules/extensions/libGLcore.la +lib/xorg/modules/extensions/libdbe.la +lib/xorg/modules/extensions/libdri.la +lib/xorg/modules/extensions/libextmod.la +${PLIST.dri}lib/xorg/modules/extensions/libglx.la +lib/xorg/modules/extensions/librecord.la +lib/xorg/modules/extensions/libxtrap.la +lib/xorg/modules/fonts/libfreetype.la +lib/xorg/modules/libafb.la +lib/xorg/modules/libcfb.la +lib/xorg/modules/libcfb32.la +lib/xorg/modules/libexa.la +lib/xorg/modules/libfb.la +lib/xorg/modules/libint10.la +lib/xorg/modules/libmfb.la +lib/xorg/modules/libpcidata.la +lib/xorg/modules/libshadow.la +lib/xorg/modules/libshadowfb.la +lib/xorg/modules/libvbe.la +lib/xorg/modules/libvgahw.la +lib/xorg/modules/libwfb.la +lib/xorg/modules/libxaa.la +lib/xorg/modules/libxf1bpp.la +lib/xorg/modules/libxf4bpp.la +lib/xorg/modules/libxf8_16bpp.la +lib/xorg/modules/libxf8_32bpp.la +lib/xorg/modules/linux/libfbdevhw.la +lib/xorg/modules/multimedia/bt829_drv.la +lib/xorg/modules/multimedia/fi1236_drv.la +lib/xorg/modules/multimedia/msp3430_drv.la +lib/xorg/modules/multimedia/tda8425_drv.la +lib/xorg/modules/multimedia/tda9850_drv.la +lib/xorg/modules/multimedia/tda9885_drv.la +lib/xorg/modules/multimedia/uda1380_drv.la +lib/xserver/SecurityPolicy +man/man1/Xnest.1 +man/man1/Xorg.1 +man/man1/Xserver.1 +man/man1/Xvfb.1 +man/man1/cvt.1 +man/man1/gtf.1 +man/man1/pcitweak.1 +man/man1/xorgconfig.1 +man/man4/exa.4 +man/man4/fbdevhw.4 +man/man5/SecurityPolicy.5 +man/man5/xorg.conf.5 +share/aclocal/xorg-server.m4 +@dirrm lib/xserver +@dirrm lib/xorg/modules/multimedia +@dirrm lib/xorg/modules/linux +@dirrm lib/xorg/modules/fonts +@dirrm lib/xorg/modules/extensions +@dirrm lib/xorg/modules +@dirrm lib/xorg +@dirrm include/xorg diff --git a/README b/README new file mode 100644 index 0000000..7474d20 --- /dev/null +++ b/README @@ -0,0 +1,16 @@ +$NetBSD$ + +ATTENTION NetBSD-current users (those with userland atomic ops): + +In order to achieve maximum benefits from this package, please +apply the following patch for x11/libdrm, making sure to build +graphics/MesaLib with the updated xf86drm.h. + + + +This will teach the [userland] dri drivers, mesa, and the X server's glxdri +how to use atomic_cas_uint() for DRM_CAS. + +Also, if you're curious, you may try defining the MESA_EXECMEM_WIRED +environment variable in your .xinitrc [or equivlent]. This will cause +the heap used for glx/DRI in the X server and mesa to be wired down. diff --git a/buildlink3.mk b/buildlink3.mk new file mode 100644 index 0000000..59302bd --- /dev/null +++ b/buildlink3.mk @@ -0,0 +1,30 @@ +# $NetBSD$ + +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ +MODULAR_XORG_SERVER_BUILDLINK3_MK:= ${MODULAR_XORG_SERVER_BUILDLINK3_MK}+ + +.if ${BUILDLINK_DEPTH} == "+" +BUILDLINK_DEPENDS+= modular-xorg-server +.endif + +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nmodular-xorg-server} +BUILDLINK_PACKAGES+= modular-xorg-server +BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}modular-xorg-server + +.if ${MODULAR_XORG_SERVER_BUILDLINK3_MK} == "+" +BUILDLINK_API_DEPENDS.modular-xorg-server+= modular-xorg-server>=1.4 +BUILDLINK_PKGSRCDIR.modular-xorg-server?= ../../wip/modular-xorg-server +.endif # MODULAR_XORG_SERVER_BUILDLINK3_MK + +.include "../../x11/compositeproto/buildlink3.mk" +.include "../../x11/fontsproto/buildlink3.mk" +.include "../../x11/inputproto/buildlink3.mk" +.include "../../x11/pixman/buildlink3.mk" +.include "../../x11/randrproto/buildlink3.mk" +.include "../../x11/renderproto/buildlink3.mk" +.include "../../x11/videoproto/buildlink3.mk" +.include "../../x11/xextproto/buildlink3.mk" +.include "../../x11/xf86driproto/buildlink3.mk" +.include "../../x11/xproto/buildlink3.mk" + +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/distinfo b/distinfo new file mode 100644 index 0000000..88902d9 --- /dev/null +++ b/distinfo @@ -0,0 +1,20 @@ +$NetBSD$ + +SHA1 (MesaLib-7.0.4.tar.bz2) = 7e2ecbe89d245510d2681d04e959aee6adc205c5 +RMD160 (MesaLib-7.0.4.tar.bz2) = 0394bb9e00ea13f2399bc5895d4264221bbc03ac +Size (MesaLib-7.0.4.tar.bz2) = 3414357 bytes +SHA1 (xorg-server-1.4.2.tar.bz2) = 385348721ecb6da4bc51a2b7ee5784de6be0a8b6 +RMD160 (xorg-server-1.4.2.tar.bz2) = 6f12b28d7e4186dfbdec3c9116c65e6831ed2e54 +Size (xorg-server-1.4.2.tar.bz2) = 6216638 bytes +SHA1 (xserver-1.4.2-pkgsrc.patch) = 617278bfc0f530c3931261d046142faae2aab6aa +RMD160 (xserver-1.4.2-pkgsrc.patch) = cf2ed873e830d8fa25e50f5b92fe3c438188a193 +Size (xserver-1.4.2-pkgsrc.patch) = 85205 bytes +SHA1 (patch-ad) = 12062351308cf5950048bdc24ebbecc1208250b6 +SHA1 (patch-ae) = 1563548c823c43a38e3534d7c709705589edefff +SHA1 (patch-af) = 2a5e199b7c75a6c26c33a5aca00e1744d7023b92 +SHA1 (patch-ag) = 93975b0c5da0534624951ff53d506efe59fb93e9 +SHA1 (patch-ah) = 699c289e2245a8ded47887fdcf5a66446669afb4 +SHA1 (patch-aj) = 05ded41f5d114b2d21bce2629999ea5758ae7e87 +SHA1 (patch-ak) = 20b62798fd6f4ea173f827a5e122cf95f4673983 +SHA1 (patch-am) = 0e7d01cbdd692b75256318a0309551f6e5d2f5ec +SHA1 (patch-an) = 57f9b5413d0c48ac12343f9d75879a46bd334931 diff --git a/files/modeline2c.awk b/files/modeline2c.awk new file mode 100644 index 0000000..7a89330 --- /dev/null +++ b/files/modeline2c.awk @@ -0,0 +1,97 @@ +#!/usr/bin/awk -f +# +# Copyright (c) 2007 Joerg Sonnenberger . +# All rights reserved. +# +# Based on Perl script by Dirk Hohndel. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# Usage: modeline2c.awk < modefile > xf86DefModes.c +# + +BEGIN { + flagsdict[""] = "0" + + flagsdict["+hsync +vsync"] = "V_PHSYNC | V_PVSYNC" + flagsdict["+hsync -vsync"] = "V_PHSYNC | V_NVSYNC" + flagsdict["-hsync +vsync"] = "V_NHSYNC | V_PVSYNC" + flagsdict["-hsync -vsync"] = "V_NHSYNC | V_NVSYNC" + flagsdict["+hsync +vsync interlace"] = "V_PHSYNC | V_PVSYNC | V_INTERLACE" + flagsdict["+hsync -vsync interlace"] = "V_PHSYNC | V_NVSYNC | V_INTERLACE" + flagsdict["-hsync +vsync interlace"] = "V_NHSYNC | V_PVSYNC | V_INTERLACE" + flagsdict["-hsync -vsync interlace"] = "V_NHSYNC | V_NVSYNC | V_INTERLACE" + + print "/* $" "XFree86$ */" + print + print "/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at" + print " * modeline2c.awk */" + print "" + print "/*" + print " * Author: Joerg Sonnenberger " + print " * Based on Perl script from Dirk Hohndel " + print " */" + print "" + print "#ifdef HAVE_XORG_CONFIG_H" + print "#include " + print "#endif" + print "" + print "#ifdef __UNIXOS2__" + print "#define I_NEED_OS2_H" + print "#endif" + print "#include \"xf86.h\"" + print "#include \"xf86Config.h\"" + print "#include \"xf86Priv.h\"" + print "#include \"xf86_OSlib.h\"" + print "" + print "#include \"globals.h\"" + print "" + print "#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT" + print "#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0" + print "" + print "DisplayModeRec xf86DefaultModes [] = {" + + modeline = "\t{MODEPREFIX(\"%dx%d\"),%d, %d,%d,%d,%d,0, %d,%d,%d,%d,0, %s, MODESUFFIX},\n" + modeline_data = "^[a-zA-Z]+[ \t]+[^ \t]+[ \t0-9.]+" +} + +/^[mM][oO][dD][eE][lL][iI][nN][eE]/ { + flags = $0 + gsub(modeline_data, "", flags) + flags = tolower(flags) + printf(modeline, $4, $8, $3 * 1000, $4, $5, $6, $7, + $8, $9, $10, $11, flagsdict[flags]) + # Half-width double scanned modes + printf(modeline, $4/2, $8/2, $3 * 500, $4/2, $5/2, $6/2, $7/2, + $8/2, $9/2, $10/2, $11/2, flagsdict[flags] " | V_DBLSCAN") +} + +/^#/ { + print "/*" substr($0, 2) " */" +} + +END { + printf("\t{MODEPREFIX(NULL),0,0,0,0,0,0,0,0,0,0,0,0,MODESUFFIX}\n};\n") +} diff --git a/files/patch-mesa b/files/patch-mesa new file mode 100644 index 0000000..2e1a15b --- /dev/null +++ b/files/patch-mesa @@ -0,0 +1,23 @@ +$NetBSD$ + +--- ../Mesa-7.0.4/src/mesa/main/imports.h.orig 2008-06-24 14:27:44.000000000 -0400 ++++ ../Mesa-7.0.4/src/mesa/main/imports.h +@@ -292,7 +292,7 @@ static INLINE int GET_FLOAT_BITS( float + *** LDEXPF: multiply value by an integral power of two + *** FREXPF: extract mantissa and exponent from value + ***/ +-#if defined(__gnu_linux__) ++#if defined(USE_NATIVE_LIBM_FUNCS) + /* C99 functions */ + #define CEILF(x) ceilf(x) + #define FLOORF(x) floorf(x) +@@ -515,7 +515,9 @@ static INLINE int iceil(float f) + /* Hardware default: All exceptions masked, extended double precision, + * round to nearest (IEEE compliant): + */ ++#ifndef DEFAULT_X86_FPU + #define DEFAULT_X86_FPU 0x037f ++#endif + /* All exceptions masked, single precision, round to nearest: + */ + #define FAST_X86_FPU 0x003f diff --git a/files/prim_x86_gcc.h b/files/prim_x86_gcc.h new file mode 100644 index 0000000..c085ddc --- /dev/null +++ b/files/prim_x86_gcc.h @@ -0,0 +1,79 @@ +/**************************************************************************** +* +* Inline helpers for x86emu +* +* Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC +* +* ======================================================================== +* +* Permission to use, copy, modify, distribute, and sell this software and +* its documentation for any purpose is hereby granted without fee, +* provided that the above copyright notice appear in all copies and that +* both that copyright notice and this permission notice appear in +* supporting documentation, and that the name of the authors not be used +* in advertising or publicity pertaining to distribution of the software +* without specific, written prior permission. The authors makes no +* representations about the suitability of this software for any purpose. +* It is provided "as is" without express or implied warranty. +* +* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR +* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +* PERFORMANCE OF THIS SOFTWARE. +* +* ======================================================================== +* +* Language: GNU C +* Environment: GCC on i386 or x86-64 +* Developer: Bart Trojanowski +* +* Description: This file defines a few x86 macros that can be used by the +* emulator to execute native instructions. +* +* For PIC vs non-PIC code refer to: +* http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well +* +****************************************************************************/ +#ifndef __X86EMU_PRIM_X86_GCC_H +#define __X86EMU_PRIM_X86_GCC_H + +#include "x86emu/types.h" + +#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__)) +#error This file is intended to be used by gcc on i386 or x86-64 system +#endif + +#if defined(__PIC__) && defined(__i386__) + +#define X86EMU_HAS_HW_CPUID 1 +static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d) +{ + __asm__ __volatile__ ("pushl %%ebx \n\t" + "cpuid \n\t" + "movl %%ebx, %1 \n\t" + "popl %%ebx \n\t" + : "=a" (*a), "=r" (*b), + "=c" (*c), "=d" (*d) + : "a" (*a), "c" (*c) + : "cc"); +} + +#else // ! (__PIC__ && __i386__) + +#define X86EMU_HAS_HW_CPUID 1 +static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d) +{ + __asm__ __volatile__ ("cpuid" + : "=a" (*a), "=b" (*b), + "=c" (*c), "=d" (*d) + : "a" (*a), "c" (*c) + : "cc"); +} + +#endif // __PIC__ && __i386__ + + +#endif // __X86EMU_PRIM_X86_GCC_H diff --git a/mesaconfig.mk b/mesaconfig.mk new file mode 100644 index 0000000..115601b --- /dev/null +++ b/mesaconfig.mk @@ -0,0 +1,31 @@ +# $NetBSD$ +### +### +### XXX This is the default heap size. Would there be an occasion to +### change it? It seems large, so we should investigate further. +### +.include "../../mk/bsd.fast.prefs.mk" + +.if !empty(OPSYS:M*BSD) || ${OPSYS} == "Linux" || ${OPSYS} == "DragonFly" +CFLAGS+= -DUSE_NATIVE_LIBM_FUNCS +.endif + +.if !empty(MACHINE_ARCH:Mi386) +### +### This is taken from . If we don't override +### it, the FPU control word will be restored to 0x037f. +### +### Also, see patch-aq about the libm functions required (float functions +### such as floorf). Proper configuration of this should be a goal of +### the Mesa developers; alas, it obviously is not. +### +### XXX We need a reliable check for these functions. +### +#/* NetBSD uses IEEE double precision. */ +CFLAGS.NetBSD+= -DDEFAULT_X86_FPU=0x127f +### +### +#/* FreeBSD leaves some exceptions unmasked as well. */ +### +CFLAGS.FreeBSD+= -DDEFAULT_x86_FPU=0x1272 +.endif diff --git a/options.mk b/options.mk new file mode 100644 index 0000000..8f405e5 --- /dev/null +++ b/options.mk @@ -0,0 +1,55 @@ +# $NetBSD: options.mk,v 1.2 2007/12/08 09:23:16 wiz Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.modular-xorg-server +PKG_SUPPORTED_OPTIONS= dri inet6 + +.include "../../mk/bsd.options.mk" + +PLIST_VARS+= dri + +.if !empty(PKG_OPTIONS:Mdri) +PLIST.dri= yes +.include "mesaconfig.mk" +DISTFILES= ${DEFAULT_DISTFILES} +DISTFILES+= MesaLib-7.0.4.tar.bz2 +_PKGSRC_PATCHES+= ${FILESDIR}/patch-mesa # XXX is there a better way? +SITES.MesaLib-7.0.4.tar.bz2=\ + ${MASTER_SITE_SOURCEFORGE:=mesa3d/} +MESA_SRC= ${WRKDIR}/Mesa-7.0.4 +CONFIGURE_ARGS+= --enable-glx +CONFIGURE_ARGS+= --enable-aiglx +CONFIGURE_ARGS+= --with-mesa-source=${MESA_SRC} +.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "sparc64" || \ + ${MACHINE_ARCH} == "alpha" +GLX_DEFINES+= -D__GLX_ALIGN64 +.endif +CONFIGURE_ENV+= GLX_DEFINES=${GLX_DEFINES:M*:Q} +# glcore.h and dri_interface.h shipped with *proto are older than +# those in Mesa-7.0.2. Either patch them or trick the build into using +# the newer ones. +#BUILDLINK_API_DEPENDS.glproto+= glproto>=1.4.8nb1 +#BUILDLINK_API_DEPENDS.xf86driproto+= xf86driproto>=2.0.3nb1 +### +### XXX As of driproto-2.0.4 and glproto-1.4.9, this should not be needed. +### +dri-post-extract: + ${LN} -s ${MESA_SRC:Q}/include/GL ${WRKSRC:Q}/GL/glx/GL + +.else +### +### XXX Do we want this? +### +CONFIGURE_ARGS+= --disable-glx + +dri-post-extract: + @${DO_NADA} + +# for GLX we already have the Mesa source +.include "../../graphics/MesaLib/buildlink3.mk" +.endif + +.if !empty(PKG_OPTIONS:Minet6) +CONFIGURE_ARGS+= --enable-ipv6 +.else +CONFIGURE_ARGS+= --disable-ipv6 +.endif diff --git a/patches/patch-ad b/patches/patch-ad new file mode 100644 index 0000000..84adf84 --- /dev/null +++ b/patches/patch-ad @@ -0,0 +1,13 @@ +$NetBSD$ + +--- hw/xfree86/common/compiler.h.orig 2008-06-10 13:57:19.000000000 -0400 ++++ hw/xfree86/common/compiler.h +@@ -564,7 +564,7 @@ inl(unsigned short port) + return ret; + } + +-# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__) ++# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)) && defined(__sparc__) + + # if !defined(Lynx) + # ifndef ASI_PL diff --git a/patches/patch-ae b/patches/patch-ae new file mode 100644 index 0000000..57f0614 --- /dev/null +++ b/patches/patch-ae @@ -0,0 +1,22 @@ +$NetBSD$ + +--- hw/xfree86/common/xf86Bus.c.orig 2008-06-10 13:57:19.000000000 -0400 ++++ hw/xfree86/common/xf86Bus.c +@@ -113,7 +113,7 @@ void + xf86BusProbe(void) + { + xf86PciProbe(); +-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) ++#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) && !defined(__NetBSD__) + xf86SbusProbe(); + #endif + } +@@ -2382,7 +2382,7 @@ xf86PostProbe(void) + + if (fbSlotClaimed) { + if (pciSlotClaimed || isaSlotClaimed +-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) ++#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) && !defined(__NetBSD__) + || sbusSlotClaimed + #endif + ) { diff --git a/patches/patch-af b/patches/patch-af new file mode 100644 index 0000000..fa7aa76 --- /dev/null +++ b/patches/patch-af @@ -0,0 +1,13 @@ +$NetBSD$ + +--- hw/xfree86/common/xf86Configure.c.orig 2008-06-10 13:57:19.000000000 -0400 ++++ hw/xfree86/common/xf86Configure.c +@@ -210,7 +210,7 @@ xf86AddBusDeviceToConfigure(const char * + NewDevice.GDev.identifier = "ISA Adapter"; + NewDevice.GDev.busID = "ISA"; + break; +-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) ++#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) && !defined(__NetBSD__) + case BUS_SBUS: { + char *promPath = NULL; + NewDevice.sVideo = (sbusDevicePtr) busData; diff --git a/patches/patch-ag b/patches/patch-ag new file mode 100644 index 0000000..2969a70 --- /dev/null +++ b/patches/patch-ag @@ -0,0 +1,13 @@ +$NetBSD$ + +--- hw/xfree86/loader/xf86sym.c.orig 2008-06-10 13:57:19.000000000 -0400 ++++ hw/xfree86/loader/xf86sym.c +@@ -499,7 +499,7 @@ _X_HIDDEN void *xfree86LookupTab[] = { + SYMFUNC(xf86AddModuleInfo) + SYMFUNC(xf86DeleteModuleInfo) + +-#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) ++#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) && !defined(__NetBSD__) + /* xf86sbusBus.c */ + SYMFUNC(xf86MatchSbusInstances) + SYMFUNC(xf86GetSbusInfoForEntity) diff --git a/patches/patch-ah b/patches/patch-ah new file mode 100644 index 0000000..ef72bf8 --- /dev/null +++ b/patches/patch-ah @@ -0,0 +1,13 @@ +$NetBSD$ + +--- hw/xfree86/os-support/bus/xf86Sbus.h.orig 2008-06-06 06:03:10.000000000 -0400 ++++ hw/xfree86/os-support/bus/xf86Sbus.h +@@ -38,6 +38,8 @@ + #include + #elif defined(__OpenBSD__) && defined(__sparc64__) + /* XXX */ ++#elif defined(__NetBSD__) ++/* XXX */ + #elif defined(CSRG_BASED) + #if defined(__FreeBSD__) + #include diff --git a/patches/patch-aj b/patches/patch-aj new file mode 100644 index 0000000..4ef45b7 --- /dev/null +++ b/patches/patch-aj @@ -0,0 +1,33 @@ +$NetBSD$ + +On Friday 04 July 2008, Joerg Sonnenberger wrote: +> On Thu, Jul 03, 2008 at 07:52:31PM -0600, Sverre Froyen wrote: +> > I've tracked the jumping cursor issue down to the function +> > acceleratePointer in dix/getevents.c. +> +> All this issues in the past happened because some very smart guys +> decided to do random broken things from signal context. Which is why +> this is extremely hard to trace down. + +I still see the jumps in 1.4.2. Perhaps my workaround (attached) could be +included until a proper fix is developed? + +--- dix/getevents.c.orig 2008-06-29 00:23:13.000000000 -0400 ++++ dix/getevents.c +@@ -613,9 +613,15 @@ GetPointerEvents(xEvent *events, DeviceI + clipAxis(pDev, 1, &y); + } + else { +- if (flags & POINTER_ACCELERATE) ++ if (flags & POINTER_ACCELERATE) { ++ int x_in; ++ if (num_valuators >= 1) ++ x_in = valuators[0]; + acceleratePointer(pDev, first_valuator, num_valuators, + valuators); ++ if (num_valuators >= 1 && valuators[0] < -3000) ++ valuators[0] = x_in; ++ } + + if (pDev->coreEvents) { + /* Get and convert the core pointer coordinate space into diff --git a/patches/patch-ak b/patches/patch-ak new file mode 100644 index 0000000..e6cbd92 --- /dev/null +++ b/patches/patch-ak @@ -0,0 +1,16 @@ +$NetBSD$ + +--- hw/xfree86/xorgconf.cpp.orig 2008-06-10 13:57:20.000000000 -0400 ++++ hw/xfree86/xorgconf.cpp +@@ -608,3 +608,11 @@ Section "ServerLayout" + InputDevice "Keyboard1" "CoreKeyboard" + EndSection + ++ ++XCOMM Two experimental extensions are available -- Composite and XEVIE. Uncomment ++XCOMM the section below to enable Composite. Many extensions can also be disabled ++XCOMM in this manner. ++ ++XCOMM Section "Extensions" ++XCOMM Option "Composite" "Enable" ++XCOMM EndSection diff --git a/patches/patch-am b/patches/patch-am new file mode 100644 index 0000000..0b7e097 --- /dev/null +++ b/patches/patch-am @@ -0,0 +1,15 @@ +$NetBSD: patch-ag,v 1.3 2007/08/14 21:34:37 joerg Exp $ + +--- hw/xfree86/common/Makefile.am.orig 2008-08-02 04:52:04.000000000 -0400 ++++ hw/xfree86/common/Makefile.am +@@ -23,8 +23,8 @@ BUSSOURCES = xf86isaBus.c xf86pciBus.c x + + MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes + +-xf86DefModeSet.c: $(srcdir)/modeline2c.pl $(MODEDEFSOURCES) +- cat $(MODEDEFSOURCES) | $(PERL) $(srcdir)/modeline2c.pl > $@ ++xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) ++ cat $(MODEDEFSOURCES) | $(AWK) -f $(srcdir)/modeline2c.awk > $@ + + BUILT_SOURCES = xf86DefModeSet.c + diff --git a/patches/patch-an b/patches/patch-an new file mode 100644 index 0000000..e856d33 --- /dev/null +++ b/patches/patch-an @@ -0,0 +1,15 @@ +$NetBSD: patch-ah,v 1.1 2007/08/14 21:34:37 joerg Exp $ + +--- hw/xfree86/common/Makefile.in.orig 2008-06-11 10:31:17.000000000 -0400 ++++ hw/xfree86/common/Makefile.in +@@ -810,8 +810,8 @@ uninstall-am: uninstall-sdkHEADERS + tags uninstall uninstall-am uninstall-sdkHEADERS + + +-xf86DefModeSet.c: $(srcdir)/modeline2c.pl $(MODEDEFSOURCES) +- cat $(MODEDEFSOURCES) | $(PERL) $(srcdir)/modeline2c.pl > $@ ++xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) ++ cat $(MODEDEFSOURCES) | $(AWK) -f $(srcdir)/modeline2c.awk > $@ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: -- 2.40.0