Build a derivation from a tarball with only an executable (no directory to cd into)

I’ve got a package I want to build (or rather just an executable) that comes in a .tar.gz. I’m using pkgs.stdenv.mkDerivation

The problem I’m having is that the tarball just contains the executable file with no sub-directory.

 last 3 log lines:
       > unpacking sources
       > unpacking source archive /nix/store/gzj5ygc6fbkswww186mkc2jr1r1qyshy-Godot_v3.x-stable_linux_editor.64.tar.gz
       > unpacker appears to have produced no directories

(note this is a tarball of a custom built godot executable that I have been unable to compile directly - so I cannot install it via other means)

Any way I can deal with this? Thanks.

1 Like

Do not use fetchtarball but fetchurl and a custom unpackPhase.

Also remember that a precompiled binary requires extra work to get it running.

1 Like

Thanks - looks like just what I was looking for.

1 Like