[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    git_xorg version 0.3
From:       Shawn Starr <shawn.starr () rogers ! com>
Date:       2006-08-28 1:02:23
Message-ID: 200608272102.24081.shawn.starr () rogers ! com
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Here is the newest updated version of git_xorg. This contains all the fixes 
mentioned on ML and from IRC plus some helper variables for updating required 
versions.

Please test, 

Thanks, 
Shawn.

["git_xorg" (application/x-shellscript)]

#! /bin/sh
#
# Copyright (c) 2006 Matthieu Herrb
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, 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.
#
# Some updates by Brian Paul

# Additional updates by Shawn Starr <shawn.starr@rogers.com>
# - Add support for pulling XCB (optional).
# - Add system check for required scm tools and packages to be installed.
# - Pull from CVS xlibs/xkbdesc.
# - Pull Mesa and drm too.
# - Fix some issues contributed by Kacper Wysocki <kacperw@online.no>

# Version 0.3
version=0.3

gitbase="git://anongit.freedesktop.org/git/xorg"

app="appres bdftopcf beforelight bitmap compiz constype editres fonttosfnt\
	fslsfonts fstobdf glxcompmgr iceauth ico lbxproxy listres luit\
	makepsres mkcfm mkfontdir mkfontscale oclock pclcomp proxymngr\
	rendercheck rgb rstart scripts sessreg setxkbmap showfont smproxy\
	twm viewres x11perf xauth xbiff xcalc xclipboard xclock xcmsdb\
	xcompmgr xconsole xcursorgen xdbedizzy xditview xdm xdpyinfo\
	xdriinfo xedit xev xeyes xf86dga xfd xfindproxy xfontsel xfs\
	xfsinfo xfwp xgamma xgc xhost xinit xkbcomp xkbevd xkbprint\
	xkbutils xkill xload xlogo xlsatoms xlsclients xlsfonts xmag\
	xman xmessage xmh xmodmap xmore xphelloworld xplsprinters xpr\
	xprehashprinterlist xprop xrandr xrdb xrefresh xrestop xrx xset\
	xsetmode xsetpointer xsetroot xshowdamage xsm xstdcmap xtrap \
	xvidtune xvinfo xwd xwininfo xwud"

data="bitmaps cursors"

doc="xorg-docs xorg-sgml-doctools"

driver="xf86-input-acecad xf86-input-aiptek xf86-input-calcomp\
	xf86-input-citron xf86-input-digitaledge xf86-input-dmc\
	xf86-input-dynapro xf86-input-elo2300 xf86-input-elographics\
	xf86-input-evdev xf86-input-fpit xf86-input-hyperpen\
	xf86-input-jamstudio xf86-input-joystick xf86-input-keyboard\
	xf86-input-magellan xf86-input-magictouch xf86-input-microtouch\
	xf86-input-mouse xf86-input-mutouch xf86-input-palmax\
	xf86-input-penmount xf86-input-sample xf86-input-spaceorb\
	xf86-input-summa xf86-input-tek4957 xf86-input-ur98\
	xf86-input-vmmouse xf86-input-void xf86-video-apm\
	xf86-video-ark xf86-video-ast xf86-video-ati\
	xf86-video-chips xf86-video-cirrus xf86-video-cyrix\
	xf86-video-dummy xf86-video-fbdev xf86-video-glide\
	xf86-video-glint xf86-video-i128 xf86-video-i740\
	xf86-video-impact xf86-video-imstt xf86-video-intel\
	xf86-video-mga xf86-video-neomagic xf86-video-newport\
	xf86-video-nsc xf86-video-nv xf86-video-rendition\
	xf86-video-s3 xf86-video-s3virge xf86-video-savage\
	xf86-video-siliconmotion xf86-video-sis xf86-video-sisusb\
	xf86-video-sunbw2 xf86-video-suncg14 xf86-video-suncg3\
	xf86-video-suncg6 xf86-video-sunffb xf86-video-sunleo\
	xf86-video-suntcx xf86-video-tdfx xf86-video-tga\
	xf86-video-trident xf86-video-tseng xf86-video-v4l\
	xf86-video-vesa xf86-video-vga xf86-video-via\
	xf86-video-vmware xf86-video-voodoo xf86-video-wsfb"

font="adobe-100dpi adobe-75dpi adobe-utopia-100dpi adobe-utopia-75dpi\
	adobe-utopia-type1 alias arabic-misc bh-100dpi bh-75dpi\
	bh-lucidatypewriter-100dpi bh-lucidatypewriter-75dpi\
	bh-ttf bh-type1 bitstream-100dpi bitstream-75dpi\
	bitstream-speedo bitstream-type1 cronyx-cyrillic\
	cursor-misc daewoo-misc dec-misc encodings ibm-type1\
	isas-misc jis-misc micro-misc misc-cyrillic misc-ethiopic\
	misc-meltho misc-misc mutt-misc schumacher-misc \
	screen-cyrillic sony-misc sun-misc util winitzki-cyrillic\
	xfree86-type1"

xcb="xcb"

lib="libAppleWM libFS libICE libSM libWindowsWM libX11 libXRes\
	libXScrnSaver libXTrap libXau libXaw libXcomposite libXcursor\
	libXdamage libXdmcp libXevie libXext libXfixes libXfont\
	libXfontcache libXft libXi libXinerama libXmu libXp\
	libXpm libXprintAppUtil libXprintUtil libXrandr libXrender\
	libXt libXtst libXv libXvMC libXxf86dga libXxf86misc\
	libXxf86rush libXxf86vm libdmx libfontenc liblbxutil\
	liboldX libpciaccess libxkbfile libxkbui libxtrans"

proto="applewmproto bigreqsproto compositeproto damageproto\
	dmxproto evieproto fixesproto fontcacheproto\
	fontsproto glproto inputproto kbproto panoramixproto\
	pmproto printproto randrproto recordproto renderproto\
	resourceproto scrnsaverproto trapproto videoproto \
	windowswmproto x11proto xcmiscproto xextproto\
	xf86bigfontproto xf86dgaproto xf86driproto xf86miscproto\
	xf86rushproto xf86vidmodeproto xineramaproto"

util="cf gccmakedep imake install-check lndir macros makedepend\
	modular xmkmf"

# Change these to reflect new minimums required to build Modular Xorg.
PKGCONFIG_MINVERSION=0.18.1
NCURSES_MINVERSION=5.5
ZLIB_MINVERSION=1.2.3
EXPAT_MINVERSION=1.95.8
FREETYPE2_MINVERSION=9.8.3
FONTCONFIG_MINVERSION=2.2.3
LIBPNG_MINVERSION=1.2.8
GPERF_MINVERSION=3.0.1

# Do some version comparsion
get_version () {
        found_version=`echo $1 | sed -e 's/[-,a-z,A-Z].*$//'`
	require_version=$2
	req_major=`echo $require_version | cut -d'.' -f1`
	req_minor=`echo $require_version | cut -d'.' -f2`
	req_micro=`echo $require_version | cut -d'.' -f3 | sed -e 's/[-,a-z,A-Z].*$//'`

        echo $found_version | awk -F"." -v major=$req_major -v minor=$req_minor -v \
micro=$req_micro '{   flag_major=0
				flag_minor=0
				flag_micro=0
				for (i = 1; i <= NF; i++) {
				    if ($i >= major && flag_major != 1) {
				       flag_major=1
				       found_major=$i
     				       continue;
			            }
				    
                                    if ($i >= minor && flag_minor != 1) {
				       flag_minor=1;
				       found_minor=$i
				       continue;
				    }

				    if ($i >= micro && flag_micro != 1) {
				       flag_micro=1;
				       found_micro=$i
				       break;
				    }
				}

				    if ((found_major > major) ||
					((found_major == major) && (found_minor > minor)) ||
				        ((found_major == major) && (found_minor == minor) && (found_micro >= \
micro))) {  printf ("yes");
					 exit;
				    }
				    
				    if ((found_major != major) || (found_minor != minor) || (found_micro != \
micro))   printf ("no");
					exit;
				    
			     }'
}

