From fc3574b125bb534b48317f7f239d2f3199f489cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?=
 <viric@vicerveza.homeunix.net>
Date: Mon, 20 Apr 2009 13:50:07 +0000
Subject: [PATCH] Updating openoffice to 3.0.1.

svn path=/nixpkgs/trunk/; revision=15181
---
 .../applications/office/openoffice/builder.sh |  8 ++-
 .../office/openoffice/default.nix             | 30 ++++----
 pkgs/applications/office/openoffice/oo.patch  | 72 +++++++++++++++++++
 pkgs/top-level/all-packages.nix               |  3 +-
 4 files changed, 98 insertions(+), 15 deletions(-)
 create mode 100644 pkgs/applications/office/openoffice/oo.patch

diff --git a/pkgs/applications/office/openoffice/builder.sh b/pkgs/applications/office/openoffice/builder.sh
index 5077463f1b2e..c3df7c3899d6 100644
--- a/pkgs/applications/office/openoffice/builder.sh
+++ b/pkgs/applications/office/openoffice/builder.sh
@@ -5,6 +5,11 @@ export NO_HIDS=TRUE
 
 export PATH=$icu/sbin:$PATH
 
+postUnpack=postUnpack
+postUnpack() {
+  tar xvjf $src_system
+}
+
 preConfigure=preConfigure
 preConfigure() {
     for i in sysui/desktop/share/makefile.mk; do 
@@ -34,6 +39,7 @@ postConfigure() {
 buildPhase=buildPhase
 buildPhase() {
     source LinuxX86*Env.Set.sh
+    export JOBS=2
     ./bootstrap
     dmake # wait a few hours...
 }
@@ -51,7 +57,7 @@ wrapSOffice() {
 # looks for it at runtime.
 export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH\${LD_LIBRARY_PATH:+:}$fontconfig/lib:$libjpeg/lib:$cups/lib
 export JAVA_HOME=$jdk
-exec $ooFiles/program/soffice $arg "\$@"
+exec $ooFiles/openoffice.org3/program/soffice $arg "\$@"
 EOF
     chmod +x $out/bin/$fn
 }
diff --git a/pkgs/applications/office/openoffice/default.nix b/pkgs/applications/office/openoffice/default.nix
index de618283d209..a5a422e0f94b 100644
--- a/pkgs/applications/office/openoffice/default.nix
+++ b/pkgs/applications/office/openoffice/default.nix
@@ -2,20 +2,27 @@
 , CompressZlib, zlib, libjpeg, expat, pkgconfig, freetype, libwpd
 , libxml2, db4, sablotron, curl, libXaw, fontconfig, libsndfile, neon
 , bison, flex, zip, unzip, gtk, libmspack, getopt, file, cairo, which
-, icu, boost, jdk, ant, hsqldb, libXext, libX11, libXtst, libXi, cups
-, libXinerama, openssl
+, icu, boost, jdk, ant, libXext, libX11, libXtst, libXi, cups
+, libXinerama, openssl, gperf, cppunit
 }:
 
-let version = "2.4.1"; in
+let version = "3.0.1"; in
 stdenv.mkDerivation rec {
   name = "openoffice.org-${version}";
   builder = ./builder.sh;
 
-  src =
-    fetchurl {
+  src = fetchurl {
       url = "http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=src_bzip&lang=core&version=${version}";
       name = "OOo_${version}_src_core.tar.bz2";
-      sha256 = "1405l6xb1qy6l43n9nli8hhay917nyr8a69agj483aaiskrpdxdb";
+      sha256 = "0fgk7n766lzsxn09p8g5ddabw568jw56k9bcdc02nlmk6k3a9qq0";
+    };
+
+  patches = [ ./oo.patch ];
+
+  src_system = fetchurl {
+      url = "http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=src_bzip&lang=system&version=${version}";
+      name = "OOo_${version}_src_system.tar.bz2";
+      sha256 = "1zp8lbn5x9wwbv82inqkanaip4l2jyiybjqv1dpx7wbh6nrasgdv";
     };
 
   configureFlags = "
@@ -28,7 +35,6 @@ stdenv.mkDerivation rec {
     --disable-mozilla
     --disable-odk
     --disable-pasf
-    --disable-qadevooo
     --with-cairo
     --with-system-libs
     --with-system-python
@@ -49,8 +55,10 @@ stdenv.mkDerivation rec {
     --without-system-xml-apis
     --without-system-xt
     --without-system-db
-    --with-system-hsqldb
-    --with-hsqldb-jar=${hsqldb}/lib/hsqldb.jar
+    --without-system-jars
+    --without-system-hunspell
+    --without-system-altlinuxhyph
+    --without-system-lpsolve
   ";
 
   LD_LIBRARY_PATH = "${libXext}/lib:${libX11}/lib:${libXtst}/lib:${libXi}/lib:${libjpeg}/lib";
@@ -60,13 +68,11 @@ stdenv.mkDerivation rec {
     libjpeg expat pkgconfig freetype libwpd libxml2 db4 sablotron curl 
     libXaw fontconfig libsndfile neon bison flex zip unzip gtk libmspack 
     getopt file jdk cairo which icu boost libXext libX11 libXtst libXi
-    cups libXinerama openssl
+    cups libXinerama openssl gperf
   ];
 
   inherit icu fontconfig libjpeg jdk cups;
 
-  patches = [./ooo-libtextcat.patch ];
-
   meta = {
     description = "OpenOffice.org is a multiplatform and multilingual office suite";
     homepage = http://www.openoffice.org/;
diff --git a/pkgs/applications/office/openoffice/oo.patch b/pkgs/applications/office/openoffice/oo.patch
new file mode 100644
index 000000000000..1234d961fd1d
--- /dev/null
+++ b/pkgs/applications/office/openoffice/oo.patch
@@ -0,0 +1,72 @@
+diff --git a/libtextcat/makefile.mk b/libtextcat/makefile.mk
+index 602b9b1..6be8427 100644
+--- a/libtextcat/makefile.mk
++++ b/libtextcat/makefile.mk
+@@ -57,7 +57,7 @@ ADDITIONAL_FILES= \
+ #CONFIGURE_DIR=$(BUILD_DIR)
+ 
+ #relative to CONFIGURE_DIR
+-CONFIGURE_ACTION=configure CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)"
++CONFIGURE_ACTION=configure CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)" --prefix=$(TMPDIR)
+ CONFIGURE_FLAGS=
+ 
+ BUILD_ACTION=make
+diff --git a/redland/raptor/makefile.mk b/redland/raptor/makefile.mk
+index 0e64d50..547d66b 100644
+--- a/redland/raptor/makefile.mk
++++ b/redland/raptor/makefile.mk
+@@ -104,7 +104,7 @@ XSLTLIB:=$(XSLTLIB)
+ 
+ CONFIGURE_DIR=
+ CONFIGURE_ACTION=.$/configure
+-CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
++CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
+ BUILD_ACTION=$(GNUMAKE)
+ BUILD_FLAGS+= -j$(EXTMAXPROCESS)
+ BUILD_DIR=$(CONFIGURE_DIR)
+diff --git a/redland/rasqal/makefile.mk b/redland/rasqal/makefile.mk
+index 850ee9c..3293a79 100644
+--- a/redland/rasqal/makefile.mk
++++ b/redland/rasqal/makefile.mk
+@@ -104,7 +104,7 @@ XSLTLIB:=$(XSLTLIB)
+ 
+ CONFIGURE_DIR=
+ CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH"
+-CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
++CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
+ BUILD_ACTION=$(GNUMAKE)
+ BUILD_FLAGS+= -j$(EXTMAXPROCESS)
+ BUILD_DIR=$(CONFIGURE_DIR)
+diff --git a/redland/redland/makefile.mk b/redland/redland/makefile.mk
+index 5719272..75c31b7 100644
+--- a/redland/redland/makefile.mk
++++ b/redland/redland/makefile.mk
+@@ -108,7 +108,7 @@ XSLTLIB:=$(XSLTLIB)
+ 
+ CONFIGURE_DIR=
+ CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH"
+-CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
++CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
+ BUILD_ACTION=$(GNUMAKE)
+ BUILD_FLAGS+= -j$(EXTMAXPROCESS)
+ BUILD_DIR=$(CONFIGURE_DIR)
+diff --git a/hunspell/hunspell-1.1.12.patch b/hunspell/hunspell-1.1.12.patch
+index 37b7964..e6fd962 100644
+--- a/hunspell/hunspell-1.1.12.patch
++++ b/hunspell/hunspell-1.1.12.patch
+@@ -487,3 +487,15 @@
+  i68568utf.test \
+  1706659.test \
+  digits_in_words.test \
++diff --git a/hunspell/unxlngi6.pro/misc/build/hunspell-1.1.12/tests/test.sh b/hunspell/unxlngi6.pro/misc/build/hunspell-1.1.12/tests/test.sh
++index 90080f6..f069517 100755
++--- a/hunspell/unxlngi6.pro/misc/build/hunspell-1.1.12/tests/test.sh
+++++ b/hunspell/unxlngi6.pro/misc/build/hunspell-1.1.12/tests/test.sh
++--- misc/hunspell-1.1.12/tests/test.sh	Sep  4 01:25:35 2007
+++++ misc/build/hunspell-1.1.12/tests/test.sh	Jun 18 11:53:11 2008
++@@ -1,4 +1,4 @@
++-#!/bin/bash
+++#!/bin/sh
++ export LC_ALL="C"
++ 
++ function check_valgrind_log () {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3d26db84e351..afc1418fd1f6 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6486,8 +6486,7 @@ let
     inherit fetchurl stdenv pam python tcsh libxslt perl zlib libjpeg
       expat pkgconfig freetype fontconfig libwpd libxml2 db4 sablotron
       curl libsndfile flex zip unzip libmspack getopt file neon cairo
-      which icu jdk ant hsqldb cups openssl bison;
-    boost = boost_1_36_0;
+      which icu jdk ant cups openssl bison boost gperf cppunit;
     inherit (xlibs) libXaw libXext libX11 libXtst libXi libXinerama;
     inherit (gtkLibs) gtk;
     inherit (perlPackages) ArchiveZip CompressZlib;