pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/modular-xorg-server Add modeline2c.awk, which repl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/40baef824d3e
branches:  trunk
changeset: 532243:40baef824d3e
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Aug 14 21:34:36 2007 +0000

description:
Add modeline2c.awk, which replaces modeline2c.pl from Xorg.
This allows us to drop the Perl dependency.

diffstat:

 x11/modular-xorg-server/Makefile             |  11 ++-
 x11/modular-xorg-server/distinfo             |   4 +-
 x11/modular-xorg-server/files/modeline2c.awk |  97 ++++++++++++++++++++++++++++
 x11/modular-xorg-server/patches/patch-ag     |  15 ++++
 x11/modular-xorg-server/patches/patch-ah     |  15 ++++
 5 files changed, 137 insertions(+), 5 deletions(-)

diffs (196 lines):

diff -r e333d558dc0a -r 40baef824d3e x11/modular-xorg-server/Makefile
--- a/x11/modular-xorg-server/Makefile  Tue Aug 14 21:32:17 2007 +0000
+++ b/x11/modular-xorg-server/Makefile  Tue Aug 14 21:34:36 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2007/08/13 16:55:20 joerg Exp $
+# $NetBSD: Makefile,v 1.16 2007/08/14 21:34:36 joerg Exp $
 
 DISTNAME=      xorg-server-1.3.0.0
 PKGNAME=       modular-${DISTNAME}
@@ -18,7 +18,6 @@
 PKGCONFIG_OVERRIDE+=   xorg-server.pc.in
 USE_TOOLS+=            pkg-config
 USE_TOOLS+=            gmake
-USE_TOOLS+=            perl
 CONFIGURE_ARGS+=       --localstatedir=${VARBASE}
 CONFIGURE_ARGS+=       --enable-dri
 
@@ -44,8 +43,6 @@
 # the newer ones.
 #BUILDLINK_API_DEPENDS.glproto+= glproto>=1.4.8nb1
 #BUILDLINK_API_DEPENDS.xf86driproto+= xf86driproto>=2.0.3nb1
-post-extract:
-       ${LN} -s ${MESA_SRC:Q}/include/GL ${WRKSRC:Q}/GL/glx/GL
 PLIST_SUBST+=          USE_DRI=""
 .else
 CONFIGURE_ARGS+=       --disable-glx
@@ -63,6 +60,12 @@
 BUILDLINK_API_DEPENDS.fixesproto+=     fixesproto>=4.0
 BUILDLINK_API_DEPENDS.kbproto+=                kbproto>=1.0.3
 
+post-extract:
+       ${CP} ${FILESDIR}/modeline2c.awk ${WRKSRC}/hw/xfree86/common
+.if !empty(PKG_OPTIONS:Mdri)
+       ${LN} -s ${MESA_SRC:Q}/include/GL ${WRKSRC:Q}/GL/glx/GL
+.endif
+
 .include "../../devel/ncurses/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../fonts/libfontenc/buildlink3.mk"
diff -r e333d558dc0a -r 40baef824d3e x11/modular-xorg-server/distinfo
--- a/x11/modular-xorg-server/distinfo  Tue Aug 14 21:32:17 2007 +0000
+++ b/x11/modular-xorg-server/distinfo  Tue Aug 14 21:34:36 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2007/08/06 11:24:14 abs Exp $
+$NetBSD: distinfo,v 1.12 2007/08/14 21:34:37 joerg Exp $
 
 SHA1 (MesaLib-6.5.2.tar.bz2) = ba860bb6ee57c02202342dfd5927464a068ea18f
 RMD160 (MesaLib-6.5.2.tar.bz2) = 9a92d69110c066ae6734bcaafb78f222ac2df6d3
@@ -10,6 +10,8 @@
 SHA1 (patch-ab) = 115905eba320f294c68783bb704359d824460469
 SHA1 (patch-ad) = 752235269f10daade0bf60665cccde39d1583064
 SHA1 (patch-af) = 6c58872798a30b31154dd7b167c84bf20ac417be
+SHA1 (patch-ag) = 222427db3e1bdbf977e992aa91aae5f16992345a
+SHA1 (patch-ah) = 23767542ea672d590050e258317c0352bb321810
 SHA1 (patch-da) = 73faacda1088304025c5e05f3d58edaf9ae1145f
 SHA1 (patch-db) = 28913a094c8499536a71c8d4d7ca57a5efb25b39
 SHA1 (patch-dc) = 75df6f37b1cbc9574adb5ee66cb84d0f5ebac853
diff -r e333d558dc0a -r 40baef824d3e x11/modular-xorg-server/files/modeline2c.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/modular-xorg-server/files/modeline2c.awk      Tue Aug 14 21:34:36 2007 +0000
@@ -0,0 +1,97 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
+# 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 <joerg%NetBSD.org@localhost>"
+       print " * Based on Perl script from Dirk Hohndel <hohndel%XFree86.Org@localhost>"
+       print " */"
+       print ""
+       print "#ifdef HAVE_XORG_CONFIG_H"
+       print "#include <xorg-config.h>"
+       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 -r e333d558dc0a -r 40baef824d3e x11/modular-xorg-server/patches/patch-ag
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/modular-xorg-server/patches/patch-ag  Tue Aug 14 21:34:36 2007 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ag,v 1.3 2007/08/14 21:34:37 joerg Exp $
+
+--- hw/xfree86/common/Makefile.am.orig 2007-08-14 20:51:48.000000000 +0200
++++ hw/xfree86/common/Makefile.am
+@@ -25,8 +25,8 @@ KBDSOURCES = xf86Kbd@XORG_OS_KBD@.c
+ 
+ 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 -r e333d558dc0a -r 40baef824d3e x11/modular-xorg-server/patches/patch-ah
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/modular-xorg-server/patches/patch-ah  Tue Aug 14 21:34:36 2007 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ah,v 1.1 2007/08/14 21:34:37 joerg Exp $
+
+--- hw/xfree86/common/Makefile.in.orig 2007-08-14 20:51:05.000000000 +0200
++++ hw/xfree86/common/Makefile.in
+@@ -990,8 +990,8 @@ uninstall-am: uninstall-info-am uninstal
+       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:



Home | Main Index | Thread Index | Old Index