2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl
|
2017-06-04 12:47:27 +01:00
|
|
|
, libX11, glib, xorg, fontconfig, freetype
|
2019-12-02 16:23:52 +00:00
|
|
|
, zlib, libpng12, libICE, libXrender, cups
|
|
|
|
, alsaLib, atk, cairo, dbus, expat
|
|
|
|
, gdk-pixbuf, gtk2-x11, lzma, pango, zotero
|
|
|
|
, sqlite, libuuid, qt5, dpkg }:
|
2017-06-04 12:47:27 +01:00
|
|
|
|
2019-12-02 16:23:52 +00:00
|
|
|
stdenv.mkDerivation rec{
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "wpsoffice";
|
2020-01-18 08:59:06 +00:00
|
|
|
version = "11.1.0.9080";
|
2016-02-23 15:36:54 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-01-18 08:59:06 +00:00
|
|
|
url = "http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9080/wps-office_11.1.0.9080.XA_amd64.deb";
|
|
|
|
sha256 = "1731e9aea22ef4e558ad66b1373d863452b4f570aecf09d448ae28a821333454";
|
2016-02-23 15:36:54 +00:00
|
|
|
};
|
2019-12-02 16:23:52 +00:00
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qt5.wrapQtAppsHook dpkg ];
|
2017-11-11 10:16:20 +00:00
|
|
|
|
2016-02-23 15:36:54 +00:00
|
|
|
meta = {
|
|
|
|
description = "Office program originally named Kingsoft Office";
|
|
|
|
homepage = http://wps-community.org/;
|
2017-06-04 12:47:27 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
hydraPlatforms = [];
|
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
2019-12-02 16:23:52 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.mlatus ];
|
2016-02-23 15:36:54 +00:00
|
|
|
};
|
|
|
|
|
2019-12-02 16:23:52 +00:00
|
|
|
libPath = with xorg; stdenv.lib.makeLibraryPath [
|
2016-02-23 15:36:54 +00:00
|
|
|
libX11
|
|
|
|
libpng12
|
|
|
|
glib
|
2019-12-02 16:23:52 +00:00
|
|
|
libSM
|
|
|
|
libXext
|
2016-02-23 15:36:54 +00:00
|
|
|
fontconfig
|
|
|
|
zlib
|
|
|
|
freetype
|
|
|
|
libICE
|
|
|
|
cups
|
|
|
|
libXrender
|
2019-12-02 16:23:52 +00:00
|
|
|
libxcb
|
|
|
|
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
dbus.daemon.lib
|
|
|
|
expat
|
|
|
|
fontconfig.lib
|
|
|
|
gdk-pixbuf
|
|
|
|
gtk2-x11
|
|
|
|
lzma
|
|
|
|
pango
|
|
|
|
zotero
|
|
|
|
sqlite
|
|
|
|
libuuid
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libXScrnSaver
|
|
|
|
libXtst
|
2016-02-23 15:36:54 +00:00
|
|
|
];
|
|
|
|
|
2017-06-04 12:47:27 +01:00
|
|
|
dontPatchELF = true;
|
2016-02-23 15:36:54 +00:00
|
|
|
|
2017-11-11 10:16:20 +00:00
|
|
|
# wpsoffice uses `/build` in its own build system making nix things there
|
|
|
|
# references to nix own build directory
|
|
|
|
noAuditTmpdir = true;
|
|
|
|
|
2016-02-23 15:36:54 +00:00
|
|
|
installPhase = ''
|
2017-06-04 12:47:27 +01:00
|
|
|
prefix=$out/opt/kingsoft/wps-office
|
2019-12-02 16:23:52 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -r opt $out
|
|
|
|
cp -r usr/* $out
|
2017-06-04 12:47:27 +01:00
|
|
|
# Avoid forbidden reference error due use of patchelf
|
2019-12-02 16:23:52 +00:00
|
|
|
rm -r *
|
|
|
|
for i in wps wpp et wpspdf; do
|
2017-06-04 12:47:27 +01:00
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2019-12-02 16:23:52 +00:00
|
|
|
--force-rpath --set-rpath "$(patchelf --print-rpath $prefix/office6/$i):${stdenv.cc.cc.lib}/lib64:${libPath}" \
|
2017-06-04 12:47:27 +01:00
|
|
|
$prefix/office6/$i
|
2019-12-02 16:23:52 +00:00
|
|
|
substituteInPlace $out/bin/$i \
|
2017-06-04 12:47:27 +01:00
|
|
|
--replace /opt/kingsoft/wps-office $prefix
|
|
|
|
done
|
2019-12-02 16:23:52 +00:00
|
|
|
for i in $out/share/applications/*;do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace /usr/bin $out/bin \
|
|
|
|
--replace /opt/kingsoft/wps-office $prefix
|
|
|
|
done
|
2016-02-23 15:36:54 +00:00
|
|
|
'';
|
2020-01-18 08:59:06 +00:00
|
|
|
}
|