# Check to verify that all of the required Xorg prerequisites are installed on the \
system before we do anything else. check_required_packages () {
	package_name=$1
	found_version=`echo $2 | sed -e 's/[-,a-z,A-Z].*$//'`
	req_version=$3	 # Minimum required version.
	manditory=$4	 # If set to false, package missing will be ignored.
	result=$5
	echo -n "git_xorg: Checking for $package_name: "
	if [ "x${result}" == "x" -a "$manditory" == "0" ]; then
		echo "WARNING: The package $package_name is optional. But some Xorg components such \
as xcb/xcb-util may not build."  return
	fi
	
	if [ "$result" == "0" ]; then
	   version=`get_version $found_version $req_version`
	   echo -n "Found Version: $found_version"
	   if [ "$version" == "no" ]; then
	      echo "... BAD: $package_name needs to be least version $req_version. Please \
upgrade it. Aborting."  exit 1
	   else
		echo "... OK!"
		return
	   fi
	else
	   echo "Error: To build modular Xorg you need the $package_name development package \
installed. Aborting."  exit 1
	fi
}

# Checks for GIT and CVS on system
check_scm_tools () {
	echo -e "git_xorg ==> Checking for required SCM tools:"
	cmd=`git version 2> /dev/null`
	result=$?
	echo -n "git_xorg: Checking for GIT: "
	if [ $result -eq 0 ]; then
	   echo "OK" "(`echo ${cmd} | cut -d' ' -f3`)"
	else
	   echo "Error, you need to have git installed to build modular Xorg. You can get it \
from http://www.kernel.org/pub/software/scm/git/ Aborting."  exit 1
	fi
	cmd=`cvs --version 2> /dev/null`
	result=$?
	echo -n "git_xorg: Checking for CVS: "
	if [ $result -eq 0 ]; then
	   echo "OK" "(`echo ${cmd} | head -2 | tr -d '\n' | cut -d' ' -f5`)"
	else
           echo "Error, you need to have cvs installed to build modular Xorg. You can \
get it from http://ftp.gnu.org/non-gnu/cvs/source/stable/ Aborting."  exit 1
	fi
}
 
