File: lpeg.cabal

package info (click to toggle)
haskell-lpeg 1.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 256 kB
  • sloc: ansic: 3,241; haskell: 205; makefile: 6
file content (92 lines) | stat: -rw-r--r-- 3,513 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cabal-version:       2.2
name:                lpeg
version:             1.0.4
synopsis:            LPeg – Parsing Expression Grammars For Lua
description:         This package contains the C sources of LPeg, as well
                     as some tiny Haskell helper to load the package.
                     .
                     <http://www.inf.puc-rio.br/~roberto/lpeg/>
homepage:            https://hslua.org/
bug-reports:         https://github.com/hslua/hslua/issues
license:             MIT
license-file:        LICENSE
author:              Albert Krewinkel
maintainer:          Albert Krewinkel <tarleb@hslua.org>
copyright:           © 2007-2019 Lua.org, PUC-Rio;
                     © 2021-2023 Albert Krewinkel
category:            Foreign
build-type:          Simple
extra-source-files:  cbits/lpeg-1.0.2/*.h
                   , cbits/re.h
                   , README.md
                   , CHANGELOG.md
tested-with:         GHC == 8.4.4
                   , GHC == 8.6.5
                   , GHC == 8.8.4
                   , GHC == 8.10.7
                   , GHC == 9.0.2
                   , GHC == 9.2.5
                   , GHC == 9.4.4

source-repository head
  type:                git
  location:            https://github.com/hslua/hslua.git
  subdir:              lpeg

flag rely-on-shared-lpeg-library
  default:             False
  manual:              True
  description:         Do not build lpeg from source, but trust that lpeg is
                       made available in other ways, e.g., through a
                       system-wide installation. The loader will be replaced
                       with a placeholder function that only emits a message.

common common-options
  default-language:    Haskell2010
  build-depends:       base                 >= 4.11   && < 5
                     , lua                  >= 2.1    && < 2.4
  ghc-options:         -Wall
                       -Wincomplete-record-updates
                       -Wnoncanonical-monad-instances
                       -Wredundant-constraints
  if impl(ghc >= 8.2)
    ghc-options:         -Wcpp-undef
                         -Werror=missing-home-modules
  if impl(ghc >= 8.4)
    ghc-options:         -Widentities
                         -Wincomplete-uni-patterns
                         -Wpartial-fields
                         -fhide-source-paths

library
  import:              common-options
  exposed-modules:     Lua.LPeg
  default-extensions:  ForeignFunctionInterface

  if flag(rely-on-shared-lpeg-library)
    hs-source-dirs:      substitute
    c-sources:           cbits/placeholder.c
    cpp-options:         -DRELY_ON_SYSTEM_INSTALL
  else
    hs-source-dirs:      src
    include-dirs:        cbits/lpeg-1.0.2
                       , cbits
    c-sources:           cbits/lpeg-1.0.2/lpvm.c
                       , cbits/lpeg-1.0.2/lptree.c
                       , cbits/lpeg-1.0.2/lpprint.c
                       , cbits/lpeg-1.0.2/lpcode.c
                       , cbits/lpeg-1.0.2/lpcap.c
                       , cbits/re.c
    cc-options:          -std=c99 -fPIC

test-suite test-lpeg
  import:              common-options
  type:                exitcode-stdio-1.0
  main-is:             test-lpeg.hs
  hs-source-dirs:      test
  build-depends:       lpeg
                     , tasty                >= 0.11
                     , tasty-hunit          >= 0.9
  other-extensions:    CPP
  if flag(rely-on-shared-lpeg-library)
    cpp-options:         -DRELY_ON_SYSTEM_INSTALL