Make gnu symlink creation work again
Since the default configure_args is now expanded immediately it cannot depend on variables defined later. To fix this for users of gnu_link_progs another API change is necessary. gnu_link_progs is now a private array of programs to link. The private gnu_link function is renamed do_gnu_link. A new public function named gnu_link is added which handles populating gnu_link_progs and modifying configure_args.
This commit is contained in:
parent
6620dc6854
commit
6e408949ea
@ -152,6 +152,8 @@ patch_prefix="-p1"
|
|||||||
gnu_prefix=g
|
gnu_prefix=g
|
||||||
# GNU dir
|
# GNU dir
|
||||||
_gnudir=gnu
|
_gnudir=gnu
|
||||||
|
# Add --program-prefix to configure if gnu_link is requested?
|
||||||
|
gnu_configure=1
|
||||||
|
|
||||||
# Distfiles should be named like this
|
# Distfiles should be named like this
|
||||||
# <name>-<version>-<pkgver>.sb-<os>-<cpu>-<pkgdirdesig>
|
# <name>-<version>-<pkgver>.sb-<os>-<cpu>-<pkgdirdesig>
|
||||||
@ -764,25 +766,39 @@ check_changelog()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# gnu_link: Setup links in $prefix/$_gnudir
|
# do_gnu_link: Create symlinks in $prefix/$_gnudir
|
||||||
# params: list of programs to link
|
# params: list of programs to link
|
||||||
# For each program given, create a symlink from $prefix/${_bindir}/program to
|
# For each program given, create a symlink from $prefix/${_bindir}/program to
|
||||||
# $prefix/gnu with the first character stripped from the name
|
# $prefix/gnu with the first character stripped from the name
|
||||||
gnu_link()
|
do_gnu_link()
|
||||||
{
|
{
|
||||||
local program
|
local program
|
||||||
|
|
||||||
${__mkdir} -p ${stagedir}${prefix}/$_gnudir
|
${__mkdir} -p ${stagedir}${prefix}/$_gnudir
|
||||||
setdir ${stagedir}${prefix}/$_gnudir
|
cd ${stagedir}${prefix}/$_gnudir
|
||||||
|
|
||||||
for program in $@
|
for program in $@
|
||||||
do
|
do
|
||||||
local dest=${program:1}
|
local dest=${program:1}
|
||||||
echo "Linking $prefix/${_bindir}/$program to $prefix/$_gnudir/$dest"
|
echo "Linking $prefix/${_bindir}/$program to $prefix/$_gnudir/$dest"
|
||||||
${__ln_s} ../${_bindir}/$program ${program:1}
|
${__ln_s} ../${_bindir}/$program ${dest}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# gnu_link: Prepare for gnu symlink setup
|
||||||
|
# params: list of programs to link
|
||||||
|
# Each param is added to the internal gnu_link_progs array
|
||||||
|
# It will also add --program-prefix=$gnu_prefix to configure_args if requested
|
||||||
|
gnu_link()
|
||||||
|
{
|
||||||
|
local item
|
||||||
|
for item in "$@"
|
||||||
|
do
|
||||||
|
gnu_link_progs+=($item)
|
||||||
|
done
|
||||||
|
[ $gnu_configure -eq 1 ] && configure_args=(--program-prefix=$gnu_prefix "${configure_args[@]}")
|
||||||
|
}
|
||||||
|
|
||||||
#####################################################
|
#####################################################
|
||||||
# Define generic functions for different build stages
|
# Define generic functions for different build stages
|
||||||
#####################################################
|
#####################################################
|
||||||
@ -934,13 +950,11 @@ generic_install()
|
|||||||
if [ $autonuke -eq 1 ]; then
|
if [ $autonuke -eq 1 ]; then
|
||||||
do_autonuke
|
do_autonuke
|
||||||
fi
|
fi
|
||||||
if [ -n "$gnu_link_progs" ]; then
|
# If there are programs that should be linked to $prefix/$_gnudir
|
||||||
# There are programs that should be linked to $prefix/$_gnudir
|
|
||||||
local prog
|
local prog
|
||||||
for prog in $gnu_link_progs; do
|
for prog in "${gnu_link_progs[@]}"; do
|
||||||
gnu_link ${gnu_prefix}${prog}
|
do_gnu_link ${gnu_prefix}${prog}
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# generic_install_perl(): Install already built perl module
|
# generic_install_perl(): Install already built perl module
|
||||||
|
@ -96,7 +96,7 @@ _mandir=share/man
|
|||||||
_infodir=share/info
|
_infodir=share/info
|
||||||
|
|
||||||
# Default configure args
|
# Default configure args
|
||||||
configure_args=(${gnu_link_progs:+--program-prefix=$gnu_prefix} --prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir})
|
configure_args=(--prefix=$prefix --mandir=${prefix}/${_mandir} --infodir=${prefix}/${_infodir})
|
||||||
|
|
||||||
# Host specific configuration
|
# Host specific configuration
|
||||||
[ -r $buildpkgscripts/config.`hostname`.solaris ] && . $buildpkgscripts/config.`hostname`.solaris
|
[ -r $buildpkgscripts/config.`hostname`.solaris ] && . $buildpkgscripts/config.`hostname`.solaris
|
||||||
|
Loading…
x
Reference in New Issue
Block a user