nixpkgs/pkgs/applications/office/wpsoffice/default.nix

115 lines
2.3 KiB
Nix
Raw Normal View History

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