diff --git a/.gitattributes b/.gitattributes index 7afb91c283..626e966de7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2409,6 +2409,9 @@ tools/install/macosx/fpc_installer_info.zip -text svneol=unset#application/zip tools/install/macosx/fpcsrc-release.packproj.template svneol=native#text/plain tools/install/macosx/fpcsrc.packproj.template svneol=native#text/plain tools/install/macosx/lazarus.packproj.template svneol=native#text/plain +tools/install/macosx/makefpcsnapshot.sh svneol=native#text/plain +tools/install/macosx/makefpcsrcsnapshot.sh svneol=native#text/plain +tools/install/macosx/makelazsnapshot.sh svneol=native#text/plain tools/install/replace_in_files.pl -text svneol=native#application/x-perl tools/install/rpm/create_nonroot_rpmmacros.sh svneol=native#text/plain tools/install/rpm/fpc.spec.template svneol=native#text/plain diff --git a/tools/install/macosx/makefpcsnapshot.sh b/tools/install/macosx/makefpcsnapshot.sh new file mode 100755 index 0000000000..5cf1d2b67c --- /dev/null +++ b/tools/install/macosx/makefpcsnapshot.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash + +set -e + +PPCARCH=ppcppc +SVN=/usr/local/bin/svn +FREEZE=/usr/bin/freeze +HDIUTIL=/usr/bin/hdiutil +UPDATELIST=~/tmp/updatelist + +TEMPLATEDIR=~/src/lazarus/tools/install/macosx + +FPCSVNDIR=~/src/fpc/build +FPCSOURCEDIR=$FPCSVNDIR/fpcsrc +PPC_RELEASE=/usr/local/lib/fpc/2.0.2/$PPCARCH +BUILDDIR=~/tmp/build +FPCBUILDDIR=$BUILDDIR/fpc +INSTALLDIR=~/tmp/fpc +INSTALLFPCDIR=~/fpc + +DATESTAMP=`date +%Y%m%d` +FPCPACKPROJ=fpc.packproj + +cd $FPCSVNDIR +$SVN update + +if [ ! -d $BUILDDIR ] ; then + mkdir -p $BUILDDIR +else + if [ -d $FPCBUILDDIR ] ; then + rm -rf $FPCBUILDDIR + fi +fi + +$SVN export $FPCSVNDIR $FPCBUILDDIR +$SVN export $FPCSVNDIR/fpcsrc $FPCBUILDDIR/fpcsrc +$SVN export $FPCSVNDIR/fpcdocs $FPCBUILDDIR/fpcdocs + +cd $FPCBUILDDIR +make distclean PP=$PPC_RELEASE +make build PP=$PPC_RELEASE + +COMPILER=$FPCBUILDDIR/fpcsrc/compiler/$PPCARCH +FPCVERSION=`$COMPILER -iV` +FPCARCH=`$COMPILER -iSP` + +# clean installdir: since I am not root and the install dir can contain files owned by root +# created by a previous freeze, I just move it out of the way +if [ ! -d /tmp/vsnijders/trash ] ; then + mkdir -p /tmp/vsnijders/trash +fi +rm -rf $INSTALLDIR +if [ -d $INSTALLDIR ]; then + mv $INSTALLDIR /tmp/vsnijders/trash/ +fi +mkdir -p $INSTALLDIR +make install PP=$COMPILER INSTALL_PREFIX=$INSTALLDIR + +# create symlink using relative paths, make symlinkinstall uses absolute path, +# which then ends up as link to the temporary build path +# on the user's machine after installation +ln -sf ../lib/fpc/$FPCVERSION/ppcppc $INSTALLDIR/bin/$PPCARCH + +# install for use by lazarus +cd fpcsrc +make compiler_install rtl_install fcl_install packages_install utils_install \ + INSTALL_PREFIX=$INSTALLFPCDIR PP=$COMPILER FPCMAKE=$FPCBUILDDIR/fpcsrc/utils/fpcm/fpcmake +make -C compiler installsymlink PP=$COMPILER INSTALL_PREFIX=$INSTALLFPCDIR + + +# fill in packproj template. +OLDIFS=$IFS +IFS=. +FPCMAJORVERSION=`set $FPCVERSION; echo $1` +FPCMINORVERSION=`set $FPCVERSION; echo $2$3` +IFS=$OLDIFS +sed -e "s|_PPCARCH_|$PPCARCH|g" -e "s|_FPCSRCDIR_|$FPCSVNDIR|g" -e "s|_FPCVERSION_|$FPCVERSION|g" \ + -e "s|_DATESTAMP_|$DATESTAMP|g" -e s/_FPCMAJORVERSION_/$FPCMAJORVERSION/g -e s/_FPCMINORVERSION_/$FPCMINORVERSION/g \ + $TEMPLATEDIR/$FPCPACKPROJ.template > $INSTALLDIR/$FPCPACKPROJ + +# build package +$FREEZE -v $INSTALLDIR/$FPCPACKPROJ + +DMGFILE=~/pkg/fpc-$FPCVERSION-$DATESTAMP-$FPCARCH-macosx.dmg +rm -rf $DMGFILE + +$HDIUTIL create -anyowners -volname fpc-$FPCVERSION -imagekey zlib-level=9 -format UDZO -srcfolder $INSTALLDIR/build $DMGFILE + +if [ -e $DMGFILE ]; then +#update lazarus snapshot web page + echo "$DMGFILE fpc-*-*-$FPCARCH-macosx.dmg" >> $UPDATELIST +fi diff --git a/tools/install/macosx/makefpcsrcsnapshot.sh b/tools/install/macosx/makefpcsrcsnapshot.sh new file mode 100755 index 0000000000..931eb61c2b --- /dev/null +++ b/tools/install/macosx/makefpcsrcsnapshot.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +set -e + +PPCARCH=ppcppc +SVN=/usr/local/bin/svn +FREEZE=/usr/bin/freeze +HDIUTIL=/usr/bin/hdiutil +UPDATELIST=~/tmp/updatelist + +TEMPLATEDIR=~/etc/templates + +FPCSVNDIR=~/src/fpc/build +FPCSOURCEDIR=$FPCSVNDIR/fpcsrc +COMPILER=~/fpc/bin/$PPCARCH +INSTALLDIR=~/tmp/fpcsrc + +DATESTAMP=`date +%Y%m%d` +PACKPROJ=fpcsrc.packproj + +# clean installdir: since I am not root and the install dir can contain files owned by root +# created by a previous freeze, I just move it out of the way +if [ ! -d /tmp/fpcfan/trash ] ; then + mkdir -p /tmp/fpcfan/trash +fi +if [ -d $INSTALLDIR ] ; then + mv $INSTALLDIR /tmp/fpcfan/trash/fpcsrc-`date +%Y%m%d%H%M%S` +fi + +# copy sources +mkdir -p $INSTALLDIR/fpcsrc +$SVN export $FPCSOURCEDIR/rtl $INSTALLDIR/fpcsrc/rtl +$SVN export $FPCSOURCEDIR/fcl $INSTALLDIR/fpcsrc/fcl +$SVN export $FPCSOURCEDIR/packages $INSTALLDIR/fpcsrc/packages + +# fill in packproj template. +FPCVERSION=`$COMPILER -iV` +FPCARCH=`$COMPILER -iSP` +OLDIFS=$IFS +IFS=. +FPCMAJORVERSION=`set $FPCVERSION; echo $1` +FPCMINORVERSION=`set $FPCVERSION; echo $2$3` +IFS=$OLDIFS +sed -e "s|_FPCSRCDIR_|$FPCSVNDIR|g" -e "s|_FPCVERSION_|$FPCVERSION|g" \ + -e "s|_DATESTAMP_|$DATESTAMP|g" -e s/_FPCMAJORVERSION_/$FPCMAJORVERSION/g -e s/_FPCMINORVERSION_/$FPCMINORVERSION/g \ + $TEMPLATEDIR/$PACKPROJ > $INSTALLDIR/$PACKPROJ + +# build package +$FREEZE -v $INSTALLDIR/$PACKPROJ + +DMGFILE=~/pkg/fpcsrc-$FPCVERSION-$DATESTAMP-$FPCARCH-macosx.dmg +rm -rf $DMGFILE + +$HDIUTIL create -anyowners -volname fpcsrc-$FPCVERSION -imagekey zlib-level=9 -format UDZO -srcfolder $INSTALLDIR/build $DMGFILE + +if [ -e $DMGFILE ]; then +#update lazarus snapshot web page + echo "$DMGFILE fpcsrc-*-*-$FPCARCH-macosx.dmg" >> $UPDATELIST +fi diff --git a/tools/install/macosx/makelazsnapshot.sh b/tools/install/macosx/makelazsnapshot.sh new file mode 100755 index 0000000000..6e23eecb6b --- /dev/null +++ b/tools/install/macosx/makelazsnapshot.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +set -e +set -x + +PPCARCH=ppcppc +SVN=/usr/local/bin/svn +FREEZE=/usr/bin/freeze +HDIUTIL=/usr/bin/hdiutil +UPDATELIST=~/tmp/updatelist + +LAZSOURCEDIR=~/src/lazsource + +COMPILER=~/fpc/bin/$PPCARCH +BUILDDIR=~/tmp/buildlaz +LAZBUILDDIR=$BUILDDIR/lazarus +DATESTAMP=`date +%Y%m%d` +PACKPROJ=lazarus.packproj +TEMPLATEDIR=$LAZSOURCEDIR/tools/install/macosx +rm -rf $BUILDDIR + +# copy sources +cd $LAZSOURCEDIR +$SVN update + +cd $LAZSOURCEDIR/tools/install +LAZVERSION=`./get_lazarus_version.sh` +cd - + +if [ -d $BUILDDIR ]; then + rm -rf $BUILDDIR +fi +mkdir -p $BUILDDIR +$SVN export $LAZSOURCEDIR $LAZBUILDDIR +if [ ! -e tools/svn2revisioninc ]; then + make tools PP=$COMPILER +fi +tools/svn2revisioninc $LAZSOURCEDIR $LAZBUILDDIR/ide/revision.inc + +cd $LAZBUILDDIR + +make bigide PP=$COMPILER +make lcl LCL_PLATFORM=carbon PP=$COMPILER +strip lazarus +strip startlazarus + +# copy license file, it must be a txt file. +cp $LAZBUILDDIR/COPYING.GPL $BUILDDIR/License.txt + +# fill in packproj template. +OLDIFS=$IFS +IFS=. +LAZMAJORVERSION=`set $LAZVERSION; echo $1` +LAZMINORVERSION=`set $LAZVERSION; echo $2$3` +FPCARCH=`$COMPILER -iSP` +IFS=$OLDIFS +sed -e "s|_LAZARUSDIR_|$LAZBUILDDIR|g" -e "s|_LAZVERSION_|$LAZVERSION|g" \ + -e "s|_DATESTAMP_|$DATESTAMP|g" -e s/_LAZMAJORVERSION_/$LAZMAJORVERSION/g \ + -e s/_LAZMINORVERSION_/$LAZMINORVERSION/g \ + $TEMPLATEDIR/$PACKPROJ.template > $BUILDDIR/$PACKPROJ + +# build package +$FREEZE -v $BUILDDIR/$PACKPROJ + +DMGFILE=~/pkg/lazarus-$LAZVERSION-$DATESTAMP-$FPCARCH-macosx.dmg +rm -rf $DMGFILE + +$HDIUTIL create -anyowners -volname lazarus-$LAZVERSION -imagekey zlib-level=9 \ + -format UDZO -srcfolder $BUILDDIR/build $DMGFILE + +if [ -e $DMGFILE ]; then +#update lazarus snapshot web page + echo "$DMGFILE lazarus-*-*-$FPCARCH-macosx.dmg " >> $UPDATELIST +fi