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 3 ]; 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."
73 elif [ "$#" -eq 4 ]; then
74 source_dir=`dirname $1`
75 build_dir=`dirname $2`
79 echo "Usage: [qt4_package] or [qt4_source_dir qt4_build_dir] [build_type] [min/full]"
83 if [ "x$patch_file" != "x" ]; then
84 echo -n "Applying patch... "
86 patch -p0 < $patch_file
90 echo "Given source dir : \"$source_dir\""
91 echo "Given build dir : \"$build_dir\""
93 echo "Configuring sources... "
95 if [ "x$full_compil" == "xfull" ]; then
96 $source_dir/configure \
97 -prefix ${HOME}/local \
99 -opensource -shared -fast \
102 $particular_options \
105 $source_dir/configure \
106 -prefix ${HOME}/local \
108 -opensource -shared -fast \
113 -nomake demos -nomake examples \
115 $particular_options \
118 echo "Configuring sources... done."
120 echo "Compiling sources..."
122 make $number_of_processes
123 echo "Compiling sources... done."
125 echo "Installing package..."
128 echo "Installing package... done."