libreoffice: wrap to set JAVA_HOME, SAL_USE_VCLPLUGIN and DBus session if not set
This commit is contained in:
parent
7f2305c431
commit
95a819c002
@ -269,7 +269,7 @@ in stdenv.mkDerivation rec {
|
|||||||
nativeBuildInputs = [ wrapGAppsHook ];
|
nativeBuildInputs = [ wrapGAppsHook ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit srcs;
|
inherit srcs jdk;
|
||||||
};
|
};
|
||||||
|
|
||||||
requiredSystemFeatures = [ "big-parallel" ];
|
requiredSystemFeatures = [ "big-parallel" ];
|
||||||
|
@ -261,7 +261,7 @@ in stdenv.mkDerivation rec {
|
|||||||
nativeBuildInputs = [ wrapGAppsHook ];
|
nativeBuildInputs = [ wrapGAppsHook ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit srcs;
|
inherit srcs jdk;
|
||||||
};
|
};
|
||||||
|
|
||||||
requiredSystemFeatures = [ "big-parallel" ];
|
requiredSystemFeatures = [ "big-parallel" ];
|
||||||
|
16
pkgs/applications/office/libreoffice/wrapper.nix
Normal file
16
pkgs/applications/office/libreoffice/wrapper.nix
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ libreoffice, runCommand, dbus, bash }:
|
||||||
|
let
|
||||||
|
jdk = libreoffice.jdk;
|
||||||
|
in
|
||||||
|
(runCommand "${libreoffice.name}" {
|
||||||
|
inherit dbus libreoffice jdk bash;
|
||||||
|
} ''
|
||||||
|
mkdir -p "$out/bin"
|
||||||
|
ln -s "${libreoffice}/share" "$out/share"
|
||||||
|
substituteAll "${./wrapper.sh}" "$out/bin/soffice"
|
||||||
|
chmod a+x "$out/bin/soffice"
|
||||||
|
|
||||||
|
for i in $(ls "${libreoffice}/bin/"); do
|
||||||
|
test "$i" = "soffice" || ln -s soffice "$out/bin/$(basename "$i")"
|
||||||
|
done
|
||||||
|
'') // { inherit libreoffice dbus; }
|
27
pkgs/applications/office/libreoffice/wrapper.sh
Normal file
27
pkgs/applications/office/libreoffice/wrapper.sh
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!@bash@/bin/bash
|
||||||
|
export JAVA_HOME="${JAVA_HOME:-@jdk@}"
|
||||||
|
export SAL_USE_VCLPLUGIN="${SAL_USE_VCLPLUGIN:-gen}"
|
||||||
|
|
||||||
|
if uname | grep Linux > /dev/null &&
|
||||||
|
! ( test -n "$DBUS_SESSION_BUS_ADDRESS" &&
|
||||||
|
test -n "$DBUS_SYSTEM_BUS_ADDRESS" ); then
|
||||||
|
dbus_tmp_dir="/run/user/$(id -u)/libreoffice-dbus"
|
||||||
|
mkdir "$dbus_tmp_dir"
|
||||||
|
dbus_socket_dir="$(mktemp -d -p "$dbus_tmp_dir")"
|
||||||
|
cat "@dbus@/share/dbus-1/system.conf" |
|
||||||
|
grep -v '[<]user[>]messagebus' > "$dbus_socket_dir/system.conf"
|
||||||
|
if test -z "$DBUS_SESSION_BUS_ADDRESS"; then
|
||||||
|
"@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "@dbus@"/share/dbus-1/session.conf --address "unix:path=$dbus_socket_dir/session" >&2 &
|
||||||
|
export DBUS_SESSION_BUS_ADDRESS="unix:path=$dbus_socket_dir/session"
|
||||||
|
fi
|
||||||
|
if test -z "$DBUS_SYSTEM_BUS_ADDRESS"; then
|
||||||
|
"@dbus@"/bin/dbus-daemon --nopidfile --nofork --config-file "$dbus_socket_dir/system.conf" --address "unix:path=$dbus_socket_dir/system" >&2 &
|
||||||
|
export DBUS_SYSTEM_BUS_ADDRESS="unix:path=$dbus_socket_dir/system"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
"@libreoffice@/bin/$(basename "$0")" "$@"
|
||||||
|
code="$?"
|
||||||
|
|
||||||
|
test -n "$dbus_socket_dir" && rm -rf "$dbus_socket_dir"
|
||||||
|
exit "$code"
|
@ -16458,51 +16458,52 @@ with pkgs;
|
|||||||
|
|
||||||
libreoffice = hiPrio libreoffice-still;
|
libreoffice = hiPrio libreoffice-still;
|
||||||
|
|
||||||
libreoffice-fresh = lowPrio (callPackage ../applications/office/libreoffice {
|
libreoffice-fresh = lowPrio (callPackage ../applications/office/libreoffice/wrapper.nix
|
||||||
inherit (perlPackages) ArchiveZip CompressZlib;
|
{ libreoffice = callPackage ../applications/office/libreoffice {
|
||||||
inherit (gnome2) GConf ORBit2 gnome_vfs;
|
inherit (perlPackages) ArchiveZip CompressZlib;
|
||||||
inherit (gnome3) defaultIconTheme;
|
inherit (gnome2) GConf ORBit2 gnome_vfs;
|
||||||
zip = zip.override { enableNLS = false; };
|
inherit (gnome3) defaultIconTheme;
|
||||||
bluez5 = bluez5_28;
|
zip = zip.override { enableNLS = false; };
|
||||||
fontsConf = makeFontsConf {
|
bluez5 = bluez5_28;
|
||||||
fontDirectories = [
|
fontsConf = makeFontsConf {
|
||||||
carlito dejavu_fonts
|
fontDirectories = [
|
||||||
freefont_ttf xorg.fontmiscmisc
|
carlito dejavu_fonts
|
||||||
liberation_ttf_v1_binary
|
freefont_ttf xorg.fontmiscmisc
|
||||||
liberation_ttf_v2_binary
|
liberation_ttf_v1_binary
|
||||||
];
|
liberation_ttf_v2_binary
|
||||||
};
|
];
|
||||||
clucene_core = clucene_core_2;
|
};
|
||||||
lcms = lcms2;
|
clucene_core = clucene_core_2;
|
||||||
harfbuzz = harfbuzz.override {
|
lcms = lcms2;
|
||||||
withIcu = true; withGraphite2 = true;
|
harfbuzz = harfbuzz.override {
|
||||||
};
|
withIcu = true; withGraphite2 = true;
|
||||||
# checking whether g++ supports C++14 or C++11... configure: error: no
|
};
|
||||||
stdenv = overrideCC stdenv gcc5;
|
# checking whether g++ supports C++14 or C++11... configure: error: no
|
||||||
});
|
stdenv = overrideCC stdenv gcc5;
|
||||||
|
};});
|
||||||
libreoffice-still = lowPrio (callPackage ../applications/office/libreoffice/still.nix {
|
|
||||||
inherit (perlPackages) ArchiveZip CompressZlib;
|
|
||||||
inherit (gnome2) GConf ORBit2 gnome_vfs;
|
|
||||||
inherit (gnome3) defaultIconTheme;
|
|
||||||
zip = zip.override { enableNLS = false; };
|
|
||||||
bluez5 = bluez5_28;
|
|
||||||
poppler = poppler_0_61;
|
|
||||||
fontsConf = makeFontsConf {
|
|
||||||
fontDirectories = [
|
|
||||||
freefont_ttf xorg.fontmiscmisc
|
|
||||||
];
|
|
||||||
};
|
|
||||||
clucene_core = clucene_core_2;
|
|
||||||
lcms = lcms2;
|
|
||||||
harfbuzz = harfbuzz.override {
|
|
||||||
withIcu = true; withGraphite2 = true;
|
|
||||||
};
|
|
||||||
icu = icu58;
|
|
||||||
# checking whether g++ supports C++14 or C++11... configure: error: no
|
|
||||||
stdenv = overrideCC stdenv gcc5;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
libreoffice-still = lowPrio (callPackage ../applications/office/libreoffice/wrapper.nix
|
||||||
|
{ libreoffice = callPackage ../applications/office/libreoffice/still.nix {
|
||||||
|
inherit (perlPackages) ArchiveZip CompressZlib;
|
||||||
|
inherit (gnome2) GConf ORBit2 gnome_vfs;
|
||||||
|
inherit (gnome3) defaultIconTheme;
|
||||||
|
zip = zip.override { enableNLS = false; };
|
||||||
|
bluez5 = bluez5_28;
|
||||||
|
poppler = poppler_0_61;
|
||||||
|
fontsConf = makeFontsConf {
|
||||||
|
fontDirectories = [
|
||||||
|
freefont_ttf xorg.fontmiscmisc
|
||||||
|
];
|
||||||
|
};
|
||||||
|
clucene_core = clucene_core_2;
|
||||||
|
lcms = lcms2;
|
||||||
|
harfbuzz = harfbuzz.override {
|
||||||
|
withIcu = true; withGraphite2 = true;
|
||||||
|
};
|
||||||
|
icu = icu58;
|
||||||
|
# checking whether g++ supports C++14 or C++11... configure: error: no
|
||||||
|
stdenv = overrideCC stdenv gcc5;
|
||||||
|
};});
|
||||||
|
|
||||||
liferea = callPackage ../applications/networking/newsreaders/liferea {
|
liferea = callPackage ../applications/networking/newsreaders/liferea {
|
||||||
inherit (gnome3) libpeas gsettings-desktop-schemas dconf;
|
inherit (gnome3) libpeas gsettings-desktop-schemas dconf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user