Default UnpackPhase doesn't return all files

Hi, I’m trying to modify a nixpkgs derivation to create a desktop item for an application. The application is X-AIR-Edit, by Behringer, distributed as a closed source Appimage. I have a derivation that builds and is able to run the application, but I’m struggling with adding the desktop item. The tar.gz archive the source fetches includes the following:

X-Air-Edit_LINUX_1.8
├── Behringer_X-AIR EDIT_V1.8_2023-06-16.pdf
├── X-AIR-Edit
├── X-AIR-Edit_icon.png
└── X-AIR-Edit_Release_History.txt

However, the default unpackphase is only returning the binary and the release history text file. I’d like to also be able to use the icon.png as the desktop file icon in $out/share/icons, but including the line cp X-AIR-Edit_icon.png $out/share/icons/x-air-edit.png results in an error as the file X-AIR-Edit_icon.png is unable to be found in the root. I’ve verified this is the case by nix develop into the build and running the unpackphase. However, I’m lost as to how to solve this problem without writing my own unpackphase from scratch, which seems unnecessary just to be able to get all the files from the archive, a behaviour that it makes sense to me to be included in the default unpacker. Is this the case and I’m missing something, or will I need to write my own unpackphase, and if so, what would that unpackphase need to be?

Thank you!

I would try to confirm what the unpack phase is by looking through the implementation and if that doesn’t suit me override it.

I haven’t written an Unpackphase, I’m still using the default one provided by mkDerivation. Do you know where this is defined, I had a look in the nixpkgs repo but couldn’t see anything obvious that was limiting the types of file unpacked.

Do

mkdir test
cd test
set -x
unpackPhase

In nix develop
There you can see the tar or other unpacker command and see if it works in standalone.

1 Like