do_dir () {
	dir=$1
	gitrepo=${gitbase}

	# If we have XCB enabled, otherwise ignore it.
 	if [ ${dir} == "xcb" ]; then
           src=`echo ${gitrepo} | sed 's/xorg/xcb/'`
	   dir="lib"
	else
	   src="${gitrepo}"
	fi

	if [ ! -d ${dir} ]; then 
		echo "creating ${dir}"
		mkdir ${dir}
	fi
	for d in $2; do 
		if [ -d "${dir}/$d" ]; then
			echo "${dir}/$d exists, pulling"
			(cd "${dir}/$d" ; git pull)
		else
			echo -e "\ncloning ${dir}/${d}"
			if [ ${dir} == '.' ] ; then
				src="${src}/$d"
			else
				if [ "${d}" == "xcb" ]; then
				   src="${src}"
				else	
				   src="${src}/${dir}/$d"
				fi
			fi
			(cd "${dir}" ; git clone ${src})
		fi
		src="${gitrepo}"
	done
}

# Main begins here

# Provide simple help on how to use this.
if [ $# -ge 1 ]; then 
	case "$1" in
		'-h'|'-?'|'--help')
cat << EOF

This script will download all of the modular X.org source code. If you want this \
script to download XCB, set the environment variable USE_XCB to yes. There are no \
other command options.

EOF
exit 0
;;
		'-v'|'--version')
			echo -e "git_xorg Version $version\n"
			exit 0
			;;

		*)
cat << EOF

git_xorg: usage git_xorg [-hv]

Options:
   -h 			Display quick help information.
   -v			Display version.
EOF
			exit 0
			;;
	esac

fi

echo "***********************************"
echo "* X.Org Modular X Source Checkout *"
echo -e "***********************************\n"

# Make sure GIT and CVS are on system first.
check_scm_tools

# Begin checking for required prerequisite packages next.
echo -e "\ngit_xorg ==> Checking for required packages on system:"
cmd=`pkg-config --version 2> /dev/null`
result=$?

# Function parameters: package name, found version, minimum version, manditory, \
execution return code. check_required_packages pkg-config $cmd $PKGCONFIG_MINVERSION \
'true' $result

file=`find -L /usr/include /usr/local/include /opt/include -maxdepth 1 -name \
ncurses.h 2> /dev/null` file=`echo $file | cut -f1 -d' '`
if [ -z $file ]; then
   echo "git_xorg: The ncurses development headers could not be found. Please install \
(On Debian/Ubuntu: libncurses5-dev, on Fedora Core: ncurses-devel)."  exit 1
fi

cmd=`grep NCURSES_VERSION $file | tail -2 | head -1 | tr -d '\"' | cut -d' ' -f3 2> \
/dev/null` result=$?
check_required_packages ncurses $cmd $NCURSES_MINVERSION 'true' $result

file=`find -L /usr/include /usr/local/include /opt/include -maxdepth 1 -name zlib.h \
2> /dev/null` file=`echo $file | cut -f1 -d' '`
if [ -z $file ]; then
   echo "git_xorg: The zlib development headers could not be found. Please install \
(On Debian/Ubuntu: zlib1g-dev, on Fedora Core: zlib-devel)."  exit 1
fi

cmd=`grep ZLIB_VERSION $file | head -1 | tr -d '\"' | cut -d' ' -f3 2> /dev/null`
result=$?
check_required_packages zlib $cmd $ZLIB_MINVERSION 'true' $result

