1
0
forked from GitHub/gf-core

move gf.cabal and all compiler dependent files into src/compiler

This commit is contained in:
Krasimir Angelov
2022-06-18 20:42:31 +02:00
parent 96c8218564
commit a8ad145aeb
264 changed files with 71 additions and 71 deletions

View File

@@ -18,22 +18,31 @@ else
endif endif
endif endif
all: build all: src/runtime/c/libpgf.la src/runtime/haskell/dist/setup-config src/compiler/dist/setup-config
dist/setup-config: gf.cabal Setup.hs WebSetup.hs
ifneq ($(STACK),1)
cabal ${CMD_PFX}configure
endif
build: dist/setup-config
${CMD} ${CMD_PFX}build
install:
ifeq ($(STACK),1) ifeq ($(STACK),1)
stack install stack install
else else
cabal ${CMD_PFX}copy (cd src/runtime/haskell; ${CMD} ${CMD_PFX}install)
cabal ${CMD_PFX}register (cd src/compiler; ${CMD} ${CMD_PFX}install)
endif
src/runtime/c/libpgf.la: src/runtime/c/Makefile
(cd src/runtime/c; make; sudo make install)
src/runtime/c/Makefile: src/runtime/c/Makefile.in src/runtime/c/configure
(cd src/runtime/c; ./configure)
src/runtime/c/Makefile.in src/runtime/c/configure: src/runtime/c/configure.ac src/runtime/c/Makefile.am
(cd src/runtime/c; autoreconf -i)
src/runtime/haskell/dist/setup-config: src/runtime/c/libpgf.la src/runtime/haskell/pgf2.cabal
ifneq ($(STACK),1)
(cd src/runtime/haskell; cabal ${CMD_PFX}configure)
endif
src/compiler/dist/setup-config: src/compiler/gf.cabal src/compiler/Setup.hs src/compiler/WebSetup.hs
ifneq ($(STACK),1)
(cd src/compiler; cabal ${CMD_PFX}configure)
endif endif
doc: doc:

View File

@@ -1,5 +1,5 @@
-- | A file cache to avoid reading and parsing the same file many times -- | A file cache to avoid reading and parsing the same file many times
module Cache (Cache,newCache,flushCache,expireCache,listCache,readCache,readCache') where module GF.Infra.Cache (Cache,newCache,flushCache,expireCache,listCache,readCache,readCache') where
import Control.Concurrent.MVar import Control.Concurrent.MVar
import Data.Map (Map) import Data.Map (Map)

View File

@@ -32,7 +32,7 @@ import Network.URI(URI(..))
import Network.Shed.Httpd(initServer,Request(..),Response(..),noCache) import Network.Shed.Httpd(initServer,Request(..),Response(..),noCache)
--import qualified Network.FastCGI as FCGI -- from hackage direct-fastcgi --import qualified Network.FastCGI as FCGI -- from hackage direct-fastcgi
import Network.CGI(handleErrors,liftIO) import Network.CGI(handleErrors,liftIO)
import CGIUtils(handleCGIErrors)--,outputJSONP,stderrToFile import GF.Server.CGIUtils(handleCGIErrors)--,outputJSONP,stderrToFile
import Text.JSON(encode,showJSON,makeObj) import Text.JSON(encode,showJSON,makeObj)
--import System.IO.Silently(hCapture) --import System.IO.Silently(hCapture)
import System.Process(readProcessWithExitCode) import System.Process(readProcessWithExitCode)
@@ -41,13 +41,13 @@ import Codec.Binary.UTF8.String(decodeString,encodeString)
import GF.Infra.UseIO(readBinaryFile,writeBinaryFile,ePutStrLn) import GF.Infra.UseIO(readBinaryFile,writeBinaryFile,ePutStrLn)
import GF.Infra.SIO(captureSIO) import GF.Infra.SIO(captureSIO)
import GF.Data.Utilities(apSnd,mapSnd) import GF.Data.Utilities(apSnd,mapSnd)
import qualified PGFService as PS import qualified GF.Server.PGFService as PS
import Data.Version(showVersion) import Data.Version(showVersion)
import Paths_gf(getDataDir,version) import Paths_gf(getDataDir,version)
import GF.Infra.BuildInfo (buildInfo) import GF.Infra.BuildInfo (buildInfo)
import SimpleEditor.Convert(parseModule) import GF.Server.SimpleEditor.Convert(parseModule)
import RunHTTP(cgiHandler) import GF.Server.RunHTTP(cgiHandler)
import URLEncoding(decodeQuery) import GF.Server.URLEncoding(decodeQuery)
--logFile :: FilePath --logFile :: FilePath
--logFile = "pgf-error.log" --logFile = "pgf-error.log"

