2022-08-26 13:14:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-14 06:01:25 +00:00
|
|
|
, fetchurl
|
2020-04-14 06:11:36 +00:00
|
|
|
, dpkg
|
2022-08-26 13:14:46 +00:00
|
|
|
, autoPatchelfHook
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2023-05-16 14:01:56 +00:00
|
|
|
, at-spi2-core
|
2020-04-14 06:11:36 +00:00
|
|
|
, libtool
|
2023-05-16 14:01:56 +00:00
|
|
|
, libxkbcommon
|
2020-04-14 06:11:36 +00:00
|
|
|
, nspr
|
2022-08-26 13:14:46 +00:00
|
|
|
, mesa
|
|
|
|
, libtiff
|
2023-05-03 05:49:38 +00:00
|
|
|
, udev
|
2023-05-16 14:01:56 +00:00
|
|
|
, gtk3
|
|
|
|
, qtbase
|
2020-04-14 06:01:25 +00:00
|
|
|
, xorg
|
2023-05-16 14:01:56 +00:00
|
|
|
, cups
|
2023-05-13 05:49:13 +00:00
|
|
|
, pango
|
2022-08-26 13:14:46 +00:00
|
|
|
, useChineseVersion ? false
|
2020-04-14 06:01:25 +00:00
|
|
|
}:
|
2017-06-04 11:47:27 +00:00
|
|
|
|
2020-06-07 21:11:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "wpsoffice";
|
2023-05-01 19:08:34 +00:00
|
|
|
version = "11.1.0.11698";
|
2016-02-23 15:36:54 +00:00
|
|
|
|
2022-08-26 13:14:46 +00:00
|
|
|
src = if useChineseVersion then fetchurl {
|
|
|
|
url = "https://wps-linux-personal.wpscdn.cn/wps/download/ep/Linux2019/${lib.last (lib.splitString "." version)}/wps-office_${version}_amd64.deb";
|
2023-05-01 19:08:34 +00:00
|
|
|
sha256 = "sha256-m7BOE2IF2m75mV/4X3HY9UJcidL0S0biqkidddp4LbQ=";
|
2022-08-26 13:14:46 +00:00
|
|
|
} else fetchurl {
|
2023-03-04 18:10:29 +00:00
|
|
|
url = "https://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/${lib.last (lib.splitString "." version)}/wps-office_${version}.XA_amd64.deb";
|
2023-05-01 19:08:34 +00:00
|
|
|
sha256 = "sha256-spqxQK/xTE8yFPmGbSbrDY1vSxkan2kwAWpCWIExhgs=";
|
2016-02-23 15:36:54 +00:00
|
|
|
};
|
2022-08-26 13:14:46 +00:00
|
|
|
|
2019-12-02 16:23:52 +00:00
|
|
|
unpackCmd = "dpkg -x $src .";
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
2023-05-16 14:01:56 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
autoPatchelfHook
|
|
|
|
];
|
2016-02-23 15:36:54 +00:00
|
|
|
|
2022-08-26 13:14:46 +00:00
|
|
|
buildInputs = [
|
2021-06-10 02:57:09 +00:00
|
|
|
alsa-lib
|
2023-05-16 14:01:56 +00:00
|
|
|
at-spi2-core
|
2020-04-14 23:08:25 +00:00
|
|
|
libtool
|
2023-05-16 14:01:56 +00:00
|
|
|
libxkbcommon
|
2020-04-14 06:11:36 +00:00
|
|
|
nspr
|
2022-08-26 13:14:46 +00:00
|
|
|
mesa
|
|
|
|
libtiff
|
2023-05-03 05:49:38 +00:00
|
|
|
udev
|
2023-05-16 14:01:56 +00:00
|
|
|
gtk3
|
|
|
|
qtbase
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXtst
|
2023-05-16 15:07:41 +00:00
|
|
|
xorg.libXv
|
2016-02-23 15:36:54 +00:00
|
|
|
];
|
|
|
|
|
2023-05-16 14:01:56 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2023-05-13 05:49:13 +00:00
|
|
|
runtimeDependencies = map lib.getLib [
|
|
|
|
cups
|
|
|
|
pango
|
2023-05-03 05:49:38 +00:00
|
|
|
];
|
2023-05-03 03:40:15 +00:00
|
|
|
|
2023-05-16 15:07:41 +00:00
|
|
|
autoPatchelfIgnoreMissingDeps = [
|
|
|
|
# distribution is missing libkappessframework.so
|
|
|
|
"libkappessframework.so"
|
|
|
|
# qt4 support is deprecated
|
|
|
|
"libQtCore.so.4"
|
|
|
|
"libQtNetwork.so.4"
|
|
|
|
"libQtXml.so.4"
|
|
|
|
];
|
|
|
|
|
2022-08-26 13:14:46 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2017-06-04 11:47:27 +00: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
|
|
|
|
for i in wps wpp et wpspdf; do
|
|
|
|
substituteInPlace $out/bin/$i \
|
2017-06-04 11:47:27 +00: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 06:48:00 +00:00
|
|
|
--replace /usr/bin $out/bin
|
2019-12-02 16:23:52 +00:00
|
|
|
done
|
2022-08-26 13:14:46 +00:00
|
|
|
runHook postInstall
|
2021-06-09 03:42:03 +00:00
|
|
|
'';
|
2020-04-14 06:18:27 +00:00
|
|
|
|
2023-01-25 10:33:32 +00:00
|
|
|
preFixup = ''
|
|
|
|
# The following libraries need libtiff.so.5, but nixpkgs provides libtiff.so.6
|
2023-05-16 15:07:41 +00:00
|
|
|
patchelf --replace-needed libtiff.so.5 libtiff.so $out/opt/kingsoft/wps-office/office6/{libpdfmain.so,libqpdfpaint.so,qt/plugins/imageformats/libqtiff.so,addons/pdfbatchcompression/libpdfbatchcompressionapp.so}
|
2023-05-03 05:49:38 +00:00
|
|
|
# dlopen dependency
|
|
|
|
patchelf --add-needed libudev.so.1 $out/opt/kingsoft/wps-office/office6/addons/cef/libcef.so
|
2023-01-25 10:33:32 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-26 13:14:46 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Office suite, formerly Kingsoft Office";
|
|
|
|
homepage = "https://www.wps.com";
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-04-03 08:52:32 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-08-26 13:14:46 +00:00
|
|
|
hydraPlatforms = [ ];
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
maintainers = with maintainers; [ mlatus th0rgal rewine ];
|
|
|
|
};
|
2020-04-01 01:11:51 +00:00
|
|
|
}
|