Skip to content

Commit

Permalink
BLD Allow for static building by commenting out cairo
Browse files Browse the repository at this point in the history
  • Loading branch information
luispedro committed Nov 19, 2018
1 parent 58ca498 commit 2488304
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 0.10.0+
* Disable Cairo dependency when building statically

Version 0.10.0 2018-11-12 by luispedro
* Fix to lock1's return value when used with paths (#68 - reopen)
* Support _F/_R suffixes for forward/reverse in load_mocat_sample
Expand Down
9 changes: 8 additions & 1 deletion NGLess/Output.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{- Copyright 2013-2018 NGLess Authors
- License: MIT
-}
{-# LANGUAGE TemplateHaskell, RecordWildCards #-}
{-# LANGUAGE TemplateHaskell, RecordWildCards, CPP #-}

module Output
( OutputType(..)
Expand Down Expand Up @@ -43,8 +43,10 @@ import qualified Data.Conduit as C
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy.Char8 as BL8
import qualified Data.ByteString.Lazy as BL
#ifdef HAS_CAIRO
import qualified Graphics.Rendering.Chart.Easy as G
import qualified Graphics.Rendering.Chart.Backend.Cairo as G
#endif
import System.Environment (lookupEnv)


Expand Down Expand Up @@ -376,6 +378,7 @@ outputConfiguration = do
outputListLno' DebugOutput ["\t\t", p]

drawBaseQs :: FilePath -> [BPosInfo] -> IO ()
#ifdef HAS_CAIRO
drawBaseQs oname bpos = G.toFile G.def oname $ do
G.layout_title G..= "FastQ Quality Statistics"
G.plot (G.line "Mean" [
Expand All @@ -386,3 +389,7 @@ drawBaseQs oname bpos = G.toFile G.def oname $ do
[(ix, _upperQuartile bp) | (ix,bp) <- zip [1:: Integer ..] bpos]])
G.plot (G.line "Lower Quartile" [
[(ix, _lowerQuartile bp) | (ix,bp) <- zip [1:: Integer ..] bpos]])

#else
drawBaseQs _ _ = return ()
#endif
11 changes: 9 additions & 2 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ dependencies:
- configurator
- containers
- convertible
- Chart
- Chart-cairo
- data-default
- deepseq >=1.3
- directory
Expand Down Expand Up @@ -82,6 +80,15 @@ dependencies:
- yaml
- zlib

when:
- condition: ! '!(flag(embed))'
then:
cc-options: -DHAS_CAIRO
cpp-options: -DHAS_CAIRO
dependencies:
- Chart
- Chart-cairo

ghc-options:
- -Wall
- -fwarn-tabs
Expand Down

0 comments on commit 2488304

Please sign in to comment.