# -*-shell-script-*-s # Prerequisites: sed, GNU make, libtool, wget # # (and for autogening: GNU m4, GNU autoconf, GNU automake) # # libz is optional for the moment # 1.3 Put RELEASE-NOTES on web site too # 1.4 Apply both of Ezra's patches of today Wed Mar 2 22:51:36 GMT 2005 # Update clipper version (the one with shelx .fcf ability) # 1.5 Apply Ezra's gtkglarea patch and GSL patch. # Update version of FFTW and other updates from MATSUURA Takanori. # 1.6 Update to mmdb-1.0.8 [# for molrep output] # 1.7 Fix logic of fftw test # 1.8 Add the clipper edcalc patch (suggested by Ezra ages ago) # 1.9 Add Fedora Core 4 support and testing for the need to build mccp4, # mmdb and clipper. # 1.10 Tidy up nightly code. # 1.11 Add code testing the need for guile_gui and goosh. # 1.12 Tidy nightly code again. # 1.13 Don't escape the "."s in gsub for new gawk (Ward Smith). # 1.14 20050628 Test for imlib on the installation, not the system (ignore # the system). # 1.15 20050709 Add glib gstrfuncs patch # 1.16 20050709 Update to guile 1.6.7 and add lt_preloaded_symbols patch # 1.17 20050721 Added clipper status code to compiling clipper part. # Redirect stderr output? # fix build_mccp4 problem. # 1.18 20050722 Fix guile build (wrong http tar file). # Added freeglut # 1.19 20050803 Update version of guile-gtk to 0.41 # 1.20 20050815 Several updates and clean up from MATSUURA Takanori. # 1.21 20050815 Stop if wget test fails. # 1.22 20050916 Update build for freeglut to use --disable-warnings and # CFLAGS # 1.23 20050916 Move "set" so we don't see confusing default coot_version # 1.24 20051012 Do pre-release tars for a few days. # 1.25 20051017 Don't make install if Coot's makes fails. Don't make -k # 1.26 20051018 Handle clipper nxmap patch. # 1.27 20051027 [Gif, Paris] Fix tarred directory for nightly pre-release # tars. # 1.28 20051101 Fix the md5sum for nxmap.h # 1.29 20051104 Apply most of MATSUURA Takanori's fixes. # Use CCP4 libs (mtz, clipper, mmdb). # 1.30 20051109 Darwin setting of FC for CCP4 libs configure. # 1.31 20051114 Fix coot tar file problem on building pre-release (or not). # 1.32 20060205 Add scripting variable debugging (its currently not making # python tar files) # 1.33 20060214 Get wget testing tar file from YSBL, not chem.gla # 1.34 20060219 Correct the install position of libccp4c.la # 1.35 20060219 create time stamp with current time, not the time of # the previous ccp4 libs file, now the find ctime test works # as I wanted. # 1.36 20060220 Add a libmmdb.la too. # 1.37 20060222 Add Bob Nolte's proxy settings # 1.38 20060224 dylib variable for libmmdb.la and libccp4c.la # 1.39 20060225 Fix sedding of libmmdb.la and libccp4c.la # 1.40 20060323 copy over coot.py to share/coot/python (if we built with # python) # 1.41 20060401 Big changes for ccp4 5.0.2 ccp4c libs. # 1.42 20060404 Various small build debuggings. # 1.43 20060405 Fix do_nightlies syntax error and fix up glut_prefix build # problem. # 1.44 20060405 Fix the tarred directory name when this is not a pre-release # 1.45 20060406 Check for missing reference structures and monomer lib and # install them if needed. # 1.46 20060418 use install_top_dir variable to copy over coot.py (not # $coot_prefix!) # 1.47 20060419 Remove the mmdb binaries # 1.48 20060420 J. Maclean says no guile. He is right. So check install for # guile, not system. # 1.49 20060420 Replace many $AUTOBUILD_INSTALLED with $install_top_dir. # 1.50 20060421 Replace other $AUTOBUILD_INSTALLED with $install_top_dir for # tar file creation. # 1.51 20060425 net-http was installing into the wrong place because it had # been set to install_top_dir, but this was not set as a shell # (or configured) variable so it was just blank [James Murray]. # Now we export install_top_dir. # 1.52 20060427 Don't add unecessary tagging of -pre-release to tar_dir at # the end. # 1.53 20060503 Force GSL to be in $install_top_dir rather than anywhere. # 1.54 20060519 Update to extract the right coot version from the release and # pre-release directories. # 1.55 20060621 Shuffle around the test for using pre-release # 1.56 20060626 Fixes from MATSUURA Takanori. Shuffle around the usage of # install_top_dir. # 1.57 20060704 run imlib-config from the installation, not anywhere. # 1.58 20060705 Fix wrong directory to build libtiff. # 1.59 20060706 guile-config should run with an argument, otherise it # returns with exit status 1 (and we test for non-zero). # 1.60 20060706 Fix (directory for) mmdb include file test. # 1.61 20060707 Add to coot configure line the option for guile_gtk # 1.62 20060708 Fix coot_prerelease_exists typo in setting install_top_dir # (oops). # 1.63 20060708 Add jpeg dependency for imlib # 1.64 20060708 Add libungif test to installation, not system (imlib # dependency). # 1.65 20060710 Add removal of coot_wrap_guile.cc compilation when python # scripting. # 1.66 20060710 Python on a Sunday. # 1.67 20060711 Try to fix up the Makefile for PNG. # 1.68 20060723 Add in the updates to ltmain.sh, ltconfig and config.guess/sub # for Mactel build. Add build for readline. # Readline version typo fixed. # 1.69 20060724 ENABLE_PYTHON_COOT variable is tested. Don't display # a variables if we are using a proxy. # 1.70 20060728 pass CFLAGS and LDFLAGS to guile's configure # 1.71 20060730 Add test for 64-bit Linux to update config.xxxs and libtool. # Installation readline built now, not system. # 1.72 20060801 Use mmdb-1.0.8-ysbl-2, which installs includes in the include # dir. This matches clipper cif_data_io.cpp which presumes that # it is there. (And is a clean thing to do anyway). # 1.73 20060801 Use the new version of libccp4c, with some of Ralf's patches # and includes that go into include/ccp4 dir. # 1.74 20060801 Use CCP4_CXXFLAGS argument to clipper (it does the wrong thing # with --with-ccp4) # 1.75 20060801 Use -pre-2 version of SSMlib, that has -Ixxx/include/mmdb to # find mmdb include files. # 1.76 20060808 test for libjpeg.$shared_lib_ext not libjpeg.so. LTE bug. # 1.77 20060818 Force update of libtool and config files for libjpeg. Extend # the make install proceedure. Lynn Ten Eyck reported problems # here. # 1.78 20060823 Add poll fix and getpwuid fix to glib build on Intel Mac. # 1.79 20060827 Add fix for gtk-canvas from fink for Intel Mac. # 1.80 20061002 Change freeglut test to test instaltion, not system. # 1.81 20061012 The path used to find *-config files should be the same one # that new executables are added (it was $AUTOBUILD_INSTALLED) # and it should be $AUTOBUILD_INSTALLED-pre-release/bin) when # we are building a pre-release. # 1.82 20061012 Change the destination tar file so that there are nightly # and stable directories for the binary tar files on the web # server. # 1.83 20061107 cd to the clipper dir when building clipper. Pirate and # bucca are not (attempted to be) built then. # 1.84 20061107 Capture and report error status from make in GSL (intel mac # build fails). # 1.85 20061107 Use GSL version 1.8, which includes Charles Ballard's fix for # fp_regs.h # 1.86 20061108 Add fink-based args for configure of gtk for Darwin # 1.87 20061108 Fix ltmain.sh updating for Gtk (oops!). # 1.88 20061122 Fix coot tar directory now that we have revision numbers in # tar file name. # 1.89 20061123 Fix/add test for ssmlib build (now depends on mmdb build) and # libccp4c build (now depends on xxx/include/ccp4/cmtzlib.h). # 1.90 20061128 Allow the user to specify if the dependencies should be checked # on the system or only in the autobuild installed directory. # Needs more checks to use this. Currently only glib and gtk # tests. # 1.91 20061211 Don't make install for guile-gtk if the make fails - or the # dependency check for guile-gtk in coot's configure passes # when it should fail (maybe). # 1.92 20061212 Apply Charles Ballards libtool patch for Macs for imlib and # guile-gtk. # 1.93 20061212 Fiddle the env vars to compile gtk+ on Mac. # 1.94 20070104 Non-pre-release build problems, BINARY_DEST_DIR # 2.01 20070109 imlib tar gz should be downloaded from the correct directory # (sigh). # 2.02 20070117 Try to compile clipper with -fno-strict-aliasing # 2.03 20070123 Tell us where the gtkglarea include file was found. # 2.04 20070124 GCC 3.2 on RH8 machine cannot compile new clipper, so add a # patch if needed. # 2.05 20070216 Put libtiff after libjpeg and give tiff's configure command # line args to find jpeg. # 2.06 20070306 Put in the clipper<->ccp4 new dist patch. # 2.07 20070319 Remove == comparisons - Lothar Esser. # 2.08 20070424 --with-jpeg-lib-dir should be a lib dir! # 2.09 20070501 Fix the setting of coot_version when no pre-release set. # 2.10 20071002 Post install slim the binaries. Add helper functions. # 2.11 20071005 Add some debugging to make_tar. It doesn't seem to work # currently. # 2.12 20071005 Fix post_install_slim call. # 2.13 20071005 Fix slim_dir # 2.14 20071006 Adjust python scripting settings, so that it should try # to compile with python most of the time now. # 2.15 20071008 Fix extra fi, uncommented typo. # 2.16 20071010 ENABLE_PYTHON_COOT=no for now. # 2.17 20071105 Swap out DL Clipper for York clipper [whoosh, bang, kerpow!] # enable-cns # 2.18 20071105 Backpeddle to mmdb 1.08. Baah. # 2.19 20071108 Version 1.08-ysbl-3 of mmdb. # 2.20 20071118 No longer make the full fat tar file. # 2.21 20071120 Sourcefource no longer distributes libungif, now in # ysbl software/extras # 2.22 20071121 set the architecture for ubuntu systems. # 2.23 20071125 Fix typo in recent fixes. # 2.24 20071126 Fix setting of systype for MacOSX, hopefully. # 2.25 20071126 Another try to fix setting of systype for MacOSX. # 2.26 20071130 Try to enable python # 2.27 20071207 More python tinkering. Upgrade to 2.5.1 # 2.28 20071207 Add greg. If in York, use it to test before installing. # 2.29 20071208 Setup CCP4 and use it to test coot before making binaries. # 2.30 20071209 Add dewinter's ccp4 setup in setup_ccp4. # 2.31 20071212 Redirect testing output to $LOGS/$HOST-testing.log # 2.32 20071213 Copy over the ChangeLog, README and RELEASE-NOTES on good test # 2.33 20071215 Pythonize only sometimes, default off. # 2.34 20071215 Tell us some Python info # 2.35 20071215 Python settings outside the subshell. # 2.36 20071219 Set up for testing and tars on biop too. # 2.37 20080213 Add Joseph Moran's fix for handling CC when set. # 2.38 20080423 change the file name target for the build and test log file. # 2.39 20080426 Check against installed python, not system. Does this mean that # bins work on a Mandriva system? Needs checking # 2.40 20080428 Apply Joseph Moran's fix correctly. # 2.41 20080518 Update the status reporting system here (sync with gtk1 version). # 2.42 20080624 Add guile-lib to build. # 2.43 20080812 Use mmdb version 1.11 # 2.44 20080815 Fix test info syntax error. # 2.45 20080818 Use mmdb version 1.12 # 2.46 20080924 Tell us in coot.txt what the source tar file was. # 2.47 20081007 Don't build python if python is not passed as arg. # Back to version 2.5.1 that compiles on bragg3, 2.5.2 does not # (port 8080 already in use). # 2.48 20081008 Migrate to CCP4 version 6.0.2 for testing in York. # 2.49 20081014 Use Python 2.6 # 2.50 20081110 Upgrade to mmdb-1.19, get it from EBI. # 2.51 20081122 Add a second test, make a holding directory for tar file before # second test is run. # 2.52 20081124 test for greg using full path to guile. # 2.53 20081127 Make file_list in post_install_slim python-dependent, like the # gtk2 version. # 2.54 20090427 Remove python and its config from bin in slimmed dir # 2.55 20090506 Upgrade to mmdb 1.21 # 2.56 20090508 add density-score-by-residue to tar ball. # 2.57 20090624 Make pre_release_server_dir be biop.ox # 2.58 20090627 Use pre_release_server_dir to set coot_version # 2.59 20090628 Don't delete build-status on my_exit. # 2.60 20090704 gtk1- prefix for the compilers dir # 2.61 20090704 mmdb-1.21 from York # 2.62 20090724 make compilers_dir depend on build_type (python build logs # split out) # 2.63 20090913 add a date to the fail status message # 2.64 20091203 release server is now in oxford. # 2.65 20091211 add libcurl to the build # 2.66 20110505 switch to new style Refmac library. # 2.67 20110507 Refmac mon lib to 5.29 script_version=2.67 # :: NOTE:: # this "strange" construction of variable names: x=${x:=thing} sets the # variable x only if it has not previously been defined. # # So, the idea is that you write a wrapper for this script (defining typically # AUTOBUILD_INSTALLED, AUTOBUILD_BUILD, LOGS and build_coot_prerelease) then # source this file. That means that you (probably) don't have to edit your # version of build-it every time it changes. # ENABLE_PYTHON_COOT: if ENABLE_PYTHON_COOT is set to 0 or "no" then # python coot is not enable (guile coot is enabled). if # ENABLE_PYTHON_COOT is set, but not set to 0 or no then python coot # is enabled. If ENABLE_PYTHON_COOT is not set, the guile-coot is # enabled (python coot is not enabled). # Pythonizing coot makes non-transferable binararies (why?). Let # the pythonness be controlled on the command line: # if [ "$1" = "python" ] ; then ENABLE_PYTHON_COOT=yes build_type=gtk1-python else ENABLE_PYTHON_COOT=no build_type=gtk1 fi # Set the host and the OS. # Fairly fundamental. # OS=`uname` HOST=`hostname` # Do we need to use a proxy server to get documents from the web? (set # to 1 if we do) use_proxy=${use_proxy:=} # if we do need a proxy then we should give the proxy host and port too: proxy_host=${proxy_host:=myproxy.com} proxy_port=${proxy_port:=800} no_proxy=${no_proxy:=".corp.net.com"} # This is where the compiled binaries/libraries/data get installed: # Note that the directory name must NOT end in a / # AUTOBUILD_INSTALLED=${AUTOBUILD_INSTALLED:=${HOME}/autobuild/${OS}-${HOST}} # or perhaps, for the adventurous: #AUTOBUILD_INSTALLED=$CCP4_MASTER # This is where the actual build (compilation) master directory is: # a temporary or scratch directory would be sensible. # # AUTOBUILD_BUILD=${HOME}/autobuild # I'm putting my build on "scratch space" AUTOBUILD_BUILD=${AUTOBUILD_BUILD:=/y/work/emsley/autobuild} # This is where the build logs go: # suggested value: # LOGS=$AUTOBUILD_BUILD/logs # but I want to put my log file on the web, so I put them here: LOGS=${LOGS:=$HOME/public_html/build-logs/${OS}-${HOST}} # set this to "no" if you don't want to compile the pre-release code. # build_coot_prerelease= build_coot_prerelease=${build_coot_prerelease:=1} # We shall we check dependencies? # # Should we look for gtk etc on the system or only in the installed # build directory? We want to do the first if we are a person using # this build script to build coot themselves and we want to do the # second to build a external-dependency-free coot build (like making # the binary tars distributed from York). # check_dependencies_in_install_only= check_dependencies_in_install_only=1 # get build specials, e.g. change the compiler or the compiler options # (e.g build for debugging), extra libraries etc setup LD_LIBRARY_DIR # (or whatever) to include the autobuild library dir so that # intermediate (configure compile) programs run and the addition to # the path of GNU make and wget. # # use this to specify config_extras # # options are: GL_prefix, e.g. SunOS has Mesa Graphics - this is # where to find them: # glut_prefix, optionally can use freeglut # # Suggested value: comment out this line specs=${specs:=$HOME/autobuild/build-scripts/${HOST}-specials} # Make nightly binary tarballs? # You probably don't want to do this, so recommended is do_nightlies=0 do_nightlies=${do_nightlies:=1} # if you do want to build them where should they go? # NIGHTLY_DEST_DIR=$AUTOBUILD_BUILD NIGHTLY_DEST_DIR=${NIGHTLY_DEST_DIR:=${HOME}/public_html/software/binaries/nightlies/pre-release} # if we are not building a nightly/pre-release, i.e. this is a binary # for a stable release, they go somewhere else: # STABLE_DEST_DIR=${STABLE_DEST_DIR:=${HOME}/public_html/software/binaries/stable} # When we fail to extract the correct tar file from the web site, what # shall we build instead? # fallback_coot_version=coot-0.1 # ---------------------------------------------------------------- # End of tinkering with parameters. # ---------------------------------------------------------------- # First, check that this is bash! # if [ "$BASH" = "" ] ; then echo this is not bash\! echo this must be run with bash\! exit fi # now the functions: function mkdir_maybe { dir=$1 if [ ! -e "$dir" ] ; then mkdir $dir fi } # Give args: prefix-dir and (based on is-static-flag) either # "clear-static" or "clear-dynamic" # # function post_install_slim { echo we are slimming directory $1 fat_dir="$1" cleaned_dir="$2" clear_type="$3" mkdir_maybe $cleaned_dir mkdir_maybe $cleaned_dir/bin mkdir_maybe $cleaned_dir/lib if [ "$ENABLE_PYTHON_COOT" = yes ] ; then mkdir_maybe $cleaned_dir/include/python$pver fi lib_sos=`cd $fat_dir && ls -1 lib/lib*.so*` lib_as=`cd $fat_dir && ls -1 lib/lib*.a` if [ "$clear_type" = "clear-dynamic" ] ; then keep_lib_archs="$lib_as" fi if [ "$clear_type" = "clear-static" ] ; then keep_lib_archs="$lib_sos" fi file_list="etc info man share bin/coot bin/coot-real \ bin/findwaters bin/findwaters-real bin/findligand bin/findligand-real \ bin/density-score-by-residue bin/density-score-by-residue-real \ bin/guile $keep_lib_archs" if [ "$ENABLE_PYTHON_COOT" = yes ] ; then # 20090427 remove python and python config from bin dir (as it # interfers with system python) file_list="$file_list lib/$python_version include/python$pver" fi echo rsyncing... for file in $file_list ; do dn=`dirname $file` if [ -e $fat_dir/$file ] ; then # echo rsync -axr $fat_dir/$file $cleaned_dir/$dn rsync -axr $fat_dir/$file $cleaned_dir/$dn else echo $file in $fat_dir does not exist, no sync. fi done } function make_tar { echo in make_tar args: $1 $2 echo in make_tar: in dir: $PWD tar_dir=$1 tar_file_name=$2 cd $install_top_dir/.. if [ -e $tar_dir ] ; then echo taring nightly... from $tar_dir to $tar_file_name echo taring nightly... from $tar_dir to $tar_file_name >&2 tar czf $tar_file_name $tar_dir status=$? if [ "$status" != 0 ] ; then echo ERROR:: tar czf $tar_file_name $tar_dir failed! echo ERROR:: tar failed > $tar_file_name.md5sum rm $tar_file_name else md5sum $tar_file_name > $tar_file_name.md5sum /bin/ls -l $tar_file_name >> $tar_file_name.md5sum echo done tar successfully. fi else echo ERROR:: tar target directory $tar_dir does not exist. echo ERROR:: tar target directory $tar_dir does not exist. >&2 fi } function ssh_copy { bin_tar_file=$1 if [ "$domainname" = "biop" ] ; then $HOME/bin/sput-with-dir $bin_tar_file public_html/software/binaries/nightlies/pre-release/ $HOME/bin/sput-with-dir $bin_tar_file.md5sum public_html/software/binaries/nightlies/pre-release/ fi } function setup_ccp4 { # we have access to $OS and $arch. if test "$OS" = Linux ; then setup_file=/y/programs/xtal/ccp4-6.0.2/ccp4-6.0.2/include/ccp4.setup-sh if test -e $setup_file ; then . $setup_file fi setup_file=/lmb/dorset/linux_software/ccp4-6.0/include/ccp4.setup-bash if test -e $setup_file ; then . $setup_file fi fi if test "$OS" = Darwin ; then . /usr/local/ccp4-6.0.2/bin/ccp4.setup-sh fi } # Return 0 on success, 1 on failure (or not tested) # # # This can only be run when the coot tar file and greg tests have been # untared (in this particular build) # # we should be in the directory where coot was untarred for building # when this function was called. # function test_coot { echo testing with greg echo currently we are here: pwd date if [ "$1" != "" ] ; then coot_binary=$1 else coot_binary=$install_top_dir/bin/coot-real fi if test "$run_tests" = true ; then # let's test our new coot # for python build we need to set COOT_PYTHON_DIR and COOT_HOME # as well as PYTHONPATH things now, because we do a "proper" # import * from coot, which needs to find coot.py the # conventional/pythonic way. If python doesn't start properly, # the greg tests fail. COOT_PYTHON_DIR=$install_top_dir/share/coot/python PYTHONPATH=$COOT_PYTHON_DIR PYTHONHOME=$install_top_dir export COOT_PYTHON_DIR export PYTHONPATH export PYTHONHOME # the greg tests are where the coot source code was untarred. # if [ ! -d greg-tests ] ; then return 1 fi setup_ccp4 cat < command-line-greg.scm (use-modules (ice-9 greg)) (set! greg-tools (list "greg-tests")) (set! greg-debug #t) (set! greg-verbose 5) (let ((r (greg-test-run))) (if r (coot-real-exit 0) (coot-real-exit 1))) EOF echo $coot_binary --no-graphics --script command-line-greg.scm $coot_binary --no-graphics --script command-line-greg.scm status=$? if [ $status = 0 ] ; then echo test_coot: coot test passed return 0 else echo test_coot: coot test failed return 1 fi else echo not running tests. return 1 fi } # Return 0 on success, 1 on failure (or not tested) # # we should be in the directory where coot was untarred for building # when this function was called. # function test_coot_python { echo testing with python unittest echo currently we are here: pwd if test "$run_tests" = true ; then # let's test our new coot # for python build we need to set COOT_PYTHON_DIR COOT_PYTHON_DIR=$install_top_dir/share/coot/python PYTHONPATH=$COOT_PYTHON_DIR PYTHONHOME=$install_top_dir export COOT_PYTHON_DIR export PYTHONPATH export PYTHONHOME echo $install_top_dir/bin/coot-real --no-graphics --script python-tests/coot_unittest.py $install_top_dir/bin/coot-real --no-graphics --script python-tests/coot_unittest.py status=$? if [ $status = 0 ] ; then echo test_coot_python: coot test passed return 0 else echo test_coot_python: coot test failed return 1 fi else return 1 fi } function my_exit { echo fail-build > $LOGS/$build_type-test-status echo fail-build > $LOGS/$build_type-build-status exit $1 } # now on to some code! if [ "$use_proxy" = 1 ] ; then # establish proxy settings printf "Proxy user: " read proxy_user printf "Proxy password: " read -s proxy_pass printf "\n" http_proxy="http://${proxy_user}:${proxy_pass}@${proxy_host}:${proxy_port}/" https_proxy="http://${proxy_user}:${proxy_pass}@${proxy_host}:${proxy_port}/" ftp_proxy="http://${proxy_user}:${proxy_pass}@${proxy_host}:${proxy_port}/" ssl_proxy="http://${proxy_user}:${proxy_pass}@${proxy_host}:${proxy_port}/" export http_proxy https_proxy ftp_proxy ssl_proxy no_proxy fi # use the right (GNU) tar and provide the path to wget (needed # for downloads) and to GNU make - (which is necesary for python # at least). # # So that python and the *-configs are found when it is installed: # A bit of a kludge because we do testing for pre-release later. # It's a logical mess. # if test "$build_coot_prerelease" = 1 ; then PATH=${AUTOBUILD_INSTALLED}-pre-release/bin:$PATH else PATH=$AUTOBUILD_INSTALLED/bin:$PATH fi PATH=$PATH:/usr/local/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin: PATH=$PATH:/etc:/usr/etc # export PATH echo PATH is now: $PATH echo AUTOBUILD_BUILD is $AUTOBUILD_BUILD # This is where the sources downloaded from network go: AUTOBUILD_SOURCES=${AUTOBUILD_BUILD}/sources echo AUTOBUILD_SOURCES is $AUTOBUILD_SOURCES if (! test -d ${AUTOBUILD_SOURCES}) ; then mkdir -p ${AUTOBUILD_SOURCES} fi # now make the build logs directory mkdir -p $LOGS shared_static_flag="--disable-shared" shared_lib_ext=so systype=unknown # malloc.h business, Darwin does not have malloc.h # used in the gtk_canvas build have_malloc=1 if test "$OS" = "Darwin" ; then have_malloc=0 fix_ulong=1 update_libtool=1 update_config_guess_sub=1 shared_static_flag="--disable-static" shared_lib_ext=dylib need_readline_patch=1 # uname -a gives processor type in last field on Darwin processor=`uname -a | awk '{print $(NF)}'` need_gtk_imlib_libtool_fix=1 if test "$processor" = "i386" ; then need_glib_getpwuid_fix=1 need_glib_poll_fix=1 need_gtk_canvas_patch=1 fi osversion=`sw_vers -productVersion` systype=MacOSX-${osversion}-${processor} fi # redirect the output. # # exec 2>&1 > $LOGS/$HOST.log # Try not to redirect standard out so that it goes to # the sub-shell log? (testing) echo INFO:: build_type is $build_type echo INFO:: redirecting std output to $LOGS/$build_type-build.log exec > $LOGS/$build_type-build.log 2>&1 echo This is script version $script_version # local tinkering because our sgi runs out of room on /tmp on compiling if [ $HOST = batman ] ; then TMPDIR=$HOME/tmp export TMPDIR fi date # if [ -n "$specs" ] ; then if [ -e "$specs" ] ; then echo running these extras: echo . -------------------------------- cat "$specs" . "$specs" echo . -------------------------------- fi fi #initially unset: if test $OS = Linux ; then architecture=`uname -i` # uname -i and uname -p (strangely) return unknown on my ubuntu if test $architecture = unknown ; then architecture=`uname -m` fi fi # now architecture is something like i386 or x86_64 # now test for 64 bit Linux: if test "$OS" = "Linux" ; then processor=`uname -a | awk '{print $NF}'` # on my Redhat i386, uname returns: # Linux kalypso 2.6.12-1.1398_FC4 #1 Fri Jul 15 00:52:32 EDT 2005 i686 athlon i386 GNU/Linux # 64 bit Ubuntu: # Linux kalypso 2.6.22-14-generic #1 SMP Sun Oct 14 21:45:15 GMT 2007 x86_64 GNU/Linux # from that I presume we need $(NF-2) to get the arch (not NF-1). Eh? # arch=`uname -a | awk '{print $(NF-1)}'` arch=`uname -a | awk '{print $(NF-1)}'` echo currently architecture is $architecture if test "$architecture" = x86_64 -o "$architecture" = ia64 ; then update_libtool=1 update_config_guess_sub=1 else echo this is not a 64 bit machine fi fi if test $OS = Linux ; then for i in fedora redhat centos ; do dist=`rpm -q --qf '%{name}' ${i}-release` if test $? = 0 ; then dist_name=`echo ${dist} | sed s/\-release//g` dist_ver=`rpm -q --qf '%{version}' ${i}-release` break else dist_name='unknown' fi done case ${dist_name} in redhat ) case ${dist_ver} in [0-9] | [0-9].[0-9]* ) systype=${architecture}-redhat-${dist_ver} ;; * ) systype=rhel-`echo ${dist_ver} | sed s/[A-Za-z]//g` ;; esac ;; fedora | centos ) systype=${architecture}-${dist_name}-${dist_ver} ;; * ) if test -r /etc/issue; then dist_name=`awk 'NR==1{print tolower($1)}' /etc/issue` dist_ver=`awk 'NR==1{print tolower($2)}' /etc/issue` systype=${architecture}-${dist_name}-${dist_ver} else systype=${architecture}-unknown-Linux fi ;; esac fi if test $OS = IRIX64 ; then osversion=`uname -r` systype=${osversion}-sgi fi if test $OS = IRIX ; then osversion=`uname -r` systype=${osversion}-sgi fi if test $OS = OSF1 ; then osversion=`uname -r | sed s/V//g` systype=${osversion}-OSF1 fi echo systype: $systype echo update_libtool: $update_libtool echo update_config_guess_sub: $update_config_guess_sub # give us some diagnostic shell information: # (what extra things did $specs give us?) # if [ "$use_proxy" = 1 ] ; then echo no diagnostic variables, we are using a proxy. else set fi # We want to add some compiler info in the directory name. # If CC is set, use that, # If not, try gcc, # if not, try cc # # Similarly for the c++ compiler info # If CXX is set, use that # if not, try g++ # if not, try c++ if [ -n "$CC" ] ; then # CC was set gcctest=`$CC --version | awk 'NR==1 {print $2}'` if [ "$gcctest" != "(GCC)" ] ; then # but not gcc v=$CC-`$CC -v` if [ $? -ne 0 ] ; then v="missing_version" fi else # gcc v=$CC-`$CC --version | awk 'NR==1 {print $3}'` fi else # CC not set v=gcc-`gcc -dumpversion | head -1` if [ $? -ne 0 ] ; then # not gcc # try cc v=cc-`cc -v` if [ $? -ne 0 ] ; then v="missing_version" fi fi fi if [ -n "$CXX" ] ; then # CXX was set gxxtest=`$CXX-$CXX --version | awk 'NR==1 {print $2}'` if [ "$gxxtest" != "(GCC)" ] ; then # but not g++ w=$CXX-`$CXX -v` if [ $? -ne 0 ] ; then w="missing_cxx_version" fi else # g++ w=$CXX-`$CXX --version | awk 'NR==1 {print $3}'` fi else # CXX not set w=g++-`g++ -dumpversion | head -1` if [ $? -ne 0 ] ; then # not g++ # try c++ w=c++-`c++ -v` if [ $? -ne 0 ] ; then # try CC w=CC-`CC -v` if [ $? -ne 0 ] ; then w="missing_c++_version" fi fi fi # note that g++ 3.2 cannot compile clipper's test_contrib.cpp. # So, if we have g++ 3.2 or less, then we need to get and apply # test_contrib.cpp.patch awk -vversion=$w 'BEGIN{ exit (version+0 >= 3.3)}' wvers=$? if [ $wvers = 0 ] ; then need_clipper_contrib_patch=true fi fi # so now we have v and w set to something. We # need to sanitize that something. v_fid=`echo $v | sed 's/ /_/g'` w_fid=`echo $w | sed 's/ /_/g'` compilers_dir=$build_type-${v_fid}_and_${w_fid} HOSTLOGDIR=$LOGS/$compilers_dir if [ ! -e $HOSTLOGDIR ] ; then mkdir -p $HOSTLOGDIR if [ $? -ne 0 ] ; then # echo DISASTER: could not make directory $HOSTLOGDIR echo exiting. my_exit 2 fi fi # need to add test that make is GNU make echo "Testing version of make" MAKE=make make --version if [ $? -ne 0 ] ; then # definately not GNU make # Try gmake then.... gmake --version if [ $? -ne 0 ] ; then nomake=1 else MAKE=gmake nomake=0 fi if [ $nomake -eq 1 ] ; then echo Ooops. Your make '(' `which make` ')' is not GNU make and gmake not found. echo Exiting now. my_exit 2 fi fi if [ ! -e "$AUTOBUILD_BUILD" ] ; then mkdir "$AUTOBUILD_BUILD" if [ $? -ne 0 ] ; then echo mkdir "$AUTOBUILD_BUILD" failed. my_exit 2 fi fi cd $AUTOBUILD_BUILD if [ $? -ne 0 ] ; then echo $AUTOBUILD_BUILD failed for some reason. Now in `pwd` fi # for ccp4 (20051104) compatibility, we can't use colons in the date string date=`date -u +'%Y-%m-%d__T%H_%M_%S'` echo Date: $date # now in $AUTOBUILD_BUILD mkdir ${HOST}_$date if [ $? -ne 0 ] ; then echo mkdir ${HOST}_$date failed for some reason. Now in `pwd` fi cd ${HOST}_$date if [ $? -ne 0 ] ; then echo cd ${HOST}_$date failed for some reason. Now in `pwd` fi build_dir=`pwd` echo checking wget echo which wget which wget wget "http://www.ysbl.york.ac.uk/~emsley/build-logs/build-notes" if [ $? -ne 0 ] ; then echo wget failed for some reason echo exiting now. my_exit 1 else echo Done wget check. WGET="wget -N -P ${AUTOBUILD_SOURCES}" fi # latest version (without .tar.gz extension) coot_version=$fallback_coot_version pre_release_server_dir=http://www.ysbl.york.ac.uk/~emsley/software/pre-release/ pre_release_server_dir=http://www.biop.ox.ac.uk/coot/software/source/pre-releases/ release_server_dir=http://www.ysbl.york.ac.uk/~emsley/software/ release_server_dir=http://www.biop.ox.ac.uk/coot/software/source/releases/ ${WGET} -O ${AUTOBUILD_SOURCES}/index.html -o ${AUTOBUILD_SOURCES}/wget-e.s.p.log $release_server_dir ${WGET} -O ${AUTOBUILD_SOURCES}/index-pre-release.html -o ${AUTOBUILD_SOURCES}/wget-e.s.p.log $pre_release_server_dir pre_release_files_html="" if [ $build_coot_prerelease = 1 ] ; then pre_release_files_html=${AUTOBUILD_SOURCES}/index-pre-release.html fi if [ $build_coot_prerelease = yes ] ; then pre_release_files_html=${AUTOBUILD_SOURCES}/index-pre-release.html fi coot_version_tmp=`egrep href ${AUTOBUILD_SOURCES}/index.html $pre_release_files_html | sed -e 's/.*">//' -e 's/<.*//' | awk ' BEGIN {bmajor = -1; bminor = -1; bmicro = -1; } # /^coot-[0-9]\.[0-9]+\.[0-9]+.*\.tar\.gz/ { /^coot-[0-9]\.[0-9]+.*\.tar\.gz$/ { n = split($1,arr,"[-.]"); # print n,"parts"; # print arr[1], arr[2], arr[3], arr[4]; # print arr[5], arr[6], arr[7], arr[8]; major = arr[2] + 0; minor = arr[3] + 0; micro = arr[4] + 0; # print "testing best:",file, bmajor, bminor, bmicro,"vs. this:", major, minor, micro if (major > bmajor) { file = $1; bmajor = major; bminor = minor; bmicro = micro; } else { if (major == bmajor) { if (minor > bminor) { file = $1; bmajor = major; bminor = minor; bmicro = micro; } else { if (minor == bminor) { if (micro >= bmicro) { file = $1; bmajor = major; bminor = minor; bmicro = micro; } } } } } } END { gsub(".tar.gz.*", "", file); print file; # which is a version now. } '` if [ -z "$coot_version_tmp" ] ; then echo clever coot_version extraction failed, using default. else coot_version=$coot_version_tmp echo setting coot_version to $coot_version from extraction fi # are we doing a pre-release in York? # # problem here? generic_prefix is not yet set. What happens to coot_prefix? # domainname=`domainname` coot_prefix= if [ "$domainname" = "yorksbl" ] ; then # we are in York, let's try the pre-release coot... echo we are in York run_tests=true build_coot_prerelease=1 fi if [ "$domainname" = "biop" ] ; then run_tests=true build_coot_prerelease=1 fi # override the switch which turns off the building of the pre-release here: # build_coot_prerelease=1 # Let's initially set coot_prerelease_exists to not-exist, then we # try to download it from the Coot web site, and if it exists we set # coot_prerelease_exists to 1. If it doesn't exist, we don't do that # of course and we also don't make the install_top_dir to be the pre-release # directory later on. coot_prerelease_exists= if test "$build_coot_prerelease" = 1 ; then ${WGET} -O ${AUTOBUILD_SOURCES}/index.html -o ${AUTOBUILD_SOURCES}/wget-e.s.p.log $pre_release_server_dir coot_version_pre=`egrep href ${AUTOBUILD_SOURCES}/index.html | sed -e 's/.*">//' -e 's/<.*//' | awk ' /^coot-[0-9]\.[0-9]+.*-pre.*\.tar\.gz$/ { last=$0 } END { print last } '` echo INFO:: building pre-release and coot_version_pre is $coot_version_pre if [ -z "$coot_version_pre" ] ; then echo trying to build pre-release coot, but failed to find pre-release version BINARY_TAR_DEST_DIR=$STABLE_DEST_DIR else build_coot_prerelease=1 # belt and braces coot_prerelease_exists=1 # tinker with coot_prefix, it is generic_prefix with pre-release added to prefix dir coot_prefix="--prefix=${AUTOBUILD_INSTALLED}-pre-release ${config_extras:-}" coot_source_tar_file=$pre_release_server_dir/$coot_version_pre coot_version=`echo $coot_version_pre | sed s/\.tar.gz//` BINARY_TAR_DEST_DIR=$NIGHTLY_DEST_DIR mkdir -p ${NIGHTLY_DEST_DIR} mkdir -p ${BINARY_TAR_DEST_DIR}/holding echo INFO:: set the target destination for binary tar file \(BINARY_TAR_DEST_DIR\) to $NIGHTLY_DEST_DIR fi else # this is a stable release BINARY_TAR_DEST_DIR=$STABLE_DEST_DIR mkdir -p ${BINARY_TAR_DEST_DIR} mkdir -p ${BINARY_TAR_DEST_DIR}/holding fi echo INFO:: binary tar destination dir: BINARY_TAR_DEST_DIR is $BINARY_TAR_DEST_DIR # set the build prefix for installed stuff. Put everything in the # pre-release directory if we are building a pre-release. # (Perhaps this bit of code should go down lower, where we test # build_coot_prerelease again # # we need install_top_dir because we use it to copy over coot.py # to the install python directory. # if [ "$build_coot_prerelease" = 1 ] ; then if [ "$coot_prerelease_exists" = 1 ] ; then if [ $ENABLE_PYTHON_COOT = yes ] ; then generic_prefix="--prefix=${AUTOBUILD_INSTALLED}-pre-release-python ${config_extras:-}" coot_prefix="$generic_prefix" install_top_dir=${AUTOBUILD_INSTALLED}-pre-release-python else generic_prefix="--prefix=${AUTOBUILD_INSTALLED}-pre-release ${config_extras:-}" coot_prefix="$generic_prefix" install_top_dir=${AUTOBUILD_INSTALLED}-pre-release fi else # don't use pre-release if [ $ENABLE_PYTHON_COOT = yes ] ; then generic_prefix="--prefix=$AUTOBUILD_INSTALLED-python ${config_extras:-}" coot_prefix="$generic_prefix" install_top_dir=${AUTOBUILD_INSTALLED}-python else generic_prefix="--prefix=$AUTOBUILD_INSTALLED ${config_extras:-}" coot_prefix="$generic_prefix" install_top_dir=${AUTOBUILD_INSTALLED} fi fi else # not pre-release if [ $ENABLE_PYTHON_COOT = yes ] ; then generic_prefix="--prefix=$AUTOBUILD_INSTALLED ${config_extras:-}" install_top_dir=${AUTOBUILD_INSTALLED} coot_prefix="$generic_prefix" else generic_prefix="--prefix=$AUTOBUILD_INSTALLED ${config_extras:-}" install_top_dir=${AUTOBUILD_INSTALLED} coot_prefix="$generic_prefix" fi fi PATH=$install_top_dir/bin:$PATH installed_check_maybe_prefix= if [ "$check_dependencies_in_install_only" = 1 ] ; then installed_check_maybe_prefix=$install_top_dir/bin/ fi # we need to export this for net-http, because it doesn't set # variables from configure, we rely on a shell (environment) variable. export install_top_dir echo testing for install_top_dir: "$install_top_dir" if [ ! -e "$install_top_dir" ] ; then echo $install_top_dir does not exist echo making directory $install_top_dir mkdir -p $install_top_dir if [ $? -ne 0 ] ; then echo DISASTER: $install_top_dir does not exist and no way echo to make it. my_exit 2 fi else echo INFO:: $install_top_dir exists already. fi echo done testing for $install_top_dir if [ ! -e "$install_top_dir/lib" ] ; then echo making "$install_top_dir/lib" mkdir -p "$install_top_dir/lib" if [ $? -ne 0 ] ; then echo DISASTER: $install_top_dir/lib cannot be created echo to make it. my_exit 2 fi fi # # append or set LD_LIBRARY_PATH # if [ -z "$LD_LIBRARY_PATH" ] ; then LD_LIBRARY_PATH=$install_top_dir/lib else LD_LIBRARY_PATH=$install_top_dir/lib:$LD_LIBRARY_PATH fi export LD_LIBRARY_PATH #for Macs: if [ -z "$LD_LIBRARY_PATH" ] ; then DYLD_LIBRARY_PATH=$install_top_dir/lib else DYLD_LIBRARY_PATH=$install_top_dir/lib:$LD_LIBRARY_PATH fi export DYLD_LIBRARY_PATH # # IRIX64 (on batman at least) does not seem to use LD_LIBRARY_PATH, # it uses, instead, LD_LIBRARYN32_PATH. So we set that for all # systems, hoping that it won't do any harm on other systems. # # LD_LIBRARYN32_PATH=$LD_LIBRARY_PATH export LD_LIBRARYN32_PATH # ccp4_system_type can be one of the following # irix irix64 sunos sunos64 aix hpux osf1 linux freebsd # linux_compaq_compilers linux_intel_compilers generic Darwin # ia64_linux_intel Darwin_ibm_compilers linux_ibm_compilers ccp4_system_type="$OS" if test "$OS" = Linux ; then ccp4_system_type=linux else if test "$OS" = IRIX64 ; then ccp4_system_type=irix64 else if test "$OS" = IRIX ; then ccp4_system_type=irix else if test "$OS" = Darwin ; then ccp4_system_type=Darwin fi fi fi fi echo ccp4_system_type $ccp4_system_type # clean up old status: if [ -e $LOGS/$build_type-test-status ] ; then echo build-in-progress @`date +"%a_%d_%b_%H:%M"` > $LOGS/$build_type-test-status echo waiting for build > $LOGS/$build_type-build-status fi # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # which components? # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # # Often there are components provided by the operating system or optional # installs thereof. # build_mmdb=0 build_ssmlib=0 build_fftw=0 build_mccp4=0 build_python=0 build_clipper=0 build_glib=0 build_gtk=0 build_guile=0 build_guile_www=0 build_guile_gui=0 build_guile_goosh=0 build_readline=0 build_net_http=0 build_gsl=0 build_libungif=0 build_libtiff=0 build_libjpeg=0 build_libpng=0 build_imlib=0 build_gtk_canvas=0 build_guile_gtk=0 build_gtkglarea=0 build_freeglut=0 # Where might the "system" components be? # non_standard_dir_list="/usr/freeware /sw /opt/gnome $install_top_dir" dir_list="/usr /usr/X11R6 /usr/local $non_standard_dir_list" # fftw # We can eventually get fancy on this... but then clipper configure # needs changing. # The test is -n, i.e. a non-zero string length to build things. # # We need to test the $AUTOBUILD_INSTALLED directory for fftw because any # other place could quite well have the fftw that is compiled with doubles. # if test -e $install_top_dir/include/fftw.h ; then echo installation has fftw build_fftw= fi if test -n "$build_fftw" ; then echo fftw should be built build_fftw=1 fi if [ -e $install_top_dir/include/curl/curl.h ] ; then echo installation has curl/libcurl else build_curl=1 fi if [ -e /usr/lib/libidn.so ] ; then echo system has libidn devel else if [ -e $install_top_dir/lib/libidn.so ] ; then echo installation has libidn devel else # set it up for building then build_libidn=1 fi fi # glib echo INFO:: running ${installed_check_maybe_prefix}glib-config --prefix ${installed_check_maybe_prefix}glib-config --prefix if test $? != 0 ; then echo glib should be built build_glib=1 else if test -e $install_top_dir/include/glib-1.2/glib.h ; then echo installation has glib glib_installed=1 else echo system has glib fi build_glib= fi # gtk # So here's a question: should we look for gtk on the system or only # in the installed build directory? We want to do the first if we are # a general person using this build script to build coot themselves # and we want to do the second to build a external-dependency-free # coot build. echo INFO:: running ${installed_check_maybe_prefix}gtk-config --prefix ${installed_check_maybe_prefix}gtk-config --prefix if test $? != 0 ; then echo gtk should be built build_gtk=1 else echo Found GTK from `which gtk-config` if test -e $install_top_dir/include/gtk-1.2/gtk/gtkruler.h ; then echo installation has gtk gtk_installed=1 else echo system has gtk fi build_gtk= fi # freeglut # for dir in ${dir_list} ; do if test -e ${install_top_dir}/include/GL/freeglut_std.h ; then echo installation has Freeglut build_freeglut= glut_prefix="--with-glut-prefix=${install_top_dir}" fi # done if test -n "$build_freeglut" ; then echo freeglut should be built build_freeglut=1 glut_prefix="--with-glut-prefix=$install_top_dir" fi build_readline=1 # # guile dependency readline. chihiro has bad build in # guile-1.6.7/guile-readline/readline.c:107 'rl_pending_input' undeclared # So installation needs to build readline (sigh). # if test -e ${install_top_dir}/include/readline/chardefs.h ; then build_readline= fi if test -z "$build_readline" ; then echo installation has readline else echo readline needs to be built fi # Darwin currently has guile-1.6 and guile (which is an older version) # we want to use guile-1.6 if it exists. echo guile-1.6-config will fail on non-fink non-mac systems guile-1.6-config --version if test $? = 0 ; then echo linking in fink 1.6 guile... rm -f $install_top_dir/bin/guile rm -f $install_top_dir/bin/guile-config rm -f $install_top_dir/bin/guile-snarf ln -s /sw/bin/guile-1.6 $install_top_dir/bin/guile ln -s /sw/bin/guile-1.6-config $install_top_dir/bin/guile-config ln -s /sw/bin/guile-1.6-snarf $install_top_dir/bin/guile-snarf fi echo atempting to run installed guile-config \(this may fail\). $install_top_dir/bin/guile-config --version if test $? != 0 ; then echo guile should be built build_guile=1 else # We have a seen a situation somehow where bin/guile-config is installed # but include/libguile.h is not. Strange. Let's test for libguile.h too. if test -e $install_top_dir/include/libguile.h ; then echo installation has guile build_guile= else echo no include/libguile.h. guile should be built build_guile=1 fi fi # guile-gui if test -f $install_top_dir/share/guile/gui/paren-match.scm ; then echo installation has guile-gui build_guile_gui= else echo guile-gui needs to be installed build_guile_gui=1 fi # goosh if test -f $install_top_dir/share/guile/site/goosh.scm ; then echo installation has goosh build_guile_goosh= else build_guile_goosh=1 echo guile goosh needs to be installed fi # guile-lib if test -f $install_top_dir/share/guile/site/sxml/simple.scm ; then echo installation has guile-lib build_guile_lib= else build_guile_lib=1 echo guile-lib needs to be installed fi # net http: if test -f $install_top_dir/share/guile/site/net/http/server.scm ; then echo installation has net-http: build_net_http= else echo net-http needs to be installed build_net_http=1 fi # do we have greg? # LD_LIBRARY_PATH has been set by now $install_top_dir/bin/guile -c '(use-modules (ice-9 greg))' status=$? if test $status = 0 ; then echo installation has greg build_greg= else echo greg should be built build_greg=1 fi if [ $ENABLE_PYTHON_COOT = yes ] ; then $install_top_dir/bin/python -V if test $? != 0 ; then echo python should be built build_python=1 else echo installation has python build_python= fi else echo not enabling python build. build_python= fi # force the GSL config to be in $install_top_dir, rather than # potenially getting it from the system # but does this compile cleanly on Mac OS X? I've forgotten. # Perhaps we will need to be more clever and potentially use # the fink GSL if it is available. $install_top_dir/bin/gsl-config --prefix if test $? != 0 ; then echo gsl should be built build_gsl=1 else gsl_version=`gsl-config --version` needed_gsl_version=1.3 build_gsl=`awk -v A=$gsl_version -v N=$needed_gsl_version 'BEGIN{x = (A+0)>(N+0) ? 0 : 1; print x}'` echo system/installation has the GSL version $gsl_version echo build_gsl is $build_gsl if [ $build_gsl = 1 ] ; then echo need to build GSL build_gsl=1 else echo GSL is up to date # set build_gsl to blank: build_gsl= fi fi # ############################################################## # wretched imlib # ############################################################## # libungif dependency if test -e ${install_top_dir}/include/gif_lib.h ; then echo system has libungif build_libungif= else echo libungif should be built build_libungif=1 fi if [ -e $install_top_dir/include/tiff.h ] ; then build_libtiff= echo installation has libtiff else echo libtiff should be built build_libtiff=1 fi if [ -e $install_top_dir/include/jpeglib.h ] ; then if [ -e $install_top_dir/lib/libjpeg.$shared_lib_ext ] ; then build_libjpeg= echo installation has libjpeg else echo libjpeg should be built - no shared lib build_libjpeg=1 fi else echo libjpeg should be built build_libjpeg=1 fi if [ -e $install_top_dir/include/png.h ] ; then build_libpng= echo installation has PNG else echo libpng should be built build_libpng=1 fi $install_top_dir/bin/imlib-config --version if test $? != 0 ; then echo imlib should be built build_imlib=1 else echo installation has imlib already build_imlib= fi # ############################################################## # Gtk Canvas # ############################################################## # gtk canvas # We don't check the system for gtk-canvas, just the installation. # (this means that the builder makes gtk-canvas and it is not # an irritating fink dependency for Mac users) if test -e "$install_top_dir/include/gtk-canvas.h" ; then echo installation has gtk-canvas build_gtk_canvas= fi if test -n "${build_gtk_canvas}" ; then echo gtk-canvas should be built build_gtk_canvas=1 fi # guile-gtk, only look in installation, not system. for dir in ${install_top_dir} ; do if test -e "${dir}/include/guile-gtk.h" ; then echo installation has guile-gtk build_guile_gtk= fi done if test -n "${build_guile_gtk}" ; then echo guile-gtk should be built build_guile_gtk=1 fi # gtkglarea for dir in $dir_list do if test -e "${dir}/include/gtkgl/gtkglarea.h" ; then echo gtkglarea test: found "${dir}/include/gtkgl/gtkglarea.h" have_gtkglarea=1 fi done gtkglarea_prefix="" for dir in $non_standard_dir_list do if test -e $dir/include/gtkgl/gtkglarea.h ; then gtkglarea_prefix="--with-gtkgl-prefix=$dir" fi done echo gtkglarea_prefix is $gtkglarea_prefix if test -z "$have_gtkglarea" ; then echo gtkglarea should be built build_gtkglarea=1 gtkglarea_prefix="--with-gtkgl-prefix=$install_top_dir" else echo system has gtkglarea build_gtkglarea= fi # test for mmdb: Does mmdb_file.h exist, and if it does, does it # contain MMDBF_IgnoreHash. If not, then build mmdb. # # CCP4 mmdb installs in the include/mmdb directory, but mmdb-1.0.8 # installs just in include (I prefer the CCP4 way and the mmdb-1.0.8 # should be fixed at some stage). # # 20060801 mmdb has indeed been updated at the prompting of Lynn Ten Eyck. # so now we assign mmdb_inc_sub_dir to be mmdb not blank. # mmdb_inc_sub_dir="mmdb" # if test -e "${install_top_dir}/include/$mmdb_inc_sub_dir/mmdb_file.h" ; then grep MMDBF_IgnoreHash ${install_top_dir}/include/$mmdb_inc_sub_dir/mmdb_file.h if [ "$?" = "0" ] ; then echo mmdb should not be built build_mmdb= else echo INFO:: mmdb installed, but MMDBF_IgnoreHash test fails, rebuilding mmdb. build_mmdb=1 fi else echo installation has no mmdb, build mmdb. build_mmdb=1 fi if [ -e $install_top_dir/include/ssm_align.h ] ; then if [ "$build_mmdb" = 1 ] ; then build_ssmlib=1 else echo SSMlib should not be built build_ssmlib= fi else build_ssmlib=1 fi # clipper depends on mmdb, so if mmdb was built, the so must clipper. # likewise for fftw. # build_clipper=1 if [ -z "$build_mmdb" ] ; then # we potentially can pass the building of clipper: echo INFO:: shall we build clipper: mmdb not to be built if [ -z "$build_fftw" ] ; then echo INFO:: shall we build clipper: fftw not to be built # test for new ccp4-based clipper (for mtz and maps) if [ -e $install_top_dir/include/clipper/ccp4/ccp4_mtz_io.h ] ; then echo $install_top_dir/include/clipper/ccp4/ccp4_mtz_io.h exist if [ -e $install_top_dir/include/clipper/contrib/sfscale.h ] ; then echo $install_top_dir/include/clipper/contrib/sfscale.h exist build_clipper= else echo $install_top_dir/include/clipper/contrib/sfscale.h not exist, building clipper build_clipper=1 fi else echo $install_top_dir/include/clipper/ccp4/ccp4_mtz_io.h not exist, building clipper fi fi else echo mmdb needs to be built, so clipper needs building. fi # shall we build libccp4c? if [ -e $install_top_dir/lib/libccp4c.la ] ; then if [ -e $install_top_dir/include/ccp4/cmtzlib.h ] ; then # no need to rebuild build_ccp4c= else build_ccp4c=1 fi else build_ccp4c=1 fi # Here we can force the building of clipper because we don't # know if the dependency libccp4c.la was from 6.0 or 5.0.2 # But, let's not do that any more. # build_clipper= # build_ccp4c= # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # build components # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # # libccp4c: if test -n "$build_ccp4c" ; then echo BUILDING: libccp4c echo BUILDING: libccp4c >&2 ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libccp4c-5.0.2-ysbl-2.tar.gz ( date gzip -dc ${AUTOBUILD_SOURCES}/libccp4c-5.0.2-ysbl-2.tar.gz | tar xf - cd libccp4c-5.0.2-ysbl-2 ./configure $generic_prefix $MAKE $MAKE install ) 2>&1 > $HOSTLOGDIR/01-libccp4c.txt else echo not building libccp4c: fi # # mmdb # # # mmdb # if test -n "$build_mmdb" ; then echo BUILDING mmdb: echo BUILDING: mmdb >&2 # # mmdb_version=1.0.10. Not yet. mmdb_version=1.0.8-ysbl-3 mmdb_version=1.11 mmdb_version=1.12 mmdb_version=1.19 mmdb_version=1.21 mmdb_version=1.23 ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/mmdb-$mmdb_version.tar.gz # this patch is badly formed. # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/mmdb-mmcif-long-line.patch # ${WGET} http://www.ebi.ac.uk/~keb/cldoc/downloads/mmdb-${mmdb_version}.tar.gz # for now get mmdb-1.21 from york, the ebi one has out of date files causing # problems on make ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/mmdb-$mmdb_version.tar.gz ( date gzip -dc ${AUTOBUILD_SOURCES}/mmdb-$mmdb_version.tar.gz | tar xf - cd mmdb-$mmdb_version # patch to read long lines in a cif file # patch -p0 < ../mmdb-mmcif-long-line.patch, commented out see above ./configure $generic_prefix $MAKE $MAKE install # now remove the mmdb binaries! ) 2>&1 > $HOSTLOGDIR/02-mmdb.txt else echo not building mmdb: fi if test -n "$build_ssmlib" ; then echo BUILDING SSMlib: # # wget http://www.ysbl.york.ac.uk/~emsley/software/extras/SSMlib-0.0-pre-1-ysbl.tar.gz ssmlib_version=0.0-pre-2-ysbl ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/SSMlib-$ssmlib_version.tar.gz ( date gzip -dc ${AUTOBUILD_SOURCES}/SSMlib-$ssmlib_version.tar.gz | tar xf - cd SSMlib-$ssmlib_version ./configure $generic_prefix --with-mmdb-prefix=$install_top_dir $MAKE $MAKE install ) > $HOSTLOGDIR/02-ssmlib.txt 2>&1 else echo not building ssmlib: fi # fftw if test -n "$build_fftw" ; then echo BUILDING fftw: # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/fftw-2.1.5.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/fftw-configure-stuff.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/fftw-2.1.5.tar.gz | tar xf - gzip -dc ${AUTOBUILD_SOURCES}/fftw-configure-stuff.tar.gz | tar xf - cd fftw-2.1.5 ./configure $generic_prefix --enable-shared --enable-float $MAKE $MAKE install ) > $HOSTLOGDIR/03-fftw.txt 2>&1 else echo not building fftw: fi # # clipper # # # # # # Note clipper (currently installs in current directory) # # if test -n "$build_clipper" ; then # clipper: we use the ccp4 version of clipper now. # (it uses configure, not scons) # echo BUILDING clipper: clipper_version=2.1-081201-ac clipper_version=2.1-090210-ac clipper_version=2.1-090520-ac clipper_dir_version=2.1 ${WGET} http://www.ysbl.york.ac.uk/~cowtan/clipper/clipper-$clipper_version.tar.gz if [ "$need_clipper_contrib_patch" = true ] ; then ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/clipper_test_contrib.cpp.patch fi ( gzip -dc ${AUTOBUILD_SOURCES}/clipper-$clipper_version.tar.gz | tar xf - cd clipper-$clipper_dir_version # make clipper echo . ------------------------------------------------------------------------------ echo . " clipper " echo . ------------------------------------------------------------------------------ if [ "$need_clipper_contrib_patch" = true ] ; then patch -p0 < ${AUTOBUILD_SOURCES}/clipper_test_contrib.cpp.patch fi ./configure --prefix=$install_top_dir \ --with-fftw=$install_top_dir \ --with-mmdb=$install_top_dir \ --with-ccp4=$install_top_dir \ --enable-shared \ --enable-mmdb \ --enable-cif \ --enable-ccp4 \ --enable-minimol \ --enable-cns \ CCP4_CXXFLAGS=-I$install_top_dir/include CCP4_LIBS=$install_top_dir/lib/libccp4c.la \ CXXFLAGS="-g -O2 -fno-strict-aliasing" # we don't want to make the clipper executables, so let's cd in to the clipper libs and # make (just) those. $MAKE status=$? clipper_status=$status if [ "$clipper_status" != 0 ] ; then echo make of clipper failed - exit 2 from internal shell. exit 2 else $MAKE install fi ) > $HOSTLOGDIR/04-clipper.txt 2>&1 clipper_build_status=$? if [ $clipper_build_status != 0 ] ; then echo clipper build failed, exiting my_exit 2 fi else echo not building clipper: fi # freeglut if test -n "$build_freeglut" ; then echo BUILDING freeglut: ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/freeglut-2.4.0.tar.gz ( date pwd save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I/usr/X11R6/include" export CFLAGS gzip -dc ${AUTOBUILD_SOURCES}/freeglut-2.4.0.tar.gz | tar xf - cd freeglut-2.4.0 ./configure $generic_prefix --disable-warnings build_status=$? echo INFO:: freeglut configure status $build_status if [ $build_status -eq 0 ] ; then $MAKE build_status=$? echo INFO:: freeglut make status $build_status if [ $build_status -eq 0 ] ; then echo INFO:: freeglut make installing... $MAKE install glut_prefix="--with-glut-prefix=$install_top_dir" echo INFO:: setting glut_prefix to $glut_prefix fi fi CFLAGS="$save_CFLAGS" export CFLAGS ) > $HOSTLOGDIR/05-freeglut.txt 2>&1 else echo not building freeglut: fi # glib # if test -n "$build_glib" ; then echo BUILDING glib: # ${WGET} http://ftp.gtk.org/pub/gtk/v1.2/glib-1.2.10.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/glib-gstrfuncs.c-patch ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltmain.sh-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltconfig-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.guess-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.sub-fink ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/glib-1.2.10.tar.gz | tar xf - cd glib-1.2.10 patch -p0 < ${AUTOBUILD_SOURCES}/glib-gstrfuncs.c-patch if test -n "$update_libtool" ; then cp ${AUTOBUILD_SOURCES}/ltmain.sh-fink ltmain.sh cp ${AUTOBUILD_SOURCES}/ltconfig-fink ltconfig fi if test -n "$update_config_guess_sub" ; then cp ${AUTOBUILD_SOURCES}/config.guess-fink config.guess cp ${AUTOBUILD_SOURCES}/config.sub-fink config.sub fi if [ "$need_glib_poll_fix" = 1 ] ; then # perl -pi -e 's/HAVE_POLL/NO_POLL_HERE/g' gmain.c sed -e 's/HAVE_POLL/NO_POLL_HERE/g' gmain.c > gmain.c.tmp mv gmain.c.tmp gmain.c fi ./configure $generic_prefix if [ "$need_glib_getpwuid_fix" = 1 ] ; then # perl -pi.bak -e 's/HAVE_GETPWUID_R/HAVE_NOTHING_IMPORTANT/g' config.h sed -e 's/HAVE_GETPWUID_R/HAVE_NOTHING_IMPORTANT/g' config.h > config.h.tmp mv config.h.tmp config.h fi $MAKE $MAKE install ) > $HOSTLOGDIR/06-glib.txt 2>&1 else echo not building glib: fi # # Note that gtk+ depends on glib, so we need to tell gtk+ where the # version of glib (that we just built) has been installed. # So, we tinker with the configure prefixes and also need to add # the location of the shared lib to LD_LIBRARY_PATH. We add at the # beginning so that it finds our new lib first. # # glib_extras=--with-glib-prefix=$install_top_dir gtk_prefixes="$generic_prefix $glib_extras" # shared mem for Gtk doesn't work: if [ "$OS" = "Darwin" ] ; then gtk_prefixes="$gtk_prefixes --disable-shm" gtk_envs="CPPFLAGS='-no-cpp-precomp -DUSE_NATIVE_LOCALE=1'" fi if [ -z "$LD_LIBRARY_PATH" ] ; then LD_LIBRARY_PATH=$install_top_dir/lib else LD_LIBRARY_PATH=$install_top_dir/lib:$LD_LIBRARY_PATH fi export LD_LIBRARY_PATH # # IRIX64 (on batman at least) does not seem to use LD_LIBRARY_PATH, # it uses, instead, LD_LIBRARYN32_PATH. So we set that for all # systems, hoping that it won't do any harm on other systems. # # LD_LIBRARYN32_PATH=$LD_LIBRARY_PATH export LD_LIBRARYN32_PATH # gtk+ # if test -n "$build_gtk" ; then echo BUILDING gtk+: # ${WGET} http://ftp.gtk.org/pub/gtk/v1.2/gtk+-1.2.10.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/gtk+-1.2.10.tar.gz | tar xf - cd gtk+-1.2.10 echo Using LD_LIBRARY_PATH $LD_LIBRARY_PATH echo Using LD_LIBRARYN32_PATH $LD_LIBRARYN32_PATH if test -n "$update_libtool" ; then cp ${AUTOBUILD_SOURCES}/ltmain.sh-fink ltmain.sh cp ${AUTOBUILD_SOURCES}/ltconfig-fink ltconfig fi if test -n "$update_config_guess_sub" ; then cp ${AUTOBUILD_SOURCES}/config.guess-fink config.guess cp ${AUTOBUILD_SOURCES}/config.sub-fink config.sub fi # Urgh. There is some problem with quoting gtk_envs and it turns out # that we can't do it this way (baah) # [bash: CPPFLAGS='-no-cpp-precomp: command not found] # # So, let's make a hack where we set gtk_envs on the line before then # clean up aftewards # if [ -z "$gtk_envs" ] ; then echo ./configure $gtk_prefixes ./configure $gtk_prefixes else # is macintosh. need gtk_envs to configure gtk+: # echo $gtk_envs ./configure $gtk_prefixes echo setting CPPFLAGS='-no-cpp-precomp -DUSE_NATIVE_LOCALE=1' CPPFLAGS='-no-cpp-precomp -DUSE_NATIVE_LOCALE=1' echo ./configure $gtk_prefixes ./configure $gtk_prefixes unset CPPFLAGS fi $MAKE status=$? if [ "$status" != 0 ] ; then echo make of gtk+ failed echo make of gtk+ failed >&2 else $MAKE install fi $MAKE install ) > $HOSTLOGDIR/06-gtk+.txt 2>&1 # else echo not building gtk+: fi # So that python is found when it is installed: # PATH=$install_top_dir/bin:$PATH export PATH # python # python_version=python2.6 pver=2.6 if test -n "$build_python" ; then echo BUILDING ${python_version}: ${WGET} http://www.python.org/ftp/python/$pver/Python-$pver.tgz ( date gzip -dc ${AUTOBUILD_SOURCES}/Python-$pver.tgz | tar xf - cd Python-$pver echo INFO:: ./configure $generic_prefix $python_spec_flags for python ./configure $generic_prefix $python_spec_flags echo INFO:: make for python $MAKE echo INFO:: make install for python $MAKE install ) > $HOSTLOGDIR/05-python.txt 2>&1 # We need these otherwise python moans about not finding the libraries. # echo setting PYTHONHOME PYTHONHOME=$install_top_dir export PYTHONHOME echo PYTHONHOME is now $PYTHONHOME echo post linking python from $python_version # if [ ! -e $install_top_dir/bin/$python_version ] ; then echo Oops\! $python_version does not exist. # only python dependencies from now on echo exiting... my_exit 2 fi if [ -e $install_top_dir/bin/python ] ; then echo removing old python rm $install_top_dir/bin/python fi current_dir=`pwd` cd $install_top_dir/bin echo linking new... ln -s $python_version python if [ $? -ne 0 ] ; then echo Opps: failed: ln -s $install_top_dir/bin/$python_version \ $install_top_dir/bin/python fi cd $current_dir echo done python linking. # now we have "python" in our path - no need to rehash - # clever old Bourne shell (or do I mean bash?). else echo not building python: fi echo scons - placeholder only > $HOSTLOGDIR/06-scons.txt # # scons # echo BUILDING scons: # wget http://jaist.dl.sourceforge.net/sourceforge/scons/scons-0.96.1.tar.gz # ( # date # pwd # gzip -dc scons-0.96.1.tar.gz | tar xf - # cd scons-0.96.1/ # python setup.py install # ) > $HOSTLOGDIR/06-scons.txt 2>&1 # Now we need: # * gtkglarea # * libart_lgpl # * gtkcanvas # * guile # * guile-www # * guile-gtk # * guile-gui # * goosh # * gsl if test -n "$build_libungif" ; then echo BUILDING libungif: # libungif_version=4.1.4 ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libungif-$libungif_version.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/libungif-$libungif_version.tar.gz | tar xf - cd libungif-$libungif_version if test "${OS}" = "IRIX" || test "${OS}" = "IRIX64" ; then for i in `find . -name Makefile.in -print` ; do sed s/\-Wall//g < ${i} > ${i}.new mv -f ${i}.new ${i} done fi ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/08-libungif.txt 2>&1 else echo not building libungif: fi if test -n "$build_libjpeg" ; then echo BUILDING libjpeg: ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltmain.sh-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltconfig-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.guess-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.sub-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/jpegsrc.v6b.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/jpegsrc.v6b.tar.gz | tar xf - cd jpeg-6b # This does not compile on G5 ppc Darwin # and update_libtool and update_config_guess_sub are not set # for that architecture. So, force update of libtool and configs # for everything. Should do no harm. We shall see cp ${AUTOBUILD_SOURCES}/ltmain.sh-fink ltmain.sh cp ${AUTOBUILD_SOURCES}/ltconfig-fink ltconfig cp ${AUTOBUILD_SOURCES}/config.guess-fink config.guess cp ${AUTOBUILD_SOURCES}/config.sub-fink config.sub echo ./configure $generic_prefix --enable-shared --enable-static ./configure $generic_prefix --enable-shared --enable-static $MAKE # libjpeg's make install is pathetic. We have to pre-make the directories the files # are installed into. mkdir $install_top_dir/lib mkdir $install_top_dir/include mkdir $install_top_dir/bin mkdir $install_top_dir/man mkdir $install_top_dir/man/man1 $MAKE install # jpeg has a funny installation system $MAKE install-lib ) > $HOSTLOGDIR/08-libjpeg.txt else echo not building libjpeg: fi # now test for libjpeg.so, exit if not there: if [ -e $install_top_dir/lib/libjpeg.$shared_lib_ext ] ; then echo good, libjpeg.$shared_lib_ext exists else echo error, $install_top_dir/lib/libjpeg.$shared_lib_ext does not exist my_exit 1 fi # tiff, now *after* libjpeg, since tiff is dependent on jpeg. if test -n "$build_libtiff" ; then echo BUILDING libtiff: tiff_version=3.8.2 ${WGET} ftp://ftp.remotesensing.org/pub/libtiff/tiff-$tiff_version.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/tiff-$tiff_version.tar.gz | tar xf - cd tiff-$tiff_version # ./configure $generic_prefix # Lynn Ten Eyck says that libtiff will find jpeg libs # if it can find them. # So let's give it them. ./configure $generic_prefix --with-jpeg-include-dir=$install_top_dir/include --with-jpeg-lib-dir=$install_top_dir/lib $MAKE $MAKE install ) > $HOSTLOGDIR/08-libtif.txt else echo not building libtiff: fi png_sys=`echo $OS | tr "[:upper:]" "[:lower:]"` if test -n "$build_libpng" ; then echo BUILDING libpng: ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libpng-1.2.5.tar.gz (date pwd gzip -dc ${AUTOBUILD_SOURCES}/libpng-1.2.5.tar.gz | tar xf - cd libpng-1.2.5 # cp scripts/makefile.$png_sys Makefile sed "s?^prefix=/usr/local?prefix=$install_top_dir?" scripts/makefile.$png_sys > Makefile.new $MAKE -f Makefile.new png_status=$? echo png_status: $png_status if [ $png_status = 0 ] ; then $MAKE -f Makefile.new install else echo build PNG: FAILED fi ) > $HOSTLOGDIR/08-libpng.txt else echo not building PNG: fi if test -n "$build_imlib" ; then echo BUILDING imlib # # ${WGET} http://ftp.gnome.org/pub/GNOME/sources/imlib/1.9/imlib-1.9.15.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/imlib-1.9.15.tar.gz if [ need_gtk_imlib_libtool_fix = 1 ] ; then ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/libtool-patch-Darwin-imlib-Charles-B fi echo BUILDING imlib echo BUILDING imlib >&2 ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/imlib-1.9.15.tar.gz | tar xf - cd imlib-1.9.15 echo env LDFLAGS=-L${install_top_dir}/lib CPPFLAGS=-I${install_top_dir}/include \ ./configure $generic_prefix env LDFLAGS=-L${install_top_dir}/lib CPPFLAGS=-I${install_top_dir}/include \ ./configure $generic_prefix # now patch the libtool if needed: if [ need_gtk_imlib_libtool_fix = 1 ] ; then patch -p0 < ../libtool-patch-Darwin-imlib-Charles-B fi $MAKE status=$? if [ "$status" != 0 ] ; then echo make of imlib failed echo make of imlib failed >&2 else $MAKE install fi ) > $HOSTLOGDIR/08-pre-imlib.txt 2>&1 # now test for presence of imlib-config (outside of sub-shell) if [ -e $install_top_dir/bin/imlib-config ] ; then echo imlib installed OK # hoorah else echo imlib failed to install. There\'s a surprise... echo stopping autobuild now echo imlib build failed. Stopping autobuild now. >&2 my_exit 2 fi else echo not building imlib: fi # build it anyway, don't use it sometimes? if test -n "$build_gtkglarea" ; then echo BUILDING gtkglarea: # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/gtkglarea-1.2.3.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/gtkglarea-1.2.3.tar.gz | tar xf - cd gtkglarea-1.2.3 ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/08-gtkglarea.txt 2>&1 else echo not building gtkglarea: fi if test -n "$build_gtk_canvas" ; then echo BUILDING gtk-canvas: # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/gtk-canvas-0.1.1.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/gtk-canvas.patch-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltmain.sh-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/ltconfig-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.guess-fink ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/config.sub-fink ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/gtk-canvas-0.1.1.tar.gz | tar xf - if [ "$need_gtk_canvas_patch" = 1 ] ; then # patch it from outside the directory patch -p0 < ${AUTOBUILD_SOURCES}/gtk-canvas.patch-fink fi cd gtk-canvas-0.1.1 find . -name install-sh -exec chmod 755 {} \; if test -n "$update_libtool" ; then cp ${AUTOBUILD_SOURCES}/ltmain.sh-fink ltmain.sh cp ${AUTOBUILD_SOURCES}/ltconfig-fink ltconfig fi if test -n "$update_config_guess_sub" ; then cp ${AUTOBUILD_SOURCES}/config.guess-fink config.guess cp ${AUTOBUILD_SOURCES}/config.sub-fink config.sub fi ./configure $generic_prefix if test $have_malloc = 0 ; then sed 's/#include.*malloc.h.*//' gtk-canvas/gtk-canvas-load.c > tmp.out mv tmp.out gtk-canvas/gtk-canvas-load.c fi $MAKE echo 1 ------------------------------------------------------------------------- echo ' ' make install echo 1 ------------------------------------------------------------------------- $MAKE install ) > $HOSTLOGDIR/09-gtk-canvas.txt 2>&1 else echo not building gtk-canvas: fi if test -n "$build_readline" ; then echo BUILDING readline: readline_version=5.1 ${WGET} ftp://ftp.cwru.edu/pub/bash/readline-$readline_version.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/readline-5.1.patch ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/readline-$readline_version.tar.gz | tar xf - if test -n "$need_readline_patch" ; then echo patching readline... patch -p0 < ${AUTOBUILD_SOURCES}/readline-5.1.patch fi cd readline-$readline_version ./configure $generic_prefix $MAKE status=$? if [ "$status" != 0 ] ; then echo make of readline failed else $MAKE install fi ) > $HOSTLOGDIR/10-pre-readline.txt 2>&1 else echo not building readline: fi if test -n "$build_guile" ; then echo BUILDING guile: # guile_version=1.6.8 # mirror has gone/moved. # ${WGET} http://mirror.ac.uk/mirror/ftp.gnu.org/gnu/guile/guile-${guile_version}.tar.gz # ${WGET} http://ftp.gnu.org/gnu/guile/guile-${guile_version}.tar.gz ${WGET} http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/guile/guile-${guile_version}.tar.gz ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/guile-1.6.7-guile.c-patch ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/guile-${guile_version}.tar.gz | tar xf - cd guile-${guile_version} patch -p0 < ${AUTOBUILD_SOURCES}/guile-1.6.7-guile.c-patch patch -p0 < ${AUTOBUILD_SOURCES}/guile-1.6.7-rpath.patch # we need to pass CFLAGS and LDFLAGS because there is no --with-readline-prefix # arg to guile's configure ./configure $generic_prefix CFLAGS=-I$install_top_dir/include LDFLAGS=-L$install_top_dir/lib # Multilib fix for procedures.txt perl -pi -e 's|threads.doc||' `find . -name Makefile` $MAKE status=$? if [ "$status" != 0 ] ; then echo guile make failed. else echo 1 --------------------------------------------------------------------- echo ' ' make install echo 1 --------------------------------------------------------------------- $MAKE install fi ) > $HOSTLOGDIR/10-guile.txt 2>&1 else echo not building guile: fi if test -n "$build_net_http" ; then echo BUILDING net http for guile # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/net-http-0.3.1.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/net-http-0.3.1.tar.gz | tar xf - cd net-http pwd echo ./configure $generic_prefix ./configure $generic_prefix # fiddle with the Makefile - to install it in the right (coot) place sed 's?^GUILE_SITEDIR.*?GUILE_SITEDIR=$(install_top_dir)/share/guile/site?' Makefile > Makefile.tmp mv Makefile.tmp Makefile # note, no make (author "humour") $MAKE install ) > $HOSTLOGDIR/11b-guile-net-http.txt else echo not building net-http: fi if test -n "$build_guile_gtk" ; then echo BUILDING guile-gtk: # ${WGET} http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/guile-gtk/guile-gtk-0.41.tar.gz if [ need_gtk_imlib_libtool_fix = 1 ] ; then ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/libtool-config-updates/libtool-patch-Darwin-imlib-Charles-B fi ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/guile-gtk-0.41.tar.gz | tar xf - cd guile-gtk-0.41 ./configure $generic_prefix # now patch the libtool if needed: if [ need_gtk_imlib_libtool_fix = 1 ] ; then patch -p0 < ../libtool-patch-Darwin-imlib-Charles-B fi # fix ulong if needed: sed 's/(ulong)/(unsigned long)/g' guile-gtk.c > tmp.c mv tmp.c guile-gtk.c $MAKE status=$? clipper_status=$status if [ "$clipper_status" != 0 ] ; then echo Oooops guile-gtk make failed else echo 1 ------------------------------------------------------------------------- echo ' ' make install echo 1 ------------------------------------------------------------------------- $MAKE install fi ) > $HOSTLOGDIR/12-guile-gtk.txt else echo not building guile-gtk: fi if test -n "$build_guile_gui" ; then echo BUILDING guile-gui: # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/guile-gui-0.2.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/guile-gui-0.2.tar.gz | tar xf - cd guile-gui-0.2 ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/13-guile-gui.txt else echo not building guile-gui: fi if test -n "$build_guile_goosh" ; then echo BUILDING goosh: # ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/goosh-1.3.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/goosh-1.3.tar.gz | tar xf - cd goosh-1.3 ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/14-goosh.txt else echo not building guile_goosh: fi if test -n "$build_guile_lib" ; then echo BUILDING guile-lib: # guile_lib_version=0.1.6 ${WGET} http://download.gna.org/guile-lib/guile-lib-$guile_lib_version.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/guile-lib-$guile_lib_version.tar.gz | tar xf - cd guile-lib-$guile_lib_version # the prefix for guile-lib must be the prefix of guile, or else the sxml and # other library files will not be found ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/14-guile-lib.txt 2>&1 else echo not building guile-lib fi if test -n "$build_greg" ; then echo building greg: ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/extras/greg-2.0.0-pe.tar.gz ( date gzip -dc ${AUTOBUILD_SOURCES}/greg-2.0.0-pe.tar.gz | tar xf - cd greg-2.0.0-pe ./configure $generic_prefix $MAKE $MAKE install ) > $HOSTLOGDIR/10-greg.txt 2>&1 else echo not building greg: fi ############################################################################### ########## build idn ############# ############################################################################### # we build libidn for libcurl. libcurl needs it on RHEL4 because # there is no /usr/lib/libidn.so. There is a rpm devel package, of # course, but that is more pain to install than compiling it from # scratch for coot install. if test -n "$build_libidn" ; then echo BUILDING libidn: ( # get libcurl from here: libidn_version=1.15 ${WGET} http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libidn/libidn-$libidn_version.tar.gz gzip -dc ${AUTOBUILD_SOURCES}/libidn-$libidn_version.tar.gz | tar xf - cd libidn-$libidn_version ./configure $generic_prefix if $MAKE ; then $MAKE install fi ) > $HOSTLOGDIR/15-a-libidn.txt else echo not building libidn: fi # ############################################################################### ########## build curl ############# ############################################################################### # if test -n "$build_curl" ; then echo BUILDING curl: ( # get libcurl from here: libcurl_version=7.19.7 ${WGET} http://curl.haxx.se/download/curl-$libcurl_version.tar.gz gzip -dc ${AUTOBUILD_SOURCES}/curl-$libcurl_version.tar.gz | tar xf - cd curl-$libcurl_version # libcurl has problems with putting the libraries ine right order when we specify # --with-libidn (it puts the libidn prefix libs at the end of its LDFLAGS and that # is bad because /usr/lib gets in front, and /usr/lib/libidn.so is missing). So here # we force the libidn libs at the front of LDFLAGS. Problem found on RHEL4-64bit # (lemur). # ./configure $generic_prefix --with-libidn=$install_top_dir LDFLAGS=-L$install_top_dir/lib if $MAKE ; then if [ -n $post_process_libcurl ] ; then fixup_libcurl fi $MAKE install # argh! This is such a hack! `make install' installs a broken (see post_process_libcurl # comments) even though it is fixed by the sed in fixup_libcurl. So *after* the install # let's install the corrected libcurl.la. Wonderful stuff. # if [ -n $post_process_libcurl ] ; then /usr/bin/install -c 'libcurl.la' $top_install_dir/lib/libcurl.la fi fi /usr/bin/install -c 'libcurl.la' '/home/emsley/autobuild/Linux-lemur-pre-release-gtk2-python/lib/libcurl.la' ) > $HOSTLOGDIR/15-b-curl.txt else echo not building curl: fi ############################################################################### ########## build gsl ############# ############################################################################### # if test -n "$build_gsl" ; then echo BUILDING gsl: # # wget http://www.mirror.ac.uk/sites/ftp.gnu.org/gnu/gsl/gsl-1.5.tar.gz # wget http://ftp.gnu.org/gnu/gsl/gsl-1.6.tar.gz gsl_version=1.8 # ${WGET} http://ftp.gnu.org/gnu/gsl/gsl-$gsl_version.tar.gz # ${WGET} http://ftp.gnu.org/gnu/gsl/gsl-$gsl_version.tar.gz ${WGET} http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/gsl/gsl-$gsl_version.tar.gz ( date pwd gzip -dc ${AUTOBUILD_SOURCES}/gsl-$gsl_version.tar.gz | tar xf - cd gsl-$gsl_version ./configure $generic_prefix $MAKE status=$? if [ "$status" != 0 ] ; then echo ERROR:: GSL make failed. my_exit 2 else echo 1 --------------------------------------------------------------- echo ' ' make install echo 1 ---------------------------------------------------------------- $MAKE install fi ) > $HOSTLOGDIR/15-gsl.txt else echo not building gsl: fi echo BUILDING coot: version $coot_version, python=$ENABLE_PYTHON_COOT echo BUILDING coot: version $coot_version, python=$ENABLE_PYTHON_COOT >&2 if [ "$build_coot_prerelease" != 1 ] ; then # normal release coot ${WGET} $release_server_dir/$coot_version.tar.gz if [ ! $? = 0 ] ; then echo failed to wget $release_server_dir/$coot_version.tar.gz my_exit 2 wget-fail-coot-source fi ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/coot-static.patch else # If we are building pre-release coot_source_tar_file is set only if we can find # a pre-release source tar in the pre-release directory, otherwise it is not set if [ -n "$coot_source_tar_file" ] ; then ${WGET} $coot_source_tar_file if [ ! $? = 0 ] ; then echo failed to wget $coot_source_tar_file my_exit 2 wget-fail-coot-source fi else # compile release code then: ${WGET} $release_server_dir/$coot_version.tar.gz if [ ! $? = 0 ] ; then echo failed to wget $release_server_dir/$coot_version.tar.gz my_exit 2 wget-fail-coot-source fi fi ${WGET} http://www.ysbl.york.ac.uk/~emsley/software/coot-static.patch fi echo using coot version $coot_version ls -ls ${AUTOBUILD_SOURCES}/$coot_version.tar.gz if [ -e ${AUTOBUILD_SOURCES}/$coot_version.tar.gz ] ; then echo good ${AUTOBUILD_SOURCES}/$coot_version.tar.gz exists else echo badness ${AUTOBUILD_SOURCES}/$coot_version.tar.gz does not exist. echo nothing left to do then. Goodbye. my_exit 2 fi date pwd gzip -dc ${AUTOBUILD_SOURCES}/$coot_version.tar.gz | tar xf - coot_dir_name=`echo $coot_version | sed 's/-revision.*//'` cd $coot_dir_name if [ $shared_static_flag = --disable-shared ] ; then if [ $OS != IRIX64 ] ; then echo patching for static build patch -p0 < ${AUTOBUILD_SOURCES}/coot-static.patch else echo Not patching for static build on this sgi fi else echo Not patching for static build fi if test -n "$glib_installed" ; then coot_extra_args="$coot_extra_args --with-glib-prefix=$install_top_dir" fi if test -n "$gtk_installed" ; then coot_extra_args="$coot_extra_args --with-gtk-prefix=$install_top_dir" fi scripting="--with-guile --with-guile-gtk --with-guile-gtk-prefix=$install_top_dir" # if ENABLE_PYTHON_COOT is not set, then we choose a day of the week # to build a python version. # if ENABLE_PYTHON_COOT is set, then if it is set to 0 or no then we # do not build a python version, otherwise we do build a python # version if [ -n "$ENABLE_PYTHON_COOT" ] ; then # it was set to something if [ "$ENABLE_PYTHON_COOT" != "0" ] ; then if [ "$ENABLE_PYTHON_COOT" != "no" ] ; then python_scripting='--with-python' fi fi else # if ENABLE_PYTHON_COOT was not set, then turn on python scripting python_scripting='--with-python' fi # no longer makes sense now that python is in by default # else # time_date=`date` # if [ ${time_date:0:3} = "Sun" ] ; then # scripting='--with-python' # fi # if [ ${time_date:0:3} = "Sun" ] ; then # scripting='--with-python' # fi # fi # question: did we build gtkglarea? # echo BUILDING coot: version $coot_version, python=$ENABLE_PYTHON_COOT echo BUILDING coot: version $coot_version, python=$ENABLE_PYTHON_COOT >&2 # set the python tag outside the compile/install sub-shell. if [ "$ENABLE_PYTHON_COOT" = "no" ] ; then python_tag= else python_tag=-python fi ( if [ "$ENABLE_PYTHON_COOT" = "no" ] ; then echo INFO:: not a pythonized build cp src/blank.cc src/coot_wrap_python.cc else echo INFO:: A pythonized build fi echo building from ${AUTOBUILD_SOURCES}/$coot_version.tar.gz in: $PWD echo ./configure $coot_prefix \ --with-gtkcanvas-prefix=$install_top_dir \ --with-mmdb-prefix=$install_top_dir \ --with-clipper-prefix=$install_top_dir \ --with-ssmlib-prefix=$install_top_dir \ $gtkglarea_prefix \ $glut_prefix \ $scripting \ "$python_scripting" \ $shared_static_flag \ $coot_extra_args \ CXXFLAGS="-g -O" ./configure $coot_prefix \ --with-gtkcanvas-prefix=$install_top_dir \ --with-mmdb-prefix=$install_top_dir \ --with-clipper-prefix=$install_top_dir \ --with-ssmlib-prefix=$install_top_dir \ $gtkglarea_prefix \ $glut_prefix \ $scripting \ "$python_scripting" \ $shared_static_flag \ $coot_extra_args \ CXXFLAGS="-g -O" $MAKE status=$? if [ "$status" != 0 ] ; then echo make failed. bad_coot_make=1 my_exit 2 else echo 1 --------------------------------------------------------------- echo ' ' make install echo 1 ---------------------------------------------------------------- $MAKE install if [ "$python_scripting" = '--with-python' ] ; then echo copying src/coot.py $install_top_dir/share/coot/python cp src/coot.py $install_top_dir/share/coot/python fi fi ) > $HOSTLOGDIR/16-coot.txt 2>&1 # --with-gsl-prefix=$install_top_dir \ # --with-glib-prefix=$install_top_dir \ # --with-gtk-prefix=$install_top_dir \ # --with-gtkgl-prefix=$install_top_dir \ coot_build_status=$? if [ $coot_build_status != 0 ] ; then echo coot build failed, exiting. echo coot build failed, exiting. >&2 echo fail-build > $LOGS/$build_type-build-status my_exit 2 else echo coot build was good. echo coot build was good. >&2 echo pass-build $coot_version > $LOGS/$build_type-build-status fi echo done coot build. echo done coot build. >&2 # now, do we need to add the extra data files, the refmac monomer # library and the reference structures? extra_dir=http://www.ysbl.york.ac.uk/~emsley/software/extras extra_dir=http://www.biop.ox.ac.uk/coot/software/dependencies # 20110505 we change to Garib's new dictionary #refmac_mon_lib=refmac-monomer-library-20090929.tar.gz #refmac_mon_lib=refmac-monomer-library-20091203.tar.gz mon_lib_dir=http://www.ysbl.york.ac.uk/~garib/refmac/data/refmac_experimental refmac_mon_lib=refmac_dictionary_v5.28.tar.gz refmac_mon_lib=refmac_dictionary_v5.29.tar.gz if [ -e $install_top_dir/share/coot/lib/data/monomers ] ; then echo INFO:: installation has refmac monomer library else echo INSTALLING refmac monomer library... $WGET $refmac_lib_dir/$refmac_mon_lib mkdir -p $install_top_dir/share/coot/lib/data tar xzCf $install_top_dir/share/coot/lib/data $AUTOBUILD_SOURCES/$refmac_mon_lib fi if [ -e $install_top_dir/share/coot/reference-structures ] ; then echo INFO:: installation has reference structures else echo INSTALLING reference structures... $WGET $extra_dir/reference-structures.tar.gz tar xzCf $install_top_dir/share/coot $AUTOBUILD_SOURCES/reference-structures.tar.gz fi # clear up the library dependencies clear_up_type= if [ $shared_static_flag != "--disable-static" ] ; then clear_up_type=clear-static fi if [ $shared_static_flag != "--disable-shared" ] ; then clear_up_type=clear-dynamic fi if [ $clear_up_type != "" ] ; then if [ "$ENABLE_PYTHON_COOT" = "yes" ] ; then slim_dir=`dirname $install_top_dir`/coot-${OS}-${systype}-gtk1-python else slim_dir=`dirname $install_top_dir`/coot-${OS}-${systype}-gtk1 fi post_install_slim $install_top_dir $slim_dir $clear_up_type fi # run test test_coot > $LOGS/$build_type-test.log r=$? # run python tests too, maybe (i.e. if we build with python) if [ "$ENABLE_PYTHON_COOT" = "yes" ] ; then test_coot_python > $LOGS/$build_type-test-python.log 2>&1 rp=$? else rp=0 fi if ( [ $r = 0 ] && [ $rp = 0 ] ); then echo ======================== echo first coot test passed echo ======================== echo pass-test > $LOGS/$build_type-test-status if test "$do_nightlies" = "1" ; then if [ -d $BINARY_TAR_DEST_DIR ] ; then # original full fat: # make_tar `basename $install_top_dir` $BINARY_TAR_DEST_DIR/${coot_version}-binary-full-${OS}-${systype}${python_tag}.tar.gz # slimmed: bin_tar_file=$BINARY_TAR_DEST_DIR/${coot_version}-binary-${OS}-${systype}${python_tag}.tar.gz holding_tar_file=$BINARY_TAR_DEST_DIR/holding/${coot_version}-binary-${OS}-${systype}${python_tag}.tar.gz make_tar `basename $slim_dir` $holding_tar_file # Now test the tar file by un-taring it and running the # tests. Only if this test passes can we move tar file # from holding to the binary pre-release dir. cd "$build_dir" mkdir test-tar cd test-tar tar xzf $holding_tar_file echo cding into `basename $slim_dir` from `pwd` cd `basename $slim_dir` ln -s ../../$coot_dir_name/greg-tests . test_coot bin/coot > $LOGS/$build_type-test-2.log test2_status=$? if [ $test2_status = 0 ] ; then echo ======================== echo second coot test passed echo ======================== echo pass-second-test > $LOGS/$build_type-test-status # copy over to York if we are in biop mv $holding_tar_file $bin_tar_file mv $holding_tar_file.md5sum $bin_tar_file.md5sum ssh_copy $bin_tar_file # update the ChangeLog, README and RELEASE-NOTES cd "$build_dir" cd $coot_dir_name cp ChangeLog $BINARY_TAR_DEST_DIR cp README $BINARY_TAR_DEST_DIR/coot-README cp RELEASE-NOTES $BINARY_TAR_DEST_DIR/${coot_version}-RELEASE-NOTES else echo ======================== echo second coot test failed echo ======================== echo fail-second-test $date > $LOGS/$build_type-test-status fi else echo directory for binaries does not exist. Skipping tar. fi else echo not doing tar files for nightlies: $do_nightlies fi else if test "$run_tests" = "true" ; then echo coot test failed echo ======================== echo ' ' first coot test failed echo ======================== echo fail-test $date > $LOGS/$build_type-test-status else echo coot not tested. echo not-tested > $LOGS/$build_type-test-status fi fi echo finished.