deech / fltkhs

Haskell bindings to FLTK GUI toolkit.
MIT License
190 stars 24 forks source link

Error building bundled fltkhs in custom Setup.hs #164

Open ch1bo opened 4 years ago

ch1bo commented 4 years ago

I have an issue with the custom Setup.hs when building:

Building bundled FLTK
Setup.hs:209:7-88: Non-exhaustive patterns in Flag prefixTemplate

Ran into this while building fltkhs using nix, but the essential problem is that the custom Setup.hs does depend on the fact that there a --libdir is passed to Cabal's configure. For example:

$ nix-shell -p ghc --run "runhaskell Setup.hs configure -fbundled"
Building bundled FLTK
Setup.hs:209:7-88: Non-exhaustive patterns in Flag prefixTemplate

while configuring like this works:

$ nix-shell -p ghc --run "runhaskell Setup.hs configure -fbundled --libdir /tmp/fltkhs/lib"
Building bundled FLTK
Archive:  fltk-master.zip
ee9ada967806dae72aa1b9ddad7b95b94f4dd2a3
   creating: fltk-master/
...

What's the rationale about a custom Setup.hs here?? AFAIK there are other packages which do have "in-tree" upstream c libraries which do use autoconf and a far simpler Setup.hs. One example would be integer-gmp in ghc itself.

ch1bo commented 4 years ago

With a case for both data constructors of Flag (https://hackage.haskell.org/package/Cabal-3.0.0.0/docs/Distribution-Simple-Setup.html#t:Flag), this could be caught and fixed.. but I have no idea what path to pick in the case none is given on configure. The current working directory?