gentoo-haskell / hackport

A command line tool to generate Gentoo ebuilds from Hackage packages.
GNU General Public License v3.0
52 stars 21 forks source link

Improve generated `.ebuild` output #132

Open hololeap opened 1 year ago

hololeap commented 1 year ago

This is a PR for generally improving the quality of generated .ebuild files. Example .ebuild files have been added for "golden" testing. Moving forward, these will serve as guidelines or templates for how we want .ebuild files to look.

We can leverage the use of the prettyprinter package, which won't add much dependency footprint since it is also needed by optparse-applicative. This will be very useful for improving the showEBuild function (shown partially here).

https://github.com/gentoo-haskell/hackport/blob/df86a2283bc725b7856d15f496b34fe2d33a1487/src/Portage/EBuild.hs#L98-L103


hololeap commented 1 year ago

@solpeth, I'd like you to take a look at the golden/example .ebuild files I included and let me know if you have any input on the formatting.

I selected these because they should cover the full range of issues we've been experiencing for generated ebuilds. They will serve as a template for how generated ebuilds should look:


Edit: @thesamesam if you have any input on how to improve the formatting of these example ebuilds, I'd be interested in your opinion.

hololeap commented 1 year ago

.out files are simply data dumps, which were generated by pretty-simple outputting live EBuilds. They can be read from the file directly as EBuild data.

This data is fed into showEBuild, whose output is then compared to the corresponding golden .ebuild file.

hololeap commented 1 month ago

@049940 ❓