summary refs log tree commit diff
path: root/pkgs/applications/office/openoffice/default.nix
blob: 5bc5cbf8c9b3dc610858274a5d17f35a5df7ba3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{ stdenv, fetchurl, pam, python, tcsh, libxslt, perl, ArchiveZip
, 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, libXext, libX11, libXtst, libXi, cups
, libXinerama, openssl, gperf, cppunit, GConf, ORBit2
}:

let version = "3.2.1"; in

stdenv.mkDerivation rec {
  name = "openoffice.org-${version}";
  builder = ./builder.sh;

  downloadRoot = "http://openoffice.mirrorbrain.org/files/stable";
  versionDirs = true;

  src = fetchurl {
      url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_core.tar.bz2";
      sha256 = "0gj2hinhnzkazh44k1an05x5cj7n6721f2grqrkjh31cm38r9p6i";
    };

  patches = [ ./oo.patch ./root-required.patch ./xlib.patch ];

  postPatch =
    /* Compiling with GCC 4.5 fails:

         Compiling: cppu/source/AffineBridge/AffineBridge.cxx
         [...]
         ../../inc/uno/lbnames.h:67:2: error: #error "Supported gcc majors are 2 , 3 and 4 <= 4.4.  Unsupported gcc major version."

       However, we can't compile with GCC 4.4 because then we'd end up with
       two different versions of libstdc++ (because the deps are compiled
       with 4.5), which isn't supported (link time error.)

       Thus, force compilation with 4.5 and hope for the best.  */
    '' sed -i "cppu/inc/uno/lbnames.h" \
           -e 's/#[[:blank:]]*error "Supported.*$//g'
    '';

  src_system = fetchurl {
      url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_system.tar.bz2";
      sha256 = "0giy3sza64ij19w7b06rxcrkrb5kq2fvkz486vh3mv08s8xa8zfc";
    };

  preConfigure = ''
    PATH=$PATH:${icu}/sbin
  '';

  configureFlags = "
    --with-package-format=native
    --disable-epm
    --disable-fontooo
    --disable-gnome-vfs
    --disable-gnome-vfs
    --disable-mathmldtd
    --disable-mozilla
    --disable-odk
    --disable-pasf
    --with-cairo
    --with-system-libs
    --with-system-python
    --with-system-boost
    --with-system-db
    --with-jdk-home=${jdk}
    --with-ant-home=${ant}
    --without-afms
    --without-dict
    --without-fonts
    --without-myspell-dicts
    --without-nas
    --without-ppds
    --without-system-agg
    --without-system-beanshell
    --without-system-hsqldb
    --without-system-xalan
    --without-system-xerces
    --without-system-xml-apis
    --without-system-xt
    --without-system-jars
    --without-system-hunspell
    --without-system-altlinuxhyph
    --without-system-lpsolve
    --without-system-graphite
  ";

  LD_LIBRARY_PATH = "${libXext}/lib:${libX11}/lib:${libXtst}/lib:${libXi}/lib:${libjpeg}/lib";

  buildInputs = [
    pam python tcsh libxslt perl ArchiveZip CompressZlib zlib 
    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 gperf GConf ORBit2
  ];

  inherit icu fontconfig libjpeg jdk cups;

  meta = {
    description = "OpenOffice.org is a multiplatform and multilingual office suite";
    homepage = http://www.openoffice.org/;
    license = "LGPL";
    maintainers = [ stdenv.lib.maintainers.raskin ];
  };
}