View File

@@ -1,5 +1,5 @@
-- | Isolate dependencies on the problematic cgi package to this module -- | Isolate dependencies on the problematic cgi package to this module
module CGI(module C) where module GF.Server.CGI(module C) where
import Network.CGI as C( import Network.CGI as C(
CGI,ContentType(..),Accept(..),Language(..), CGI,ContentType(..),Accept(..),Language(..),
getVarWithDefault,readInput,negotiate,requestAcceptLanguage,getInput, getVarWithDefault,readInput,negotiate,requestAcceptLanguage,getInput,

View File

@@ -1,6 +1,6 @@
{-# LANGUAGE DeriveDataTypeable, CPP #-} {-# LANGUAGE DeriveDataTypeable, CPP #-}
-- | CGI utility functions for output, error handling and logging -- | CGI utility functions for output, error handling and logging
module CGIUtils (throwCGIError, handleCGIErrors, module GF.Server.CGIUtils (throwCGIError, handleCGIErrors,
stderrToFile,logError, stderrToFile,logError,
outputJSONP,outputEncodedJSONP, outputJSONP,outputEncodedJSONP,
outputPNG,outputBinary,outputBinary', outputPNG,outputBinary,outputBinary',
@@ -14,7 +14,7 @@ import System.IO(hPutStrLn,stderr)
import System.Posix import System.Posix
#endif #endif
import CGI(CGI,CGIResult,setHeader,output,outputFPS,outputError, import GF.Server.CGI(CGI,CGIResult,setHeader,output,outputFPS,outputError,
getInput) getInput)
import Text.JSON import Text.JSON

View File

@@ -1,19 +1,19 @@
{-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-}
module PGFService(cgiMain,cgiMain',getPath, module GF.Server.PGFService(cgiMain,cgiMain',getPath,
logFile,stderrToFile, logFile,stderrToFile,
Caches,pgfCache,newPGFCache,flushPGFCache,listPGFCache) where Caches,pgfCache,newPGFCache,flushPGFCache,listPGFCache) where
import PGF2 import PGF2
import PGF2.Transactions import PGF2.Transactions
import GF.Text.Lexing import GF.Text.Lexing
import Cache import GF.Infra.Cache
import CGIUtils(outputJSONP,outputPlain,outputHTML,outputText, import GF.Server.CGIUtils(outputJSONP,outputPlain,outputHTML,outputText,
outputBinary,outputBinary', outputBinary,outputBinary',
logError,handleCGIErrors,throwCGIError,stderrToFile) logError,handleCGIErrors,throwCGIError,stderrToFile)
import CGI(CGI,readInput,getInput,getVarWithDefault, import GF.Server.CGI(CGI,readInput,getInput,getVarWithDefault,
CGIResult,requestAcceptLanguage,handleErrors,setHeader, CGIResult,requestAcceptLanguage,handleErrors,setHeader,
Accept(..),Language(..),negotiate,liftIO) Accept(..),Language(..),negotiate,liftIO)
import URLEncoding import GF.Server.URLEncoding
import Data.Time.Clock(UTCTime) import Data.Time.Clock(UTCTime)
import Data.Time.Format(formatTime) import Data.Time.Format(formatTime)

View File

@@ -1,13 +1,14 @@
module RunHTTP(runHTTP,Options(..),cgiHandler) where module GF.Server.RunHTTP(runHTTP,Options(..),cgiHandler) where
import GF.Server.CGI(ContentType(..),
CGIResult(..),CGIRequest(..),Input(..),
Headers,HeaderName(..),
runCGIT)
import GF.Server.URLEncoding(decodeQuery)
import Network.URI(uriPath,uriQuery) import Network.URI(uriPath,uriQuery)
import CGI(ContentType(..))
import CGI(CGIResult(..),CGIRequest(..),Input(..),
Headers,HeaderName(..))
import CGI(runCGIT)
import Network.Shed.Httpd(initServer,Request(..),Response(..)) import Network.Shed.Httpd(initServer,Request(..),Response(..))
import qualified Data.ByteString.Lazy.Char8 as BS(pack,unpack,empty) import qualified Data.ByteString.Lazy.Char8 as BS(pack,unpack,empty)
import qualified Data.Map as M(fromList) import qualified Data.Map as M(fromList)
import URLEncoding(decodeQuery)
data Options = Options { documentRoot :: String, port :: Int } deriving Show data Options = Options { documentRoot :: String, port :: Int } deriving Show

View File

@@ -1,5 +1,5 @@
{-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE NoMonomorphismRestriction #-}
module SimpleEditor.Convert where module GF.Server.SimpleEditor.Convert where
import Control.Monad(unless,foldM,ap,mplus) import Control.Monad(unless,foldM,ap,mplus)
import Data.List(sortBy) import Data.List(sortBy)
@@ -19,8 +19,8 @@ import GF.Grammar.Lexer(Posn(..))
import GF.Data.ErrM import GF.Data.ErrM
import PGF2(Literal(LStr)) import PGF2(Literal(LStr))
import SimpleEditor.Syntax as S import GF.Server.SimpleEditor.Syntax as S
import SimpleEditor.JSON import GF.Server.SimpleEditor.JSON
parseModule (path,source) = parseModule (path,source) =

View File

@@ -1,8 +1,8 @@
module SimpleEditor.JSON where module GF.Server.SimpleEditor.JSON where
import Text.JSON import Text.JSON
import SimpleEditor.Syntax import GF.Server.SimpleEditor.Syntax
instance JSON Grammar where instance JSON Grammar where

View File

@@ -2,7 +2,7 @@
Abstract syntax for the small subset of GF grammars supported Abstract syntax for the small subset of GF grammars supported
in gfse, the JavaScript-based simple grammar editor. in gfse, the JavaScript-based simple grammar editor.
-} -}
module SimpleEditor.Syntax where module GF.Server.SimpleEditor.Syntax where
type Id = String -- all sorts of identifiers type Id = String -- all sorts of identifiers
type ModId = Id -- module name type ModId = Id -- module name

View File

@@ -1,4 +1,4 @@
module URLEncoding(urlDecodeUnicode,decodeQuery) where module GF.Server.URLEncoding(urlDecodeUnicode,decodeQuery) where
import Data.Bits (shiftL, (.|.)) import Data.Bits (shiftL, (.|.))
import Data.Char (chr,digitToInt,isHexDigit) import Data.Char (chr,digitToInt,isHexDigit)

View File

@@ -118,7 +118,7 @@ setupWeb dest (pkg,lbi) = do
copyGFLogo = copyGFLogo =
do createDirectoryIfMissing True logo_dir do createDirectoryIfMissing True logo_dir
copyFile ("doc"</>"Logos"</>gf_logo) (logo_dir</>gf_logo) copyFile (".."</>".."</>"doc"</>"Logos"</>gf_logo) (logo_dir</>gf_logo)
-- | Run an arbitrary system command, returning False on failure -- | Run an arbitrary system command, returning False on failure
execute :: String -> [String] -> IO Bool execute :: String -> [String] -> IO Bool

View File

@@ -13,12 +13,6 @@ homepage: https://www.grammaticalframework.org/
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2 tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2
data-dir: src
extra-source-files:
README.md
CHANGELOG.md
WebSetup.hs
doc/Logos/gf0.png
data-files: data-files:
www/*.html www/*.html
www/*.css www/*.css
@@ -69,7 +63,6 @@ flag network-uri
default: True default: True
executable gf executable gf
hs-source-dirs: src/programs, src/compiler
main-is: gf-main.hs main-is: gf-main.hs
default-language: Haskell2010 default-language: Haskell2010
build-depends: pgf2, build-depends: pgf2,
@@ -171,6 +164,7 @@ executable gf
GF.Infra.Ident GF.Infra.Ident
GF.Infra.Location GF.Infra.Location
GF.Infra.SIO GF.Infra.SIO
GF.Infra.Cache
GF.JavaScript.AbsJS GF.JavaScript.AbsJS
GF.JavaScript.PrintJS GF.JavaScript.PrintJS
GF.Quiz GF.Quiz
@@ -232,18 +226,14 @@ executable gf
cpp-options: -DSERVER_MODE cpp-options: -DSERVER_MODE
other-modules: other-modules:
GF.Server GF.Server
PGFService GF.Server.PGFService
RunHTTP GF.Server.RunHTTP
SimpleEditor.Convert GF.Server.SimpleEditor.Convert
SimpleEditor.JSON GF.Server.SimpleEditor.JSON
SimpleEditor.Syntax GF.Server.SimpleEditor.Syntax
URLEncoding GF.Server.URLEncoding
CGI GF.Server.CGI
CGIUtils GF.Server.CGIUtils
Cache
hs-source-dirs:
src/server
src/server/transfer
if flag(interrupt) if flag(interrupt)
cpp-options: -DUSE_INTERRUPT cpp-options: -DUSE_INTERRUPT

Some files were not shown because too many files have changed in this diff Show More