I want to submit a package for an unfree library that only allows redistribution of its unmodified binaries. Because patchelf will need to alter the binaries, the
licenses.unfreeRedistributable does not seem acceptable. If I use
licenses.unfree, then the binaries will be patched on the user’s local machine, which is fine. However, it would be useful to cache the original, unmodified binaries in case the download link disappears or changes. Thus, I was thinking of creating two packages:
- mylibrary, which would be the package you install that contains the patched binaries. This would have the unfree license applied.
- mylibrary-dist, a dependency of the former that would only contain the original redistributable files and would have the unfreeRedistributable license applied. The output of this package could be stored in cache.nixos.org.
I’ve not seen this pattern anywhere else, so I’m a bit concerned about polluting nixpkgs with something idiosyncratic.
Another question I have is what would happen if the original download link went down but the output was already cached? Would Hydra ever attempt to build the package again if the derivation never changed?