2020-04-14 07:01:25 +01:00
|
|
|
{ stdenv
|
2020-04-14 07:11:36 +01:00
|
|
|
, mkDerivation
|
2020-04-14 07:01:25 +01:00
|
|
|
, fetchurl
|
2020-04-14 07:11:36 +01:00
|
|
|
, autoPatchelfHook
|
|
|
|
, dpkg
|
|
|
|
, wrapQtAppsHook
|
2020-04-14 07:01:25 +01:00
|
|
|
, alsaLib
|
|
|
|
, atk
|
2020-04-14 07:11:36 +01:00
|
|
|
, bzip2
|
2020-04-14 07:01:25 +01:00
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, expat
|
2020-04-14 07:11:36 +01:00
|
|
|
, ffmpeg_3
|
2020-04-14 07:01:25 +01:00
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
2020-04-14 07:11:36 +01:00
|
|
|
, gperftools
|
2020-04-14 07:01:25 +01:00
|
|
|
, gtk2-x11
|
|
|
|
, libpng12
|
2020-04-14 07:11:36 +01:00
|
|
|
, libtool
|
2020-04-14 07:01:25 +01:00
|
|
|
, libuuid
|
2020-04-14 07:11:36 +01:00
|
|
|
, libxml2
|
2020-04-14 07:01:25 +01:00
|
|
|
, lzma
|
2020-04-14 07:11:36 +01:00
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, openssl
|
2020-04-14 07:01:25 +01:00
|
|
|
, pango
|
2020-04-14 07:11:36 +01:00
|
|
|
, qt4
|
|
|
|
, qtbase
|
2020-04-14 07:01:25 +01:00
|
|
|
, sqlite
|
2020-04-14 07:11:36 +01:00
|
|
|
, unixODBC
|
2020-04-14 07:01:25 +01:00
|
|
|
, xorg
|
|
|
|
, zlib
|
|
|
|
}:
|
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-04-13 23:11:01 +01:00
|
|
|
version = "11.1.0.9505";
|
2016-02-23 15:36:54 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-13 23:11:01 +01: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 15:36:54 +00:00
|
|
|
};
|
2019-12-02 16:23:52 +00:00
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2020-04-14 07:11:36 +01:00
|
|
|
postUnpack = stdenv.lib.optionalString (version == "11.1.0.9505") ''
|
|
|
|
# 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 wrapQtAppsHook ];
|
2017-11-11 10:16:20 +00:00
|
|
|
|
2016-02-23 15:36:54 +00:00
|
|
|
meta = {
|
|
|
|
description = "Office program originally named Kingsoft Office";
|
2020-04-01 02:11:51 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2020-04-14 07:11:36 +01:00
|
|
|
buildInputs = with xorg; [
|
2019-12-02 16:23:52 +00:00
|
|
|
alsaLib
|
|
|
|
atk
|
2020-04-14 07:11:36 +01:00
|
|
|
bzip2
|
2019-12-02 16:23:52 +00:00
|
|
|
cairo
|
2020-04-14 07:11:36 +01:00
|
|
|
dbus.lib
|
2019-12-02 16:23:52 +00:00
|
|
|
expat
|
2020-04-14 07:11:36 +01:00
|
|
|
ffmpeg_3.out
|
2019-12-02 16:23:52 +00:00
|
|
|
fontconfig.lib
|
2020-04-14 07:01:25 +01:00
|
|
|
freetype
|
2019-12-02 16:23:52 +00:00
|
|
|
gdk-pixbuf
|
2020-04-14 07:01:25 +01:00
|
|
|
glib
|
2020-04-14 07:11:36 +01:00
|
|
|
gperftools
|
2019-12-02 16:23:52 +00:00
|
|
|
gtk2-x11
|
2020-04-14 07:01:25 +01:00
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libX11
|
2020-04-14 07:11:36 +01:00
|
|
|
libX11
|
2020-04-14 07:01:25 +01:00
|
|
|
libXScrnSaver
|
2019-12-02 16:23:52 +00:00
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
2020-04-14 07:01:25 +01:00
|
|
|
libXext
|
2019-12-02 16:23:52 +00:00
|
|
|
libXfixes
|
|
|
|
libXi
|
|
|
|
libXrandr
|
2020-04-14 07:01:25 +01:00
|
|
|
libXrender
|
2019-12-02 16:23:52 +00:00
|
|
|
libXtst
|
2020-04-14 07:01:25 +01:00
|
|
|
libpng12
|
2020-04-14 07:11:36 +01:00
|
|
|
libtool.lib
|
2020-04-14 07:01:25 +01:00
|
|
|
libuuid
|
|
|
|
libxcb
|
2020-04-14 07:11:36 +01:00
|
|
|
libxml2
|
2020-04-14 07:01:25 +01:00
|
|
|
lzma
|
2020-04-14 07:11:36 +01:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
openssl
|
2020-04-14 07:01:25 +01:00
|
|
|
pango
|
2020-04-14 07:11:36 +01:00
|
|
|
qt4
|
|
|
|
qtbase
|
2020-04-14 07:01:25 +01:00
|
|
|
sqlite
|
2020-04-14 07:11:36 +01:00
|
|
|
unixODBC
|
2020-04-14 07:01:25 +01:00
|
|
|
zlib
|
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;
|
|
|
|
|
2020-04-14 07:11:36 +01:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
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
|
2020-04-14 07:11:36 +01:00
|
|
|
for lib in $unvendoredLibraries; do
|
|
|
|
rm -v "$prefix/office6/lib$lib"*.so{,.*}
|
|
|
|
done
|
2019-12-02 16:23:52 +00:00
|
|
|
for i in wps wpp et wpspdf; do
|
|
|
|
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-04-01 02:11:51 +01:00
|
|
|
}
|