mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
wpsoffice: switch to autoPatchelfHook, update dependencies
This commit is contained in:
parent
f6e2834821
commit
593fd37ce6
@ -1,29 +1,38 @@
|
||||
{ stdenv
|
||||
, mkDerivation
|
||||
, fetchurl
|
||||
, autoPatchelfHook
|
||||
, dpkg
|
||||
, wrapQtAppsHook
|
||||
, alsaLib
|
||||
, atk
|
||||
, bzip2
|
||||
, cairo
|
||||
, cups
|
||||
, dbus
|
||||
, dpkg
|
||||
, expat
|
||||
, ffmpeg_3
|
||||
, fontconfig
|
||||
, freetype
|
||||
, gdk-pixbuf
|
||||
, glib
|
||||
, gperftools
|
||||
, gtk2-x11
|
||||
, libICE
|
||||
, libX11
|
||||
, libXrender
|
||||
, libpng12
|
||||
, libtool
|
||||
, libuuid
|
||||
, libxml2
|
||||
, lzma
|
||||
, nspr
|
||||
, nss
|
||||
, openssl
|
||||
, pango
|
||||
, qt5
|
||||
, qt4
|
||||
, qtbase
|
||||
, sqlite
|
||||
, unixODBC
|
||||
, xorg
|
||||
, zlib
|
||||
, zotero
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec{
|
||||
@ -37,7 +46,13 @@ stdenv.mkDerivation rec{
|
||||
unpackCmd = "dpkg -x $src .";
|
||||
sourceRoot = ".";
|
||||
|
||||
nativeBuildInputs = [ qt5.wrapQtAppsHook dpkg ];
|
||||
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 ];
|
||||
|
||||
meta = {
|
||||
description = "Office program originally named Kingsoft Office";
|
||||
@ -48,22 +63,24 @@ stdenv.mkDerivation rec{
|
||||
maintainers = [ stdenv.lib.maintainers.mlatus ];
|
||||
};
|
||||
|
||||
libPath = with xorg; stdenv.lib.makeLibraryPath [
|
||||
buildInputs = with xorg; [
|
||||
alsaLib
|
||||
atk
|
||||
bzip2
|
||||
cairo
|
||||
cups
|
||||
dbus.daemon.lib
|
||||
dbus.lib
|
||||
expat
|
||||
fontconfig
|
||||
ffmpeg_3.out
|
||||
fontconfig.lib
|
||||
freetype
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gperftools
|
||||
gtk2-x11
|
||||
libICE
|
||||
libSM
|
||||
libX11
|
||||
libX11
|
||||
libXScrnSaver
|
||||
libXcomposite
|
||||
libXcursor
|
||||
@ -75,13 +92,20 @@ stdenv.mkDerivation rec{
|
||||
libXrender
|
||||
libXtst
|
||||
libpng12
|
||||
libtool.lib
|
||||
libuuid
|
||||
libxcb
|
||||
libxml2
|
||||
lzma
|
||||
nspr
|
||||
nss
|
||||
openssl
|
||||
pango
|
||||
qt4
|
||||
qtbase
|
||||
sqlite
|
||||
unixODBC
|
||||
zlib
|
||||
zotero
|
||||
];
|
||||
|
||||
dontPatchELF = true;
|
||||
@ -90,18 +114,37 @@ stdenv.mkDerivation rec{
|
||||
# references to nix own build directory
|
||||
noAuditTmpdir = true;
|
||||
|
||||
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
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
prefix=$out/opt/kingsoft/wps-office
|
||||
mkdir -p $out
|
||||
cp -r opt $out
|
||||
cp -r usr/* $out
|
||||
# Avoid forbidden reference error due use of patchelf
|
||||
rm -r *
|
||||
for lib in $unvendoredLibraries; do
|
||||
rm -v "$prefix/office6/lib$lib"*.so{,.*}
|
||||
done
|
||||
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
|
||||
substituteInPlace $out/bin/$i \
|
||||
--replace /opt/kingsoft/wps-office $prefix
|
||||
done
|
||||
|
@ -22552,7 +22552,7 @@ in
|
||||
|
||||
worldengine-cli = python3Packages.worldengine;
|
||||
|
||||
wpsoffice = callPackage ../applications/office/wpsoffice {};
|
||||
wpsoffice = libsForQt5.callPackage ../applications/office/wpsoffice {};
|
||||
|
||||
wrapFirefox = callPackage ../applications/networking/browsers/firefox/wrapper.nix { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user