File: lua.cabal

package info (click to toggle)
haskell-lua 2.3.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: haskell: 1,582; ansic: 403; makefile: 7
file content (217 lines) | stat: -rw-r--r-- 8,017 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
cabal-version:       2.2
name:                lua
version:             2.3.3
synopsis:            Lua, an embeddable scripting language
description:         This package provides bindings and types to bridge
                     Haskell and <https://www.lua.org/ Lua>.
                     .
                     The full Lua interpreter version 5.4.7 is included.
                     Alternatively, a system-wide Lua installation can be
                     linked instead.
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–2012 Gracjan Polak;
                     © 2012–2016 Ömer Sinan Ağacan;
                     © 2017-2024 Albert Krewinkel
category:            Foreign
build-type:          Simple
extra-source-files:  cbits/lua-5.4.7/*.h
                   , cbits/hslua/*.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.8
                   , GHC == 9.4.8
                   , GHC == 9.6.5
                   , GHC == 9.8.2
                   , GHC == 9.10.1

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

flag system-lua
  default:             False
  manual:              True
  description:         Use the system-wide Lua instead of the bundled copy.

flag apicheck
  default:             False
  manual:              True
  description:         Compile Lua with -DLUA_USE_APICHECK.

flag lua_32bits
  default:             False
  manual:              True
  description:         Compile Lua with -DLUA_32BITS

flag allow-unsafe-gc
  default:             True
  manual:              True
  description:         Allow optimizations which make Lua's garbage collection
                       potentially unsafe; enabling this should be safe if
                       there are no callbacks into Haskell during Lua garbage
                       collection cycles. The flag should be *disabled* if Lua
                       objects can have Haskell finalizers, i.e., @__gc@
                       metamethods that call Haskell function.

flag export-dynamic
  default:             True
  manual:              True
  description:         Add all symbols to dynamic symbol table; disabling this
                       will make it possible to create fully static binaries,
                       but renders loading of dynamic C libraries impossible.

flag pkg-config
  default:             False
  manual:              True
  description:         Use @pkg-config@ to discover library and include paths.
                       Setting this flag implies `system-lua`.

flag cross-compile
  default:             False
  manual:              True
  description:         Avoids constructs that would prevent cross-compilation.
                       The Lua version constants may become inaccurate when
                       this flag is enabled.

common common-options
  default-language:    Haskell2010
  build-depends:       base                 >= 4.11   && < 5
  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

  if flag(lua_32bits)
    cc-options:          -DLUA_32BITS

  if flag(apicheck)
    cc-options:          -DLUA_USE_APICHECK

  if flag(allow-unsafe-gc)
    cpp-options:         -DALLOW_UNSAFE_GC

  if flag(cross-compile)
    cpp-options:         -D_LUA_NO_CONST_STR

library
  import:              common-options
  exposed-modules:     Lua
                     , Lua.Auxiliary
                     , Lua.Call
                     , Lua.Constants
                     , Lua.Debug
                     , Lua.Ersatz
                     , Lua.Ersatz.Auxiliary
                     , Lua.Ersatz.Functions
                     , Lua.Lib
                     , Lua.Primary
                     , Lua.Types
                     , Lua.Userdata
                     , Lua.Warn
  hs-source-dirs:      src
  default-extensions:  CApiFFI
                     , ForeignFunctionInterface
                     , LambdaCase
                     , StrictData
  other-extensions:    CPP
                     , DeriveGeneric
                     , GeneralizedNewtypeDeriving
                     , PatternSynonyms
  c-sources:           cbits/hslua/hsludata.c
                     , cbits/hslua/hslcall.c
                     , cbits/hslua/hslauxlib.c
                     , cbits/hslua/hslua.c
                     , cbits/hslua/hslwarn.c
  include-dirs:        cbits/hslua
  includes:            lua.h
                     , luaconf.h
                     , lauxlib.h
                     , lualib.h
  if flag(system-lua) || flag(pkg-config)
    if flag(pkg-config)
      pkgconfig-depends: lua5.4
    else
      extra-libraries:   lua
  else
    include-dirs:        cbits/lua-5.4.7
    install-includes:    lua.h
                       , luaconf.h
                       , lauxlib.h
                       , lualib.h
    c-sources:           cbits/lua-5.4.7/lapi.c
                       , cbits/lua-5.4.7/lcode.c
                       , cbits/lua-5.4.7/lctype.c
                       , cbits/lua-5.4.7/ldebug.c
                       , cbits/lua-5.4.7/ldo.c
                       , cbits/lua-5.4.7/ldump.c
                       , cbits/lua-5.4.7/lfunc.c
                       , cbits/lua-5.4.7/lgc.c
                       , cbits/lua-5.4.7/llex.c
                       , cbits/lua-5.4.7/lmem.c
                       , cbits/lua-5.4.7/lobject.c
                       , cbits/lua-5.4.7/lopcodes.c
                       , cbits/lua-5.4.7/lparser.c
                       , cbits/lua-5.4.7/lstate.c
                       , cbits/lua-5.4.7/lstring.c
                       , cbits/lua-5.4.7/ltable.c
                       , cbits/lua-5.4.7/ltm.c
                       , cbits/lua-5.4.7/lundump.c
                       , cbits/lua-5.4.7/lvm.c
                       , cbits/lua-5.4.7/lzio.c

                       , cbits/lua-5.4.7/lauxlib.c
                       , cbits/lua-5.4.7/lbaselib.c
                       , cbits/lua-5.4.7/lcorolib.c
                       , cbits/lua-5.4.7/ldblib.c
                       , cbits/lua-5.4.7/liolib.c
                       , cbits/lua-5.4.7/lmathlib.c
                       , cbits/lua-5.4.7/loadlib.c
                       , cbits/lua-5.4.7/loslib.c
                       , cbits/lua-5.4.7/lstrlib.c
                       , cbits/lua-5.4.7/ltablib.c
                       , cbits/lua-5.4.7/lutf8lib.c
                       , cbits/lua-5.4.7/linit.c

  if os(linux)
    cc-options:          -DLUA_USE_LINUX
    if flag(export-dynamic)
      ld-options:        -Wl,-E

  if os(darwin)
    cc-options:          -DLUA_USE_MACOSX

  if os(freebsd)
    cc-options:          -DLUA_USE_POSIX
    if flag(export-dynamic)
      ld-options:        -Wl,-E

test-suite test-lua
  import:              common-options
  type:                exitcode-stdio-1.0
  main-is:             test-lua.hs
  hs-source-dirs:      test
  other-modules:       Lua.ErsatzTests
                     , Lua.PrimaryTests
                     , Lua.UnsafeTests
  build-depends:       lua
                     , tasty                >= 0.11
                     , tasty-hunit          >= 0.9