2021-01-15 05:42:41 +00:00
|
|
|
{ lib, 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
|
|
|
, dpkg
|
2020-04-14 07:18:27 +01:00
|
|
|
, wrapGAppsHook
|
2020-04-14 07:11:36 +01:00
|
|
|
, wrapQtAppsHook
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib
|
2020-04-14 07:01:25 +01:00
|
|
|
, atk
|
2020-04-14 07:11:36 +01:00
|
|
|
, bzip2
|
2020-04-14 07:01:25 +01:00
|
|
|
, cairo
|
|
|
|
, cups
|
|
|
|
, dbus
|
|
|
|
, expat
|
2020-08-06 14:52:38 +01:00
|
|
|
, ffmpeg
|
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
|
2021-03-14 18:12:53 +00:00
|
|
|
, xz
|
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
|
2021-06-09 04:42:03 +01:00
|
|
|
, steam
|
|
|
|
, makeWrapper
|
2020-04-14 07:01:25 +01:00
|
|
|
}:
|
2017-06-04 12:47:27 +01:00
|
|
|
|
2020-06-07 22:11:08 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "wpsoffice";
|
2020-08-06 14:52:38 +01:00
|
|
|
version = "11.1.0.9615";
|
2016-02-23 15:36:54 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-08-06 14:52:38 +01:00
|
|
|
url = "http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9615/wps-office_11.1.0.9615.XA_amd64.deb";
|
|
|
|
sha256 = "0dpd4njpizclllps3qagipycfws935rhj9k5gmdhjfgsk0ns188w";
|
2016-02-23 15:36:54 +00:00
|
|
|
};
|
2019-12-02 16:23:52 +00:00
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
postUnpack = lib.optionalString (version == "11.1.0.9505") ''
|
2020-04-14 07:11:36 +01: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}
|
|
|
|
'';
|
|
|
|
|
2021-06-09 04:42:03 +01:00
|
|
|
nativeBuildInputs = [ dpkg wrapGAppsHook wrapQtAppsHook makeWrapper ];
|
2017-11-11 10:16:20 +00:00
|
|
|
|
2021-02-28 10:14:17 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Office suite, formerly Kingsoft Office";
|
|
|
|
homepage = "https://www.wps.com/";
|
2020-04-14 11:28:18 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2017-06-04 12:47:27 +01:00
|
|
|
hydraPlatforms = [];
|
2021-02-28 10:14:17 +00:00
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
maintainers = with maintainers; [ mlatus th0rgal ];
|
2016-02-23 15:36:54 +00:00
|
|
|
};
|
|
|
|
|
2020-04-14 07:11:36 +01:00
|
|
|
buildInputs = with xorg; [
|
2021-06-10 03:57:09 +01:00
|
|
|
alsa-lib
|
2019-12-02 16:23:52 +00:00
|
|
|
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-08-06 14:52:38 +01:00
|
|
|
ffmpeg
|
2020-04-15 00:08:25 +01:00
|
|
|
fontconfig
|
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-15 00:08:25 +01:00
|
|
|
libtool
|
2020-04-14 07:01:25 +01:00
|
|
|
libuuid
|
|
|
|
libxcb
|
2020-04-14 07:11:36 +01:00
|
|
|
libxml2
|
2021-03-14 18:12:53 +00:00
|
|
|
xz
|
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
|
2021-06-09 04:42:03 +01:00
|
|
|
cups.lib
|
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
|
|
|
|
];
|
|
|
|
|
2021-06-09 04:42:03 +01:00
|
|
|
installPhase = let
|
|
|
|
steam-run = (steam.override {
|
|
|
|
extraPkgs = p: buildInputs;
|
|
|
|
nativeOnly = true;
|
|
|
|
}).run;
|
|
|
|
in ''
|
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 \
|
2020-04-14 07:48:00 +01:00
|
|
|
--replace /usr/bin $out/bin
|
2019-12-02 16:23:52 +00:00
|
|
|
done
|
2020-04-14 07:18:27 +01:00
|
|
|
|
2021-06-09 04:42:03 +01:00
|
|
|
for i in wps wpp et wpspdf; do
|
|
|
|
mv $out/bin/$i $out/bin/.$i-orig
|
|
|
|
makeWrapper ${steam-run}/bin/steam-run $out/bin/$i \
|
|
|
|
--add-flags $out/bin/.$i-orig \
|
|
|
|
--argv0 $i
|
|
|
|
done
|
|
|
|
'';
|
2020-04-14 07:18:27 +01:00
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
dontWrapGApps = true;
|
|
|
|
postFixup = ''
|
|
|
|
for f in "$out"/bin/*; do
|
|
|
|
echo "Wrapping $f"
|
|
|
|
wrapProgram "$f" \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
2021-06-09 04:42:03 +01:00
|
|
|
"''${qtWrapperArgs[@]}"
|
2020-04-14 07:18:27 +01:00
|
|
|
done
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
}
|