ImplicitCAD icon indicating copy to clipboard operation
ImplicitCAD copied to clipboard

Arch Linux build issue

Open alhirzel opened this issue 10 months ago • 1 comments

I am taking over the Arch Linux AUR package for ImplicitCAD, and I am noticing that as of #462, ImplicitCAD no longer distributes a Setup.hs file. This file is used by the boilerplate PKGBUILD script to generate register.sh and unregister.sh scripts that Arch Linux seems to require for their style of distribution. It seems that the option to generate an unregister.sh script is not available via a "v1" cabal command (e.g. like cabal v1-unregister), so I am looking for guidance on the best way to generate this unregister.sh script.

I am not very experienced in production packaging of Haskell projects, so I am likely missing something simple about the "Nix-style" packaging method that it appears ImplicitCAD now uses. Help! :)

alhirzel avatar Feb 25 '25 18:02 alhirzel

Hey! Ideally Arch should support packages without Setup.hs as it is no longer required for build-type:Simple ones and over time you will stumble on more of these.

For build-type:Simple the Setup.hs is always

import Distribution.Simple
main :: IO ()
main = defaultMain

which is pretty much a boilerplate to call Cabal.

We can either add it back or you can cat > Setup.hs (maybe improving the boilerplate PKGBUILD script template so it does that when Setup.hs is missing) / patch it locally.

It might be possible to use cabal v2 commands to achieve the same but I'm not quite sure (i.e. how it's done in NixOS). There's nothing Nix-special about ImplicitCAD's packaging though - it's just a standard Haskell project, .nix boilerplate is just a convenience for spawning dev shell and reproducibly building it.

sorki avatar Feb 26 '25 07:02 sorki