Hi Trevor / Daniel!
Could we make a similar change to our own, i.e. LilyPond's, distributions?


Have a look at the attached build script. Guile 1.8 is installed inside the 
lilypond tree after a minor modification (see lines 65..70)

Knut
#!/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

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!
#
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"

#=======================================================
# As our guile is hidden, our 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 needs these (undocumented!)
export LILYPOND_GIT=$LILYSOURCE
export LILYPOND_BUILD_DIR=$LILYSOURCE/build

cd $LILYSOURCE

doit "git checkout master"
doit "git checkout release/2.19.1-1"
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"
doit "make $LILYMAKEPAR doc"
doit "make $LILYMAKEPAR install-doc"

ENDTIME=`date +"%s"`
let "TOTALTIME = $ENDTIME - $STARTTIME"
echo "Total guile and lilypond build time: $TOTALTIME seconds"

exit 0
_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to