2012-01-26 00:04:34 +01:00
|
|
|
{ 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
|
2012-03-12 21:15:08 +01:00
|
|
|
, libXinerama, openssl, gperf, cppunit, GConf, ORBit2, poppler
|
2012-03-14 23:44:52 +01:00
|
|
|
, librsvg, gnome_vfs, gstreamer, gst_plugins_base, mesa
|
2012-03-15 17:45:04 +01:00
|
|
|
, autoconf, automake, openldap, bash
|
2012-03-14 10:40:26 +01:00
|
|
|
, fontsConf
|
2012-03-14 18:49:23 +01:00
|
|
|
, langs ? [ "ca" "ru" "eo" "fr" "nl" "de" "en-GB" ]
|
2012-01-26 00:04:34 +01:00
|
|
|
}:
|
|
|
|
|
2012-03-13 22:23:25 +01:00
|
|
|
let
|
|
|
|
langsSpaces = stdenv.lib.concatStringsSep " " langs;
|
|
|
|
in
|
2012-01-26 00:04:34 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2012-03-15 20:50:23 +01:00
|
|
|
name = "libreoffice-3.5.1.2";
|
2012-01-26 00:04:34 +01:00
|
|
|
|
|
|
|
srcs_download = import ./libreoffice-srcs.nix { inherit fetchurl; };
|
|
|
|
|
2012-03-13 22:23:25 +01:00
|
|
|
src_translation = fetchurl {
|
2012-03-15 20:50:23 +01:00
|
|
|
url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-translations-3.5.1.2.tar.xz";
|
|
|
|
sha256 = "cf8ed662f7d0a679bd3a242a7f88cf445b769afdcd8a3d3df655d774f296972a";
|
2012-03-13 22:23:25 +01:00
|
|
|
};
|
|
|
|
|
2012-03-14 22:51:33 +01:00
|
|
|
src_help = fetchurl {
|
2012-03-15 20:50:23 +01:00
|
|
|
url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-help-3.5.1.2.tar.xz";
|
|
|
|
sha256 = "43b07225854b1c8b3195b252453b8e97d2d58d83909bf4b5f920cb08b7f33e30";
|
2012-03-14 22:51:33 +01:00
|
|
|
};
|
|
|
|
|
2012-01-26 00:04:34 +01:00
|
|
|
src = fetchurl {
|
2012-03-15 20:50:23 +01:00
|
|
|
url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-core-3.5.1.2.tar.xz";
|
|
|
|
sha256 = "61cd12e20fb9460178fc6f08100a9a189c2390c21e2e47eb66e07a5b0ce5cd94";
|
2012-01-26 00:04:34 +01:00
|
|
|
};
|
|
|
|
|
2012-03-15 17:45:04 +01:00
|
|
|
# Openoffice will open libcups dynamically, so we link it directly
|
|
|
|
# to make its dlopen work.
|
|
|
|
NIX_LDFLAGS = "-lcups";
|
|
|
|
|
|
|
|
# If we call 'configure', 'make' will then call configure again without parameters.
|
|
|
|
# It's their system.
|
2012-03-12 21:15:08 +01:00
|
|
|
configureScript = "./autogen.sh";
|
|
|
|
|
2012-01-26 00:04:34 +01:00
|
|
|
preConfigure = ''
|
2012-03-13 22:23:25 +01:00
|
|
|
tar xf $src_translation
|
2012-03-14 22:51:33 +01:00
|
|
|
# Libreoffice expects by default the translations in ./translations
|
2012-03-15 20:50:23 +01:00
|
|
|
mv libreoffice-translations-3.5.1.2/translations .
|
2012-03-14 22:51:33 +01:00
|
|
|
tar xf $src_help
|
|
|
|
# Libreoffice expects by default the help in ./helpcontent2
|
2012-03-15 20:50:23 +01:00
|
|
|
mv libreoffice-help-3.5.1.2/helpcontent2 .
|
2012-03-13 22:23:25 +01:00
|
|
|
|
2012-03-14 19:51:59 +01:00
|
|
|
sed -i 's,/bin/bash,${bash}/bin/bash,' sysui/desktop/share/makefile.mk solenv/bin/localize
|
2012-03-12 21:15:08 +01:00
|
|
|
sed -i 's,/usr/bin/env bash,${bash}/bin/bash,' bin/unpack-sources \
|
|
|
|
solenv/bin/install-gdb-printers solenv/bin/striplanguagetags.sh
|
2012-01-26 00:04:34 +01:00
|
|
|
|
2012-03-13 22:23:25 +01:00
|
|
|
sed -i 's,/usr/bin/env perl,${perl}/bin/perl,' solenv/bin/concat-deps.pl solenv/bin/ooinstall
|
|
|
|
sed -i 's,ANT_OPTS+="\(.*\)",ANT_OPTS+=\1,' apache-commons/java/*/makefile.mk
|
2012-03-12 22:38:00 +01:00
|
|
|
|
2012-01-26 00:04:34 +01:00
|
|
|
# Needed to find genccode
|
|
|
|
PATH=$PATH:${icu}/sbin
|
2012-03-13 22:23:25 +01:00
|
|
|
|
2012-03-14 19:51:59 +01:00
|
|
|
configureFlagsArray=("--with-lang=${langsSpaces}")
|
2012-01-26 00:04:34 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2012-03-14 22:51:33 +01:00
|
|
|
# This is required as some cppunittests require fontconfig configured
|
2012-03-14 10:40:26 +01:00
|
|
|
export FONTCONFIG_FILE=${fontsConf}
|
2012-03-12 21:15:08 +01:00
|
|
|
mkdir src
|
2012-01-26 00:04:34 +01:00
|
|
|
for a in $srcs_download; do
|
|
|
|
FILE=$(basename $a)
|
|
|
|
# take out the hash
|
|
|
|
cp -v $a src/$(echo $FILE | sed 's/[^-]*-//')
|
|
|
|
done
|
|
|
|
|
|
|
|
# Remove an exit 1, ignoring the lack of wget or curl
|
|
|
|
sed '/wget nor curl/{n;d}' -i download
|
|
|
|
./download
|
|
|
|
|
|
|
|
# Fix sysui: wants to create a tar for root
|
|
|
|
sed -i -e 's,--own.*root,,' sysui/desktop/slackware/makefile.mk
|
|
|
|
# Fix redland: wants to set rpath to /usr/local/lib
|
|
|
|
sed -i -e 's,^CONFIGURE_FLAGS.*,& --prefix='$TMPDIR, redland/redland/makefile.mk \
|
|
|
|
redland/raptor/makefile.mk redland/rasqal/makefile.mk
|
|
|
|
|
|
|
|
# This to aovid using /lib:/usr/lib at linking
|
|
|
|
sed -i '/gb_LinkTarget_LDFLAGS/{ n; /rpath-link/d;}' solenv/gbuild/platform/unxgcc.mk
|
|
|
|
|
|
|
|
find -name "*.cmd" -exec sed -i s,/lib:/usr/lib,, {} \;
|
|
|
|
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
2012-03-15 12:29:13 +01:00
|
|
|
# It installs only things to $out/lib/libreoffice
|
2012-03-15 12:02:52 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/bin
|
2012-03-15 12:29:13 +01:00
|
|
|
for a in sbase scalc sdraw smath swriter spadmin simpress soffice; do
|
|
|
|
ln -s $out/lib/libreoffice/program/$a $out/bin/$a
|
|
|
|
done
|
2012-03-15 12:02:52 +01:00
|
|
|
'';
|
|
|
|
|
2012-01-26 00:04:34 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-verbose"
|
|
|
|
|
|
|
|
# Without these, configure does not finish
|
|
|
|
"--without-junit"
|
|
|
|
"--without-system-mythes"
|
|
|
|
|
|
|
|
# Without this, it wants to download
|
2012-03-14 22:51:33 +01:00
|
|
|
"--with-system-cairo"
|
2012-01-26 00:04:34 +01:00
|
|
|
"--with-system-libs"
|
2012-03-14 22:51:33 +01:00
|
|
|
"--enable-python=system"
|
2012-01-26 00:04:34 +01:00
|
|
|
"--with-system-boost"
|
|
|
|
"--with-system-db"
|
|
|
|
|
|
|
|
# I imagine this helps. Copied from go-oo.
|
|
|
|
"--disable-epm"
|
|
|
|
"--disable-mathmldtd"
|
|
|
|
"--disable-mozilla"
|
|
|
|
"--disable-odk"
|
|
|
|
"--disable-dbus"
|
|
|
|
"--disable-kde"
|
|
|
|
"--disable-kde4"
|
2012-03-13 22:23:25 +01:00
|
|
|
"--disable-postgresql-sdbc"
|
2012-01-26 00:04:34 +01:00
|
|
|
"--with-package-format=native"
|
|
|
|
"--with-jdk-home=${jdk}"
|
|
|
|
"--with-ant-home=${ant}"
|
|
|
|
"--without-afms"
|
|
|
|
"--without-fonts"
|
|
|
|
"--without-myspell-dicts"
|
|
|
|
"--without-ppds"
|
|
|
|
"--without-system-beanshell"
|
|
|
|
"--without-system-hsqldb"
|
|
|
|
"--without-system-jars"
|
|
|
|
"--without-system-hunspell"
|
|
|
|
"--without-system-altlinuxhyph"
|
|
|
|
"--without-system-lpsolve"
|
|
|
|
"--without-system-graphite"
|
|
|
|
"--without-system-mozilla"
|
|
|
|
"--without-system-libwps"
|
|
|
|
"--without-system-libwpg"
|
|
|
|
"--without-system-redland"
|
2012-03-12 21:15:08 +01:00
|
|
|
"--without-system-libvisio"
|
|
|
|
"--without-system-libcmis"
|
|
|
|
"--without-system-nss"
|
|
|
|
"--without-system-sampleicc"
|
|
|
|
"--without-system-libexttextcat"
|
2012-01-26 00:04:34 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
2012-03-12 21:15:08 +01:00
|
|
|
getopt file jdk cairo which icu boost libXext libX11 libXtst libXi mesa
|
2012-03-14 23:44:52 +01:00
|
|
|
cups libXinerama openssl gperf GConf ORBit2 gnome_vfs gstreamer gst_plugins_base
|
2012-03-15 17:45:04 +01:00
|
|
|
ant autoconf openldap cppunit poppler librsvg automake
|
2012-01-26 00:04:34 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Libre-office, variant of openoffice.org";
|
|
|
|
homepage = http://libreoffice.org/;
|
|
|
|
license = "LGPL";
|
|
|
|
maintainers = [ stdenv.lib.maintainers.viric ];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|