ku-fpg / blank-canvas

A Haskell API into HTML5 Canvas
BSD 3-Clause "New" or "Revised" License
72 stars 14 forks source link

Unable to install on clean RHEL 7.2 #75

Closed robert-blankenship closed 8 years ago

robert-blankenship commented 8 years ago

After trying to run cabal install blank-canvas --force-resintalls I get the following error message:

screen shot 2016-05-26 at 10 24 52 am

RyanGlScott commented 8 years ago

I'm guessing you're using GHC 7.6. blank-canvas's dependencies no longer build with GHC 7.6 (and we only test with 7.8 and later), so we should probably bump the minimum version bounds of base to reflect this. Sorry about the confusion.

RyanGlScott commented 8 years ago

I've revised the Hackage metadata so that one cannot construct a build plan with GHC 7.6.

robert-blankenship commented 8 years ago

Thanks @RyanGlScott

robert-blankenship commented 8 years ago

I am now getting the following warning when trying to install on a clean Fedora 23 environment (which has a newer Haskell than the previous RHEL 7.2).

cabal: The following packages are likely to be broken by the reinstalls:
haskell-platform-2014.2.0.0.2
Use --force-reinstalls if you want to install anyway
screen shot 2016-05-26 at 8 40 13 pm

My GHCI is now >= 7.8, as you graciously pointed out :). It shipped with the haskell-platform package that I installed using dnf.

After running cabal install --force-reinstalls blank-canvas it did install successfully, but the error message was scary.

robert-blankenship commented 8 years ago

Also, how do I get it to accept non-local connections? :)

robert-blankenship commented 8 years ago

Figured it out :)

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Graphics.Blank                     -- import the blank canvas

main = blankCanvas (Options 8000 [] True "." [] False) $ \ context -> do -- start blank canvas on port 3000
        send context $ do                 -- send commands to this specific context
                moveTo(50,50)
                lineTo(200,100)
                lineWidth 10
                strokeStyle "red"
                stroke()
andygill commented 8 years ago

For non-local, it is better to use

main = blankCanvas 8000 { middleware = [] } $ \ context -> ...

Which removes the local_only Middleware from the Options. The number of Options in options may change in the next version and this solution would still work.