I had a go at writing a Nix derivation for Parsec. While it ended up being very similar to yours, I think it might improve on a few points:
Use autoPatchelfHook with a postFixupHook to append to the shared object's rpath: I let autoPatchelf do the heavy lifting, which allows to distinguish between build inputs and runtime dependencies, and makes the fixup phase somewhat more maintainable.
Remove parsecd-150-28.so: this is required by the previous change. The latest shared object loads libGL and libX11 at runtime instead of depending on them as shared libraries. There's no point having a special case to build the packaged shared object, so I remove it during the unpack phase.
Use rec to self-reference the version attribute in the URL, unpack phase, and post fixup hook: this makes version updates easier.
The latest shared object seems to have fewer runtime dependencies than the packaged one (e.g. no libXinerama, no libXrandr). I haven't used Parsec enough to be certain that my list of runtime dependencies is exhaustive though.
Good job finding the appdata and shared object URLs! My reverse engineering skills are rusty and I was only able to find bits of URL in the shared object strings.
Would you mind explaining why you consider your derivation to be experimental? With my limited knowledge of Nix I don't see how the required hacks could be improved.
Hi,
I had a go at writing a Nix derivation for Parsec. While it ended up being very similar to yours, I think it might improve on a few points:
autoPatchelfHook
with apostFixupHook
to append to the shared object's rpath: I letautoPatchelf
do the heavy lifting, which allows to distinguish between build inputs and runtime dependencies, and makes the fixup phase somewhat more maintainable.parsecd-150-28.so
: this is required by the previous change. The latest shared object loadslibGL
andlibX11
at runtime instead of depending on them as shared libraries. There's no point having a special case to build the packaged shared object, so I remove it during the unpack phase.rec
to self-reference the version attribute in the URL, unpack phase, and post fixup hook: this makes version updates easier.Good job finding the appdata and shared object URLs! My reverse engineering skills are rusty and I was only able to find bits of URL in the shared object strings.
Would you mind explaining why you consider your derivation to be experimental? With my limited knowledge of Nix I don't see how the required hacks could be improved.
Thanks, Emma