~alcinnz/rhapsode

989a503211a3b9363322d50b74306fc85d1e7c0c — Adrian Cochrane 3 years ago 481a108
Ease fixing buildsystem for unexpected current directories.
3 files changed, 6 insertions(+), 3 deletions(-)

M src/Input.hs
M src/Render.hs
M src/Types.hs
M src/Input.hs => src/Input.hs +1 -1
@@ 242,7 242,7 @@ foreign export ccall c_freeSession :: StablePtr Session -> IO ()

c_newSession = do
    sess <- newSession
    newStablePtr $ sess {aboutPages = map lazify $(embedDir "about")}
    newStablePtr $ sess {aboutPages = map lazify $(embedDir $ buildDirFile "about")}
  where lazify (a, b) = (a, B.fromStrict b)
c_freeSession = freeStablePtr


M src/Render.hs => src/Render.hs +1 -1
@@ 73,7 73,7 @@ renderElLBS el = XML.renderLBS XML.def $ XML.Document {

retreiveStyles :: Session -> CSSCond.ConditionalStyles (CSSTxt.TextStyle SpeechStyle) -> IO (CSSCond.ConditionalStyles (CSSTxt.TextStyle SpeechStyle))
retreiveStyles manager authorStyle = do
    let agentStyle = H2C.cssPriorityAgent authorStyle `CSS.parse` $(embedStringFile "useragent.css")
    let agentStyle = H2C.cssPriorityAgent authorStyle `CSS.parse` $(embedStringFile $ buildDirFile "useragent.css")
    userStyle <- loadUserStyles agentStyle
    CSSCond.loadImports loadURL lowerVars lowerToks userStyle []
  where

M src/Types.hs => src/Types.hs +4 -1
@@ 1,5 1,5 @@
{-# LANGUAGE OverloadedStrings #-}
module Types(CArray, Page(..), Application(..)) where
module Types(CArray, Page(..), Application(..), buildDirFile) where

import System.Directory (getCurrentDirectory) -- default referer URI
import SpeechStyle (SpeechStyle)


@@ 22,6 22,9 @@ import Control.Parallel (par)
import Foreign.Ptr
import Foreign.StablePtr

buildDir = "."
buildDirFile = (buildDir </>)

type CArray a = Ptr a

data Page = Page {