12 if [ "$cur_dir" == "/" ]; then
13 echo "$cur_dir`basename \"$1\"`"
15 echo "$cur_dir/`basename \"$1\"`"
21 ## Some configuration variables
22 number_of_processes="-j4"
26 if [ "$platform" == "Darwin" ]; then
27 particular_options=-no-framework
28 bash_path=`abspath $0`
29 bash_dir=`dirname $bash_path`
30 patch_file=$bash_dir/qt-4.8.6.patch
33 ## Check input parameters and process inputs (if needed)
34 if [ "$#" -eq 2 ]; then
35 valid_extensions=("zip" "tar" "tar.gz" "tar.bz2")
37 for ext in ${valid_extensions[@]}; do
38 if [ `basename $1 $ext` != $1 ]; then
42 if [ "x$actual_ext" == "x" ]; then
43 echo "$0: Invalid file type."
46 canonical_path=`abspath $1`
47 source_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`
48 build_dir=`dirname $canonical_path`/`basename $1 .$actual_ext`-build
49 echo -n "Cleaning directories... "
53 echo -n "Creating directories... "
57 echo -n "Extracting sources... "
58 if [ "$actual_ext" == "zip" ]; then
59 echo unzip $canonical_path
60 elif [ "$actual_ext" == "tar" ]; then
61 tar xf $canonical_path -C $source_dir --strip-components=1
62 elif [ "$actual_ext" == "tar.gz" ]; then
63 tar xzf $canonical_path -C $source_dir --strip-components=1
64 elif [ "$actual_ext" == "tar.bz2" ]; then
65 tar xjf $canonical_path -C $source_dir --strip-components=1
67 echo "$0: Invalid file type."
72 elif [ "$#" -eq 3 ]; then
73 source_dir=`dirname $1`
74 build_dir=`dirname $2`
77 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir] [build_type]"
81 if [ "x$patch_file" != "x" ]; then
82 echo -n "Applying patch... "
84 patch -p0 < $patch_file
88 echo "Given source dir : \"$source_dir\""
89 echo "Given build dir : \"$build_dir\""
91 echo "Configuring sources... "
93 $source_dir/configure \
94 -prefix ${HOME}/local \
96 -opensource -shared -fast \
101 -nomake demos -nomake examples \
103 $particular_options \
105 echo "Configuring sources... done."
107 echo "Compiling sources..."
109 make $number_of_processes
110 echo "Compiling sources... done."
112 echo "Installing package..."
115 echo "Installing package... done."