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: https://github.com/NixOS/nixpkgs/commit/9974c079152df7551896ab477524230278ee1b3f#diff-85b519c3da52c3aa89996d730c2b4da0
Also notice the current package contains some unresolved problems as mentioned in the new pr:
https://github.com/NixOS/nixpkgs/pull/82408

1 Like

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