Enhance InstallOptionalHaikuImagePackage to accept a new parameter, which

indicates the archive to be usable with either GCC. When utilized, the
packages shared libraries will automatically be symlinked in the alternative
gcc subdir, eg common/lib/gcc4. At the moment, packages that set isCDPackage
are not supported, as Installer needs to be enhanced.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36456 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-04-24 19:52:36 +00:00
parent b64b6705ad
commit 4eb0a8c2fd
4 changed files with 98 additions and 12 deletions
+54 -3
View File
@@ -6,6 +6,8 @@ set -o errexit
# outputDir
# tmpDir
# addBuildCompatibilityLibDir
# gccVersion
# isHybridBuild
# The following are only for image types:
# installDir
# isImage
@@ -94,20 +96,20 @@ else
mkindex=mkindex
fi
extractFile()
{
# extractFile <archive> <directory>
archiveFile=$1
targetExtractedDir=$2
extractedSubDir=$3
isGCCAgnostic=$4
echo "Extracting $archiveFile ..."
extractDir=$tmpDir/extract
$rmAttrs -rf "$extractDir"
mkdir -p "$extractDir"
case "$archiveFile" in
*.zip)
$unzip -q -d "$extractDir" "$archiveFile"
@@ -120,19 +122,68 @@ extractFile()
exit 1
;;
esac
if [ -f $extractDir/.OptionalPackageDescription ]; then
cat $extractDir/.OptionalPackageDescription >> $copyrightsFile
echo >> $copyrightsFile
rm $extractDir/.OptionalPackageDescription
fi
if [ "$isGCCAgnostic" == "true" ] && [ $isHybridBuild ] ; then
#if [ $isGCCAgnostic -eq 1 ] && [ $isHybridBuild ] ; then
extractedLibs=`find "$extractDir/$extractedSubDir/" -name "*.so"`
moreExtractedLibs=`find "$extractDir/$extractedSubDir/" -name "*.so.*"`
createSymlinksForHybrid $extractedLibs $moreExtractedLibs
fi
$cp -r "${sPrefix}$extractDir/$extractedSubDir/." "${tPrefix}$targetExtractedDir"
$rmAttrs -rf "$extractDir"
}
createSymlinksForHybrid()
{
# createSymlinksForHybrid <libraries>
# Determine the alternative gcc subdir.
if [ $gccVersion -eq 2 ]; then
gccAltDir=gcc4
else
gccAltDir=gcc2
fi
# Iterate over the library file paths that were passed in.
for srcPathLib in $@; do
# determine the relative path of the library
relPathLib=`echo $srcPathLib | \
sed -e "s:${extractDir}/${extractedSubDir}/::"`
relPath=`dirname $relPathLib`
# check if that relative path is one of the standard library paths
standardLibPaths="system/lib common/lib home/config/lib"
isStandardPath=
for stdLibPath in $standardLibPaths; do
if [ "$relPath" == "$stdLibPath" ]; then
isStandardPath=true
break
fi
done
# create alt gcc symlinks for libs inside standard paths
if [ $isStandardPath ]; then
srcPath=`dirname $srcPathLib`
srcLib=`basename $srcPathLib`
destLinkDir="${srcPath}/${gccAltDir}"
destLinkTarget="../$srcLib"
mkdir -p $destLinkDir
ln -sf -t $destLinkDir $destLinkTarget
fi
done
}
mkdir -p $tmpDir
copyrightsFile=$tmpDir/copyrights
$rmAttrs -f $copyrightsFile