From 87f20f11e220241ced3ba8a32d8d9867d2baebd9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 14 Nov 2015 22:23:47 -0800 Subject: Use stack for Windows installer. --- windows/make-windows-installer.bat | 26 +++++++++----------------- windows/pandoc.wxs | 12 ++++++------ windows/stack.yaml | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 windows/stack.yaml (limited to 'windows') diff --git a/windows/make-windows-installer.bat b/windows/make-windows-installer.bat index 1e576a525..c7befe531 100644 --- a/windows/make-windows-installer.bat +++ b/windows/make-windows-installer.bat @@ -1,22 +1,15 @@ @echo off -cd .. -cabal update -cabal sandbox init -cabal clean -cabal install hsb2hs +stack install --test if %errorlevel% neq 0 exit /b %errorlevel% -cabal install -v1 --force --enable-tests --reinstall --flags="embed_data_files" . pandoc-citeproc +for /f "delims=" %%a in ('stack path --local-bin-path') do @set BINPATH=%%a +strip %BINPATH%\pandoc.exe +strip %BINPATH%\pandoc-citeproc.exe +%BINPATH%\pandoc.exe -s -S ..\README -o README.html if %errorlevel% neq 0 exit /b %errorlevel% -cabal test +%BINPATH%\pandoc.exe -s ..\COPYING -t rtf -S -o COPYING.rtf if %errorlevel% neq 0 exit /b %errorlevel% -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 -if %errorlevel% neq 0 exit /b %errorlevel% -.\.cabal-sandbox\bin\pandoc.exe -s --template data\templates\default.rtf COPYING -t rtf -S -o COPYING.rtf -if %errorlevel% neq 0 exit /b %errorlevel% -copy COPYRIGHT COPYRIGHT.txt -for /f "tokens=1-2 delims= " %%a in ('.\.cabal-sandbox\bin\pandoc --version') do ( +copy ..\COPYRIGHT COPYRIGHT.txt +for /f "tokens=1-2 delims= " %%a in ('%BINPATH%\pandoc.exe --version') do ( @set VERSION=%%b goto :next ) @@ -26,9 +19,8 @@ if "%VERSION%" == "" ( exit /b 1 ) echo Detected version %VERSION% -cd windows echo Creating msi... -candle -dVERSION=%VERSION% pandoc.wxs +candle -dVERSION=%VERSION% -dBINPATH=%BINPATH% pandoc.wxs if %errorlevel% neq 0 exit /b %errorlevel% light -sw1076 -ext WixUIExtension -ext WixUtilExtension -out pandoc-%VERSION%-windows.msi pandoc.wixobj if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/windows/pandoc.wxs b/windows/pandoc.wxs index c1465ffcf..d19ed81e1 100644 --- a/windows/pandoc.wxs +++ b/windows/pandoc.wxs @@ -41,11 +41,11 @@ KeyPath="yes"/> + Source="$(var.BINPATH)\pandoc.exe" /> + Source="COPYRIGHT.txt" /> + Source="COPYING.rtf" /> + Source="$(var.BINPATH)\pandoc-citeproc.exe" /> + Source="README.html" KeyPath="yes"> @@ -163,7 +163,7 @@ - + diff --git a/windows/stack.yaml b/windows/stack.yaml new file mode 100644 index 000000000..4a00e2d38 --- /dev/null +++ b/windows/stack.yaml @@ -0,0 +1,19 @@ +flags: + pandoc: + trypandoc: false + https: true + embed_data_files: true + old-locale: false + network-uri: true + pandoc-citeproc: + bibutils: true + embed_data_files: true + unicode_collation: false + test_citeproc: false + debug: false +packages: +- '..' +- '../../pandoc-citeproc' +extra-deps: +- 'hsb2hs-0.3.1' +resolver: lts-3.13 -- cgit v1.2.3