Compiling package written in pascal with lazarus

I’m trying to write a derivation for some software that is written in pascal.

The recommended way to install it is by using the the pre-compiled executables, but these search for resources in hard-wired locations in /usr/share. But there are also instructions for compiling from source with lazarus which is available in nixpkgs.

I wonder whether the latter approach would be better than using the pre-compiled binaries, or whether it is likely to be more trouble than it’s worth.

There seems to be a small number of packages in nixpkgs done this way:

applications/radio/cqrlog/default.nix
applications/networking/p2p/transgui/default.nix
applications/graphics/lazpaint/default.nix
applications/file-managers/doublecmd/default.nix
applications/editors/cudatext/default.nix
tools/system/ddrescueview/default.nix
tools/graphics/goverlay/default.nix

Have you any experience with this approach? Would you recommend it over trying to use the binaries?

It is always preferred to use a self compiled binary especially when patching needs to be done

After you’ve figured out how to build a few Pascal packages then some convenience function for repeating the process will naturally fall out.