2022-05-18 14:49:53 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
2024-07-27 06:49:29 +00:00
|
|
|
, fetchgit
|
|
|
|
, fetchpatch2
|
2022-05-18 14:49:53 +00:00
|
|
|
, lib
|
|
|
|
, pam
|
2024-07-27 06:49:29 +00:00
|
|
|
, python311
|
2022-05-18 14:49:53 +00:00
|
|
|
, libxslt
|
|
|
|
, perl
|
2024-06-05 15:53:02 +00:00
|
|
|
, perlPackages
|
2022-05-18 14:49:53 +00:00
|
|
|
, box2d
|
|
|
|
, gettext
|
|
|
|
, zlib
|
|
|
|
, libjpeg
|
2024-01-13 08:15:51 +00:00
|
|
|
, liblangtag
|
2022-05-18 14:49:53 +00:00
|
|
|
, expat
|
|
|
|
, freetype
|
|
|
|
, libwpd
|
|
|
|
, libxml2
|
|
|
|
, db
|
|
|
|
, curl
|
|
|
|
, fontconfig
|
|
|
|
, libsndfile
|
|
|
|
, neon
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, zip
|
|
|
|
, unzip
|
|
|
|
, gtk3
|
|
|
|
, libmspack
|
|
|
|
, getopt
|
|
|
|
, file
|
|
|
|
, cairo
|
|
|
|
, which
|
|
|
|
, icu
|
|
|
|
, boost
|
2022-12-02 08:20:57 +00:00
|
|
|
, jdk17
|
2022-05-18 14:49:53 +00:00
|
|
|
, ant
|
|
|
|
, cups
|
|
|
|
, xorg
|
|
|
|
, fontforge
|
2022-12-02 08:20:57 +00:00
|
|
|
, jre17_minimal
|
2022-05-18 14:49:53 +00:00
|
|
|
, openssl
|
|
|
|
, gperf
|
|
|
|
, cppunit
|
|
|
|
, poppler
|
|
|
|
, util-linux
|
|
|
|
, librsvg
|
|
|
|
, libGLU
|
|
|
|
, libGL
|
|
|
|
, bsh
|
2024-06-20 14:57:18 +00:00
|
|
|
, coinmp
|
2022-05-18 14:49:53 +00:00
|
|
|
, libwps
|
|
|
|
, libabw
|
2024-06-05 15:53:02 +00:00
|
|
|
, libargon2
|
2022-05-18 14:49:53 +00:00
|
|
|
, libmysqlclient
|
|
|
|
, autoconf
|
|
|
|
, automake
|
|
|
|
, openldap
|
|
|
|
, bash
|
|
|
|
, hunspell
|
2024-06-05 15:53:02 +00:00
|
|
|
, librdf_rasqal
|
2022-05-18 14:49:53 +00:00
|
|
|
, librdf_redland
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, libwpg
|
|
|
|
, dbus-glib
|
2024-06-05 15:53:02 +00:00
|
|
|
, clucene_core_2
|
2022-05-18 14:49:53 +00:00
|
|
|
, libcdr
|
2024-06-05 15:53:02 +00:00
|
|
|
, lcms2
|
2022-05-18 14:49:53 +00:00
|
|
|
, unixODBC
|
|
|
|
, mdds
|
|
|
|
, sane-backends
|
|
|
|
, mythes
|
|
|
|
, libexttextcat
|
|
|
|
, libvisio
|
|
|
|
, pkg-config
|
|
|
|
, bluez5
|
|
|
|
, libtool
|
|
|
|
, libatomic_ops
|
|
|
|
, graphite2
|
|
|
|
, harfbuzz
|
|
|
|
, libodfgen
|
|
|
|
, libzmf
|
|
|
|
, librevenge
|
|
|
|
, libe-book
|
|
|
|
, libmwaw
|
|
|
|
, glm
|
|
|
|
, gst_all_1
|
|
|
|
, gdb
|
2024-07-27 06:49:29 +00:00
|
|
|
, adwaita-icon-theme
|
2022-05-18 14:49:53 +00:00
|
|
|
, glib
|
|
|
|
, ncurses
|
|
|
|
, libepoxy
|
|
|
|
, gpgme
|
2022-10-21 18:38:19 +00:00
|
|
|
, libwebp
|
2022-05-18 14:49:53 +00:00
|
|
|
, abseil-cpp
|
2024-06-05 15:53:02 +00:00
|
|
|
, libepubgen
|
|
|
|
, libetonyek
|
|
|
|
, liborcus
|
|
|
|
, libpng
|
2024-07-27 06:49:29 +00:00
|
|
|
, langs ? [ "ar" "ca" "cs" "da" "de" "en-GB" "en-US" "eo" "es" "fi" "fr" "hu" "it" "ja" "ko" "nl" "pl" "pt" "pt-BR" "ro" "ru" "sk" "sl" "tr" "uk" "zh-CN" ]
|
|
|
|
, withFonts ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
, withHelp ? true
|
2022-05-18 14:49:53 +00:00
|
|
|
, kdeIntegration ? false
|
|
|
|
, qtbase ? null
|
|
|
|
, qtx11extras ? null
|
2023-03-15 16:39:30 +00:00
|
|
|
, qtwayland ? null
|
2022-05-18 14:49:53 +00:00
|
|
|
, ki18n ? null
|
|
|
|
, kconfig ? null
|
|
|
|
, kcoreaddons ? null
|
|
|
|
, kio ? null
|
|
|
|
, kwindowsystem ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, variant ? "fresh"
|
2022-05-18 14:49:53 +00:00
|
|
|
, symlinkJoin
|
2023-02-09 11:40:11 +00:00
|
|
|
, postgresql
|
2024-06-05 15:53:02 +00:00
|
|
|
, makeFontsConf
|
|
|
|
, amiri
|
|
|
|
, caladea
|
|
|
|
, carlito
|
|
|
|
, dejavu_fonts
|
|
|
|
, rubik
|
|
|
|
, liberation-sans-narrow
|
|
|
|
, liberation_ttf_v2
|
|
|
|
, libertine
|
|
|
|
, libertine-g
|
|
|
|
, noto-fonts
|
|
|
|
, noto-fonts-cjk-sans
|
2023-03-15 16:39:30 +00:00
|
|
|
# The rest are used only in passthru, for the wrapper
|
|
|
|
, kauth ? null
|
|
|
|
, kcompletion ? null
|
|
|
|
, kconfigwidgets ? null
|
|
|
|
, kglobalaccel ? null
|
|
|
|
, kitemviews ? null
|
|
|
|
, knotifications ? null
|
|
|
|
, ktextwidgets ? null
|
|
|
|
, kwidgetsaddons ? null
|
|
|
|
, kxmlgui ? null
|
|
|
|
, phonon ? null
|
|
|
|
, qtdeclarative ? null
|
|
|
|
, qtquickcontrols ? null
|
|
|
|
, qtsvg ? null
|
|
|
|
, qttools ? null
|
|
|
|
, solid ? null
|
|
|
|
, sonnet ? null
|
2024-06-05 15:53:02 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
assert builtins.elem variant [ "fresh" "still" "collabora" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit (lib)
|
|
|
|
flatten flip
|
2022-10-21 18:38:19 +00:00
|
|
|
concatMapStrings concatStringsSep
|
2022-05-18 14:49:53 +00:00
|
|
|
getDev getLib
|
2024-07-27 06:49:29 +00:00
|
|
|
optionals optionalAttrs optionalString;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
fontsConf = makeFontsConf {
|
|
|
|
fontDirectories = [
|
|
|
|
amiri
|
|
|
|
caladea
|
|
|
|
carlito
|
|
|
|
dejavu_fonts
|
|
|
|
rubik
|
|
|
|
liberation-sans-narrow
|
|
|
|
liberation_ttf_v2
|
|
|
|
libertine
|
|
|
|
libertine-g
|
|
|
|
noto-fonts
|
|
|
|
noto-fonts-cjk-sans
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
jre' = jre17_minimal.override {
|
2022-06-26 10:26:21 +00:00
|
|
|
modules = [ "java.base" "java.desktop" "java.logging" "java.sql" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
importVariant = f: import (./. + "/src-${variant}/${f}");
|
2023-10-09 19:29:22 +00:00
|
|
|
# Update these files with:
|
|
|
|
# nix-shell maintainers/scripts/update.nix --argstr package libreoffice-$VARIANT.unwrapped
|
|
|
|
version = importVariant "version.nix";
|
|
|
|
srcsAttributes = {
|
|
|
|
main = importVariant "main.nix";
|
|
|
|
help = importVariant "help.nix";
|
|
|
|
translations = importVariant "translations.nix";
|
|
|
|
deps = (importVariant "deps.nix") ++ [
|
|
|
|
# TODO: Why is this needed?
|
|
|
|
(rec {
|
|
|
|
name = "unowinreg.dll";
|
|
|
|
url = "https://dev-www.libreoffice.org/extern/${md5name}";
|
|
|
|
sha256 = "1infwvv1p6i21scywrldsxs22f62x85mns4iq8h6vr6vlx3fdzga";
|
|
|
|
md5 = "185d60944ea767075d27247c3162b3bc";
|
|
|
|
md5name = "${md5}-${name}";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
srcs = {
|
2023-10-09 19:29:22 +00:00
|
|
|
third_party = map (x:
|
|
|
|
(fetchurl {
|
|
|
|
inherit (x) url sha256 name;
|
|
|
|
}) // {
|
|
|
|
inherit (x) md5name md5;
|
|
|
|
}) srcsAttributes.deps;
|
2024-07-27 06:49:29 +00:00
|
|
|
} // optionalAttrs (variant != "collabora") {
|
2023-10-09 19:29:22 +00:00
|
|
|
translations = fetchurl srcsAttributes.translations;
|
|
|
|
help = fetchurl srcsAttributes.help;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
qtMajor = lib.versions.major qtbase.version;
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# See `postPatch` for details
|
|
|
|
kdeDeps = symlinkJoin {
|
|
|
|
name = "libreoffice-kde-dependencies-${version}";
|
|
|
|
paths = flatten (map (e: [ (getDev e) (getLib e) ]) [
|
|
|
|
qtbase
|
|
|
|
qtx11extras
|
|
|
|
kconfig
|
|
|
|
kcoreaddons
|
|
|
|
ki18n
|
|
|
|
kio
|
|
|
|
kwindowsystem
|
|
|
|
]);
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
tarballPath = "external/tarballs";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
in stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libreoffice";
|
|
|
|
inherit version;
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
src = srcsAttributes.main { inherit fetchurl fetchgit; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
mkdir -v $sourceRoot/${tarballPath}
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
${flip concatMapStrings srcs.third_party (f: ''
|
|
|
|
ln -sfv ${f} $sourceRoot/${tarballPath}/${f.md5name}
|
|
|
|
ln -sfv ${f} $sourceRoot/${tarballPath}/${f.name}
|
|
|
|
'')}
|
2024-07-27 06:49:29 +00:00
|
|
|
'' + optionalString (variant != "collabora") ''
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
ln -sv ${srcs.help} $sourceRoot/${tarballPath}/${srcs.help.name}
|
|
|
|
ln -svf ${srcs.translations} $sourceRoot/${tarballPath}/${srcs.translations.name}
|
2024-06-05 15:53:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
tar -xf ${srcs.help}
|
|
|
|
tar -xf ${srcs.translations}
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches = [
|
2024-06-05 15:53:02 +00:00
|
|
|
# Skip some broken tests:
|
|
|
|
# - tdf160386 does not fall back to a CJK font properly for some reason
|
|
|
|
# - the remaining tests have notes in the patch
|
|
|
|
# FIXME: get rid of this ASAP
|
|
|
|
./skip-broken-tests.patch
|
2024-07-27 06:49:29 +00:00
|
|
|
(fetchpatch2 {
|
|
|
|
name = "icu74-compat.patch";
|
|
|
|
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-fresh/-/raw/main/libreoffice-7.5.8.2-icu-74-compatibility.patch?ref_type=heads.patch";
|
|
|
|
hash = "sha256-OGBPIVQj8JTYlkKywt4QpH7ULAzKmet5jTLztGpIS0Y=";
|
|
|
|
})
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (variant == "still") [
|
2023-10-09 19:29:22 +00:00
|
|
|
# Remove build config to reduce the amount of `-dev` outputs in the
|
|
|
|
# runtime closure. This behavior was introduced by upstream in commit
|
|
|
|
# cbfac11330882c7d0a817b6c37a08b2ace2b66f4
|
2023-08-04 22:07:22 +00:00
|
|
|
./0001-Strip-away-BUILDCONFIG.patch
|
2024-06-05 15:53:02 +00:00
|
|
|
# See above
|
|
|
|
./skip-broken-tests-still.patch
|
2024-07-27 06:49:29 +00:00
|
|
|
] ++ lib.optionals (variant == "fresh" || variant == "collabora") [
|
2024-06-05 15:53:02 +00:00
|
|
|
# Revert part of https://github.com/LibreOffice/core/commit/6f60670877208612b5ea320b3677480ef6508abb that broke zlib linking
|
|
|
|
./readd-explicit-zlib-link.patch
|
|
|
|
# See above
|
|
|
|
./skip-broken-tests-fresh.patch
|
2024-07-27 06:49:29 +00:00
|
|
|
] ++ lib.optionals (variant == "collabora") [
|
|
|
|
./fix-unpack-collabora.patch
|
|
|
|
./skip-broken-tests-collabora.patch
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# configure checks for header 'gpgme++/gpgmepp_version.h',
|
|
|
|
# and if it is found (no matter where) uses a hardcoded path
|
|
|
|
# in what presumably is an effort to make it possible to write
|
|
|
|
# '#include <context.h>' instead of '#include <gpgmepp/context.h>'.
|
|
|
|
#
|
|
|
|
# Fix this path to point to where the headers can actually be found instead.
|
2024-06-05 15:53:02 +00:00
|
|
|
substituteInPlace configure.ac --replace-fail \
|
2020-04-24 23:36:52 +00:00
|
|
|
'GPGMEPP_CFLAGS=-I/usr/include/gpgme++' \
|
|
|
|
'GPGMEPP_CFLAGS=-I${gpgme.dev}/include/gpgme++'
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
# Fix for Python 3.12
|
|
|
|
substituteInPlace configure.ac --replace-fail distutils.sysconfig sysconfig
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
nativeBuildInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
autoconf
|
|
|
|
automake
|
|
|
|
bison
|
|
|
|
fontforge
|
|
|
|
gdb
|
2022-12-02 08:20:57 +00:00
|
|
|
jdk17
|
2022-05-18 14:49:53 +00:00
|
|
|
libtool
|
|
|
|
pkg-config
|
2023-03-15 16:39:30 +00:00
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = finalAttrs.passthru.gst_packages ++ [
|
|
|
|
# Make libpng not handle APNG images, so LibreOffice's own handler kicks in
|
|
|
|
# This should be ordered first, so it gets picked up before any other
|
|
|
|
# propagated libpng
|
|
|
|
# See: https://www.mail-archive.com/libreoffice@lists.freedesktop.org/msg334080.html
|
|
|
|
(libpng.override { apngSupport = false; })
|
|
|
|
perlPackages.ArchiveZip
|
2024-06-20 14:57:18 +00:00
|
|
|
coinmp
|
2024-06-05 15:53:02 +00:00
|
|
|
perlPackages.IOCompress
|
2022-05-18 14:49:53 +00:00
|
|
|
abseil-cpp
|
|
|
|
ant
|
|
|
|
bluez5
|
|
|
|
boost
|
|
|
|
box2d
|
|
|
|
cairo
|
2024-06-05 15:53:02 +00:00
|
|
|
clucene_core_2
|
2022-05-18 14:49:53 +00:00
|
|
|
cppunit
|
|
|
|
cups
|
|
|
|
curl
|
|
|
|
db
|
|
|
|
dbus-glib
|
|
|
|
expat
|
|
|
|
file
|
|
|
|
flex
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
getopt
|
|
|
|
gettext
|
|
|
|
glib
|
|
|
|
glm
|
2024-07-27 06:49:29 +00:00
|
|
|
adwaita-icon-theme
|
2022-05-18 14:49:53 +00:00
|
|
|
gperf
|
|
|
|
gpgme
|
|
|
|
graphite2
|
|
|
|
gtk3
|
2024-06-05 15:53:02 +00:00
|
|
|
(harfbuzz.override { withIcu = true; })
|
2022-05-18 14:49:53 +00:00
|
|
|
hunspell
|
|
|
|
icu
|
|
|
|
jre'
|
2024-06-05 15:53:02 +00:00
|
|
|
lcms2
|
2022-05-18 14:49:53 +00:00
|
|
|
libGL
|
|
|
|
libGLU
|
2024-06-05 15:53:02 +00:00
|
|
|
xorg.libX11
|
|
|
|
xorg.libXaw
|
|
|
|
xorg.libXdmcp
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXinerama
|
|
|
|
xorg.libXtst
|
2022-05-18 14:49:53 +00:00
|
|
|
libabw
|
2024-06-05 15:53:02 +00:00
|
|
|
libargon2
|
2022-05-18 14:49:53 +00:00
|
|
|
libatomic_ops
|
|
|
|
libcdr
|
|
|
|
libe-book
|
|
|
|
libepoxy
|
2024-06-05 15:53:02 +00:00
|
|
|
libepubgen
|
|
|
|
libetonyek
|
2022-05-18 14:49:53 +00:00
|
|
|
libexttextcat
|
|
|
|
libjpeg
|
2024-01-13 08:15:51 +00:00
|
|
|
liblangtag
|
2022-05-18 14:49:53 +00:00
|
|
|
libmspack
|
|
|
|
libmwaw
|
|
|
|
libmysqlclient
|
|
|
|
libodfgen
|
2024-06-05 15:53:02 +00:00
|
|
|
liborcus
|
|
|
|
xorg.libpthreadstubs
|
2022-05-18 14:49:53 +00:00
|
|
|
librdf_redland
|
|
|
|
librevenge
|
|
|
|
librsvg
|
|
|
|
libsndfile
|
|
|
|
libvisio
|
|
|
|
libwpd
|
|
|
|
libwpg
|
|
|
|
libwps
|
|
|
|
libxml2
|
2024-06-05 15:53:02 +00:00
|
|
|
xorg.libxshmfence
|
2022-05-18 14:49:53 +00:00
|
|
|
libxslt
|
|
|
|
libzmf
|
2023-10-09 19:29:22 +00:00
|
|
|
libwebp
|
2022-05-18 14:49:53 +00:00
|
|
|
mdds
|
|
|
|
mythes
|
|
|
|
ncurses
|
|
|
|
neon
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
openldap
|
|
|
|
openssl
|
|
|
|
pam
|
|
|
|
perl
|
|
|
|
poppler
|
2023-02-09 11:40:11 +00:00
|
|
|
postgresql
|
2024-07-27 06:49:29 +00:00
|
|
|
python311
|
2022-05-18 14:49:53 +00:00
|
|
|
sane-backends
|
|
|
|
unixODBC
|
|
|
|
unzip
|
|
|
|
util-linux
|
|
|
|
which
|
|
|
|
zip
|
|
|
|
zlib
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ optionals kdeIntegration [
|
|
|
|
qtbase
|
|
|
|
qtx11extras
|
|
|
|
kcoreaddons
|
|
|
|
kio
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray=(
|
|
|
|
"--with-parallelism=$NIX_BUILD_CORES"
|
|
|
|
# here because we need to be very specific about spaces
|
|
|
|
"--with-lang=${concatStringsSep " " langs}"
|
|
|
|
);
|
|
|
|
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
|
|
|
'' + optionalString kdeIntegration ''
|
|
|
|
# configure.ac assumes that the first directory that contains headers and
|
|
|
|
# libraries during its checks contains *all* the relevant headers/libs which
|
|
|
|
# obviously doesn't work for us, so we have 2 options:
|
|
|
|
#
|
|
|
|
# 1. patch configure.ac in order to specify the direct paths to various Qt/KDE
|
|
|
|
# dependencies which is ugly and brittle, or
|
|
|
|
#
|
|
|
|
# 2. use symlinkJoin to pull in the relevant dependencies and just patch in
|
|
|
|
# that path which is *also* ugly, but far less likely to break
|
|
|
|
#
|
|
|
|
# The 2nd option is not very Nix'y, but I'll take robust over nice any day.
|
|
|
|
# Additionally, it's much easier to fix if LO breaks on the next upgrade (just
|
|
|
|
# add the missing dependencies to it).
|
|
|
|
export QT${qtMajor}INC=${kdeDeps}/include
|
|
|
|
export QT${qtMajor}LIB=${kdeDeps}/lib
|
|
|
|
export KF${qtMajor}INC="${kdeDeps}/include ${kdeDeps}/include/KF${qtMajor}"
|
|
|
|
export KF${qtMajor}LIB=${kdeDeps}/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
# Explicitly passing in --host even on non-cross, because
|
|
|
|
# LibreOffice will attempt to detect WSL and cross-compile
|
|
|
|
# itself to Windows automatically, and we don't want it
|
|
|
|
# doing that.
|
|
|
|
"--host=${stdenv.hostPlatform.config}"
|
|
|
|
"--without-buildconfig-recorded"
|
|
|
|
|
|
|
|
(lib.withFeature withHelp "help")
|
|
|
|
"--with-boost=${getDev boost}"
|
|
|
|
"--with-boost-libdir=${getLib boost}/lib"
|
|
|
|
"--with-beanshell-jar=${bsh}"
|
|
|
|
"--with-vendor=NixOS"
|
|
|
|
"--disable-report-builder"
|
|
|
|
"--disable-online-update"
|
|
|
|
"--enable-python=system"
|
|
|
|
"--enable-dbus"
|
|
|
|
"--enable-release-build"
|
|
|
|
"--enable-epm"
|
|
|
|
"--with-ant-home=${getLib ant}/lib/ant"
|
|
|
|
"--with-system-cairo"
|
|
|
|
"--with-system-libs"
|
|
|
|
"--with-system-headers"
|
|
|
|
"--with-system-openssl"
|
|
|
|
"--with-system-libabw"
|
|
|
|
"--with-system-liblangtag"
|
|
|
|
"--without-system-libcmis"
|
|
|
|
"--with-system-libwps"
|
|
|
|
"--with-system-mdds"
|
|
|
|
"--with-system-openldap"
|
|
|
|
"--with-system-coinmp"
|
|
|
|
"--with-system-postgresql"
|
|
|
|
|
|
|
|
# Without these, configure does not finish
|
|
|
|
"--without-junit"
|
|
|
|
|
|
|
|
# Schema files for validation are not included in the source tarball
|
|
|
|
"--without-export-validation"
|
|
|
|
|
|
|
|
# We do tarball prefetching ourselves
|
|
|
|
"--disable-fetch-external"
|
|
|
|
"--enable-build-opensymbol"
|
|
|
|
|
|
|
|
# I imagine this helps. Copied from go-oo.
|
|
|
|
# Modified on every upgrade, though
|
|
|
|
"--disable-odk"
|
|
|
|
"--disable-firebird-sdbc"
|
2024-07-27 06:49:29 +00:00
|
|
|
(lib.withFeature withFonts "fonts")
|
2024-06-05 15:53:02 +00:00
|
|
|
"--without-doxygen"
|
|
|
|
|
|
|
|
# TODO: package these as system libraries
|
|
|
|
"--with-system-beanshell"
|
|
|
|
"--without-system-hsqldb"
|
|
|
|
"--without-system-altlinuxhyph"
|
|
|
|
"--without-system-frozen"
|
|
|
|
"--without-system-lpsolve"
|
|
|
|
"--without-system-libfreehand"
|
|
|
|
"--without-system-libmspub"
|
|
|
|
"--without-system-libnumbertext"
|
|
|
|
"--without-system-libpagemaker"
|
|
|
|
"--without-system-libstaroffice"
|
|
|
|
"--without-system-libqxp"
|
|
|
|
"--without-system-dragonbox"
|
|
|
|
"--without-system-libfixmath"
|
|
|
|
|
|
|
|
# is packaged but headers can't be found because there is no pkg-config file
|
|
|
|
"--without-system-zxcvbn"
|
|
|
|
|
|
|
|
"--with-system-orcus"
|
|
|
|
"--with-system-libepubgen"
|
|
|
|
"--with-system-libetonyek"
|
|
|
|
"--without-system-xmlsec"
|
|
|
|
"--without-system-zxing"
|
|
|
|
] ++ optionals kdeIntegration [
|
|
|
|
"--enable-kf${qtMajor}"
|
|
|
|
"--enable-qt${qtMajor}"
|
|
|
|
] ++ optionals (kdeIntegration && qtMajor == "5") [
|
|
|
|
"--enable-gtk3-kde5"
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
env = {
|
|
|
|
# FIXME: this is a hack, because the right cflags are not being picked up
|
|
|
|
# from rasqal's .pc file. Needs more investigation.
|
|
|
|
NIX_CFLAGS_COMPILE = "-I${librdf_rasqal}/include/rasqal";
|
|
|
|
|
|
|
|
# Provide all the fonts used in tests.
|
|
|
|
FONTCONFIG_FILE = fontsConf;
|
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [ "SHELL=${bash}/bin/bash" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
buildTargets = [ "build-nocheck" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(pwd)
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkTarget = concatStringsSep " " [
|
|
|
|
"unitcheck"
|
|
|
|
"slowcheck"
|
|
|
|
"--keep-going" # easier to debug test failures
|
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postInstall = optionalString (variant != "collabora") ''
|
2024-06-05 15:53:02 +00:00
|
|
|
mkdir -p $out/share/icons
|
|
|
|
|
|
|
|
cp -r sysui/desktop/icons/hicolor $out/share/icons
|
|
|
|
|
|
|
|
# Rename icons for consistency
|
|
|
|
for file in $out/share/icons/hicolor/*/apps/*; do
|
|
|
|
mv $file "$(dirname $file)/libreoffice-$(basename $file)"
|
|
|
|
done
|
|
|
|
|
|
|
|
ln -s $out/lib/libreoffice/share/xdg $out/share/applications
|
|
|
|
|
|
|
|
# Unversionize desktop files
|
|
|
|
. ./bin/get_config_variables PRODUCTVERSION
|
|
|
|
for file in $out/lib/libreoffice/share/xdg/*.desktop; do
|
|
|
|
substituteInPlace $file \
|
|
|
|
--replace-fail "LibreOffice $PRODUCTVERSION" "LibreOffice" \
|
|
|
|
--replace-warn "Icon=libreoffice$PRODUCTVERSION" "Icon=libreoffice" \
|
|
|
|
--replace-fail "Exec=libreoffice$PRODUCTVERSION" "Exec=libreoffice"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Wrapping is done in ./wrapper.nix
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit srcs;
|
|
|
|
jdk = jre';
|
2024-07-27 06:49:29 +00:00
|
|
|
python = python311; # for unoconv
|
2023-10-09 19:29:22 +00:00
|
|
|
updateScript = [
|
|
|
|
./update.sh
|
|
|
|
# Pass it this file name as argument
|
|
|
|
(builtins.unsafeGetAttrPos "pname" finalAttrs.finalPackage).file
|
|
|
|
# And the variant
|
|
|
|
variant
|
|
|
|
];
|
2023-03-15 16:39:30 +00:00
|
|
|
inherit kdeIntegration;
|
|
|
|
# For the wrapper.nix
|
|
|
|
inherit gtk3;
|
|
|
|
# Although present in qtPackages, we need qtbase.qtPluginPrefix and
|
|
|
|
# qtbase.qtQmlPrefix
|
|
|
|
inherit qtbase;
|
|
|
|
gst_packages = with gst_all_1; [
|
|
|
|
gst-libav
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-ugly
|
|
|
|
gstreamer
|
|
|
|
];
|
|
|
|
qmlPackages = [
|
|
|
|
ki18n
|
|
|
|
knotifications
|
|
|
|
qtdeclarative
|
|
|
|
qtquickcontrols
|
|
|
|
qtwayland
|
|
|
|
solid
|
|
|
|
sonnet
|
|
|
|
];
|
|
|
|
qtPackages = [
|
|
|
|
kauth
|
|
|
|
kcompletion
|
|
|
|
kconfigwidgets
|
|
|
|
kglobalaccel
|
|
|
|
ki18n
|
|
|
|
kio
|
|
|
|
kitemviews
|
|
|
|
ktextwidgets
|
|
|
|
kwidgetsaddons
|
|
|
|
kwindowsystem
|
|
|
|
kxmlgui
|
|
|
|
phonon
|
|
|
|
qtbase
|
|
|
|
qtdeclarative
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
qtwayland
|
|
|
|
sonnet
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# libreoffice tries to reference the BUILDCONFIG (e.g. PKG_CONFIG_PATH)
|
|
|
|
# in the binary causing the closure size to blow up because of many unnecessary
|
|
|
|
# dependencies to dev outputs. This behavior was patched away in nixpkgs
|
|
|
|
# (see above), make sure these don't leak again by accident.
|
|
|
|
# FIXME: disabled for kdeIntegration builds because the weird symlinkJoin setup
|
|
|
|
# leaks all the -dev dependencies :(
|
|
|
|
disallowedRequisites = lib.optionals (!kdeIntegration) (lib.concatMap (x: lib.optional (x?dev) x.dev) finalAttrs.buildInputs);
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
requiredSystemFeatures = [ "big-parallel" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://wiki.documentfoundation.org/ReleaseNotes/${lib.versions.majorMinor version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Comprehensive, professional-quality productivity suite, a variant of openoffice.org";
|
|
|
|
homepage = "https://libreoffice.org/";
|
2022-06-16 17:23:12 +00:00
|
|
|
# at least one jar in dependencies
|
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
2024-07-27 06:49:29 +00:00
|
|
|
mainProgram = "libreoffice";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|