Difference between revisions of "User:Dyrcona/LeopardBuild"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Scripts and Environment Files: Add --disable-binfilter to reflect what I'm actually building at the moment.)
(File Organization: Add mention of diff subdirectory.)
Line 5: Line 5:
 
If you work on several different projects, not just OO.o, you might like to keep your code files neatly organized and separate from your other files. To that end, I suggest creating a subdirectory, called <code>Sources</code>, in your home directory. In this directory, you could create a subdirectory for each of your major projects. Thus, the code for each project is neatly organized and distinct from the others.
 
If you work on several different projects, not just OO.o, you might like to keep your code files neatly organized and separate from your other files. To that end, I suggest creating a subdirectory, called <code>Sources</code>, in your home directory. In this directory, you could create a subdirectory for each of your major projects. Thus, the code for each project is neatly organized and distinct from the others.
  
In the case of OO.o, a further subdivision of the project directory helps to organize the various builds and other files. First, one has the main OO.o project directory, <code>${HOME}/Sources/OpenOffice.org/</code>, where all of the OpenOffice.org-related code and build files may be kept. Under this main project directory, a <code>bin</code> subdirectory is a useful place to keep some scripts and environment files. Side by side with this <code>bin</code> subdirectory sits another called <code>prebuild</code>. It stores the various pre-built binaries that are recommended to speed up the total OO.o build process. Finally, one of the scripts in the <code>bin</code> will create a build directory for a milestone  based on the CVS tag. The structure of this layout looks something like the following:
+
In the case of OO.o, a further subdivision of the project directory helps to organize the various builds and other files. First, one has the main OO.o project directory, <code>${HOME}/Sources/OpenOffice.org/</code>, where all of the OpenOffice.org-related code and build files may be kept. Under this main project directory, a <code>bin</code> subdirectory is a useful place to keep some scripts and environment files. Side by side with this <code>bin</code> subdirectory sits another called <code>prebuild</code>. It stores the various pre-built binaries that are recommended to speed up the total OO.o build process. If you work on more than one release at a time, or if you try different milestones, then you will likely want a subdirectory name for each milestone CVS tag that you checkout. You might also want to incorporate the name of any CWS that you integrate into that build. Finally, once you begin actually making changes to the OpenOffice.org code, or if you receive any patches from another developer, you will want a directory to store these. I call this directory <code>diff</code> in my setup.
 +
 
 +
The structure of this layout looks something like the following:
  
 
<pre>
 
<pre>
 
${HOME}/Sources/OpenOffice.org/
 
${HOME}/Sources/OpenOffice.org/
 
                               bin/
 
                               bin/
 +
                              diff/
 
                               prebuild/
 
                               prebuild/
 
                               ${CVSTAG}/
 
                               ${CVSTAG}/

Revision as of 01:16, 21 March 2008

File Organization

OpenOffice.org is a large project. A fresh checkout of a recent development milestone (DEV300_m3) comprises 98,117 files in 13,307 directories that occupy about 1.8 GB of space on disk. Those 13,307 directories are themselves split among 179 modules, each module being a top-level directory. Good file organization is necessary to work effectively with such a large project.

If you work on several different projects, not just OO.o, you might like to keep your code files neatly organized and separate from your other files. To that end, I suggest creating a subdirectory, called Sources, in your home directory. In this directory, you could create a subdirectory for each of your major projects. Thus, the code for each project is neatly organized and distinct from the others.

In the case of OO.o, a further subdivision of the project directory helps to organize the various builds and other files. First, one has the main OO.o project directory, ${HOME}/Sources/OpenOffice.org/, where all of the OpenOffice.org-related code and build files may be kept. Under this main project directory, a bin subdirectory is a useful place to keep some scripts and environment files. Side by side with this bin subdirectory sits another called prebuild. It stores the various pre-built binaries that are recommended to speed up the total OO.o build process. If you work on more than one release at a time, or if you try different milestones, then you will likely want a subdirectory name for each milestone CVS tag that you checkout. You might also want to incorporate the name of any CWS that you integrate into that build. Finally, once you begin actually making changes to the OpenOffice.org code, or if you receive any patches from another developer, you will want a directory to store these. I call this directory diff in my setup.

