X11rdp: update buildx.sh to pull files from server1.xrdp.org

This commit is contained in:
Jay Sorg 2014-09-04 06:32:42 -07:00
parent 64e2291274
commit 4fe4b436d7

View File

@ -1,7 +1,8 @@
#!/bin/sh
# build.sh: a script for building X11R7.6 X server for use with xrdp #
# Copyright 2011-2012 Jay Sorg Jay.Sorg@gmail.com
# buildx.sh: a script for building X11R7.6 X server for use with xrdp
#
# Copyright 2011-2013 Jay Sorg Jay.Sorg@gmail.com
#
# Authors
# Jay Sorg Jay.Sorg@gmail.com
@ -24,107 +25,27 @@
download_file()
{
local file url status
file=$1
# if we already have the file, don't re-download it
if [ -r downloads/$file ]; then
return 0
fi
# if we already have the file, don't download it
if [ -r downloads/$file ]; then
return 0
fi
echo "downloading file $download_url/$file"
cd downloads
echo "downloading file $file"
if [ "$file" = "pixman-0.15.20.tar.bz2" ]; then
wget -cq http://ftp.x.org/pub/individual/lib/$file
status=$?
cd ..
return $status
elif [ "$file" = "libdrm-2.4.26.tar.bz2" ]; then
wget -cq http://dri.freedesktop.org/libdrm/$file
status=$?
cd ..
return $status
elif [ "$file" = "MesaLib-7.10.3.tar.bz2" ]; then
wget -cq ftp://ftp.freedesktop.org/pub/mesa/7.10.3/$file
status=$?
cd ..
return $status
elif [ "$file" = "expat-2.0.1.tar.gz" ]; then
wget -cq http://server1.xrdp.org/xrdp/expat-2.0.1.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "freetype-2.4.6.tar.bz2" ]; then
wget -cq http://download.savannah.gnu.org/releases/freetype/freetype-2.4.6.tar.bz2
status=$?
cd ..
return $status
elif [ "$file" = "xkeyboard-config-2.0.tar.bz2" ]; then
wget -cq http://www.x.org/releases/individual/data/xkeyboard-config/xkeyboard-config-2.0.tar.bz2
status=$?
cd ..
return $status
elif [ "$file" = "makedepend-1.0.3.tar.bz2" ]; then
wget -cq http://xorg.freedesktop.org/releases/individual/util/makedepend-1.0.3.tar.bz2
status=$?
cd ..
return $status
elif [ "$file" = "libxml2-sources-2.7.8.tar.gz" ]; then
wget -cq ftp://ftp.xmlsoft.org/libxml2/libxml2-sources-2.7.8.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "Python-2.5.tar.bz2" ]; then
wget -cq http://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2
status=$?
cd ..
return $status
elif [ "$file" = "Python-2.7.tar.bz2" ]; then
wget -cq http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
status=$?
cd ..
return $status
elif [ "$file" = "expat-2.0.1.tar.gz" ]; then
wget -cq http://server1.xrdp.org/xrdp/expat-2.0.1.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "cairo-1.8.8.tar.gz" ]; then
wget -cq http://server1.xrdp.org/xrdp/cairo-1.8.8.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "libpng-1.2.46.tar.gz" ]; then
wget -cq http://server1.xrdp.org/xrdp/libpng-1.2.46.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "intltool-0.41.1.tar.gz" ]; then
wget -cq http://launchpad.net/intltool/trunk/0.41.1/+download/intltool-0.41.1.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "libxslt-1.1.26.tar.gz" ]; then
wget -cq ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz
status=$?
cd ..
return $status
elif [ "$file" = "fontconfig-2.8.0.tar.gz" ]; then
wget -cq http://server1.xrdp.org/xrdp/fontconfig-2.8.0.tar.gz
status=$?
cd ..
return $status
else
wget -cq $download_url/$file
status=$?
cd ..
return $status
fi
wget -cq $download_url/$file
status=$?
cd ..
return $status
}
remove_modules()
{
local mod_file mod_dir mod_args
if [ -d cookies ]; then
rm cookies/*
fi
@ -136,21 +57,15 @@ remove_modules()
exit 0
fi
cd build_dir
while read line
while IFS=: read mod_file mod_dir mod_args
do
mod_dir=`echo $line | cut -d':' -f2`
if [ -d $mod_dir ]; then
rm -rf $mod_dir
fi
done < ../$data_file
cd ..
(cd build_dir; [ -d $mod_dir ] && rm -rf $mod_dir)
done < $data_file
}
extract_it()
{
local mod_file mod_name mod_args comp
mod_file=$1
mod_name=$2
mod_args=$3
@ -160,8 +75,8 @@ extract_it()
fi
# download file
download_file $mod_file
if [ $? -ne 0 ]; then
if ! download_file $mod_file
then
echo ""
echo "failed to download $mod_file - aborting build"
echo ""
@ -172,13 +87,15 @@ extract_it()
# if pkg has not yet been extracted, do so now
if [ ! -d $mod_name ]; then
echo $mod_file | grep -q tar.bz2
if [ $? -eq 0 ]; then
tar xjf ../downloads/$mod_file > /dev/null 2>&1
else
tar xzf ../downloads/$mod_file > /dev/null 2>&1
fi
if [ $? -ne 0 ]; then
case "$mod_file" in
*.tar.bz2) comp=j ;;
*.tar.gz) comp=z ;;
*.tar.xz) comp=J ;;
*.tar) comp= ;;
*) echo "unknown compressed module $mod_name" ; exit 1 ;;
esac
if ! tar x${comp}f ../downloads/$mod_file > /dev/null
then
echo "error extracting module $mod_name"
exit 1
fi
@ -188,13 +105,13 @@ extract_it()
cd $mod_name
# check for patches
if [ -e ../../$mod_name.patch ]; then
patch -p1 < ../../$mod_name.patch
patch -p1 < ../../$mod_name.patch
fi
# now configure
echo "executing ./configure --prefix=$PREFIX_DIR $mod_args"
./configure --prefix=$PREFIX_DIR $mod_args
if [ $? -ne 0 ]; then
echo "configuration failed for module $mn"
if ! ./configure --prefix=$PREFIX_DIR $mod_args
then
echo "configuration failed for module $mod_name"
exit 1
fi
@ -205,6 +122,7 @@ extract_it()
make_it()
{
local mod_file mod_name mod_args
mod_file=$1
mod_name=$2
mod_args=$3
@ -221,8 +139,8 @@ make_it()
echo "*** processing module $mod_name ($count of $num_modules) ***"
echo ""
extract_it $mod_file $mod_name "$mod_args"
if [ $? -ne 0 ]; then
if ! extract_it $mod_file $mod_name "$mod_args"
then
echo ""
echo "extract failed for module $mod_name"
echo ""
@ -231,8 +149,8 @@ make_it()
# make module
if [ ! -e cookies/$mod_name.made ]; then
(cd build_dir/$mod_name ; make)
if [ $? -ne 0 ]; then
if ! make -C build_dir/$mod_name
then
echo ""
echo "make failed for module $mod_name"
echo ""
@ -242,8 +160,8 @@ make_it()
fi
# install module
(cd build_dir/$mod_name ; make install)
if [ $? -ne 0 ]; then
if ! make -C build_dir/$mod_name install
then
echo ""
echo "make install failed for module $mod_name"
echo ""
@ -253,9 +171,9 @@ make_it()
# special case after installing python make this sym link
# so Mesa builds using this python version
case "$mod_name" in
*Python-2*)
(cd build_dir/$mod_name ; ln -s python $PREFIX_DIR/bin/python2)
;;
*Python-2*)
ln -s python build_dir/$mod_name/$PREFIX_DIR/bin/python2
;;
esac
touch cookies/$mod_name.installed
@ -266,7 +184,9 @@ make_it()
data_file=x11_file_list.txt
# this is the default download location for most modules
download_url=http://www.x.org/releases/X11R7.6/src/everything
# changed now to server1.xrdp.org
# was www.x.org/releases/X11R7.6/src/everything
download_url=http://server1.xrdp.org/xrdp/X11R7.6
num_modules=`cat $data_file | wc -l`
count=0
@ -277,10 +197,10 @@ count=0
if [ $# -lt 1 ]; then
echo ""
echo "usage: build.sh <installation dir>"
echo "usage: build.sh <clean>"
echo "usage: build.sh default"
echo "usage: build.sh <installation dir> drop - set env and run bash in rdp dir"
echo "usage: buildx.sh <installation dir>"
echo "usage: buildx.sh <clean>"
echo "usage: buildx.sh default"
echo "usage: buildx.sh <installation dir> drop - set env and run bash in rdp dir"
echo ""
exit 1
fi
@ -299,9 +219,9 @@ else
fi
if ! test -d $PREFIX_DIR; then
echo "dir does not exit, creating [$PREFIX_DIR]"
mkdir $PREFIX_DIR
if ! test $? -eq 0; then
echo "dir does not exist, creating [$PREFIX_DIR]"
if ! mkdir $PREFIX_DIR
then
echo "mkdir failed [$PREFIX_DIR]"
exit 0
fi
@ -316,8 +236,8 @@ export CFLAGS="-I$PREFIX_DIR/include -fPIC -O2"
# prefix dir must exist...
if [ ! -d $PREFIX_DIR ]; then
mkdir -p $PREFIX_DIR
if [ $? -ne 0 ]; then
if ! mkdir -p $PREFIX_DIR
then
echo "$PREFIX_DIR does not exist; failed to create it - cannot continue"
exit 1
fi
@ -331,8 +251,8 @@ fi
# create a downloads dir
if [ ! -d downloads ]; then
mkdir downloads
if [ $? -ne 0 ]; then
if ! mkdir downloads
then
echo "error creating downloads directory"
exit 1
fi
@ -340,8 +260,8 @@ fi
# this is where we do the actual build
if [ ! -d build_dir ]; then
mkdir build_dir
if [ $? -ne 0 ]; then
if ! mkdir build_dir
then
echo "error creating build_dir directory"
exit 1
fi
@ -349,22 +269,18 @@ fi
# this is where we store cookie files
if [ ! -d cookies ]; then
mkdir cookies
if [ $? -ne 0 ]; then
if ! mkdir cookies
then
echo "error creating cookies directory"
exit 1
fi
fi
while read line
while IFS=: read mod_file mod_dir mod_args
do
mod_file=`echo $line | cut -d':' -f1`
mod_dir=`echo $line | cut -d':' -f2`
mod_args=`echo $line | cut -d':' -f3`
mod_args=`eval echo $mod_args`
make_it $mod_file $mod_dir "$mod_args"
done < $data_file
echo "build for X OK"
@ -372,22 +288,22 @@ echo "build for X OK"
X11RDPBASE=$PREFIX_DIR
export X11RDPBASE
cd rdp
make
if [ $? -ne 0 ]; then
if ! make -C rdp
then
echo "error building rdp"
exit 1
fi
# this will copy the build X server with the other X server binaries
cd rdp
strip X11rdp
cp X11rdp $X11RDPBASE/bin
if [ "$2" = "drop" ]; then
echo ""
echo "dropping you in dir, type exit to get out"
bash
exit 1
echo ""
echo "dropping you in dir, type exit to get out"
bash
exit 1
fi
echo "All done"