diff --git a/helper-templates/perl-module.sh b/helper-templates/perl-module.sh index a343703a831..b1fbba8324e 100755 --- a/helper-templates/perl-module.sh +++ b/helper-templates/perl-module.sh @@ -1,3 +1,4 @@ +# # This helper does the required steps to be able to build and install # perl modules into the correct location. # diff --git a/helper-templates/pkg-config-transform.sh b/helper-templates/pkg-config-transform.sh index a82539487f1..709b8219cc0 100755 --- a/helper-templates/pkg-config-transform.sh +++ b/helper-templates/pkg-config-transform.sh @@ -1,4 +1,5 @@ -# This script will transform the pkg-config files with correct +# +# This helper will transform the pkg-config files with correct # directories pointing at PKGFS_MASTERDIR specified in the config file. # pkgconfig_transform_file() diff --git a/helper-templates/unzip-extraction.sh b/helper-templates/unzip-extraction.sh index 256ba45ab48..adf07ddac6c 100644 --- a/helper-templates/unzip-extraction.sh +++ b/helper-templates/unzip-extraction.sh @@ -1,19 +1,26 @@ -# Helper for templates using extract_sufx=".zip" that installs the unzip -# package if it's not available in PKGFS_MASTERDIR. - +# +# This helper is used in templates using extract_sufx=".zip". +# This checks if unzip is installed and installs it if it's not +# and sets the unzip_cmd variable appropiately. +# unzip_version="5.52" +# Save pkgname before installing unzip. +save_pkgname=$pkgname + # If unzip is already installed just return immediately. check_installed_tmpl unzip-$unzip_version if [ "$?" -ne 0 ]; then echo "=> unzip not installed, will install it." install_tmpl unzip-$unzip_version # - # Continue with origin template that called us. + # Continue with previous template that called us. # reset_tmpl_vars - run_file ${origin_tmpl} + run_file $PKGFS_TEMPLATESDIR/$save_pkgname.tmpl + check_tmpl_vars $save_pkgname fi +unset save_pkgname unset unzip_version unzip_cmd=$PKGFS_MASTERDIR/bin/unzip diff --git a/pkgfs.sh b/pkgfs.sh index ee15e318025..acfc8ac2992 100755 --- a/pkgfs.sh +++ b/pkgfs.sh @@ -31,7 +31,6 @@ # TODO # - Multiple distfiles in a package. # - Multiple URLs to download source distribution files. -# - Fix PKGFS_{C,CXX}FLAGS, aren't passed to the environment yet. # - Support adding filters to templates to avoid creating useless links. # # Default path to configuration file, can be overriden @@ -346,6 +345,7 @@ check_tmpl_vars() check_rmd160_cksum() { local file="$1" + local dfile= [ -z "$file" ] && return 1 @@ -479,9 +479,13 @@ build_tmpl_sources() echo "==> Building \`$pkgname' (be patient, may take a while)" # - # For now, just set LDFLAGS. + # For now, just set them through the environment. # - export LDFLAGS="-L$PKGFS_MASTERDIR/lib -Wl,-R$PKGFS_MASTERDIR/lib $LDFLAGS" + LDFLAGS="-L$PKGFS_MASTERDIR/lib -Wl,-R$PKGFS_MASTERDIR/lib $LDFLAGS" + export LDFLAGS="-L$PKGFS_DESTDIR/$pkgname/lib $LDFLAGS" + export CFLAGS="$CFLAGS $PKGFS_CFLAGS" + export CXXFLAGS="$CXXFLAGS $PKGFS_CXXFLAGS" + export CPPFLAGS="-I$PKGFS_MASTERDIR/include $CPPFLAGS" export PKG_CONFIG="$PKGFS_MASTERDIR/bin/pkg-config" # Run stuff before configure. @@ -622,7 +626,7 @@ build_tmpl_sources() pkgconfig_transform_file $tmpf done - unset LDFLAGS PKG_CONFIG + unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS PKG_CONFIG echo "==> Installed \`$pkgname' into $PKGFS_DESTDIR/$pkgname." @@ -714,18 +718,26 @@ add_dependency_tolist() # [ "$i" = "deps" ] && continue - echo -n " $i: " + # + # origin_deps is used to only show the list of + # dependencies for the origin template once. + # + [ -n "$origin_deps" ] && \ + echo -n " $i: " # # Check if dep already installed. # if [ -r "$reg_pkgdb" ]; then check_installed_tmpl $i if [ "$?" -eq 0 ]; then - echo "already installed." + [ -n "$origin_deps" ] && \ + echo "already installed." continue fi - echo "not installed." - # Added dep into list + + [ -n "$origin_deps" ] && + echo "not installed." + deps_list="$i $deps_list" [ -n "$prev_depf" ] && unset prev_depf # @@ -733,6 +745,7 @@ add_dependency_tolist() # depdbf="$PKGFS_DEPSDIR/$i-deps.db" if [ -r "$PKGFS_DEPSDIR/$i-deps.db" ]; then + unset origin_deps add_dependency_tolist ${depdbf} prev_depf="$depdbf" fi @@ -746,6 +759,7 @@ install_dependency_tmpl() local tmpdepf="$pkgdepf" local tmppkgname= deps_list= + origin_deps=yes [ -z "$pkgdepf" ] && return 1 @@ -761,10 +775,11 @@ install_dependency_tmpl() check_installed_tmpl $i [ "$?" -eq 0 ] && continue echo "=> Installing dependency: $i" - install_tmpl "${i%-deps.db}" + install_tmpl $i done - deps_list= + unset deps_list + unset origin_deps } install_xstow_tmpl() @@ -773,7 +788,6 @@ install_xstow_tmpl() reset_tmpl_vars run_file "$PKGFS_TEMPLATESDIR/$xstow_version.tmpl" - cur_tmpl=$path_fixed check_tmpl_vars ${xstow_version} fetch_tmpl_sources extract_tmpl_sources @@ -787,7 +801,6 @@ install_xstow_tmpl() # Continue with origin package that called us. # run_file ${origin_tmpl} - cur_tmpl=${path_fixed} } installed_tmpl_handler() @@ -845,7 +858,6 @@ install_tmpl() reset_tmpl_vars run_file ${cur_tmpl} - cur_tmpl=${path_fixed} # # If we are the originator package save the path this template in diff --git a/templates/MesaLib-7.2.tmpl b/templates/MesaLib-7.2.tmpl index 542fc6646c3..1262ee6db30 100755 --- a/templates/MesaLib-7.2.tmpl +++ b/templates/MesaLib-7.2.tmpl @@ -7,7 +7,6 @@ url=http://kent.dl.sourceforge.net/sourceforge/mesa3d build_style=gnu_configure make_build_args="MKDEP=mkdep" configure_args="--with-expat=$PKGFS_MASTERDIR" -configure_env="CPPFLAGS=-I$PKGFS_MASTERDIR/include" make_cmd="$PKGFS_MASTERDIR/bin/gmake" pkgconfig_override="gl.pc glu.pc glw.pc" short_desc="Graphics library similar to SGI's OpenGL" diff --git a/templates/git-1.6.0.2.tmpl b/templates/git-1.6.0.2.tmpl index fe56c61c34d..db6c6e3bb19 100755 --- a/templates/git-1.6.0.2.tmpl +++ b/templates/git-1.6.0.2.tmpl @@ -5,10 +5,6 @@ url=http://www.kernel.org/pub/software/scm/git build_style=gnu_configure configure_args="--with-shell=/bin/sh --with-perl=$PKGFS_MASTERDIR/bin/perl --with-curl --without-tcltk --with-expat" -# Looks like git is ignoring some stuff from autoconf, so pass our stuff -# directly to it through the environment. -export CPPFLAGS="-I$PKGFS_MASTERDIR/include" -export CURLDIR="$PKGFS_MASTERDIR" make_cmd="$PKGFS_MASTERDIR/bin/gmake" short_desc="GIT Tree History Storage Tool" maintainer="Daniel Horecki " diff --git a/templates/gtk+-2.14.3.tmpl b/templates/gtk+-2.14.3.tmpl index 42525898f5a..ca406859e1a 100755 --- a/templates/gtk+-2.14.3.tmpl +++ b/templates/gtk+-2.14.3.tmpl @@ -4,8 +4,6 @@ patch_files="$pkgname-tests-Makefile-in.diff" extract_sufx=".tar.bz2" url=http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.14 build_style=gnu_configure -LDFLAGS="-L$PKGFS_DESTDIR/$pkgname/lib" -configure_env="CPPFLAGS=-I$PKGFS_MASTERDIR/include" configure_args="--disable-cups" make_cmd="$PKGFS_MASTERDIR/bin/gmake" pkgconfig_override="gail.pc gdk-2.0.pc gdk-pixbuf-2.0.pc gdk-pixbuf-xlib-2.0.pc diff --git a/templates/jasper-1.900.1.tmpl b/templates/jasper-1.900.1.tmpl index 71f687f8f18..e594660fe62 100755 --- a/templates/jasper-1.900.1.tmpl +++ b/templates/jasper-1.900.1.tmpl @@ -3,7 +3,6 @@ pkgname=jasper-1.900.1 extract_sufx=".zip" url=http://www.ece.uvic.ca/~mdadams/jasper/software build_style=gnu_configure -export CPPFLAGS="-I$PKGFS_MASTERDIR/include" configure_args="--enable-shared --without-x --disable-opengl" short_desc="Software-based reference implementation of the JPEG-2000 codec" maintainer="Juan RP " diff --git a/templates/pango-1.22.0.tmpl b/templates/pango-1.22.0.tmpl index 50379103449..85c8be51222 100755 --- a/templates/pango-1.22.0.tmpl +++ b/templates/pango-1.22.0.tmpl @@ -4,8 +4,6 @@ patch_files="$pkgname-docs-Makefile-in.diff" extract_sufx=".tar.bz2" url=http://ftp.gnome.org/pub/GNOME/sources/pango/1.22 build_style=gnu_configure -configure_env="CPPFLAGS=-I$PKGFS_MASTERDIR/include" -LDFLAGS="-L$PKGFS_DESTDIR/$pkgname/lib" make_cmd="$PKGFS_MASTERDIR/bin/gmake" pkgconfig_override="pango.pc pangocairo.pc pangoft2.pc pangox.pc pangoxft.pc" short_desc="Library for layout and rendering of text" diff --git a/templates/unzip-5.52.tmpl b/templates/unzip-5.52.tmpl index d661efc4e4d..9a2a8ad2b6a 100755 --- a/templates/unzip-5.52.tmpl +++ b/templates/unzip-5.52.tmpl @@ -7,9 +7,9 @@ extract_sufx=".tgz" url=ftp://ftp.info-zip.org/pub/infozip/src/ build_style=gnu_makefile make_cmd="$PKGFS_MASTERDIR/bin/gmake" +CFLAGS="-I. -DUNIX -Dunix -DUSE_UNSHRINK" make_build_args="-f unix/Makefile" make_build_target="generic_zlib unzipsfx" -export CFLAGS="-I. -DUNIX -Dunix -DUSE_UNSHRINK" short_desc="List, test and extract compressed files in a ZIP archive" maintainer="Juan RP " checksum=b749b0923bc4cceaa6f937aef688e9713a84328c