From cdd6389e91357c48dc3bb859695ab4538da4d004 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Oct 2015 11:01:38 -0700 Subject: New approach to stack build on appveyor. This uses system lua library. See https://github.com/osa1/hslua/issues/22#issuecomment-151281274 --- windows/hslua.cabal | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++ windows/stack.yaml | 19 ++++++++ 2 files changed, 146 insertions(+) create mode 100644 windows/hslua.cabal create mode 100644 windows/stack.yaml (limited to 'windows') diff --git a/windows/hslua.cabal b/windows/hslua.cabal new file mode 100644 index 000000000..fc6d419bb --- /dev/null +++ b/windows/hslua.cabal @@ -0,0 +1,127 @@ +name: hslua +version: 0.4.1 +stability: beta +cabal-version: >= 1.8 +license: MIT +build-type: Simple +license-File: COPYRIGHT +copyright: Gracjan Polak 2007-2012, Ömer Sinan Ağacan 2012-2015 +author: Gracjan Polak, Ömer Sinan Ağacan +maintainer: omeragacan@gmail.com +synopsis: A Lua language interpreter embedding in Haskell +description: The Scripting.Lua module is a wrapper of Lua language interpreter + as described in [lua.org](http://www.lua.org/). + . + This package contains full Lua interpreter version 5.1.5. + If you want to link it with system-wide Lua installation, use @system-lua@ flag. + . + [Example programs](https://github.com/osa1/hslua/tree/master/examples) +category: Scripting +extra-source-files: lua-5.1.5/*.h + README.md + CHANGELOG.md + COPYRIGHT + examples/callbacks/callbacks.lua + examples/haskellfun/haskellfun.lua + examples/err_prop/err_prop.lua + +source-repository head + type: git + location: https://github.com/osa1/hslua.git + +flag system-lua + description: Use the system-wide Lua instead of the bundled copy + default: False + +flag apicheck + description: Compile Lua with -DLUA_USE_APICHECK. + default: False + +flag luajit + description: Link with LuaJIT (should be used with -fsystem-lua) + default: False + +library + build-depends: base == 4.*, bytestring >= 0.10.2.0 && < 0.11 + exposed-modules: Scripting.Lua, Scripting.Lua.Raw + hs-source-dirs: src + ghc-options: -Wall -O2 + if flag(system-lua) + if flag(luajit) + Extra-libraries: luajit-5.1 + else + Extra-libraries: lua5.1 + includes: lua.h + else + c-sources: lua-5.1.5/lobject.c, lua-5.1.5/ltm.c, lua-5.1.5/ldblib.c, + lua-5.1.5/ldo.c, lua-5.1.5/lvm.c, lua-5.1.5/ltable.c, + lua-5.1.5/lstrlib.c, lua-5.1.5/lfunc.c, + lua-5.1.5/lstate.c, lua-5.1.5/lmathlib.c, lua-5.1.5/lmem.c, + lua-5.1.5/ltablib.c, lua-5.1.5/lzio.c, lua-5.1.5/lstring.c, + lua-5.1.5/ldump.c, lua-5.1.5/linit.c, lua-5.1.5/lbaselib.c, + lua-5.1.5/lauxlib.c, lua-5.1.5/lopcodes.c, lua-5.1.5/lgc.c, + lua-5.1.5/lcode.c, lua-5.1.5/loadlib.c, lua-5.1.5/lapi.c, + lua-5.1.5/lundump.c, lua-5.1.5/loslib.c, lua-5.1.5/lparser.c, + lua-5.1.5/ldebug.c, lua-5.1.5/liolib.c, + lua-5.1.5/llex.c + + include-dirs: lua-5.1.5 + + if os(linux) + cc-options: "-DLUA_USE_LINUX" + + if os(darwin) + cc-options: "-DLUA_USE_MACOSX" + + if os(freebsd) + cc-options: "-DLUA_USE_POSIX" + + if os(windows) + cc-options: "-D__NO_ISOCEXT" + + if flag(apicheck) + cc-Options: "-DLUA_USE_APICHECK" + +-- This is not necessary because we have a test suite now. Still keeping here as +-- a very simple test. Originally added with 799a4c2 to test if linking with +-- system-wide Lua is really working. +test-suite simple-test + type: exitcode-stdio-1.0 + main-is: simple-test.hs + hs-source-dirs: test + build-depends: base, hslua + +test-suite callbacks + type: exitcode-stdio-1.0 + main-is: callbacks.hs + hs-source-dirs: examples/callbacks + build-depends: base, bytestring, hslua + +test-suite haskellfun + type: exitcode-stdio-1.0 + main-is: haskellfun.hs + hs-source-dirs: examples/haskellfun + build-depends: base, bytestring, hslua + +test-suite err_prop + type: exitcode-stdio-1.0 + main-is: err_prop.hs + hs-source-dirs: examples/err_prop + build-depends: base, bytestring, hslua + +test-suite test + type: exitcode-stdio-1.0 + main-is: Spec.hs + hs-source-dirs: test + ghc-options: -Wall -threaded + + build-depends: + base, + bytestring, + hslua, + hspec, + hspec-contrib, + HUnit, + text, + QuickCheck >= 2.7, + quickcheck-instances diff --git a/windows/stack.yaml b/windows/stack.yaml new file mode 100644 index 000000000..0cdee8add --- /dev/null +++ b/windows/stack.yaml @@ -0,0 +1,19 @@ +flags: + pandoc: + trypandoc: false + https: true + embed_data_files: false + old-locale: false + network-uri: true +flags: + hslua: + system-lua: True +packages: +- '..' +- '../hslua-0.4.1' +extra-deps: [] +extra-include-dirs: +- "C:/lua-5.1.5/include" +extra-lib-dirs: +- "C:/lua-5.1.5" +resolver: lts-3.10 -- cgit v1.2.3