mozilla

Revision 121874 of Building PyXPCOM

  • Revision slug: Building_PyXPCOM
  • Revision title: Building PyXPCOM
  • Revision id: 121874
  • Created:
  • Creator: Matiu
  • Is current revision? No
  • Comment

Revision Content

These commands seem to work well on gentoo:

Compile Python

Gentoo Users

First you should have a python compiled with --enable-shared option. You could modify the official ebuild like that :

cp /usr/portage/dev-lang/python/python-2.4.2.ebuild /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild
cp /usr/portage/dev-lang/python/files/python-2.4* /usr/local/portage/dev-lang/python/files/
nano /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild

line 145 add a new line and edit :
myconf = "${myconf} --enable-shared "

Hit (CRTl+O then CTRL+X)

ebuild /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild digest
emerge python 

Others

If you don't have gentoo, try this, get the source from and:

tar zxf Python2.4.tar.bz2 # Or whatever the filename is
cd python
./configure --enable-shared --prefix=/usr # To install over your current python
make
sudo make install

Compile Mozilla

Then you can compile Mozilla from DOM_AGNOSTIC2_BRANCH cvs branch:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r DOM_AGNOSTIC2_BRANCH mozilla/client.mk
cd mozilla
make -f client.mk checkout MOZ_CO_PROJECT=suite
cat > .mozconfig
mk_add_options MOZ_CO_PROJECT=suite
ac_add_options --enable-application=suite
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-xft
ac_add_options --enable-extensions=python/xpcom,python/dom,default
ac_add_options --disable-optimize
ac_add_options --enable-debug
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/suite-debug

Hit (Ctrl+D)

make -f client.mk build

Test

Once done, to test your pyxpcom install do this:

cd suite-debug/dist/bin
export PYTHONPATH=python
./run-mozilla.sh ./seamonkey -chrome chrome://pyxultest/content

Revision Source

<p>These commands seem to work well on gentoo:
</p>
<h3 name="Compile_Python"> Compile Python </h3>
<h4 name="Gentoo_Users"> Gentoo Users </h4>
<p>First you should have a python compiled with --enable-shared option.
You could modify the official ebuild like that :
</p>
<pre>cp /usr/portage/dev-lang/python/python-2.4.2.ebuild /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild
cp /usr/portage/dev-lang/python/files/python-2.4* /usr/local/portage/dev-lang/python/files/
nano /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild

line 145 add a new line and edit :
myconf = "${myconf} --enable-shared "
</pre>
<p>Hit (CRTl+O then CTRL+X)
</p>
<pre>ebuild /usr/local/portage/dev-lang/python/python-2.4.2-r1.ebuild digest
emerge python 
</pre>
<h4 name="Others"> Others </h4>
<p><b>If you don't have gentoo</b>, try this, get the source from <a class="external" href="http://www.python.org"> and:
</a></p><a class="external" href="http://www.python.org">
<pre>tar zxf Python2.4.tar.bz2 # Or whatever the filename is
cd python
./configure --enable-shared --prefix=/usr # To install over your current python
make
sudo make install
</pre>
<h3 name="Compile_Mozilla"> Compile Mozilla </h3>
</a><p><a class="external" href="http://www.python.org">Then you can <b>compile Mozilla</b> from </a><a class="external" href="http://wiki.mozilla.org/Breaking_the_grip_JS_has_on_the_DOM">DOM_AGNOSTIC2_BRANCH cvs branch</a>:
</p>
<pre>cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r DOM_AGNOSTIC2_BRANCH mozilla/client.mk
cd mozilla
make -f client.mk checkout MOZ_CO_PROJECT=suite
cat &gt; .mozconfig
mk_add_options MOZ_CO_PROJECT=suite
ac_add_options --enable-application=suite
ac_add_options --enable-default-toolkit=gtk2
ac_add_options --enable-xft
ac_add_options --enable-extensions=python/xpcom,python/dom,default
ac_add_options --disable-optimize
ac_add_options --enable-debug
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/suite-debug
</pre>
<p>Hit (Ctrl+D)
</p>
<pre>make -f client.mk build
</pre>
<h3 name="Test"> Test </h3>
<p>Once done, to test your pyxpcom install do this:
</p>
<pre>cd suite-debug/dist/bin
export PYTHONPATH=python
./run-mozilla.sh ./seamonkey -chrome chrome://pyxultest/content
</pre>
Revert to this revision