3 ## Some configuration variables
4 number_of_processes="-j4"
8 if [ "$platform" == "Darwin" ]; then
9 particular_options=-no-framework
12 ## Check input parameters and process inputs (if needed)
13 if [ "$#" -eq 1 ]; then
14 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
16 for ext in ${valid_extensions[@]}; do
17 if [ `basename $1 $ext` != $1 ]; then
21 if [ "x$actual_ext" == "x" ]; then
22 echo "$0: Invalid file type."
25 canonical_path=`readlink -e $1`
26 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
27 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
28 echo -n "Cleaning directories... "
32 echo -n "Creating directories... "
36 echo -n "Extracting sources... "
37 if [ "$actual_ext" == "zip" ]; then
38 echo unzip $canonical_path
39 elif [ "$actual_ext" == "tar" ]; then
40 tar xf $canonical_path -C $source_dir --strip-components=1
41 elif [ "$actual_ext" == "tar.gz" ]; then
42 tar xzf $canonical_path -C $source_dir --strip-components=1
43 elif [ "$actual_ext" == "tar.bz2" ]; then
44 tar xjf $canonical_path -C $source_dir --strip-components=1
46 echo "$0: Invalid file type."
50 elif [ "$#" -eq 2 ]; then
51 source_dir=`dirname $1`
52 build_dir=`dirname $2`
54 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir]"
57 echo "Given source dir : \"$source_dir\""
58 echo "Given build dir : \"$build_dir\""
60 echo "Configuring sources... "
62 $source_dir/configure \
63 -prefix ${HOME}/local \
65 -opensource -shared -fast \
70 -nomake demos -nomake examples \
74 echo "Configuring sources... done."
76 echo "Compiling sources..."
78 make $number_of_processes
79 echo "Compiling sources... done."
81 echo "Installing package..."
84 echo "Installing package... done."