[PC-BSD Commits] r5514 - in pbibuild: pbibuilder7/pbicreator pbibuilder7/pbicreator/PBIfiles pbibuilder7/scripts pbibuilder8/pbicreator pbibuilder8/pbicreator/PBIfiles pbibuilder8/scripts
svn at pcbsd.org
svn at pcbsd.org
Wed Dec 9 11:40:33 PST 2009
Author: kris
Date: 2009-12-09 11:40:33 -0800 (Wed, 09 Dec 2009)
New Revision: 5514
Modified:
pbibuild/pbibuilder7/pbicreator/PBIfiles/copylibs.sh
pbibuild/pbibuilder7/pbicreator/createpbi.sh
pbibuild/pbibuilder7/scripts/3.makepbi.sh
pbibuild/pbibuilder8/pbicreator/PBIfiles/copylibs.sh
pbibuild/pbibuilder8/pbicreator/createpbi.sh
pbibuild/pbibuilder8/scripts/3.makepbi.sh
Log:
Update to the pbibuilder, started adding support for auto-linking in system fonts, libGL by default
the developer can disable this in a module however
Modified: pbibuild/pbibuilder7/pbicreator/PBIfiles/copylibs.sh
===================================================================
--- pbibuild/pbibuilder7/pbicreator/PBIfiles/copylibs.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder7/pbicreator/PBIfiles/copylibs.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -117,6 +117,20 @@
mkdir -p ${2} >/dev/null 2>/dev/null
rm /tmp/.pbilddlist >/dev/null 2>/dev/null
+
+# Dont run on linux binaries
+file ${LDDFILE} | grep "Linux" >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ exit
+fi
+
+# Dont check sym-links
+if [ -h "$LDDFILE" ]
+then
+ exit
+fi
+
ldd ${LDDFILE} 2>/dev/null | grep -v 'not found' >/tmp/.pbilddlist
if [ "$?" != "0" ]
then
Modified: pbibuild/pbibuilder7/pbicreator/createpbi.sh
===================================================================
--- pbibuild/pbibuilder7/pbicreator/createpbi.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder7/pbicreator/createpbi.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -45,6 +45,10 @@
# Get the directory of the program
PBILOC="`cat ${PBCFILE} | grep PackageDir | cut -d " " -f 2-5`" ; export PBILOC
+# Figure out if we need to prune the fonts / GL libs
+PBIUSESYSFONTS="`cat ${PBCFILE} | grep ProgUseSysFonts: | cut -d " " -f 2-5`" ; export PBIUSESYSFONTS
+PBIUSESYSGL="`cat ${PBCFILE} | grep ProgUseSysGL | cut -d " " -f 2-5`" ; export PBIUSESYSGL
+
# Now start creating the PkgConfig file from the data in the PBC file
############################################################################
echo -e "Creating PkgConfig file...\t\c"
@@ -82,6 +86,11 @@
echo "ProgSize: $PBISIZE" >> ${WORKDIR}/PkgConfig
fi
+# Figure out the PBI name for the /Programs/<progname>
+cat ${PBCFILE} | grep '^ProgName:' | cut -d ' ' -f 2-10 >${WORKDIR}/.s1
+sed -e "s, ,,g" ${WORKDIR}/.s1 > ${WORKDIR}/.s2
+TMPNAME="`cat ${WORKDIR}/.s2`"
+PBIPROGDIR="${TMPNAME}"
# Check if we need to include the license file
cat ${PBCFILE} | grep '^License: YES' >/dev/null
@@ -115,10 +124,10 @@
then
echo -e "Populating libraries...\t\c"
- # Make sure the autolibs directory is made in the PBI folder
- mkdir "${PBILOC}/autolibs" >/dev/null 2>/dev/null
+ # Make sure the lib directory is made in the PBI folder
+ mkdir "${PBILOC}/lib" >/dev/null 2>/dev/null
- echo "Checking for libs in the ExePath: Variables"
+ echo "Checking for lib in the ExePath: Variables"
# Now loop through the ExePath variables and grab the libs for each
while read line
do
@@ -127,7 +136,7 @@
if [ "$?" = "0" ]
then
BINARY="`echo $line | grep '^ExePath:' | cut -d ' ' -f 2-5`"
- ${PROGDIR}/PBIfiles/copylibs.sh ${PBILOC}/${BINARY} ${PBILOC}/autolibs/ ${PROGDIR}
+ ${PROGDIR}/PBIfiles/copylibs.sh ${PBILOC}/${BINARY} ${PBILOC}/lib/ ${PROGDIR}
fi
done < ${PBCFILE}
@@ -139,7 +148,7 @@
echo "Checking binaries in $d for required libraries"
for i in `ls ${d}`
do
- ${PROGDIR}/PBIfiles/copylibs.sh ${d}/${i} ${PBILOC}/autolibs/ ${PROGDIR}
+ ${PROGDIR}/PBIfiles/copylibs.sh ${d}/${i} ${PBILOC}/lib/ ${PROGDIR}
done
done
@@ -147,8 +156,9 @@
LD_LIBRARY_OLD="${LD_LIBRARY_PATH}"
# Copy the ldconfig directory over, this will be used by pbi installer when running apps
- rm -rf ${PBILOC}/libdata
- cp -r /usr/local/libdata ${PBILOC}/libdata
+ rm -rf ${PBILOC}/libdata/
+ mkdir ${PBILOC}/libdata
+ cp -r /usr/local/libdata/ldconfig ${PBILOC}/libdata/
# Setup our extra LIBDIRS in ldconfig
LDCONFIGDIRS=""
@@ -160,21 +170,32 @@
then
LDCONFIGDIRS="${TMP}:${LDCONFIGDIRS}"
fi
+
+ # Make sure we massage any /usr/local entries, in case we built
+ # with a /usr/local LOCALBASE
+ echo $LDCONFIGDIRS | grep "^/usr/local" >/dev/null 2>/dev/null
+ if [ "$?" = "0" ]
+ then
+ cat ${PBILOC}/libdata/ldconfig/${i} \
+ | sed -e "s|/usr/local|/Programs/${PBIPROGDIR}|g" \
+ > ${PBILOC}/libdata/ldconfig/${i}.tmp
+ mv ${PBILOC}/libdata/ldconfig/${i}.tmp ${PBILOC}/libdata/ldconfig/${i}
+ fi
done
# Make sure we parse any .so files, to find any libs they may require as well
LIBFILES="`find ${PBILOC} -type f -print | grep '\.so$'`"
for i in ${LIBFILES}
do
- file ${i} | grep "dynamically linked" >/dev/null 2>/dev/null
+ file ${i} | grep "shared object" >/dev/null 2>/dev/null
if [ "$?" = "0" ]
then
echo "Checking libraries required for ${i}"
LIBDIR="`dirname ${i}`"
- LD_LIBRARY_PATH="${PBILOC}/autolibs:$LIBDIR:${LDCONFIGDIRS}" ; export LD_LIBRARY_PATH
+ LD_LIBRARY_PATH="${PBILOC}/lib:$LIBDIR:${LDCONFIGDIRS}" ; export LD_LIBRARY_PATH
# Copy over the libs for this file now
- ${PROGDIR}/PBIfiles/copylibs.sh ${i} ${PBILOC}/autolibs/ ${PROGDIR}
+ ${PROGDIR}/PBIfiles/copylibs.sh ${i} ${PBILOC}/lib/ ${PROGDIR}
fi
done
@@ -189,6 +210,24 @@
echo "Done!"
fi
+# Check if we need to remove the fonts / GL libs from this PBI
+###############################################################################
+if [ "$PBIUSESYSGL" = "YES" ]
+then
+ # Make sure we only use the libGL on the system
+ rm ${PBILOC}/lib/libGl.* >/dev/null 2>/dev/null
+ rm ${PBILOC}/lib/libGL.* >/dev/null 2>/dev/null
+ rm ${PBILOC}/lib/libGLU.* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIUSESYSFONTS" = "YES" ]
+then
+ # Make sure we only use the fonts on the system
+ rm -rf ${PBILOC}/etc/fonts >/dev/null 2>/dev/null
+ rm -rf ${PBILOC}/lib/X11/fonts >/dev/null 2>/dev/null
+fi
+
+
# Create the tarball now
###############################################################################
@@ -207,7 +246,7 @@
chmod 755 ${WORKDIR}/addpbimime.sh
# Start the creation of the tar.lzma file
-tar cvf - -C ${PBILOC} . 2>${WORKDIR}/.lines | ${PROGDIR}/PBIfiles/lzma e -si ${WORKDIR}/Package.tar.lzma 2>/dev/null
+tar cvf - -C ${PBILOC} . 2>${WORKDIR}/.lines | ${PROGDIR}/PBIfiles/lzma -z -c - >${WORKDIR}/Package.tar.lzma 2>/dev/null
if [ "$?" != "0" ]
then
echo "ERROR: Tar / lzma failed!"
@@ -252,6 +291,12 @@
cp ${PROGDIR}/PBIfiles/PBItext ${WORKDIR}/
cp ${PROGDIR}/PBIfiles/PBI ${WORKDIR}/
+if [ -e "${PROGDIR}/PBIfiles/PBI64" ]
+then
+ cp ${PROGDIR}/PBIfiles/PBI64 ${WORKDIR}/
+ cp ${PROGDIR}/PBIfiles/PBItext64 ${WORKDIR}/
+fi
+
# Now copy over any .qm lang files
cp ${PROGDIR}/PBIfiles/*.qm ${WORKDIR}/
Modified: pbibuild/pbibuilder7/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder7/scripts/3.makepbi.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder7/scripts/3.makepbi.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -43,6 +43,8 @@
PBIAUTOPOPULATE="" ; export PBIAUTOPOPULATE
PBIAUTOPOPULATE_OTHERPORT="" ; export PBIAUTOPOPULATE_OTHERPORT
PBIAUTOPOPULATE_PORTS="" ; export PBIAUTOPOPULATE_PORTS
+PBIDISABLEFONTLINK="" ; export PBIDISABLEFONTLINK
+PBIKEEPGL="" ; export PBIKEEPGL
INMATEVER="" ; export INMATEVER
BUILDINMATE="" ; export BUILDINMATE
@@ -195,6 +197,21 @@
tar cvf - -C /module/overlay-dir . 2>/dev/null | tar xvpf - -C ${PBIDIR} 2>/dev/null
fi
+# Set our GL / Font variables
+if [ "${PBIDISABLEFONTLINK}" = "YES" ]
+then
+ USESYSFONTS="NO";
+else
+ USESYSFONTS="YES";
+fi
+
+if [ "${PBIKEEPGL}" = "YES" ]
+then
+ USESYSGL="NO"
+else
+ USESYSGL="YES"
+fi
+
# Start the creation of the .pbc file
echo "Starting build of pbc file..."
echo "[ PBC 1.0 ]
@@ -202,6 +219,8 @@
ProgVersion: ${PORTVER}
ProgWeb: ${PROGWEB}
ProgAuthor: ${PROGAUTHOR}
+ProgUseSysFonts: ${USESYSFONTS}
+ProgUseSysGL: ${USESYSGL}
PBIVer: 0
PBIUpdate: ${PBIUPDATE}
PackageDir: ${PBIDIR}/
@@ -247,13 +266,15 @@
fi
# Set some variables for build.sh to use
-CPROGNAME="`echo $PROGNAME | tr -d ' '`"
+CPROGNAME=`echo $PROGNAME | sed "s| ||g"`
PBI_TARGETFULLDIR="${PBILOCALBASE}"
PBI_TARGETDIR="${CPROGNAME}"
PBI_CURDIR="${PBIDIR}"
PBI_VERSION="${PORTVER}"
export PBI_CURDIR PBI_TARGETFULLDIR PBI_TARGETDIR PBI_VERSION
+echo "KPM: $PBI_TARGETDIR $PBI_TARGETFULLDIR $PBI_CURDIR $PBI_VERSION" > /tmp/err
+
# Check if we have a build.sh script to run afterwards
if [ -e "/module/build.sh" ]
then
Modified: pbibuild/pbibuilder8/pbicreator/PBIfiles/copylibs.sh
===================================================================
--- pbibuild/pbibuilder8/pbicreator/PBIfiles/copylibs.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder8/pbicreator/PBIfiles/copylibs.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -117,6 +117,20 @@
mkdir -p ${2} >/dev/null 2>/dev/null
rm /tmp/.pbilddlist >/dev/null 2>/dev/null
+
+# Dont run on linux binaries
+file ${LDDFILE} | grep "Linux" >/dev/null 2>/dev/null
+if [ "$?" = "0" ]
+then
+ exit
+fi
+
+# Dont check sym-links
+if [ -h "$LDDFILE" ]
+then
+ exit
+fi
+
ldd ${LDDFILE} 2>/dev/null | grep -v 'not found' >/tmp/.pbilddlist
if [ "$?" != "0" ]
then
Modified: pbibuild/pbibuilder8/pbicreator/createpbi.sh
===================================================================
--- pbibuild/pbibuilder8/pbicreator/createpbi.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder8/pbicreator/createpbi.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -45,6 +45,10 @@
# Get the directory of the program
PBILOC="`cat ${PBCFILE} | grep PackageDir | cut -d " " -f 2-5`" ; export PBILOC
+# Figure out if we need to prune the fonts / GL libs
+PBIUSESYSFONTS="`cat ${PBCFILE} | grep ProgUseSysFonts: | cut -d " " -f 2-5`" ; export PBIUSESYSFONTS
+PBIUSESYSGL="`cat ${PBCFILE} | grep ProgUseSysGL | cut -d " " -f 2-5`" ; export PBIUSESYSGL
+
# Now start creating the PkgConfig file from the data in the PBC file
############################################################################
echo -e "Creating PkgConfig file...\t\c"
@@ -206,6 +210,24 @@
echo "Done!"
fi
+# Check if we need to remove the fonts / GL libs from this PBI
+###############################################################################
+if [ "$PBIUSESYSGL" = "YES" ]
+then
+ # Make sure we only use the libGL on the system
+ rm ${PBILOC}/lib/libGl.* >/dev/null 2>/dev/null
+ rm ${PBILOC}/lib/libGL.* >/dev/null 2>/dev/null
+ rm ${PBILOC}/lib/libGLU.* >/dev/null 2>/dev/null
+fi
+
+if [ "$PBIUSESYSFONTS" = "YES" ]
+then
+ # Make sure we only use the fonts on the system
+ rm -rf ${PBILOC}/etc/fonts >/dev/null 2>/dev/null
+ rm -rf ${PBILOC}/lib/X11/fonts >/dev/null 2>/dev/null
+fi
+
+
# Create the tarball now
###############################################################################
Modified: pbibuild/pbibuilder8/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder8/scripts/3.makepbi.sh 2009-12-09 17:32:42 UTC (rev 5513)
+++ pbibuild/pbibuilder8/scripts/3.makepbi.sh 2009-12-09 19:40:33 UTC (rev 5514)
@@ -43,6 +43,8 @@
PBIAUTOPOPULATE="" ; export PBIAUTOPOPULATE
PBIAUTOPOPULATE_OTHERPORT="" ; export PBIAUTOPOPULATE_OTHERPORT
PBIAUTOPOPULATE_PORTS="" ; export PBIAUTOPOPULATE_PORTS
+PBIDISABLEFONTLINK="" ; export PBIDISABLEFONTLINK
+PBIKEEPGL="" ; export PBIKEEPGL
INMATEVER="" ; export INMATEVER
BUILDINMATE="" ; export BUILDINMATE
@@ -195,6 +197,21 @@
tar cvf - -C /module/overlay-dir . 2>/dev/null | tar xvpf - -C ${PBIDIR} 2>/dev/null
fi
+# Set our GL / Font variables
+if [ "${PBIDISABLEFONTLINK}" = "YES" ]
+then
+ USESYSFONTS="NO";
+else
+ USESYSFONTS="YES";
+fi
+
+if [ "${PBIKEEPGL}" = "YES" ]
+then
+ USESYSGL="NO"
+else
+ USESYSGL="YES"
+fi
+
# Start the creation of the .pbc file
echo "Starting build of pbc file..."
echo "[ PBC 1.0 ]
@@ -202,6 +219,8 @@
ProgVersion: ${PORTVER}
ProgWeb: ${PROGWEB}
ProgAuthor: ${PROGAUTHOR}
+ProgUseSysFonts: ${USESYSFONTS}
+ProgUseSysGL: ${USESYSGL}
PBIVer: 0
PBIUpdate: ${PBIUPDATE}
PackageDir: ${PBIDIR}/
@@ -247,13 +266,15 @@
fi
# Set some variables for build.sh to use
-CPROGNAME="`echo $PROGNAME | tr -d ' '`"
+CPROGNAME=`echo $PROGNAME | sed "s| ||g"`
PBI_TARGETFULLDIR="${PBILOCALBASE}"
PBI_TARGETDIR="${CPROGNAME}"
PBI_CURDIR="${PBIDIR}"
PBI_VERSION="${PORTVER}"
export PBI_CURDIR PBI_TARGETFULLDIR PBI_TARGETDIR PBI_VERSION
+echo "KPM: $PBI_TARGETDIR $PBI_TARGETFULLDIR $PBI_CURDIR $PBI_VERSION" > /tmp/err
+
# Check if we have a build.sh script to run afterwards
if [ -e "/module/build.sh" ]
then
More information about the Commits
mailing list