Education ClassRoom/Practice

From Apache OpenOffice Wiki
Jump to: navigation, search

Draft

Since we use subversion, some parts are obsolete, and need to be updated

Objective : create exercices, to practice OpenOffice.org tools used for development

TODO : define a list of items

Join the Project

Login and accounts

Find a page or a document

  • Find the web page for your own locale in OpenOffice.org project ( e.g. nl.openoffice.org )
  • Find the OpenOffice.org Coding Guidelines on the Wiki ( and read it ... )
  • Find the page about cws ( Child Workspace )
  • Find dev@gsl.openoffice.org mailing list archive
  • Subscribe to dev@education.openoffice.org mailing list if you didn't yet
  • Extract mails 10 to 14 from any mailing list


Bonsai use

  • Discover Bonsai
  • Visualize changes in a cws

1) Go to http://bonsai.go-oo.org/cvsqueryform.cgi

We'll try to do a request :)

2) Don't modify Module (must be All files in the repository ) Remark : note the name "repository "

3) In the Field "Branch" replace HEAD with cws_dev300_aquavcl07

4) in the field "Date" check "Since the beginning of time "

5) do not modify the other fields

6) Click "Run Query"

=> all the changes in the code, based on DEV300_m9 ( we'll explain later) are on the page !!

7) To see the diff for any commit, click in the Rev. columns. Back to retrieve the current page.

Strongly advised : 8) Look carefully at other changes, what information you can obtain here.

Remark: Bonsai helps when you are searching for changes in the code, author date .. precise information about CODE

LXR use

[Complete me]

Checkout the code

Preliminary:

- we suppose you have some bash knowledge, and some programming skills

- your .cvsrc file is ok (else ask on #education.openoffice.org )

Now, open a terminal, use bash, and do :

0 ) create the environment


If you don't have a proxy, do , (in a terminal) :

export CVSROOT=":pserver:anoncvs@anoncvs.services.openoffice.org:/cvs"


There is a proxy, and nothing works using the line above, do, (in a terminal) :

Let the proxy be 100.101.102.103 ( name proxy.machine.education.org ) , and the open port 1234, then just do :

export CVSROOT=":pserver;proxy=100.101.102.103;proxyport=1234:anoncvs@anoncvs.services.openoffice.org:/cvs"


And if you ignore the IP address of the gateway, but you know its name, do, (in a terminal) :

export CVSROOT=":pserver;proxy=proxy.machine.education.org;proxyport=1234:anoncvs@anoncvs.services.openoffice.org:/cvs"


IMPORTANT : proxy.machine.education.org is just a fake name, as example. Please replace it with the one in your network :)


... it should work now (else, contact your sys admin).

For the next step, create TMP dir (command: mkdir TMP )

cd TMP

1) checkout vcl module from DEV300_m31

cvs co -r DEV300_m31 dtrans

Question: what happens ?


Download all OpenOffice.org tree :

mkdir DEV300_m31

cd DEV300_m31

cvs -4 co -r DEV300_m31 OpenOffice2

( -z4 is optional )

-> once done ( can be very long), and if no error occurs, you got all OpenOffice.org source code from DEV300_m31 Milestone !!

Create a patch

2) Modify one file, do "cvs up" , and comment on the result

3) using grep , retrieve the name of the milestone in the sources

4) checkout vcl from a cws under development

cvs -z4 co -r cws_dev300_aquavcl07 vcl

5) retrieve the cwsname in the sources

6) analyse the list of the subdirectories vcl contains

7) modify the code in vcl/source/gdi/sallayout.cxx

(write whatever you want, respecting C++ syntax prefered ;)

8) create a diff with the OpenOffice.org repository

change directory outside of vcl

in the current dir ( TMP ) , do :

cvs diff -u vcl > my_pretty_patch.diff

9) What does contain the patch ?

Apply and Reverse a patch

  • Simulate a patch application
  • Apply it for true


10) How reverse your changes ?

11) Be sure you have enough place on your hard disk ( count 2GB )

Fix a build breaker (most common breakages )

A) Building OpenOffice.org

Note: add your own experience here !


Building on Ubunutu 7.10

Ubuntu version : 7.10 - Gutsy Gibbon

Estimated time for the cnofiguration: 1h30


1) Download OpenOffice.org source code

install subversion : sudo apt-get install subversion

Command line for the download : svn checkout svn://svn.services.openoffice.org/ooo/tags/DEV300_m39


2) Java

Prefer the Sun JDK

Version of the installed Java (mini 1.5.0 ) Command line to check : java -version

In config_office tcsh was not found

Solution it to use the following option : --with-use-shell=bash


Archive::Zip is missing :

checking for required Perl modules... Can't locate Archive/Zip.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. configure: error: Failed to find some modules

Solution :

apt-cache search archive | grep perl

Returns

libarchive-zip-perl - Module for manipulation of ZIP archives

Solution sudo apt-get install libarchive-zip-perl


Cups : checking for cups/cups.h... no configure: error: cups/cups.h could not be found. libcupsys2-dev or cups???-dev

Solution: sudo apt-get install libcupsys2-dev

pam :

checking for security/pam_appl.h... no configure: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?

Solution: sudo apt-get install libpam0g-dev


javac: checking for javac... no configure: error: javac not found set with_jdk_home

Solution:

Install Sun Java 1.5.0 from the URL below:

http://java.sun.com/javase/downloads/index_jdk5.jsp

JDK2 installed in /usr/local, means the following option is mandatory :

--with-jdk-home=/usr/local/jdk1.5.0_17


Gperf: checking for gperf... no configure: error: gperf not found but needed. Install it.

Solution: sudo apt-get install gperf


unowinreg.dll:

checking whether to build the ODK... yes

