Merge pull request #26343 from gnidorah/master4

wpsoffice: cleanup and i686 version

authored by Jörg Thalheim and committed by GitHub f80d7868 1ff5f6c4

+46 -23
+46 -23
pkgs/applications/office/wpsoffice/default.nix
··· 1 - {stdenv, fetchurl, unzip, libX11, libcxxabi, glib, xorg, qt4, fontconfig, phonon, freetype, zlib, libpng12, libICE, libXrender, cups, lib}: 2 3 - stdenv.mkDerivation rec{ 4 - name = "wpsoffice-${version}"; 5 version = "10.1.0.5672"; 6 7 src = fetchurl { 8 - name = "${name}.tar.gz"; 9 - url = "http://kdl.cc.ksosoft.com/wps-community/download/a21/wps-office_10.1.0.5672~a21_x86_64.tar.xz"; 10 - sha1 = "7e9b17572ed5cea50af24f01457f726fc558a515"; 11 }; 12 13 meta = { 14 description = "Office program originally named Kingsoft Office"; 15 homepage = http://wps-community.org/; 16 - platforms = [ "x86_64-linux" ]; 17 - # Binary for i686 is also available if someone can package it 18 - license = lib.licenses.unfreeRedistributable; 19 }; 20 21 libPath = stdenv.lib.makeLibraryPath [ 22 libX11 23 - libcxxabi 24 libpng12 25 glib 26 xorg.libSM 27 xorg.libXext 28 fontconfig 29 - phonon 30 zlib 31 freetype 32 libICE ··· 34 libXrender 35 ]; 36 37 - phases = [ "unpackPhase" "installPhase" ]; 38 39 installPhase = '' 40 - cp -r . "$out" 41 - chmod +x "$out/office6/wpp" 42 - patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --force-rpath --set-rpath "$out/office6:$libPath" "$out/office6/wpp" 43 - chmod +x "$out/office6/wps" 44 - patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --force-rpath --set-rpath "$out/office6:$libPath" "$out/office6/wps" 45 - chmod +x "$out/office6/et" 46 - patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --force-rpath --set-rpath "$out/office6:$libPath" "$out/office6/et" 47 - mkdir -p "$out/bin/" 48 - ln -s "$out/office6/wpp" "$out/bin/wpspresentation" 49 - ln -s "$out/office6/wps" "$out/bin/wpswriter" 50 - ln -s "$out/office6/et" "$out/bin/wpsspreadsheets" 51 ''; 52 }
··· 1 + { stdenv, fetchurl, fetchFromGitHub 2 + , libX11, glib, xorg, fontconfig, freetype 3 + , zlib, libpng12, libICE, libXrender, cups }: 4 5 + let 6 + bits = if stdenv.system == "x86_64-linux" then "x86_64" 7 + else "x86"; 8 + 9 version = "10.1.0.5672"; 10 + in stdenv.mkDerivation rec{ 11 + name = "wpsoffice-${version}"; 12 13 src = fetchurl { 14 + name = "${name}.tar.xz"; 15 + url = "http://kdl.cc.ksosoft.com/wps-community/download/a21/wps-office_${version}~a21_${bits}.tar.xz"; 16 + sha256 = if bits == "x86_64" then 17 + "0mi3n9kplf82gd0g2m0np957agy53p4g1qh81pbban49r4n0ajcz" else 18 + "1dk400ap5qwdhjvn8lnk602f5akayr391fkljxdkrpn5xac01m97"; 19 }; 20 21 meta = { 22 description = "Office program originally named Kingsoft Office"; 23 homepage = http://wps-community.org/; 24 + platforms = [ "i686-linux" "x86_64-linux" ]; 25 + hydraPlatforms = []; 26 + license = stdenv.lib.licenses.unfreeRedistributable; 27 }; 28 29 libPath = stdenv.lib.makeLibraryPath [ 30 libX11 31 libpng12 32 glib 33 xorg.libSM 34 xorg.libXext 35 fontconfig 36 zlib 37 freetype 38 libICE ··· 40 libXrender 41 ]; 42 43 + dontPatchELF = true; 44 45 installPhase = '' 46 + prefix=$out/opt/kingsoft/wps-office 47 + mkdir -p $prefix 48 + cp -r . $prefix 49 + 50 + # Avoid forbidden reference error due use of patchelf 51 + rm -r $PWD 52 + 53 + mkdir $out/bin 54 + for i in wps wpp et; do 55 + patchelf \ 56 + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 57 + --force-rpath --set-rpath "$prefix/office6:$libPath" \ 58 + $prefix/office6/$i 59 + 60 + substitute $prefix/$i $out/bin/$i \ 61 + --replace /opt/kingsoft/wps-office $prefix 62 + chmod +x $out/bin/$i 63 + 64 + substituteInPlace $prefix/resource/applications/wps-office-$i.desktop \ 65 + --replace /usr/bin $out/bin 66 + done 67 + 68 + # China fonts 69 + mkdir -p $prefix/resource/fonts/wps-office $out/etc/fonts/conf.d 70 + ln -s $prefix/fonts/* $prefix/resource/fonts/wps-office 71 + ln -s $prefix/fontconfig/*.conf $out/etc/fonts/conf.d 72 + 73 + ln -s $prefix/resource $out/share 74 ''; 75 }