Installing wpsoffice, unpacking deb archives

The url for wpsoffice seems to be stale, so I tried using this:

nix-repl> u = fetchurl {
          url="http://wdl1.pcfg.cache.wpscdn.com/wpsdl/wpsoffice/download/linux/9126/wps-office_11.1.0.9126.XA_amd64.deb";
          sha256="10d5sgpl1i70rj2596i6865hj0xdlzwdrwiplz41zys6l4zbmfp7";
          }

nix-repl> o = wpsoffice.overrideAttrs (o: {src = u;})

nix-repl> :b o
builder for '/nix/store/ly35v3apmszyacm266knmkk90bak5wzs-wpsoffice-10.1.0.5672.drv' failed with exit code 1; last 3 log lines:
  unpacking sources
  unpacking source archive /nix/store/hajm4anmwrahljl603l7aibj9az7yp96-wps-office_11.1.0.9126.XA_amd64.deb
  do not know how to unpack source archive /nix/store/hajm4anmwrahljl603l7aibj9az7yp96-wps-office_11.1.0.9126.XA_amd64.deb
[0 built (1 failed), 0.0 MiB DL]
error: build of '/nix/store/ly35v3apmszyacm266knmkk90bak5wzs-wpsoffice-10.1.0.5672.drv' failed

Nix expression for wpsoffice has an attribute named unpackCmd:

But for some reason it’s not being used here.

I noticed the drv you are actually building is version 10.1.0.5672, please check if you accidently use an old channel

This is the output of nix-info -m:

 - system: `"x86_64-linux"`
 - host os: `Linux 4.19.108, NixOS, 19.09.2218.a81842b6994 (Loris)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.3`
 - channels(root): `"nixos-19.09.2218.a81842b6994"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Commit a81842b6994 in nixpkgs was made on march 4 this year.

Overriding unpackCmd to "${dpkg}/bin/dpkg -x $src ." but now I am getting another error saying:

unpacker produced multiple directories

The deb file contains etc, usr and opt folders.

wps get updated in Dec 3, 2019 after three years of the last version update and some build recipe changes, which is not included in 19.09: wpsoffice: 10.1.0.5672 -> 11.1.0.8865 (#74769) · NixOS/nixpkgs@9974c07 · GitHub
Also notice the current package contains some unresolved problems as mentioned in the new pr:
wpsoffice: 11.1.0.9080 -> 11.1.0.9126 by Ninlives · Pull Request #82408 · NixOS/nixpkgs · GitHub

1 Like

sourceRoot = "."; should do the trick. With multiple directories, the default scripts don’t know which directory to cd into.