diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-10-28 11:01:38 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-10-28 11:01:38 -0700 |
commit | cdd6389e91357c48dc3bb859695ab4538da4d004 (patch) | |
tree | 93bb337590769a75fbabe4e574845aa3185629c9 | |
parent | fb1843ecdeea5131ea4ed27adc1124e13ae1c5d9 (diff) | |
download | pandoc-cdd6389e91357c48dc3bb859695ab4538da4d004.tar.gz |
New approach to stack build on appveyor.
This uses system lua library.
See https://github.com/osa1/hslua/issues/22#issuecomment-151281274
-rw-r--r-- | appveyor.yml | 58 | ||||
-rw-r--r-- | windows/hslua.cabal | 127 | ||||
-rw-r--r-- | windows/stack.yaml | 19 |
3 files changed, 171 insertions, 33 deletions
diff --git a/appveyor.yml b/appveyor.yml index 00a1aab34..013ec38b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,38 +1,30 @@ -install: -- cmd: 'git submodule update --init' -- ps: | - choco install haskellplatform -version 2014.2.0.0 -y - # Haskell Platfrom package doesn't update PATH for the current shell instance +branches: + only: + - master - $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\bin" - $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\lib\extralibs\bin" - $env:Path += ";${env:ProgramFiles}\Haskell Platform\2014.2.0.0\mingw\bin" - # choco install wixtoolset - cabal sandbox init - $env:Path += ";.\.cabal-sandbox\bin" - cabal update - cabal install --force hsb2hs +cache: +- "c:\\sr" # stack root, short paths == fewer problems +- "%LOCALAPPDATA%\\Programs\\stack" -build_script: -- cmd: | - cabal install --force --enable-tests -fembed_data_files +build: off -# after_build: -# - cmd: | -# cabal install -fembed_data_files pandoc-citeproc -# strip .\.cabal-sandbox\bin\pandoc.exe -# strip .\.cabal-sandbox\bin\pandoc-citeproc.exe -# .\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.html -S README -o README.html -# .\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf -# copy COPYRIGHT COPYRIGHT.txt -# for /f "tokens=2 delims= " %%a in ('.\.cabal-sandbox\bin\pandoc --version') do ( set "VERSION=%%a" && exit ) -# if "%VERSION%" == "" ( echo "Error: could not determine version number." && exit /b 1 ) -# cd windows -# echo Creating msi... -# candle -dVERSION=%VERSION% pandoc.wxs -# if %errorlevel% neq 0 exit /b %errorlevel% -# light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj +before_test: +- git submodule update --init +- 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 +- ps: Invoke-WebRequest "https://github.com/fpco/minghc/blob/master/bin/7z.exe?raw=true" -OutFile 7z.exe +- ps: Invoke-WebRequest "https://github.com/fpco/minghc/blob/master/bin/7z.dll?raw=true" -OutFile 7z.dll +- 7z x -oc:\\stack stack.zip +- move c:\\stack\\stack.exe stack.exe +- stack setup --arch=i386 +- 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 +- 7z x -oc:\\lua-5.1.5 lua-5.1.5.zip + +clone_folder: "c:\\pandoc" +environment: + global: + STACK_ROOT: "c:\\sr" test_script: -- cmd: | - cabal test +- echo "" | stack unpack hslua-0.4.1 +- copy windows/hslua.cabal hslua-0.4.1/hslua.cabal +- echo "" | stack test --stack-yaml windows/stack.yaml 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 |