file=`find -L /usr/include /usr/local/include /opt/include -maxdepth 1 -name expat.h \
2> /dev/null` file=`echo $file | cut -f1 -d' '`
if [ -z $file ]; then
   echo "git_xorg: The expat development headers could not be found. Please install \
(On Debian/Ubuntu: libexpat1-dev, on Fedora Core: expat-devel)."  exit 1
fi

cmd=`grep VERSION $file | awk '{ printf(".%s", $3); }' | cut -c2- 2> /dev/null`
result=$?
check_required_packages expat $cmd $EXPAT_MINVERSION 'true' $result

file=`find -L /usr/lib/pkgconfig /usr/local/lib/pkgconfig /opt/lib/pkgconfig \
-maxdepth 1 -name freetype2.pc 2> /dev/null` file=`echo $file | cut -f1 -d' '`
# Set the PKG_CONFIG_PATH, needed to find the other pkg-config .pc files.
PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`echo "$file" | awk -F'/' '{ printf ("/"); for (i = \
2; i <= NF-1; i++) printf ("%s/", $i); }'`" cmd=`pkg-config --modversion freetype2`
result=$?
check_required_packages freetype2 $cmd $FREETYPE2_MINVERSION 'true' $result

cmd=`pkg-config --modversion fontconfig`
result=$?
check_required_packages fontconfig $cmd $FONTCONFIG_MINVERSION 'true' $result

cmd=`pkg-config --modversion libpng`
result=$?
check_required_packages libpng $cmd $LIBPNG_MINVERSION 'true' $result

#cmd=`pkg-config --modversion libdrm`
#result=$?
#check_required_packages libdrm $cmd '2.0' 'true' $result

#file=`find -L /usr/include/GL /usr/local/include/GL /opt/include/GL -maxdepth 1 \
-name osmesa.h 2> /dev/null` #file=`echo $file | cut -f1 -d' '`
#cmd=`grep VERSION $file | awk '{ printf(".%s", $3); }' | cut -c2- 2> /dev/null`
#result=$?
#check_required_packages mesa $cmd '6.5.0' 'true' $result

# If we want XCB, check to see if we also have GNU gperf installed
if [ "${USE_XCB}" == "yes" -o "${USE_XCB}" == "y" ]; then
   cmd=`gperf --version 2> /dev/null | head -1 | cut -d' ' -f3`
   result=$?
   check_required_packages gperf $cmd $GPERF_MINVERSION 'false' $result
fi

echo -e "\ngit_xorg ==> Checking out/Updating Xorg Modular components:"
do_dir app "${app}"
do_dir data "${data}"

# Til this is in git
if [ ! -d data/xkbdesc ]; then
   echo -e "\nchecking out data/xkbdesc"
   cvs -d :pserver:anoncvs:anoncvs@annarchy.freedesktop.org:/cvs/xlibs login  >& \
/dev/null  (cd data; cvs -d \
:pserver:anoncvs:anoncvs@annarchy.freedesktop.org:/cvs/xlibs co xkbdesc >& /dev/null) \
else  echo "data/xkbdesc exists, updating"
   (cd data/xkbdesc; cvs -d up >& /dev/null)
fi

do_dir doc "${doc}"
do_dir driver "${driver}"

# Check if we have XCB set or enabled.
if [ "${USE_XCB}" == "yes" -o "${USE_XCB}" == "y" ]; then
   echo "git_xorg: Going to download XCB support for Xorg..."
   do_dir xcb "${xcb}"
fi

do_dir font "${font}"
do_dir lib "${lib}"
do_dir proto "${proto}"
do_dir util "${util}"
do_dir . xserver

# Pull DRM and Mesa too
if [ -d drm ]; then
     echo -e "./drm exists, pulling"
     (cd drm; git pull )
else
    echo -e "\ncloning drm"
    git clone git://anongit.freedesktop.org/git/mesa/drm
fi

if [ -d Mesa ]; then
   echo -e "./Mesa exists, updating"
   (cd Mesa; cvs up >& /dev/null)
else
   echo -e "\nchecking out Mesa"
   cvs -d :pserver:anoncvs:anoncvs@annarchy.freedesktop.org:/cvs/mesa login >& \
/dev/null  (cvs -d :pserver:anoncvs:anoncvs@annarchy.freedesktop.org:/cvs/mesa co \
Mesa >& /dev/null) fi

echo -e "\n*** git_xorg: Modular Xorg downloading complete!"


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic