Multiple changes to gnu_configure style packages, as well as other

changes to allow better linking flags in future packages through
pkg-config.

Removed the PKGFS_TEMPLATESDIR, PKGFS_DEPSDIR and others that weren't
too useful. Instead use a single PKGFS_DISTRIBUTIONDIR on which all
those directories/files can be found.

Added a template helper for pkg-config, that changes a pkg-config file
after it's installed to produce correct linker paths.

More helpers could be added in the future.

--HG--
extra : convert_revision : a42fd2e72915a4219714de92579011bca2b0f4a6
This commit is contained in:
Juan RP 2008-09-30 22:48:52 +02:00
parent 42eda74f0d
commit 01799e1e18
10 changed files with 98 additions and 56 deletions

View File

@ -0,0 +1,26 @@
#! /bin/sh
#
# This script will transform the pkg-config files with correct
# directories pointing at PKGFS_MASTERDIR specified in the config file.
#
: ${sed_cmd:=/usr/bin/sed}
: ${mv_cmd:=/bin/mv}
transform_pkgconfig_file()
{
local file="$1"
[ -z "$file" ] && return 1
$sed_cmd \
-e "s|^exec_prefix=$PKGFS_DESTDIR/$pkgname.*$|exec_prefix=\${prefix}|" \
-e "s|-L\${libdir}|-L\${libdir} -Wl,-R\${libdir}|" \
$file > $file.in && \
$mv_cmd $file.in $file
[ "$?" -eq 0 ] && \
echo "=> Transformed pkg-config file: $(basename $file)."
}
transform_pkgconfig_file "$1"
exit 0

View File

@ -2,37 +2,33 @@
# Configuration file for pkgfs. # Configuration file for pkgfs.
# #
# Global directory where the pkgfs distribution files are stored.
# Templates, patches, helpers and dependency files should all be
# in that directory.
#
PKGFS_DISTRIBUTIONDIR=$HOME/pkgfs
# #
# Global master directory: this is where all symlinks will be # Global master directory: this is where all symlinks will be
# created pointing at packages installed in PKGFS_DESTDIR. # created pointing at packages installed in PKGFS_DESTDIR.
# #
PKGFS_MASTERDIR=$HOME/pkgfs PKGFS_MASTERDIR=$PKGFS_DISTRIBUTIONDIR/depot
# #
# Global destination directory: this is where all packages will be # Global destination directory: this is where all packages will be
# installed. # installed.
# #
PKGFS_DESTDIR=$HOME/pkgfs/packages PKGFS_DESTDIR=$PKGFS_DISTRIBUTIONDIR/packages
# #
# Global directory where source files will be extracted to. # Global directory where source files will be extracted to.
# #
PKGFS_BUILDDIR=$HOME/pkgfs/builddir PKGFS_BUILDDIR=$PKGFS_DISTRIBUTIONDIR/builddir
# #
# Global directory where the source distfiles are stored. # Global directory where source distribution files are stored.
# #
PKGFS_SRC_DISTDIR=$HOME/pkgfs/distdir PKGFS_SRCDISTDIR=$PKGFS_DISTRIBUTIONDIR/srcdistdir
#
# Global directory where templates and patches are stored.
#
PKGFS_TEMPLATESDIR=$HOME/pkgfs/templates
#
# Global directory where the dependency database files are stored.
#
PKGFS_DEPSDIR=$HOME/pkgfs/dependencies
# #
# Path to the xstow program. # Path to the xstow program.

View File

@ -66,6 +66,22 @@
: ${xstow_version:=xstow-0.6.1-unstable} : ${xstow_version:=xstow-0.6.1-unstable}
: ${xstow_args:=-ap} : ${xstow_args:=-ap}
set_defvars()
{
# Directories
: ${PKGFS_TEMPLATESDIR:=$PKGFS_DISTRIBUTIONDIR/templates}
: ${PKGFS_DEPSDIR:=$PKGFS_DISTRIBUTIONDIR/dependencies}
: ${PKGFS_TMPLHELPDIR:=$PKGFS_DISTRIBUTIONDIR/helper-templates}
local DDIRS="PKGFS_DEPSDIR PKGFS_TEMPLATESDIR PKGFS_TMPLHELPDIR"
for i in ${DDIRS}; do
if [ ! -d "$PKGFS_DEPSDIR" ]; then
echo "**** ERROR: cannot find $i, aborting ***"
exit 1
fi
done
}
usage() usage()
{ {
cat << _EOF cat << _EOF
@ -96,9 +112,6 @@ check_path()
eval local orig="$1" eval local orig="$1"
case "$orig" in case "$orig" in
$PKGFS_TEMPLATESDIR)
orig="$PKGFS_TEMPLATESDIR/$orig"
;;
/) /)
;; ;;
/*) /*)
@ -118,7 +131,6 @@ run_file()
check_path "$file" check_path "$file"
. $path_fixed . $path_fixed
} }
# #
@ -218,7 +230,7 @@ apply_tmpl_patches()
cd $pkg_builddir && $patch_cmd < $patch 2>/dev/null cd $pkg_builddir && $patch_cmd < $patch 2>/dev/null
if [ "$?" -eq 0 ]; then if [ "$?" -eq 0 ]; then
echo ">> Patch applied: \`$i'." echo "=> Patch applied: \`$i'."
else else
echo -n "*** ERROR: couldn't apply patch '$i'" echo -n "*** ERROR: couldn't apply patch '$i'"
echo ", aborting ***" echo ", aborting ***"
@ -239,20 +251,8 @@ check_config_vars()
exit 1 exit 1
fi fi
if [ ! -d "$PKGFS_DEPSDIR" ]; then
echo -n "**** ERROR: PKGFS_DEPSDIR not set in configuration "
echo "file, aborting ***"
exit 1
fi
if [ ! -d "$PKGFS_TEMPLATESDIR" ]; then
echo -n "*** ERROR: PKGFS_TEMPLATESDIR cannot be read"
echo ", aborting ***"
exit 1
fi
local PKGFS_VARS="PKGFS_MASTERDIR PKGFS_DESTDIR PKGFS_BUILDDIR \ local PKGFS_VARS="PKGFS_MASTERDIR PKGFS_DESTDIR PKGFS_BUILDDIR \
PKGFS_SRC_DISTDIR" PKGFS_SRCDISTDIR"
for f in ${PKGFS_VARS}; do for f in ${PKGFS_VARS}; do
eval val="\$$f" eval val="\$$f"
@ -313,7 +313,7 @@ check_tmpl_vars()
exit 1 exit 1
fi fi
dfile="$PKGFS_SRC_DISTDIR/$dfile" dfile="$PKGFS_SRCDISTDIR/$dfile"
case "$extract_sufx" in case "$extract_sufx" in
.tar.bz2|.tar.gz|.tgz|.tbz) .tar.bz2|.tar.gz|.tgz|.tbz)
@ -353,7 +353,7 @@ check_rmd160_cksum()
fi fi
origsum="$checksum" origsum="$checksum"
dfile="$PKGFS_SRC_DISTDIR/$dfile" dfile="$PKGFS_SRCDISTDIR/$dfile"
filesum="$($cksum_cmd $dfile | $awk_cmd '{print $4}')" filesum="$($cksum_cmd $dfile | $awk_cmd '{print $4}')"
if [ "$origsum" != "$filesum" ]; then if [ "$origsum" != "$filesum" ]; then
echo "*** WARNING: checksum doesn't match (rmd160) ***" echo "*** WARNING: checksum doesn't match (rmd160) ***"
@ -376,7 +376,7 @@ fetch_tmpl_sources()
for f in "$file"; do for f in "$file"; do
file2="$f$extract_sufx" file2="$f$extract_sufx"
if [ -f "$PKGFS_SRC_DISTDIR/$file2" ]; then if [ -f "$PKGFS_SRCDISTDIR/$file2" ]; then
check_rmd160_cksum $f check_rmd160_cksum $f
if [ "$?" -eq 0 ]; then if [ "$?" -eq 0 ]; then
if [ -n "$only_fetch" ]; then if [ -n "$only_fetch" ]; then
@ -387,11 +387,11 @@ fetch_tmpl_sources()
fi fi
fi fi
echo ">>> Fetching \`$file2' source tarball" echo "==> Fetching \`$file2' source tarball"
cd $PKGFS_SRC_DISTDIR && $fetch_cmd $url/$file2 cd $PKGFS_SRCDISTDIR && $fetch_cmd $url/$file2
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
if [ ! -f $PKGFS_SRC_DISTDIR/$file2 ]; then if [ ! -f $PKGFS_SRCDISTDIR/$file2 ]; then
echo -n "*** ERROR: couldn't fetch '$file2', " echo -n "*** ERROR: couldn't fetch '$file2', "
echo "aborting ***" echo "aborting ***"
else else
@ -411,7 +411,7 @@ extract_tmpl_sources()
{ {
[ -z "$pkgname" ] && return 1 [ -z "$pkgname" ] && return 1
echo ">>> Extracting \`$pkgname' into $PKGFS_BUILDDIR." echo "==> Extracting \`$pkgname' into $PKGFS_BUILDDIR."
$extract_cmd $extract_cmd
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
@ -468,7 +468,7 @@ build_tmpl_sources()
# Apply patches if requested by template file # Apply patches if requested by template file
apply_tmpl_patches apply_tmpl_patches
echo ">>> Building \`$pkgname' (be patient, may take a while)" echo "==> Building \`$pkgname' (be patient, may take a while)"
# #
# For now, just set LDFLAGS. # For now, just set LDFLAGS.
@ -489,12 +489,9 @@ build_tmpl_sources()
# Pass consistent arguments to not have unexpected # Pass consistent arguments to not have unexpected
# surprises later. # surprises later.
# #
./configure --prefix="$PKGFS_MASTERDIR" \ ./configure --prefix="$PKGFS_MASTERDIR" \
--exec-prefix="$PKGFS_DESTDIR/$pkgname" \ --mandir="$PKGFS_DESTDIR/$pkgname/man" \
--mandir="$PKGFS_DESTDIR/$pkgname/man" \
--infodir="$PKGFS_DESTDIR/$pkgname/share/info" \ --infodir="$PKGFS_DESTDIR/$pkgname/share/info" \
--libdir="$PKGFS_MASTERDIR/lib" \
--includedir="$PKGFS_MASTERDIR/include" \
${configure_args} ${configure_args}
# #
@ -538,14 +535,20 @@ build_tmpl_sources()
exit 1 exit 1
fi fi
# Transform pkg-config files if requested by template.
for i in ${pkgconfig_override}; do
local tmpf="$PKGFS_DESTDIR/$pkgname/lib/pkgconfig/$i"
[ -f "$tmpf" ] && $PKGFS_TMPLHELPDIR/pkg-config-transform.sh ${tmpf}
done
unset LDFLAGS PKG_CONFIG unset LDFLAGS PKG_CONFIG
echo ">>> Installed \`$pkgname' into $PKGFS_DESTDIR/$pkgname." echo "==> Installed \`$pkgname' into $PKGFS_DESTDIR/$pkgname."
if [ -d "$pkg_builddir" -a -z "$dontrm_builddir" ]; then if [ -d "$pkg_builddir" -a -z "$dontrm_builddir" ]; then
$rm_cmd -rf $pkg_builddir $rm_cmd -rf $pkg_builddir
[ "$?" -eq 0 ] && \ [ "$?" -eq 0 ] && \
echo ">> Removed \`$pkgname' build directory." echo "=> Removed \`$pkgname' build directory."
fi fi
cd $PKGFS_BUILDDIR cd $PKGFS_BUILDDIR
@ -576,7 +579,7 @@ stow_tmpl()
echo "*** ERROR: couldn't create symlinks for \`$pkg' ***" echo "*** ERROR: couldn't create symlinks for \`$pkg' ***"
exit 1 exit 1
else else
echo ">>> Created \`$pkg' symlinks into master directory." echo "==> Created \`$pkg' symlinks into master directory."
fi fi
xstow_args="$real_xstowargs" xstow_args="$real_xstowargs"
@ -605,7 +608,7 @@ unstow_tmpl()
exit 1 exit 1
else else
$rm_cmd -f $PKGFS_DESTDIR/$pkg/share/info/dir $rm_cmd -f $PKGFS_DESTDIR/$pkg/share/info/dir
echo ">>> Removed \`$pkg' symlinks from master directory." echo "==> Removed \`$pkg' symlinks from master directory."
fi fi
installed_tmpl_handler unregister $pkg installed_tmpl_handler unregister $pkg
@ -663,7 +666,7 @@ install_dependency_tmpl()
doing_deps=true doing_deps=true
tmp_pkgn=${pkgdepf%%-deps.db} tmp_pkgn=${pkgdepf%%-deps.db}
echo ">>> Required dependencies for $(basename $tmp_pkgn):" echo "==> Required dependencies for $(basename $tmp_pkgn):"
add_dependency_tolist $pkgdepf add_dependency_tolist $pkgdepf
@ -671,7 +674,7 @@ install_dependency_tmpl()
# skip dup deps # skip dup deps
check_installed_tmpl $i check_installed_tmpl $i
[ "$?" -eq 0 ] && continue [ "$?" -eq 0 ] && continue
echo ">>> Installing dependency: $i" echo "=> Installing dependency: $i"
install_tmpl "${i%-deps.db}" install_tmpl "${i%-deps.db}"
done done
@ -886,8 +889,11 @@ if [ -z "$target" ]; then
usage usage
fi fi
# Check configuration vars before anyting else. #
# Check configuration vars before anyting else, and set defaults vars.
#
check_config_vars check_config_vars
set_defvars
# Main switch # Main switch
case "$target" in case "$target" in

View File

@ -3,6 +3,7 @@ pkgname=curl-7.18.0
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://curl.haxx.se/download/ url=http://curl.haxx.se/download/
build_style=gnu_configure build_style=gnu_configure
pkgconfig_override="libcurl.pc"
short_desc="Client that groks URLs" short_desc="Client that groks URLs"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
checksum=f25ec844e7ef6221719439b3214fd3c3a42f5604 checksum=f25ec844e7ef6221719439b3214fd3c3a42f5604

View File

@ -9,6 +9,11 @@ make_cmd="$PKGFS_MASTERDIR/bin/gmake"
configure_args="--disable-fam --with-pcre=system" configure_args="--disable-fam --with-pcre=system"
configure_env="ac_cv_func_statfs=no" configure_env="ac_cv_func_statfs=no"
build_style=gnu_configure build_style=gnu_configure
pkgconfig_override="glib-2.0-uninstalled.pc glib-2.0.pc
gmodule-2.0-uninstalled.pc gmodule-2.0.pc gmodule-export-2.0.pc
gmodule-no-export-2.0-uninstalled.pc gmodule-no-export-2.0.pc
gobject-2.0-uninstalled.pc gobject-2.0.pc gthread-2.0-uninstalled.pc
gthread-2.0.pc gio-2.0.pc gio-unix-2.0.pc"
short_desc="The GNU library of C routines" short_desc="The GNU library of C routines"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
checksum=264b37584419d983685910adde8f7b282eccc1ad checksum=264b37584419d983685910adde8f7b282eccc1ad

View File

@ -2,7 +2,9 @@
pkgname=irssi-0.8.12 pkgname=irssi-0.8.12
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://www.irssi.org/files url=http://www.irssi.org/files
configure_args="--with-terminfo --with-proxy --without-curses" configure_args="--with-terminfo --with-proxy --without-curses
--with-perl-lib=$PKGFS_MASTERDIR/lib/perl5/site_perl"
build_style=gnu_configure build_style=gnu_configure
short_desc="Secure and modular IRC client with text mode user interface" short_desc="Secure and modular IRC client with text mode user interface"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"

View File

@ -3,6 +3,7 @@ pkgname=libidn-1.9
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://ftp.gnu.org/gnu/libidn url=http://ftp.gnu.org/gnu/libidn
build_style=gnu_configure build_style=gnu_configure
pkgconfig_override="libidn.pc"
configure_env="EMACS=/bin/false" configure_env="EMACS=/bin/false"
configure_args="--disable-csharp --disable-java" configure_args="--disable-csharp --disable-java"
short_desc="Internationalized Domain Names command line tool" short_desc="Internationalized Domain Names command line tool"

View File

@ -3,8 +3,10 @@ pkgname=mc-4.6.1
extract_sufx=".tar.gz" extract_sufx=".tar.gz"
url=http://www.ibiblio.org/pub/Linux/utils/file/managers/mc url=http://www.ibiblio.org/pub/Linux/utils/file/managers/mc
build_style=gnu_configure build_style=gnu_configure
# Override datadir to get the correct directory.
configure_args="--without-ext2undel --with-screen=mcslang configure_args="--without-ext2undel --with-screen=mcslang
--enable-charset --without-libiconv-prefix --without-libintl-prefix" --enable-charset --without-libiconv-prefix --without-libintl-prefix
--datadir=$PKGFS_DESTDIR/$pkgname/share"
configure_env="gt_cv_func_gnugettext_libintl=yes configure_env="gt_cv_func_gnugettext_libintl=yes
gt_cv_func_gnugettext1_libintl=yes gt_cv_func_gnugettext2_libintl=yes" gt_cv_func_gnugettext1_libintl=yes gt_cv_func_gnugettext2_libintl=yes"

View File

@ -3,6 +3,7 @@ pkgname=pcre-7.8
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=http://kent.dl.sourceforge.net/sourceforge/pcre url=http://kent.dl.sourceforge.net/sourceforge/pcre
build_style=gnu_configure build_style=gnu_configure
pkgconfig_override="libpcre.pc libpcrecpp.pc"
configure_args="--enable-utf8 --enable-unicode-properties" configure_args="--enable-utf8 --enable-unicode-properties"
short_desc="Perl Compatible Regular Expressions" short_desc="Perl Compatible Regular Expressions"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"

View File

@ -3,7 +3,9 @@ pkgname=ruby-1.8.7-p72
extract_sufx=".tar.bz2" extract_sufx=".tar.bz2"
url=ftp://ftp.ruby-lang.org/pub/ruby/1.8 url=ftp://ftp.ruby-lang.org/pub/ruby/1.8
build_style=gnu_configure build_style=gnu_configure
configure_args="--enable-pthread --enable-shared" # Override --exec-prefix to install it into the correct location.
configure_args="--enable-pthread --enable-shared
--exec-prefix=$PKGFS_DESTDIR/$pkgname"
short_desc="Ruby programming language" short_desc="Ruby programming language"
maintainer="Daniel Horecki <morr@morr.pl>" maintainer="Daniel Horecki <morr@morr.pl>"
checksum=07bf0d6987ba111aed988093c569fb66ba54891b checksum=07bf0d6987ba111aed988093c569fb66ba54891b