checking for external/unowinreg/unowinreg.dll... configure: WARNING: not found, will be cross-built using mingw32

Looking at external/unowinreg, the readme invites to download unowinreg.dll at

http://tools.openoffice.org/unowinreg_prebuild/680

cd ../DEV300_m39/external/unowinreg/

Solution:

wget http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll


gtk+ stuff :

checking whether freetype is available... checking for pkg-config... /usr/bin/pkg-config checking for freetype2 >= 2.0 ... Package freetype2 was not found in the pkg-config search path

Solution : install all the gtk+ stuff (first is freetype )

sudo apt-get install libfreetype6-dev


Mozilla :

checking for mozilla-source-1.7.5.tar.gz... not found checking for mozilla-source-1.7.5.tar.bz2... not found configure: error: Mozilla source archive not found. Please copy mozilla-source-1.7.5.tar.bz2 or mozilla-source-1.7.5.tar.gz to moz/download/. The archives can be found here: http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.5/source/

use prebuilt-archives downloadable from http://tools.openoffice.org/source/browse/tools/www/moz_prebuild/680/

For Linux: LINUXGCCIinc.zip LINUXGCCIlib.zip LINUXGCCIruntime.zip


Xaw:

checking X11/Xaw/Label.h usability... no checking X11/Xaw/Label.h presence... no checking for X11/Xaw/Label.h... no configure: error: Xaw include headers not found

Solution :

sudo apt-get install libxaw6-dev


Fontconfig:

checking fontconfig/fontconfig.h usability... no checking fontconfig/fontconfig.h presence... no checking for fontconfig/fontconfig.h... no configure: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?

Solution: sudo apt-get install libfontconfig1-dev


Xrandr:

checking for X11/extensions/Xrandr.h... no configure: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?

Solution: sudo apt-get install libxrandr-dev


Bison:

checking for bison... no configure: error: no bison found in $PATH, install bison

Solution: sudo apt-get install bison


Flex: checking for flex... no configure: error: no flex found in $PATH, install flex

Solution: sudo apt-get install flex


Gconf-2.0:

checking whether to enable GConf support... yes checking for gconf-2.0 ... Package gconf-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gconf-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gconf-2.0' found configure: error: Library requirements (gconf-2.0 ) not met; consider adjusti

Solution: sudo apt-get install libgconf2-dev


Gnomevfs:

checking for gnome-vfs-2.0 >= 2.6.0 ... Package gnome-vfs-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gnome-vfs-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gnome-vfs-2.0' found configure: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; cons

Solution: sudo apt-get install libgnome-vfs-dev

WARNING: not available -> use the --disable-gnome-vfs option solved the issue


libgtk+-2.0 missing:

Solution: sudo apt-get install libgtk2.0-dev


Ant missing:

checking for ant.cmd... no configure: error: Ant not found - Make sure it's in the path or use --with-ant-home

Solution Download apache-ant from (e.g.) : http://archive.apache.org/dist/ant/binaries/

Install the decompressed archive in /usr/local

use : --with-ant-home=/usr/local/apache-ant-1.7.1


EXTRA INSTALLATION

Use as much as possible system libs:


libxml : --with-system-openssl

To avoid broken dependencies, libxml2 + matching libxslt (development archives) must be installed.

sudo apt-get install libxslt1-dev libxslt1.1

Finaly,use the foloowing option to successfully pass configure : --with-system-libxml


openssl : --with-system-openssl


checking for openssl ... Package openssl was not found in the pkg-config search path. Perhaps you should add the directory containing `openssl.pc' to the PKG_CONFIG_PATH environment variable No package 'openssl' found

Solution:

sudo apt-get install libssl-dev

expat : --with-system-expat

berkeleydb : --with-system-db

checking for db.h... no checking for db4/db.h... no configure: error: no. install the db4 libraries

Solution : sudo apt-get install libdb4.4-dev

icu: --with-system-icu

checking for genbrk... no configure: error: \genbrk\ not found in $PATH, install the icu development tool \genbrk""

Solution : sudo apt-get install libicu36-dev

neon : --with-system-neon

checking which neon to use... external checking for neon >= 0.24.0... configure: error: you need neon >= 0.24.x for system-neon

Solution: sudo apt-get install libneon26-dev



Install ccache :

sudo apt-get install ccache

edit the ~/.bashrc and add the lines :

CC="ccache gcc" CXX="ccache g++" export CC CXX

save, close and open a new term => ccache will be detected at the next configure


Final configure command line ( experimental, might be modified) :

./configure \
        --with-use-shell=bash \
        --with-jdk-home=/usr/local/jdk1.5.0_17 \
        --disable-build-mozilla \
        --disable-gnome-vfs \
        --with-ant-home=/usr/local/apache-ant-1.7.1 \
        --with-lang=fr \
        --with-system-libxml \
        --with-system-libxslt \
        --with-system-openssl \
        --with-system-expat \
        --with-system-db \
        --with-system-icu \
        --with-system-neon

And configure is successfull :-)

Bootstrap :

cd $ROOT_SOURCES

./bootstrap # builds dmake

either :

dmake

or :

cd instsetoo_native

build --all -P4

Starts the build

See you tomorrow :)

Missing modules

e.g. missing alias in DEV300_m13 : hyphen module is not checked, causing missing headers, never delivered and then, a breakage in lingucomponent because of undefined functions/methods and so on

Solution: check out hyphen

export CVSROOT=":pserver:anoncvs@anoncvs.services.openoffice.org:/cvs"

Note: there is another solution for experimented devs, using tunnel

cvs co -r DEV300_m13 hyphen

Missing Files
Warnings
Missing headers
(deprecated) gcc parser issues

B) Hacking OpenOffice.org

Syntax Errors
Missing headers
Multi inclusions
Linking issues
Visibility
Personal tools