The structure of this layout looks something like the following:

${HOME}/Sources/OpenOffice.org/
                               bin/
                               diff/
                               prebuild/
                               ${CVSTAG}/
                               .../

Getting Pre-built Binaries

This is currently in a state of flux, but I'll soon post the links and other information needed to get the pre-built binaries for

Mozilla

unowinreg.dll

Scripts and Environment Files

(Some text needs to be filled in here, but it is getting late and I'm tired, so I'll finish this tomorrow.)

env.sh

export CCACHE_DIR="$(pwd)/.ccache"
export CC="ccache gcc"
export CXX="ccache g++"
export TMP=/tmp
export SYSTEM_OPENSSL=YES

mkBuildDir.sh

#!/bin/sh

cvsTag=${1}
CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:2401/cvs 
where=$(pwd)

if [ "${where}" != "${HOME}/Sources/OpenOffice.org" ]; then
    cd ${HOME}/Sources/OpenOffice.org
fi

if [ -e ${cvsTag} ]; then
    if [ -d ${cvsTag} ]; then
        echo "${cvsTag} already exists and is a directory"
        read -p "Do you wish to continue (y|n)? " readContinue
        case "${readContinue}" in
            y|Y|yes|YES)
                echo "Expect undesired results if ${cvsTag} is not empty"
                cd "${cvsTag}"
                ;;
            *)
                exit 1
                ;;
        esac
    else
        echo "${cvsTag} is not a directory"
        exit 1;
    fi
else
    mkdir ${cvsTag}
    cd ${cvsTag}
fi

cvs -z4 -d ${CVSROOT} co -r ${cvsTag} OpenOffice2

# Copy the Mozilla and unowinreg.dll pre-builts to the proper place.
cp ${HOME}/Sources/OpenOffice.org/prebuild/MACOSXGCC*.zip ./moz/zipped/
cp ${HOME}/Sources/OpenOffice.org/prebuild/unowinreg.dll ./external/unowinreg/

# Link the pre-existing build script
cd config_office/
ln -s ../../bin/build.sh

build.sh

#!/bin/sh
export BASE=`pwd|sed 's/\/config_office//'`
export OOVERSION=`echo $BASE|sed 's/^\/.*\///'`
echo Building from     : $BASE
echo OpenOffice Version: $OOVERSION
./configure \
--with-lang="en-US" \
--disable-binfilter \
--disable-pasf \
--disable-gtk \
--disable-build-mozilla \
--with-build-version=$OOVERSION-`date +%d-%m-%y` \
--disable-fontconfig \
--disable-headless \
--without-nas \
--with-use-shell=bash \
--with-jdk-home=/System/Library/Frameworks/JavaVM.framework/Home \
--with-stlport=no

The Build

Again, some explanatory text should go here.

In the ${CVSTAG} directory:

source ../bin/env.sh
cd config_office/
./build.sh
cd ..
./bootstrap
source MacOSXX86Env.Set.sh
cd instsetoo_native
build --all -P4 --dlv_switch -link  

Installing/Using the Result

You will find .dmg images files with installable apps in the following two directories under your main build directory, the one named for the CVS tag that you checked out earlier. The exact names of the dmg files will vary as they will include the date of the build, but there should be only 1 dmg file per directory unless you've done multiple builds.

instsetoo_native/unxmacxi.pro/OpenOffice/dmg/install/en-US
instsetoo_native/unxmacxi.pro/OpenOffice_SDK/dmg/install/en-US


You can install the OpenOffice.org.app from the dmg to almost anywhere on your system and it should work just fine. I usually place it in my Applications folder. You can also drag the icon to the dock, and that works. If you have a previous installation of OpenOffice.org in your Applications folder, I highly recommend dragging it to the Trash before installing the new OO.o in the Applicaitons folder. If you wish to have multiple versions of OO.o installed for testing or whatever reason, then it is best to install the OO.o that you just built some place other than the Applications folder.

At the time of this edit, I don't exactly know what to do with the SDK dmg. I'll do some investigation and come back when I know more.

Hacking OO.o

Once I've had some more time for code changes of my own, I'll add a subpage about hacking OO.o on Mac OS X, managing patches, etc. I have an idea for an example hack, too.

Personal tools