Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wpsoffice: 11.1.0.9080 -> 11.1.0.9126 #82408

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
108 changes: 53 additions & 55 deletions pkgs/applications/office/wpsoffice/default.nix
@@ -1,22 +1,48 @@
{ stdenv, fetchurl
, libX11, glib, xorg, fontconfig, freetype
, zlib, libpng12, libICE, libXrender, cups
, alsaLib, atk, cairo, dbus, expat
, gdk-pixbuf, gtk2-x11, lzma, pango, zotero
, sqlite, libuuid, qt5, dpkg }:

stdenv.mkDerivation rec{
# Build tools
{ stdenv, fetchurl, dpkg,
wrapGAppsHook, autoPatchelfHook,
# Dependencies
alsaLib, atk, cairo, dbus, libsForQt5,
expat, fontconfig, freetype, gdk-pixbuf,
gtk2-x11, glib, primusLib, xorg,
libtool, lzma, pango, nspr, qt5, qt4,
nss, sqlite, libuuid, zlib, cups, file
}:
let
runtimeLibPath = stdenv.lib.makeLibraryPath [
cups.lib
];
in
stdenv.mkDerivation rec {
pname = "wpsoffice";
version = "11.1.0.9080";
version = "11.1.0.9126";

src = fetchurl {
url = "http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9080/wps-office_11.1.0.9080.XA_amd64.deb";
sha256 = "1731e9aea22ef4e558ad66b1373d863452b4f570aecf09d448ae28a821333454";
url = "http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9126/wps-office_11.1.0.9126.XA_amd64.deb";
sha256 = "10d5sgpl1i70rj2596i6865hj0xdlzwdrwiplz41zys6l4zbmfp7";
};
unpackCmd = "dpkg -x $src .";
sourceRoot = ".";

nativeBuildInputs = [ qt5.wrapQtAppsHook dpkg ];
nativeBuildInputs = [ wrapGAppsHook qt5.wrapQtAppsHook dpkg autoPatchelfHook ];
dontWrapQtApps = true;
dontWrapGApps = true;

buildInputs = [
alsaLib atk cairo dbus.lib
expat fontconfig.lib stdenv.cc.cc.lib
freetype gdk-pixbuf gtk2-x11 glib
xorg.libICE libtool.lib
lzma pango nspr qt4 qt5.qtbase
nss xorg.libSM sqlite libuuid
xorg.libX11 xorg.libxcb
xorg.libXcomposite xorg.libXcursor
xorg.libXdamage xorg.libXfixes
xorg.libXi xorg.libXrandr
xorg.libXrender xorg.libXScrnSaver
xorg.libXtst xorg.libXext zlib
libsForQt5.qtstyleplugins
];

meta = {
description = "Office program originally named Kingsoft Office";
Expand All @@ -27,43 +53,6 @@ stdenv.mkDerivation rec{
maintainers = [ stdenv.lib.maintainers.mlatus ];
};

libPath = with xorg; stdenv.lib.makeLibraryPath [
libX11
libpng12
glib
libSM
libXext
fontconfig
zlib
freetype
libICE
cups
libXrender
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
];

dontPatchELF = true;

# wpsoffice uses `/build` in its own build system making nix things there
Expand All @@ -77,18 +66,27 @@ stdenv.mkDerivation rec{
cp -r usr/* $out
# Avoid forbidden reference error due use of patchelf
rm -r *
for i in wps wpp et wpspdf; do
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}" \
$prefix/office6/$i

for i in et wpp wps wpspdf;do
substituteInPlace $out/bin/$i \
--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
'';
}

postFixup = ''
bins=$(find $prefix/office6 -maxdepth 1 -executable ! -type d|grep -v '.*\.so\.*')
for i in $bins;do
echo Wrapping $i
wrapProgram $i \
"''${gappsWrapperArgs[@]}" \
"''${qtWrapperArgs[@]}" \
--suffix LD_LIBRARY_PATH : ${runtimeLibPath}
done
'';
}