# bootstrap.conf (fontforge) version 2014-07-31
# Written by Gary V. Vaughan, 2010

# Copyright (C) 2010 Free Software Foundation, Inc.

# This file is part of GNU fontforge.
#
# GNU fontforge is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNU fontforge is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.


## -------------- ##
## Configuration. ##
## -------------- ##

# List of programs, minimum versions, and software urls required to
# bootstrap, maintain and release GNU Fontforge.

# Build prerequisites
buildreq='
        git        1.5.5   http://git-scm.com
        perl       5.5     http://perl.com
        tar        -       http://www.gnu.org/s/tar
'

# Additional gnulib-tool options to use.
gnulib_tool_options='
'

# gnulib modules used by this package.
gnulib_modules='
	warnings
	manywarnings
	c-strtod
	gethostname
	getline
	iconv
	inet_ntop
	localeconv
	progname
	strcase
	strtok_r
	strndup
	xalloc
	xvasprintf
'

# Extra gnulib files that are not in modules, which override files of
# the same name installed by other bootstrap tools.
gnulib_non_module_files="$gnulib_non_module_files"'
'

# The not-synced with gnulib warning is bogus until upstream adopts
# the saner bootstrap script.
require_bootstrap_uptodate=:


## -------------------- ##
## Resource management. ##
## -------------------- ##

# require_git
# -----------
# Ignore git if it's not available, or we're not in a git checkout tree.
require_git=fontforge_require_git
fontforge_require_git ()
{
    $debug_cmd

    $opt_skip_git && GIT=true

    test true = "$GIT" || { 
        # Test for .git directory as we auto-generate .gitignore
	#
	# note that we *need* to have the .git directory here because
	# submodules are used like gnulib. However, for OSX build
	# environments we might be a temporary "copy" of the tree
	# which doesn't include .git so we are best to assume that the
	# user knows what they are doing, and create the .git if it
	# doesn't exist
	#
	if test -d .git ; then :; else
	    echo "WARNING: you do not have a .git directory in your build, so one is being created"
            $GIT init;
	fi

        if ($GIT --version) >/dev/null 2>&1; then :; else
            GIT=true
        fi
    }

    func_verbose "GIT='$GIT'"

    require_git=:
}


## --------------- ##
## Hook functions. ##
## --------------- ##

# fontforge_skip_po
# -----------------
# Ensure --skip-po (we have no translations in the Translation Project).
fontforge_skip_po ()
{
    $debug_cmd

    opt_skip_po=true
}
func_add_hook func_options fontforge_skip_po

# fontforge_ignore_gnulib_ignore
# ------------------------------
# gnulib-tool updates m4/.gitignore and lib/.gitignore, and keeping
# generated files under version control does not make sense.  Since
# lib is entirely ignored, we only need to prepopulate the m4 ignore
# files with generated files not tracked by gnulib-tool.
fontforge_ignore_gnulib_ignore ()
{
    $debug_cmd

    $require_macro_dir

    if test -f "$macro_dir/.gitignore" ; then
      :
    else
      func_verbose "creating initial \`$macro_dir/.gitignore'"
      cat > $macro_dir/.gitignore <<\EOF
# files created by gnulib, but that gnulib doesn't track
*~
.gitignore
/argz.m4
/gnulib-cache.m4
/gnulib-comp.m4
/libtool.m4
/ltargz.m4
/ltdl.m4
/ltoptions.m4
/ltsugar.m4
/ltversion.m4
/lt~obsolete.m4
EOF
    fi
}
func_add_hook func_prep fontforge_ignore_gnulib_ignore


# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "# bootstrap.conf (fontforge) version "
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "$"
# End:
