#!/bin/bash #==================================================================== # Build lilypond and guile 1.8 in a way that # -> guile is installed under PREFIX/share/lilypond # -> guile does not need to be in PATH # -> libguile does not need to be in the systems library search path #==================================================================== RED='\033[0;31m' NOCOLOR='\033[0m' STARTTIME=`date +"%s"` #======================================================= # Adapt the next three lines to your needs! # LILYSOURCE is the local lilypond git repository # GUILESOURCE is the local guile git repository # LILYROOT is the install destination root directory #======================================================= LILYSOURCE=/home/knut/sources/lily GUILESOURCE=/home/knut/sources/guile LILYROOT=/home/knut/sources/lilybuilt #======================================================= # derived from the defintions above, there should be # no need to change these: #======================================================= BUILDLOG=$LILYROOT/lilypond_buildlog GUILEROOT=$LILYROOT/share/lilypond GUILELIBDIR=$GUILEROOT/lib64 GUILEBINDIR=$GUILEROOT/bin LILYLIBDIR=$LILYROOT/lib64/lilypond LILYBINDIR=$LILYROOT/bin #======================================================= # options for make #======================================================= LILYMAKEPAR="-j 11 CPU_COUNT=11" GUILEMAKEPAR="-j 11" function doit { AT=`date +"%s"` echo -en " exec $RED$1$NOCOLOR in `pwd` ..." $1 &>> $BUILDLOG if [ $? -ne 0 ]; then echo " failed, see $BUILDLOG";exit 1;else echo -n " succeeded";fi BT=`date +"%s"` let "CT = $BT - $AT" echo " after $CT seconds" } #=========================================== # ensure that our LILYROOT directory exists! #=========================================== mkdir -p $LILYROOT #================================= # Now we patch and build guile 1.8 #================================= cd $GUILESOURCE git checkout branch_release-1-8 &>> $BUILDLOG git reset --hard &>> $BUILDLOG git clean -dfx &>> $BUILDLOG echo Building GUILE `git rev-parse HEAD` first ... #============================================================================ # We do not want our guile to be visible to other applications, so we # need to tell our hidden libguile where it has to look for module libraries! # All we have to do is to add $GUILEBINDIR to the search path of guile. #============================================================================ echo " First we add a library search path to libguile/dynl.c" sed -i "s|lt_dlinit ();|lt_dlinit (); lt_dlsetsearchpath (\"$GUILELIBDIR\");|" libguile/dynl.c doit "./autogen.sh" doit "./configure --disable-error-on-warning --prefix=$GUILEROOT" doit "make $GUILEMAKEPAR" doit "make $GUILEMAKEPAR install" GUILEENDTIME=`date +"%s"` let "TOTALTIME = $GUILEENDTIME - $STARTTIME" echo "GUILE build time: $TOTALTIME seconds" #=========================================================== # As our guile is hidden, the lilypond binaries need to know # where # guile and libguile is located ... during build we # need guile-config etc to be in PATH. #=========================================================== PATH=$GUILEBINDIR:$PATH export LDFLAGS="-Wl,-rpath,$GUILELIBDIR" #====================================================== # make-regtest-pngs.sh would need these (undocumented!) #====================================================== export LILYPOND_GIT=$LILYSOURCE export LILYPOND_BUILD_DIR=$LILYSOURCE/build cd $LILYSOURCE echo Building LILYPOND `git rev-parse HEAD`... doit "git reset --hard" doit "git clean -dfx" doit "./autogen.sh --noconfigure" doit "mkdir -p build" doit "cd $LILYSOURCE/build" doit "../configure --prefix=$LILYROOT" doit "make $LILYMAKEPAR all" doit "make $LILYMAKEPAR install" LILYBINENDTIME=`date +"%s"` let "TOTALTIME = $LILYBINENDTIME - $GUILEENDTIME" echo "LILYPOND binary build time: $TOTALTIME seconds" doit "make $LILYMAKEPAR doc" doit "make $LILYMAKEPAR install-doc" LILYENDTIME=`date +"%s"` let "TOTALTIME = $LILYENDTIME - $LILYBINENDTIME" echo "LILYPOND documentation build time: $TOTALTIME seconds" let "TOTALTIME = $LILYENDTIME - $STARTTIME" echo "Total guile and lilypond build time: $TOTALTIME seconds" exit 0