diff --git a/tools/make-package.sh b/tools/make-package.sh index 9aa3d072..9789b5c2 100755 --- a/tools/make-package.sh +++ b/tools/make-package.sh @@ -29,7 +29,7 @@ source ports/$PORT_NAME/PACKAGE [ -z ${url+x} ] && show_error "error: The port's PACKAGE file does not have a 'url' key." if ! [ -z ${dependencies+x} ]; then - echo "Installing dependencies of $name: ($dependencies)" + echo "Installing dependencies of $name: (${dependencies[@]})" for dep in ${dependencies[@]}; do tools/install-package.sh $dep done @@ -48,15 +48,22 @@ case $format in tar) [ -z ${output+x} ] && show_error "error: The 'tar' download format needs an 'output' key." [ -z ${sha256sum+x} ] && show_error "error: The 'tar' download format needs a 'sha256sum' key." - echo "Downloading tarball for $name..." - wget $url --quiet + if ! [ -f $output ]; then + echo "Downloading tarball for $name..." + wget $url --quiet + else + echo "Using cached tarball for $name." + fi echo "$sha256sum $output" | sha256sum -c tar xf $output - rm $output ;; git) - echo "Cloning repository for $name..." - git clone $url $srcdir + if ! [ -d $srcdir]; then + echo "Cloning repository for $name..." + git clone $url $srcdir + else + echo "Using local repository for $name." + fi if ! [ -z ${tag+x} ]; then cd $srcdir git checkout $tag @@ -68,12 +75,14 @@ case $format in ;; esac +if ! [ "$set_cc_variables" = "no" ]; then export CC=x86_64-luna-gcc export CXX=x86_64-luna-g++ export PKG_CONFIG=luna-pkg-config export CC_FOR_BUILD=gcc export CXX_FOR_BUILD=g++ export PKG_CONFIG_FOR_BUILD=pkg-config +fi mkdir -p $builddir cd $builddir