diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/office/libreoffice/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/office/libreoffice/default.nix | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/applications/office/libreoffice/default.nix b/nixpkgs/pkgs/applications/office/libreoffice/default.nix index f5f53e10496b..c8bb58d29213 100644 --- a/nixpkgs/pkgs/applications/office/libreoffice/default.nix +++ b/nixpkgs/pkgs/applications/office/libreoffice/default.nix @@ -1,10 +1,10 @@ -{ stdenv, fetchurl, pam, python3, libxslt, perl, ArchiveZip, gettext +{ stdenv, fetchurl, fetchpatch, pam, python3, libxslt, perl, ArchiveZip, gettext , IOCompress, zlib, libjpeg, expat, freetype, libwpd -, libxml2, db, sablotron, curl, fontconfig, libsndfile, neon +, libxml2, db, curl, fontconfig, libsndfile, neon , bison, flex, zip, unzip, gtk3, gtk2, libmspack, getopt, file, cairo, which , icu, boost, jdk, ant, cups, xorg, libcmis, fontforge , openssl, gperf, cppunit, GConf, ORBit2, poppler, utillinux -, librsvg, gnome_vfs, libGLU_combined, bsh, CoinMP, libwps, libabw, mysql +, librsvg, gnome_vfs, libGLU, libGL, bsh, CoinMP, libwps, libabw, libmysqlclient , autoconf, automake, openldap, bash, hunspell, librdf_redland, nss, nspr , libwpg, dbus-glib, qt4, clucene_core, libcdr, lcms, vigra , unixODBC, mdds, sane-backends, mythes, libexttextcat, libvisio @@ -13,30 +13,28 @@ , librevenge, libe-book, libmwaw, glm, glew, gst_all_1 , gdb, commonsLogging, librdf_rasqal, wrapGAppsHook , gnome3, glib, ncurses, epoxy, gpgme -, langs ? [ "ca" "cs" "de" "en-GB" "en-US" "eo" "es" "fr" "hu" "it" "ja" "nl" "pl" "ru" "sl" "zh-CN" ] +, langs ? [ "ca" "cs" "de" "en-GB" "en-US" "eo" "es" "fr" "hu" "it" "ja" "nl" "pl" "pt" "pt-BR" "ru" "sl" "zh-CN" ] , withHelp ? true , kdeIntegration ? false -}: +, variant ? "fresh" +} @ args: + +assert builtins.elem variant [ "fresh" "still" ]; let - primary-src = import ./default-primary-src.nix { inherit fetchurl; }; -in + importVariant = f: import (./. + "/src-${variant}/${f}"); -let inherit (primary-src) major minor subdir version; in + primary-src = importVariant "primary.nix" { inherit fetchurl; }; + + inherit (primary-src) major minor subdir version; -let lib = stdenv.lib; langsSpaces = lib.concatStringsSep " " langs; - fetchSrc = {name, sha256}: fetchurl { - url = "https://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz"; - inherit sha256; - }; - srcs = { third_party = map (x : ((fetchurl {inherit (x) url sha256 name;}) // {inherit (x) md5name md5;})) - ((import ./libreoffice-srcs.nix) ++ [ + (importVariant "download.nix" ++ [ (rec { name = "unowinreg.dll"; url = "https://dev-www.libreoffice.org/extern/${md5name}"; @@ -46,31 +44,36 @@ let }) ]); - translations = fetchSrc { - name = "translations"; - sha256 = "0730fw2kr00b2d56jkdzjdz49c4k4mxiz879c7ikw59c5zvrh009"; - }; - - # TODO: dictionaries - - help = fetchSrc { - name = "help"; - sha256 = "1w9bqwzz75vvxxy9dgln0v6p6isf8mkqnkg1nzlaykvdgsn5sp4z"; - }; - + translations = primary-src.translations; + help = primary-src.help; }; -in stdenv.mkDerivation rec { +in (stdenv.mkDerivation rec { pname = "libreoffice"; inherit version; inherit (primary-src) src; + outputs = [ "out" "dev" ]; + # For some reason librdf_redland sometimes refers to rasqal.h instead # of rasqal/rasqal.h - NIX_CFLAGS_COMPILE = [ "-I${librdf_rasqal}/include/rasqal" ] ++ lib.optional stdenv.isx86_64 "-mno-fma"; + NIX_CFLAGS_COMPILE = "-I${librdf_rasqal}/include/rasqal"; patches = [ ./xdg-open-brief.patch + + # Poppler-0.82 compatibility + # https://gerrit.libreoffice.org/81545 + (fetchpatch { + url = "https://github.com/LibreOffice/core/commit/2eadd46ab81058087af95bdfc1fea28fcdb65998.patch"; + sha256 = "1mpipdfxvixjziizbhfbpybpzlg1ijw7s0yqjpmq5d7pf3pvkm4n"; + }) + # Poppler-0.83 compatibility + # https://gerrit.libreoffice.org/84384 + (fetchpatch { + url = "https://github.com/LibreOffice/core/commit/9065cd8d9a19864f6b618f2dc10daf577badd9ee.patch"; + sha256 = "0nd0gck8ra3ffw936a7ri0s6a0ii5cyglnhip2prcjh5yf7vw2i2"; + }) ]; tarballPath = "external/tarballs"; @@ -245,7 +248,7 @@ in stdenv.mkDerivation rec { find -name "*.cmd" -exec sed -i s,/lib:/usr/lib,, {} \; ''; - makeFlags = "SHELL=${bash}/bin/bash"; + makeFlags = [ "SHELL=${bash}/bin/bash" ]; enableParallelBuilding = true; @@ -276,6 +279,9 @@ in stdenv.mkDerivation rec { cp -r sysui/desktop/icons "$out/share" sed -re 's@Icon=libreoffice(dev)?[0-9.]*-?@Icon=@' -i "$out/share/applications/"*.desktop + + mkdir -p $dev + cp -r include $dev ''; configureFlags = [ @@ -360,10 +366,10 @@ in stdenv.mkDerivation rec { hunspell icu jdk lcms libcdr libexttextcat unixODBC libjpeg libmspack librdf_redland librsvg libsndfile libvisio libwpd libwpg libX11 libXaw libXext libXi libXinerama libxml2 libxslt libXtst - libXdmcp libpthreadstubs libGLU_combined mythes gst_all_1.gstreamer - gst_all_1.gst-plugins-base glib mysql.connector-c + libXdmcp libpthreadstubs libGLU libGL mythes gst_all_1.gstreamer + gst_all_1.gst-plugins-base glib libmysqlclient neon nspr nss openldap openssl ORBit2 pam perl pkgconfig poppler - python3 sablotron sane-backends unzip vigra which zip zlib + python3 sane-backends unzip vigra which zip zlib mdds bluez5 libcmis libwps libabw libzmf libxshmfence libatomic_ops graphite2 harfbuzz gpgme utillinux librevenge libe-book libmwaw glm glew ncurses epoxy @@ -384,4 +390,4 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ raskin ]; platforms = platforms.linux; }; -} +}).overrideAttrs ((importVariant "override.nix") args) |