New approach to stack build on appveyor.
This uses system lua library. See https://github.com/osa1/hslua/issues/22#issuecomment-151281274
This commit is contained in:
parent
fb1843ecde
commit
cdd6389e91
3 changed files with 171 additions and 33 deletions
58
appveyor.yml
58
appveyor.yml
|
@ -1,38 +1,30 @@
|
||||||
install:
|
branches:
|
||||||
- cmd: 'git submodule update --init'
|
only:
|
||||||
- ps: |
|
- master
|
||||||
choco install haskellplatform -version 2014.2.0.0 -y
|
|
||||||
# Haskell Platfrom package doesn't update PATH for the current shell instance
|
|
||||||
|
|
||||||
$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\bin"
|
cache:
|
||||||
$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\lib\extralibs\bin"
|
- "c:\\sr" # stack root, short paths == fewer problems
|
||||||
$env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\mingw\bin"
|
- "%LOCALAPPDATA%\\Programs\\stack"
|
||||||
# choco install wixtoolset
|
|
||||||
cabal sandbox init
|
|
||||||
$env:Path += ";.\.cabal-sandbox\bin"
|
|
||||||
cabal update
|
|
||||||
cabal install --force hsb2hs
|
|
||||||
|
|
||||||
build_script:
|
build: off
|
||||||
- cmd: |
|
|
||||||
cabal install --force --enable-tests -fembed_data_files
|
|
||||||
|
|
||||||
# after_build:
|
before_test:
|
||||||
# - cmd: |
|
- git submodule update --init
|
||||||
# cabal install -fembed_data_files pandoc-citeproc
|
- ps: Invoke-WebRequest "https://github.com/commercialhaskell/stack/releases/download/v0.1.5.0/stack-0.1.5.0-i386-windows.zip" -OutFile stack.zip
|
||||||
# strip .\.cabal-sandbox\bin\pandoc.exe
|
- ps: Invoke-WebRequest "https://github.com/fpco/minghc/blob/master/bin/7z.exe?raw=true" -OutFile 7z.exe
|
||||||
# strip .\.cabal-sandbox\bin\pandoc-citeproc.exe
|
- ps: Invoke-WebRequest "https://github.com/fpco/minghc/blob/master/bin/7z.dll?raw=true" -OutFile 7z.dll
|
||||||
# .\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.html -S README -o README.html
|
- 7z x -oc:\\stack stack.zip
|
||||||
# .\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf
|
- move c:\\stack\\stack.exe stack.exe
|
||||||
# copy COPYRIGHT COPYRIGHT.txt
|
- stack setup --arch=i386
|
||||||
# for /f "tokens=2 delims= " %%a in ('.\.cabal-sandbox\bin\pandoc --version') do ( set "VERSION=%%a" && exit )
|
- ps: Invoke-WebRequest "http://sourceforge.net/projects/luabinaries/files/5.1.5/Windows%20Libraries/Static/lua-5.1.5_Win64_mingw4_lib.zip/download" -OutFile lua-5.1.5.zip
|
||||||
# if "%VERSION%" == "" ( echo "Error: could not determine version number." && exit /b 1 )
|
- 7z x -oc:\\lua-5.1.5 lua-5.1.5.zip
|
||||||
# cd windows
|
|
||||||
# echo Creating msi...
|
clone_folder: "c:\\pandoc"
|
||||||
# candle -dVERSION=%VERSION% pandoc.wxs
|
environment:
|
||||||
# if %errorlevel% neq 0 exit /b %errorlevel%
|
global:
|
||||||
# light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj
|
STACK_ROOT: "c:\\sr"
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cmd: |
|
- echo "" | stack unpack hslua-0.4.1
|
||||||
cabal test
|
- copy windows/hslua.cabal hslua-0.4.1/hslua.cabal
|
||||||
|
- echo "" | stack test --stack-yaml windows/stack.yaml
|
||||||
|
|
127
windows/hslua.cabal
Normal file
127
windows/hslua.cabal
Normal file
|
@ -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
|
19
windows/stack.yaml
Normal file
19
windows/stack.yaml
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue