c866b6f85d50ffe0ec7402f05f3fafb2735f3950
max
  Wed Apr 30 17:59:51 2025 -0700
auto-detecting libfreetype, not using master branch anymore, using mariadb-dev package rather than the oracle client, which seems to crash hgTracks now

diff --git src/product/installer/browserSetup.sh src/product/installer/browserSetup.sh
old mode 100644
new mode 100755
index ea76d776ada..8d0244a0be7
--- src/product/installer/browserSetup.sh
+++ src/product/installer/browserSetup.sh
@@ -1,18 +1,18 @@
 #!/bin/bash
 
-# script to install/setup dependencies for the UCSC genome browser CGIs
+# Script to install/setup dependencies for the UCSC genome browser CGIs 
 # call it like this as root from a command line: bash browserSetup.sh
 
 # You can easily debug this script with 'bash -x browserSetup.sh', it 
 # will show all commands then
 
 exec > >(tee -a "${HOME}/browserSetup.log") 2>&1
 
 set -u -e -o pipefail # fail on unset vars and all errors, also in pipes
 
 # set all locale settings to English
 # searching for certain strings in command output might fail, if locale is different
 export LANG=C
 
 exitHandler() {
     if [ "$1" == "100" -o "$1" == "0" ] ; then
@@ -1044,31 +1044,31 @@
     # ghostscript for PDF export
     # imagemagick for the session gallery
     # r-base-core for the gtex tracks
     # python-mysqldb for hgGeneGraph
     apt-get $APTERR --no-install-recommends --assume-yes install ghostscript imagemagick wget rsync r-base-core curl gsfonts
     # python-mysqldb has been removed in almost all distros as of 2021
     # There is no need to install Python2 anymore. Remove the following?
     if apt-cache policy python-mysqldb | grep "Candidate: .none." > /dev/null; then 
 	    echo2 The package python-mysqldb is not available anymore. Working around it
 	    echo2 by installing python2 and MySQL-python with pip2
 	    if apt-cache policy python2 | grep "Candidate: .none." > /dev/null; then 
                # Ubuntu >= 21 does not have python2 anymore - hgGeneGraph has been ported, so not an issue anymore
    	       echo2 Python2 package is not available either for this distro, so not installing Python2 at all.
 	    else
                # workaround for Ubuntu 16-20 - keeping this section for a few years, just in case
-               apt-get install $APTERR --assume-yes python2 libmysqlclient-dev python2-dev wget gcc
+               apt-get install $APTERR --assume-yes python2 libmariadb-dev python2-dev wget gcc
     	       curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output /tmp/get-pip.py
     	       python2 /tmp/get-pip.py
                if [ -f /usr/include/mysql/my_config.h ]; then
                    echo my_config.h found
                else
                    wget https://raw.githubusercontent.com/paulfitz/mysql-connector-c/master/include/my_config.h -P /usr/include/mysql/
                fi
                pip2 install MySQL-python
 	    fi
     else
 	    apt-get --assume-yes install python-mysqldb
     fi
 
     if [ ! -f $APACHECONF ]; then
         echo2
@@ -1104,31 +1104,31 @@
     fi
 
     if [[ ! -f /usr/sbin/mysqld ]]; then
         echo2
         echo2 Now installing the Mysql server. 
         echo2 The root password will be set to a random string and will be written
         echo2 to the file /root/.my.cnf so root does not have to provide a password on
         echo2 the command line.
         waitKey
         moveAwayMyCnf
 
         # do not prompt in apt-get, will set an empty mysql root password
         export DEBIAN_FRONTEND=noninteractive
 	# Debian / Ubuntu 20 defaults to Mysql 8 and Mysql 8 does not allow rsync of myisam anymore
 	# -> we require mariaDb now
-        apt-get $APTERR --assume-yes install mariadb-server
+        apt-get $APTERR --assume-yes install mariadb-server libmariadb-dev
 
         mysqlStrictModeOff
         startMysql
         # flag so script will set mysql root password later to a random value
         SET_MYSQL_ROOT=1
     fi
 
 }
 
 # download apache mysql libpng openssl into the current dir
 # and build them into $APACHEDIR/ext
 function buildApacheMysqlOpensslLibpng () 
 {
 echo2
 echo2 Now building cmake, openssl, pcre, apache and mysql into $APACHEDIR/ext
@@ -1478,67 +1478,68 @@
    if grep -qv XBitHack /etc/apache2/httpd.conf ; then
      sudo sed -Ei '' '/Options FollowSymLinks Includes Multiviews/ a\
 XBitHack on\
 SSILegacyExprParser on
 ' /etc/apache2/httpd.conf
    fi
    sudo /usr/sbin/apachectl restart
 }
 
 # install gcc, make etc so we can build the tree on linux
 function setupBuildLinux ()
 {
    echo2 Installing required linux packages from repositories: Git, GCC, G++, Mysql-client-libs, uuid, etc
    waitKey
    if [[ "$DIST" == "debian" ]]; then
-      apt-get --assume-yes $APTERR install make git gcc g++ libpng-dev libmysqlclient-dev uuid-dev libfreetype-dev libbz2-dev
+      apt-get --assume-yes $APTERR install make git gcc g++ libpng-dev libmysqlclient-dev uuid-dev libfreetype-dev libbz2-dev pkg-config
    elif [[ "$DIST" == "redhat" ]]; then
       yum install -y git vim gcc gcc-c++ make libpng-devel libuuid-devel freetype-devel
    else 
       echo Error: Cannot identify linux distribution
       exit 100
    fi
    # the build target cgi-bin requires that these directories exist
    mkdir -p $HTDOCDIR $CGIBINDIR
    # leave a flag file so the script knows later that this directory did not exist and we made it
    # and it is safe to write into it
    touch "$APACHEDIR"/.madeByBrowserBuild
 }
 
 # set this machine for browser development: install required tools, clone the tree, build it
 function buildTree () 
 {
    if [[ "$DIST" == "OSX" ]]; then
        setupBuildOsx
    else
        setupBuildLinux
    fi
 
    if [ ! -e ~/kent ]; then
       echo2 Cloning kent repo into ~/kent using git with --depth=1
       echo2 Branch is: \"beta\" = our current release, beta = testing
       waitKey
       cd ~
-      git clone -b beta https://github.com/ucscGenomeBrowser/kent.git --depth=1
+      #git clone -b beta https://github.com/ucscGenomeBrowser/kent.git --depth=1
+      git clone https://github.com/ucscGenomeBrowser/kent.git --depth=1
    fi
 
    echo2 Now building CGIs from ~/kent to /usr/local/apache/cgi-bin 
    echo2 Copying JS/HTML/CSS to /usr/local/apache/htdocs
    waitKey
    cd ~/kent/src
-   make -j8 cgi-alpha
-   make -j8 doc-alpha
+   make cgi-alpha
+   make doc-alpha
 }
 
 # main function, installs the browser on Redhat/Debian and potentially even on OSX
 function installBrowser () 
 {
     if [ -f $COMPLETEFLAG ]; then
         echo2 error: the file $COMPLETEFLAG exists. It seems that you have installed the browser already.
         echo2 If you want to reset the Apache directory, you can run '"rm -rf /usr/local/apache"' and 
         echo2 then run this script again.
         exit 100
     fi
 
     echo '--------------------------------'
     echo UCSC Genome Browser installation
     echo '--------------------------------'