2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, mkDerivation
|
|
|
|
, fetchurl
|
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
|
|
|
, wrapGAppsHook
|
|
|
|
, wrapQtAppsHook
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, atk
|
|
|
|
, bzip2
|
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, expat
|
2020-11-30 08:33:03 +00:00
|
|
|
, ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
|
|
|
, gperftools
|
|
|
|
, gtk2-x11
|
|
|
|
, libpng12
|
|
|
|
, libtool
|
|
|
|
, libuuid
|
|
|
|
, libxml2
|
2021-04-05 15:23:46 +00:00
|
|
|
, xz
|
2020-04-24 23:36:52 +00:00
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, openssl
|
|
|
|
, pango
|
|
|
|
, qt4
|
|
|
|
, qtbase
|
|
|
|
, sqlite
|
|
|
|
, unixODBC
|
|
|
|
, xorg
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "wpsoffice";
|
2020-11-30 08:33:03 +00:00
|
|
|
version = "11.1.0.9615";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-11-30 08:33:03 +00:00
|
|
|
url = "http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9615/wps-office_11.1.0.9615.XA_amd64.deb";
|
|
|
|
sha256 = "0dpd4njpizclllps3qagipycfws935rhj9k5gmdhjfgsk0ns188w";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
postUnpack = lib.optionalString (version == "11.1.0.9505") ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# distribution is missing libjsapiservice.so, so we should not let
|
|
|
|
# autoPatchelfHook fail on the following dead libraries
|
|
|
|
rm opt/kingsoft/wps-office/office6/{libjsetapi.so,libjswppapi.so,libjswpsapi.so}
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook dpkg wrapGAppsHook wrapQtAppsHook ];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Office suite, formerly Kingsoft Office";
|
|
|
|
homepage = "https://www.wps.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
hydraPlatforms = [];
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
maintainers = with maintainers; [ mlatus th0rgal ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = with xorg; [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
atk
|
|
|
|
bzip2
|
|
|
|
cairo
|
|
|
|
dbus.lib
|
|
|
|
expat
|
2020-11-30 08:33:03 +00:00
|
|
|
ffmpeg
|
2020-04-24 23:36:52 +00:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gperftools
|
|
|
|
gtk2-x11
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libX11
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libpng12
|
|
|
|
libtool
|
|
|
|
libuuid
|
|
|
|
libxcb
|
|
|
|
libxml2
|
2021-04-05 15:23:46 +00:00
|
|
|
xz
|
2020-04-24 23:36:52 +00:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
openssl
|
|
|
|
pango
|
|
|
|
qt4
|
|
|
|
qtbase
|
|
|
|
sqlite
|
|
|
|
unixODBC
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
# wpsoffice uses `/build` in its own build system making nix things there
|
|
|
|
# references to nix own build directory
|
|
|
|
noAuditTmpdir = true;
|
|
|
|
|
|
|
|
unvendoredLibraries = [
|
|
|
|
# Have to use parts of the vendored qt4
|
|
|
|
#"Qt"
|
|
|
|
"SDL2"
|
|
|
|
"bz2"
|
|
|
|
"avcodec"
|
|
|
|
"avdevice"
|
|
|
|
"avformat"
|
|
|
|
"avutil"
|
|
|
|
"swresample"
|
|
|
|
"swscale"
|
|
|
|
"jpeg"
|
|
|
|
"png"
|
|
|
|
# File saving breaks unless we are using vendored llvmPackages_8.libcxx
|
|
|
|
#"c++"
|
|
|
|
"ssl" "crypto"
|
|
|
|
"nspr"
|
|
|
|
"nss"
|
|
|
|
"odbc"
|
|
|
|
"tcmalloc" # gperftools
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
prefix=$out/opt/kingsoft/wps-office
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r opt $out
|
|
|
|
cp -r usr/* $out
|
|
|
|
for lib in $unvendoredLibraries; do
|
|
|
|
rm -v "$prefix/office6/lib$lib"*.so{,.*}
|
|
|
|
done
|
|
|
|
for i in wps wpp et wpspdf; do
|
|
|
|
substituteInPlace $out/bin/$i \
|
|
|
|
--replace /opt/kingsoft/wps-office $prefix
|
|
|
|
done
|
|
|
|
for i in $out/share/applications/*;do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace /usr/bin $out/bin
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
runtimeLibPath = lib.makeLibraryPath [
|
2020-04-24 23:36:52 +00:00
|
|
|
cups.lib
|
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
dontWrapGApps = true;
|
|
|
|
postFixup = ''
|
|
|
|
for f in "$out"/bin/*; do
|
|
|
|
echo "Wrapping $f"
|
|
|
|
wrapProgram "$f" \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
"''${qtWrapperArgs[@]}" \
|
|
|
|
--suffix LD_LIBRARY_PATH : "$runtimeLibPath"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
}
|