Apps :: Desktop Icon Doesn't work.
For those who are interested here are my current build scripts for gpsdrive. These are for the latest CVS versions of gpsdrive. I assume they will still work for 2.09 but I haven't tried it. Anyone interested should also visit the nice people at http://gpsdrive.cc and read all about the package and what it does.
This build process is still work in progress and currently the compile doesn't succeed and fails during the make process of Gpsdrive. If you can figure out why I'm all ears. I'm still working on it.
I have been running the scripts below on Knoppix (boot from cd) as I couldn't get all the build stuff to work on DSL. I'm told they should be binary compatible and execute no problem when installed on DSL.
As Knoppix runs from RAM disk I couldn't get it to run on a system with 256Mb of RAM. But 512mb is ok. It doesn't crash or give an error it just never completes.
You compile each package using build.sh (see below) or just run everything.sh (which calls build.sh many times) to build the lot. It takes about one and a half hours on my little 800mhz beast.
Build.sh outputs a "0" at each successfull stage and something else if it fails. The output from the compile process goes to .log files one for each package. I also capture the configure --help output that shows all the different switches available that will come in handy when we try and cut down the size of this.
I haven't botherd to make the script exit on failure it just presses on so it is important to scroll back and see where the first problem occured. You will need to change around the variables at the top of each file to suit your system depending on your file system and where you decide to put things along the way.
Don't forget each time you reboot you will need to stat the build from the begining as it is in memory it is all lost on shutdown.
There is a section in build.sh that removes many of the non esiental files like man pages etc and then it builds the .tar.gz file and places it on my usb key. The whole lot when installed to DSL is contained in /opt/gpsdrive except for the Desktop Icon (I think). So I think it will qualify for one of those "green" ratings if it gets published on DSL's site.
There are comments in the scripts but just ask if it isn't clear what they do. I know my scripts are LAME and there are more efficient ways of doing this but when I started I had no idea how big they would become or how similar each of the different packages are.
These are the required packages. They should be easy to find and download as they are all very popular things.
I think if you find newer versions they should work too.
atk-1.10.1.tar.gz
cairo-1.0.2.tar.gz
expat-1.95.8.tar.gz
fontconfig-2.3.2.tar.gz
freetype-2.1.10.tar.gz
gettext-0.14.5.tar.gz
glib-2.8.1.tar.gz
gtk+-2.8.3.tar.gz
pango-1.10.0.tar.gz
pkg-config-0.19.tar.gz
autoconf-2.59.tar.gz
automake-1.9.6.tar.gz
And
gpsdrive-2.10pre3.tar.gz
Use this copy of gpsdrive if you don't want to use CVS but they should be almost identical anyway on build.sh will download the latest CVS version when you run it anyway.
BTW the CVS download stops and waits for you to enter a password. There is no password just press return. I couldn't figure out how to send a CR automatically.
everything.sh
==================
mount /dev/hda2 # Knoppix on car computer with usbkey
# mount /dev/hda5 # Knoppic on notebook and 2nd partition
# echo Compiling Autoconf
./build.sh autoconf /usr # This will install programs to /usr/bin
echo Compiling Automake
./build.sh automake /usr # This will install programs to /usr/bin
# echo Compiling pkgconfig
# Not required on Knoppix
# ./build.sh pkgconfig
# echo Compiling gettext
# Not required on Knoppix
# ./build.sh gettext
# NOTE:
# I can't figure out how to get the library path stuff to work properly.
# To work around this I have compiled the packages once into their standard
# location so that ./configure can find them and the again into /opt/gpsdrive
# which will be the defalut location on DSL
#
# Note when starting the package on DSL use the following command line.
# LD_LIBRARY_PATH=/opt/gpsdrive/lib /opt/gpsdrive/bin/gpsdrive
echo Compiling glib
./build.sh glib /usr
./build.sh glib /opt/gpsdrive
echo Compiling freetype
./build.sh freetype /opt/gpsdrive
echo Compiling expat
./build.sh expat /opt/gpsdrive
echo Compiling fontconfig
./build.sh fontconfig /opt/gpsdrive
echo Compiling atk
./build.sh atk /usr
./build.sh atk /opt/gpsdrive
echo compiling cairo
./build.sh cairo /usr
./build.sh cairo /opt/gpsdrive
echo compiling pango
./build.sh pango /usr
./build.sh pango /opt/gpsdrive
echo compiling gtk
./build.sh gtk /usr
./build.sh gtk /opt/gpsdrive
echo Update CVS gpsdrive
./build.sh cvsupdate
echo compiling GPSDrive
# ./build.sh gpsdrive /opt/gpsdrive tar #build from the tar file
./build.sh gpsdrive /opt/gpsdrive #build from the cvs source
# echo Moving executables onto Hard Disk
./build.sh cpy
# echo Building the gpsdrive.tar.gz package
./build.sh package
Build.sh
=============
################################################################
# This script is called from everything.sh
# D. Pollard
#
################################################################
USB=sda1 # Usb key
#
LOGFILE=/mnt/$USB/$1.log
CONFIGHELP=/mnt/$USB/$1-help.txt
UNPACK=/mnt/hda2/unpack
# UNPACK=/mnt/hda5/unpack
DEST=$2
BUILDFROM=$3
# WORK=/mnt/hda2/work
WORK=/work
#
echo "================================================================" > $LOGFILE
echo $1 >> $LOGFILE
date >> $LOGFILE
echo "================================================================" >> $LOGFILE
# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
##############################################################
# Autoconf
##############################################################
# Reuired for the build
# Version 1.79 comes with knoppix and 1.9 is required to build
# gpsdrive. Current version appears to be 2.5
if [ "$1" == "autoconf" ]
then
cd $UNPACK
mkdir autoconf
cd autoconf
tar -xvzf /mnt/$USB/source/autoconf-2.59.tar.gz >> $LOGFILE 2>&1
echo " unpack status " $?
cd autoconf-2.59
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure status " $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status " $?
make >> $LOGFILE 2>&1
echo " Make Status " $?
make install >> $LOGFILE 2>&1
echo " Make install staus " $?
cd $UNPACK
rm -rf autoconf >> $LOGFILE 2>&1
fi
##############################################################
# Automake
##############################################################
# Required for the build.
# Version 1.79 comes with knoppis and 1.9 is required to build
# gpsdrive. Current version appears to be 1.96
if [ "$1" == "automake" ]
then
cd $UNPACK
mkdir automake
cd automake
tar -xvzf /mnt/$USB/source/automake-1.9.6.tar.gz >> $LOGFILE 2>&1
echo " unpack status " $?
cd automake-1.9.6
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure status " $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status " $?
make >> $LOGFILE 2>&1
echo " Make Status " $?
make install >> $LOGFILE 2>&1
echo " Make install staus " $?
cd $UNPACK
rm -rf automake >> $LOGFILE 2>&1
fi
##############################################################
# Pkgconfig
##############################################################
# Requied for the build on DSL (not for the runtime)
if [ "$1" == "pkgconfig" ]
then
cd $UNPACK
mkdir pkgconfig
cd pkgconfig
tar -xvzf /mnt/$USB/source/pkg-config-0.19.tar.gz >> $LOGFILE 2>&1
echo " unpack status " $?
cd pkg-config-0.19
./configure --help > $CONFIGHELP
./configure >> $LOGFILE 2>&1
echo " Configure status " $?
make clean >> $LOGFILE 2>&1
echo " Make clean status "$?
make >> $LOGFILE 2>&1
echo " Make status " $?
make install >> $LOGFILE 2>&1
echo " Make Install Status "$?
cd $UNPACK
rm -rf pkgconfig >> $LOGFILE 2>&1
fi
##############################################################
# Gettext
##############################################################
# Required for the build on DSL (not for the runtime)
if [ "$1" == "gettext" ]
then
cd $UNPACK
mkdir gettext
cd gettext
tar -xvzf /mnt/$USB/source/gettext-0.14.5.tar.gz >> $LOGFILE 2>&1
echo " unpack status " $?
cd gettext-0.14.5
./configure --help > $CONFIGHELP
./configure >> $LOGFILE 2>&1
echo " Configure status " $?
make clean >> $LOGFILE 2>&1
echo " Make clean status " $?
make >> $LOGFILE 2>&1
echo " Make status " $?
make install >> $LOGFILE 2>&1
echo " Make Install Status " $?
cd $UNPACK
rm -rf gettext >> $LOGFILE 2>&1
fi
##############################################################
# Glib
##############################################################
# It looks like glib is alrdady part of Knoppix but it is not in DSL
# Required for the runtime (not for the build) I think
if [ "$1" == "glib" ]
then
cd $UNPACK
mkdir glib
cd glib
tar -xvzf /mnt/$USB/source/glib-2.8.1.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd glib-2.8.1
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf glib >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Freetype
##############################################################
# Required by atk and cairo for the run time
if [ "$1" == "freetype" ]
then
cd $UNPACK
mkdir freetype
cd freetype
tar -xvzf /mnt/$USB/source/freetype-2.1.10.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd freetype-2.1.10
chmod -R 777 * >> $LOGFILE 2>&1
echo " Chmod Status" $?
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo "Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf freetype >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Expat
##############################################################
# Required by fontconfig
if [ "$1" == "expat" ]
then
cd $UNPACK
mkdir expat
cd expat
tar -xvzf /mnt/$USB/source/expat-1.95.8.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd expat-1.95.8
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Config status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Staus" $?
cd $UNPACK
rm -rf expat >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Fontconfig
##############################################################
# Required by atk for the run time
if [ "$1" == "fontconfig" ]
then
cd $UNPACK
mkdir fontconfig
cd fontconfig
tar -xvzf /mnt/$USB/source/fontconfig-2.3.2.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd fontconfig-2.3.2
./configure --help > $CONFIGHELP
echo "-------------- Configure starts here ---------------" >> $LOGFILE
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
echo "-------------- Make clan starts here ---------------" >> $LOGFILE
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
echo "--------------- Make starts here ----------------" >> $LOGFILE
make -j1 >> $LOGFILE 2>&1
echo " Make status" $?
echo "--------------- Make Install starts here ------------------" >> $LOGFILE
# fix permission problem
chmod 777 -R /usr/share/fonts >> $LOGFILE
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf fontcontig >> $LOGFILE 2>&1
exit 0
fi
##############################################################
# Freetype
##############################################################
# Required for the runtime (not for the build)
# This package requires the following packages
# freetype
# fontconfig
if [ "$1" == "atk" ]
then
ldconfig # need this line so glib can be found
cd $UNPACK
mkdir atk
cd atk
tar -xvzf /mnt/$USB/source/atk-1.10.1.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd atk-1.10.1
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf atk >> $LOGFILE 2>&1
exit 0
fi
###############################################################
# Pango
###############################################################
# Required for the runtime
if [ "$1" == "pango" ]
then
cd $UNPACK
mkdir pango
cd pango
tar -xvzf /mnt/$USB/source/pango-1.10.0.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd pango-1.10.0
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf pango >> $LOGFILE 2>&1
exit 0
fi
###############################################################
# Cairo
###############################################################
# Required for the runtime
if [ "$1" == "cairo" ]
then
cd $UNPACK
mkdir cairo
cd cairo
tar -xvzf /mnt/$USB/source/cairo-1.0.2.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd cairo-1.0.2 >> $LOGFILE 2>&1
./configure --help > $CONFIGHELP
./configure --prefix=$DEST --disable-ps --disable-pdf >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
# -j1 limit the number of concurrent jobs to one.
# work around for "libtool link error Object Name Conflicts.
make -j 1 --keep-going >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf cairo >> $LOGFILE 2>&1
exit 0
fi
###############################################################
# Gtk
###############################################################
# Required for the runtime
if [ "$1" == "gtk" ]
then
cd $UNPACK
mkdir gtk
cd gtk
tar -xvzf /mnt/$USB/source/gtk+-2.8.3.tar.gz >> $LOGFILE 2>&1
echo " Unpack Status" $?
cd gtk+-2.8.3
./configure --help > $CONFIGHELP
./configure --prefix=$DEST >> $LOGFILE 2>&1
echo " Configure Status" $?
make clean >> $LOGFILE 2>&1
echo " Make Clean Status" $?
make >> $LOGFILE 2>&1
echo " Make Status" $?
make install >> $LOGFILE 2>&1
echo " Make Install Status" $?
cd $UNPACK
rm -rf gtk >> $LOGFILE 2>&1
exit 0
fi
################################################################
# Gps Drive
################################################################A
# Update CVS (get the latest bleeding edge version)
##############
if [ "$1" == "cvsupdate" ]
then
cd /mnt/$USB/source
export CVSROOT=:pserver:anonymous@cvs.gpsdrive.cc:/cvsroot
cp .cvspass /root
cvs login # Press return for blank PW
cvs co gpsdrive >> $LOGFILE 2>&1 # use this to get the lot
# cvs up gpsdrive >> $LOGFILE 2>&1 # use this to get an update
echo " CVS Checkout status " $?
cvs logout
fi
##############
# Build
##############
if [ "$1" == "gpsdrive" ]
then
if [ "$BUILDFROM" == "tar" ] # otherwise build from CVS source
then
SOURCE=gpsdrive-2.10pre3-cvs-version23-10.tar.gz
ARCHIVE_DIR=gpsdrive-2.10pre3
cd $UNPACK
mkdir gpsdrive
cd gpsdrive
tar -xvzf /mnt/$USB/source/$SOURCE >> $LOGFILE 2>&1
echo " Unpack Status" $?
else
ARCHIVE_DIR=/mnt/$USB/source/gpsdrive
fi
cd $ARCHIVE_DIR
# /opt running out of space. remove openoffice
rm -rf /opt/openoffice
./configure --help > $CONFIGHELP
./configure --prefix=$DEST --disable-garmin >> $LOGFILE 2>&1
echo Configure Status $?
make clean >> $LOGFILE 2>&1
echo Make Clean Status $?
make >> $LOGFILE 2>&1
echo Make Status $?
make install >> $LOGFILE 2>&1
echo Make Install Status $?
cd $UNPACK
if [ "$BUILDFROM" == "tar" ]
then
rm -rf gpsdrive >> $LOGFILE 2>&1
fi
exit 0
fi
################################################################
# Copy the files to working folder on Hard Disk
################################################################
if [ "$1" == "cpy" ]
then
# Probably already mounted
# mount /dev/hda2 /mnt/hda2 >> $LOGFILE 2>&1
cd /opt
cp -Pr gpsdrive $WORK/opt >> $LOGFILE 2>&1
# Additional Libraries and Links
ln -s $WORK/opt/gpsdrive/lib/libpangocario-1.0.so.0.1000.0 $WORK/opt/gpsdrive/lib/libpangocairo-1.0.so >> $LOGFILE 2>&1
ln -s i$WORK/opt/gpsdrive/lib/libpangocairo-1.0.so.0.1000.0 $WORK/opt/gpsdrive/lib/libpangocairo-1.0.so.0 >> $LOGFILE 2>&1
cp /usr/lib/libpcre.so.3 $WORK/opt/gpsdrive/lib
cp /usr/X11R6/lib/libXrandr.so.2 $WORK/opt/gpsdrive/lib
cp /usr/lib/libXcursor.so.1 $WORK/opt/gpsdrive/lib
fi
################################################################
# Create the Package for DSL
#################################################################
if [ "$1" == "package" ]
then
cd $WORK
echo "Current working direcory..."
pwd
# Make the install dir
mkdir opt
# Make the Icon item
mkdir home
mkdir home/dsl
mkdir home/dsl/.xtdesktop
# Copy the Icon and the .lnk desktop icon file
cp /mnt/$USB/gpsdrive.lnk home/dsl/.xtdesktop/Gpsdrive.lnk
cp /mnt/$USB/gpsdrive.gif home/dsl/.xtdesktop/Gpsdrive.gif
# Make the menu item
# TODO
# mkdir var
# mkdir var/tmp
# mkdir var/tmp/mydsl.menu
# cp /mnt/$USB/gpsdrive-menu.txt var/tmp/mydsl.menu/gpsdrive
# Fix file ownership
chown -R 0.0 ./{opt/,var/}
chown -R 1001.50 ./home/dsl/
# chown 1001.50 ./var/tmp/mydsl.menu/gpsdrive
# Remove the old archive if any
rm -f gpsdrive.tar.gz
# Create the file list
find . > files.txt
# Remove unwanted files from the list
# -v sends all non matching lines to the output file
# -x matches the whole line only
echo "Building the files list "
cat files.txt \
| grep -vx . \
| grep -vx ./opt \
| grep -v /man/ \
| grep -vx /man \
| grep -v /include \
| grep -v /doc \
| grep -v /gtk-doc \
| grep -vx ./home \
| grep -vx ./home/dsl \
| grep -vx ./var \
| grep -vx ./var/tmp \
| grep -vx .var/tmp/mydsk.menu \
| grep -vx ./files.txt \
| grep -v .gpsdrive.tar \
> includedfiles.txt
echo "Build file list status " $?
# Create the archive
echo " Creating the Archive "
tar -cvf gpsdrive.tar --no-recursion --numeric-owner -T includedfiles.txt >> $LOGFILE
echo " Create Archive Status " $?
echo " Compressing the Archive (please wait) "
gzip -9 gpsdrive.tar
echo " Compress Archive Status " $?
# Create an info file
# TODO
# Create an md5sum
# TODO
md5sum gpsdrive.tar.gz > gpsdrive.tar.gz.md5.txt
fi
################################################################
Start.sh
============
When you want to start GPSdrive on DSL you will need something like this to start the program.
This is so the libraries can all be found.
LOGFILE=/opt/gpsdrive/start.log
echo "=======================================================================" >> $LOGFILE
date >> $LOGFILE
export LD_LIBRARY_PATH=/opt/gpsdrive/lib
/opt/gpsdrive/bin/gpsdrive >> $LOGFILE 2>&1
echo "=======================================================================" >> $LOGFILE
original here.