git.iko.soy/typeable/pandoc
on d81ddf7 help sign in
7 files changed+160−197
since splitsnapshots
unifiedsplit
.github/workflows/release-candidate.yml+117−117 Makefile+7−2 cabal.project+1−6 linux/Dockerfile−30 linux/Makefile−18 linux/make_deb.sh → linux/make_artifacts.sh+35−5 linux/make_tarball.sh−19
.github/workflows/release-candidate.yml+117−117
@@ -22,120 +22,120 @@ jobs:
2222 name: linux-release-candidate
2323 path: linux-release-candidate
2424
25− windows:
26−
27− runs-on: windows-2019
28− strategy:
29− fail-fast: true
30− matrix:
31− versions:
32− - osarch: "windows-x86_64"
33− arch: "x64"
34− choco_opts: ""
35− stack_opts: "-j1"
36− - osarch: "windows-i386"
37− arch: "x86"
38− choco_opts: "--x86 --version 2.1.3.20190715"
39− stack_opts: "-j1 --flag hslua:lua_32bits"
40− # we use stack 2.1.3 because 2.3.1 doesn't support i386
41−
42− steps:
43− - uses: actions/checkout@v1
44− - name: Install stack
45− shell: cmd
46− run: |
47− choco install haskell-stack ${{ matrix.versions.choco_opts }}
48− - name: Install dependencies
49− run: |
50− stack update
51− stack build ${{ matrix.versions.stack_opts }} --dependencies-only pandoc pandoc-citeproc
52− - name: Create windows package
53− shell: cmd
54− run: |
55− for /f %%a in ('powershell -Command "Get-Date -format yyyy-MM-dd"') do set THEDATE=%%a
56− stack build ${{ matrix.versions.stack_opts }} pandoc pandoc-citeproc
57− for /f "tokens=1-2 delims= " %%a in ('stack exec pandoc -- --version') do (
58− @set VERSION=%%b
59− goto :next
60− )
61− :next
62− if "%VERSION%" == "" (
63− echo Error: could not determine version number.
64− exit /b 1
65− )
66− echo Detected version %VERSION%
67− @set WINDOWS=%CD%\windows
68− @set RELEASE=%WINDOWS%\pandoc-%VERSION%
69− mkdir %RELEASE%
70− forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C echo @path && echo %%WINDOWS%% && copy @path %%RELEASE%%"
71− stack exec pandoc -- -s --toc MANUAL.txt -o %RELEASE%\MANUAL.html
72− stack exec pandoc -- -s COPYING.md -t rtf -o %RELEASE%\COPYING.rtf
73− copy %RELEASE%\COPYING.rtf %WINDOWS%
74− copy COPYRIGHT %RELEASE%\COPYRIGHT.txt
75− cd windows
76− echo Creating msi...
77− dir
78− @set WIXBIN="c:\Program Files (x86)\WiX Toolset v3.11\bin"
79− @set WORKDIR=%CD%
80− echo Running candle...
81− %WIXBIN%\candle -arch ${{ matrix.versions.arch }} -dVERSION=%VERSION% -dBINPATH=%RELEASE% *.wxs -out wixobj\
82− if %errorlevel% neq 0 exit /b %errorlevel%
83− echo Running light...
84− %WIXBIN%\light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out %WORKDIR%\pandoc-%VERSION%-${{ matrix.versions.osarch }}-UNSIGNED.msi wixobj\*.wixobj
85− 7z a "pandoc-%VERSION%-${{ matrix.versions.osarch }}.zip" pandoc-%VERSION%
86− cd ..
87− mkdir windows-release-candidate
88− copy windows\pandoc-%VERSION%-${{ matrix.versions.osarch }}-UNSIGNED.msi windows-release-candidate
89− copy windows\pandoc-%VERSION%-${{ matrix.versions.osarch }}.zip windows-release-candidate
90− copy windows\Makefile windows-release-candidate
91− - uses: actions/upload-artifact@v2
92− with:
93− name: windows-release-candidate
94− path: windows-release-candidate
95−
96− macos:
97−
98− runs-on: macOS-10.15
99−
100− steps:
101− - uses: actions/checkout@v1
102− - name: Install stack
103− run: |
104− curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz
105− tar xzvf stack.tar.gz --strip-components=1 'stack*/stack'
106− - name: Install dependencies
107− run: |
108− ./stack update
109− ./stack build --dependencies-only pandoc pandoc-citeproc
110− - name: Create macOS package
111− run: |
112− export VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')
113− export BASEDIR=$(pwd)
114− export ARTIFACTS=${BASEDIR}/macos-release-candidate
115− export RESOURCES=${ARTIFACTS}/Resources
116− export ROOT=${ARTIFACTS}/pandoc
117− export DEST=${ROOT}/usr/local
118− export ME=$(whoami)
119− export BASE=pandoc-$VERSION
120− mkdir -p ${ARTIFACTS}
121− mkdir -p ${RESOURCES}
122− mkdir -p ${DEST}/bin
123− mkdir -p ${DEST}/share/man/man1
124− ./stack build pandoc pandoc-citeproc
125− for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${DEST}/bin/; done
126− strip ${DEST}/bin/pandoc
127− strip ${DEST}/bin/pandoc-citeproc
128− cp man/pandoc.1 ${DEST}/share/man/man1/pandoc.1
129− ${DEST}/bin/pandoc-citeproc --man > \
130− $DEST/share/man/man1/pandoc-citeproc.1
131− ${DEST}/bin/pandoc -t html5 -s COPYING.md -Vpagetitle=License \
132− -o ${RESOURCES}/license.html
133− chown -R $ME:staff ${ROOT}
134− sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
135− cp macos/Makefile ${ARTIFACTS}/
136− echo ${VERSION} > ${ARTIFACTS}/version.txt
137− - uses: actions/upload-artifact@v2
138− with:
139− name: macos-release-candidate
140− path: macos-release-candidate
141−
25+# windows:
26+#
27+# runs-on: windows-2019
28+# strategy:
29+# fail-fast: true
30+# matrix:
31+# versions:
32+# - osarch: "windows-x86_64"
33+# arch: "x64"
34+# choco_opts: ""
35+# stack_opts: "-j1"
36+# - osarch: "windows-i386"
37+# arch: "x86"
38+# choco_opts: "--x86 --version 2.1.3.20190715"
39+# stack_opts: "-j1 --flag hslua:lua_32bits"
40+# # we use stack 2.1.3 because 2.3.1 doesn't support i386
41+#
42+# steps:
43+# - uses: actions/checkout@v1
44+# - name: Install stack
45+# shell: cmd
46+# run: |
47+# choco install haskell-stack ${{ matrix.versions.choco_opts }}
48+# - name: Install dependencies
49+# run: |
50+# stack update
51+# stack build ${{ matrix.versions.stack_opts }} --dependencies-only pandoc pandoc-citeproc
52+# - name: Create windows package
53+# shell: cmd
54+# run: |
55+# for /f %%a in ('powershell -Command "Get-Date -format yyyy-MM-dd"') do set THEDATE=%%a
56+# stack build ${{ matrix.versions.stack_opts }} pandoc pandoc-citeproc
57+# for /f "tokens=1-2 delims= " %%a in ('stack exec pandoc -- --version') do (
58+# @set VERSION=%%b
59+# goto :next
60+# )
61+# :next
62+# if "%VERSION%" == "" (
63+# echo Error: could not determine version number.
64+# exit /b 1
65+# )
66+# echo Detected version %VERSION%
67+# @set WINDOWS=%CD%\windows
68+# @set RELEASE=%WINDOWS%\pandoc-%VERSION%
69+# mkdir %RELEASE%
70+# forfiles /P .\.stack-work\install /M pandoc*.exe /S /C "cmd /C echo @path && echo %%WINDOWS%% && copy @path %%RELEASE%%"
71+# stack exec pandoc -- -s --toc MANUAL.txt -o %RELEASE%\MANUAL.html
72+# stack exec pandoc -- -s COPYING.md -t rtf -o %RELEASE%\COPYING.rtf
73+# copy %RELEASE%\COPYING.rtf %WINDOWS%
74+# copy COPYRIGHT %RELEASE%\COPYRIGHT.txt
75+# cd windows
76+# echo Creating msi...
77+# dir
78+# @set WIXBIN="c:\Program Files (x86)\WiX Toolset v3.11\bin"
79+# @set WORKDIR=%CD%
80+# echo Running candle...
81+# %WIXBIN%\candle -arch ${{ matrix.versions.arch }} -dVERSION=%VERSION% -dBINPATH=%RELEASE% *.wxs -out wixobj\
82+# if %errorlevel% neq 0 exit /b %errorlevel%
83+# echo Running light...
84+# %WIXBIN%\light -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out %WORKDIR%\pandoc-%VERSION%-${{ matrix.versions.osarch }}-UNSIGNED.msi wixobj\*.wixobj
85+# 7z a "pandoc-%VERSION%-${{ matrix.versions.osarch }}.zip" pandoc-%VERSION%
86+# cd ..
87+# mkdir windows-release-candidate
88+# copy windows\pandoc-%VERSION%-${{ matrix.versions.osarch }}-UNSIGNED.msi windows-release-candidate
89+# copy windows\pandoc-%VERSION%-${{ matrix.versions.osarch }}.zip windows-release-candidate
90+# copy windows\Makefile windows-release-candidate
91+# - uses: actions/upload-artifact@v2
92+# with:
93+# name: windows-release-candidate
94+# path: windows-release-candidate
95+#
96+# macos:
97+#
98+# runs-on: macOS-10.15
99+#
100+# steps:
101+# - uses: actions/checkout@v1
102+# - name: Install stack
103+# run: |
104+# curl -L https://get.haskellstack.org/stable/osx-x86_64.tar.gz -o stack.tar.gz
105+# tar xzvf stack.tar.gz --strip-components=1 'stack*/stack'
106+# - name: Install dependencies
107+# run: |
108+# ./stack update
109+# ./stack build --dependencies-only pandoc pandoc-citeproc
110+# - name: Create macOS package
111+# run: |
112+# export VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}')
113+# export BASEDIR=$(pwd)
114+# export ARTIFACTS=${BASEDIR}/macos-release-candidate
115+# export RESOURCES=${ARTIFACTS}/Resources
116+# export ROOT=${ARTIFACTS}/pandoc
117+# export DEST=${ROOT}/usr/local
118+# export ME=$(whoami)
119+# export BASE=pandoc-$VERSION
120+# mkdir -p ${ARTIFACTS}
121+# mkdir -p ${RESOURCES}
122+# mkdir -p ${DEST}/bin
123+# mkdir -p ${DEST}/share/man/man1
124+# ./stack build pandoc pandoc-citeproc
125+# for f in $(find .stack-work/install -name 'pandoc*' -perm +001 -type f); do cp $f ${DEST}/bin/; done
126+# strip ${DEST}/bin/pandoc
127+# strip ${DEST}/bin/pandoc-citeproc
128+# cp man/pandoc.1 ${DEST}/share/man/man1/pandoc.1
129+# ${DEST}/bin/pandoc-citeproc --man > \
130+# $DEST/share/man/man1/pandoc-citeproc.1
131+# ${DEST}/bin/pandoc -t html5 -s COPYING.md -Vpagetitle=License \
132+# -o ${RESOURCES}/license.html
133+# chown -R $ME:staff ${ROOT}
134+# sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
135+# cp macos/Makefile ${ARTIFACTS}/
136+# echo ${VERSION} > ${ARTIFACTS}/version.txt
137+# - uses: actions/upload-artifact@v2
138+# with:
139+# name: macos-release-candidate
140+# path: macos-release-candidate
141+#
Makefile+7−2
@@ -5,6 +5,7 @@ BRANCH?=master
55RESOLVER?=lts-13
66GHCOPTS=-fdiagnostics-color=always
77WEBSITE=../../web/pandoc.org
8+REVISION?=1
89
910quick:
1011 stack install --ghc-options='$(GHCOPTS)' --install-ghc --flag 'pandoc:embed_data_files' --fast --test --ghc-options='-j +RTS -A64m -RTS' --test-arguments='-j4 --hide-successes $(TESTARGS)'
@@ -70,8 +71,12 @@ checkdocs: README.md
7071 ! grep -n -e "\t" MANUAL.txt changelog
7172
7273debpkg: man/pandoc.1
73− make -C linux && \
74− cp linux/artifacts/pandoc-$(version)-*.* .
74+ docker run -v `pwd`:/mnt \
75+ -v `pwd`/linux/artifacts:/artifacts \
76+ -e REVISION=$(REVISION) \
77+ -w /mnt \
78+ utdemir/ghc-musl:v12-libgmp-ghc8101 bash \
79+ /mnt/linux/make_artifacts.sh
7580
7681macospkg: man/pandoc.1
7782 ./macos/make_macos_package.sh
cabal.project+1−6
@@ -11,9 +11,4 @@ package pandoc-citeproc
1111source-repository-package
1212 type: git
1313 location: https://github.com/jgm/pandoc-citeproc
14− tag: 0.17.0.1
15−
16− source-repository-package
17− type: git
18− location: https://github.com/jgm/commonmark-hs
19− tag: 8d4442abc443ce0100cc87af797e7df9a72b9b9a
14+ tag: 82833c1d162b19464d9aa2b5d4eb756443d726c9
linux/Dockerfiledeleted−30
@@ -1,30 +0,0 @@
1−# USE ALPINE LINUX
2−FROM alpine:3.11
3−RUN apk --no-cache add \
4− alpine-sdk \
5− bash \
6− ca-certificates \
7− cabal \
8− dpkg \
9− fakeroot \
10− ghc \
11− git \
12− gmp-dev \
13− xz \
14− zlib-dev \
15− zlib-static
16−RUN mkdir -p /usr/src/ && \
17− git clone https://github.com/jgm/pandoc /usr/src/pandoc
18−WORKDIR /usr/src/pandoc
19−CMD cabal --version && \
20− ghc --version && \
21− git pull && \
22− git checkout -b work $TREE && \
23− cabal new-update && \
24− cabal new-clean && \
25− cabal new-configure --enable-tests -f-export-dynamic -fstatic -fembed_data_files -fbibutils --ghc-options '-optc-Os -optl=-pthread -optl=-static -fPIC -split-sections' . pandoc-citeproc && \
26− cabal new-build . pandoc-citeproc && \
27− cabal new-test -j1 . pandoc-citeproc && \
28− for f in $(find dist-newstyle -name 'pandoc*' -type f -perm +400); do cp $f /artifacts/; done && \
29− bash linux/make_deb.sh && \
30− bash linux/make_tarball.sh
linux/Makefiledeleted−18
@@ -1,18 +0,0 @@
1−TREE?=HEAD
2−ARTIFACTS=`pwd`/artifacts
3−REVISION?=1
4−
5−build:
6− mkdir -p $(ARTIFACTS)
7− docker build -t alpine-pandoc .
8− docker run --env TREE=$(TREE) --env REVISION=$(REVISION) \
9− -v $(ARTIFACTS):/artifacts alpine-pandoc
10−
11−interact:
12− docker run --env TREE=$(TREE) --env REVISION=$(REVISION) \
13− -v $(ARTIFACTS):/artifacts -it alpine-pandoc bash
14−
15−setup:
16− docker pull alpine:edge
17−
18−.PHONY: build setup interact
linux/make_deb.sh → linux/make_artifacts.shrenamed+35−5
@@ -9,6 +9,20 @@ esac
99
1010ARTIFACTS="${ARTIFACTS:-/artifacts}"
1111
12+# build binaries
13+
14+cabal --version
15+ghc --version
16+
17+cabal v2-update
18+cabal v2-clean
19+cabal v2-configure --enable-tests -f-export-dynamic -fstatic -fembed_data_files -fbibutils --enable-executable-static --ghc-options '-optc-Os -optl=-pthread -split-sections' . pandoc-citeproc
20+cabal v2-build . pandoc-citeproc
21+cabal v2-test -j1 . pandoc-citeproc
22+for f in $(find dist-newstyle -name 'pandoc*' -type f -perm /400); do cp $f /artifacts/; done
23+
24+# make deb
25+
1226VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
1327REVISION=${REVISION:-1}
1428DEBVER=$VERSION-$REVISION
@@ -17,8 +31,6 @@ DIST=`pwd`/$BASE
1731DEST=$DIST/usr
1832COPYRIGHT=$DEST/share/doc/pandoc/copyright
1933
20−PANDOC_CITEPROC_VERSION=`$ARTIFACTS/pandoc-citeproc --version | awk '{print $2;}'`
21−
2234mkdir -p $DEST/bin
2335mkdir -p $DEST/share/man/man1
2436mkdir -p $DEST/share/doc/pandoc
@@ -29,12 +41,12 @@ cp $ARTIFACTS/pandoc $DEST/bin/
2941cp $ARTIFACTS/pandoc-citeproc $DEST/bin/
3042strip $DEST/bin/pandoc
3143strip $DEST/bin/pandoc-citeproc
32−cp man/pandoc.1 $DEST/share/man/man1/pandoc.1
44+cp /mnt/man/pandoc.1 $DEST/share/man/man1/pandoc.1
3345$ARTIFACTS/pandoc-citeproc --man > $DEST/share/man/man1/pandoc-citeproc.1
3446gzip -9 $DEST/share/man/man1/pandoc.1
3547gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
3648
37−cp COPYRIGHT $COPYRIGHT
49+cp /mnt/COPYRIGHT $COPYRIGHT
3850echo "" >> $COPYRIGHT
3951echo "pandoc-citeproc" >> $COPYRIGHT
4052$ARTIFACTS/pandoc-citeproc --license >> $COPYRIGHT
@@ -46,6 +58,24 @@ perl -pe "s/VERSION/$DEBVER/" linux/control.in | \
4658 perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
4759 > $DIST/DEBIAN/control
4860
49−fakeroot dpkg-deb --build $DIST
61+fakeroot dpkg-deb -Zgzip -z4 --build $DIST
5062rm -rf $DIST
5163cp $BASE.deb $ARTIFACTS/
64+
65+# Make tarball
66+
67+TARGET=pandoc-$VERSION
68+cd $ARTIFACTS
69+rm -rf $TARGET
70+mkdir $TARGET
71+mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1
72+./pandoc-citeproc --man > $TARGET/share/man/man1/pandoc-citeproc.1
73+cp /mnt/man/pandoc.1 $TARGET/share/man/man1
74+mv pandoc pandoc-citeproc $TARGET/bin
75+strip $TARGET/bin/pandoc
76+strip $TARGET/bin/pandoc-citeproc
77+gzip -9 $TARGET/share/man/man1/pandoc.1
78+gzip -9 $TARGET/share/man/man1/pandoc-citeproc.1
79+
80+tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
81+rm -r $TARGET
linux/make_tarball.shdeleted−19
@@ -1,19 +0,0 @@
1−set -e
2−
3−ARTIFACTS="${ARTIFACTS:-/artifacts}"
4−VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
5−TARGET=pandoc-$VERSION
6−
7−cd $ARTIFACTS
8−rm -rf $TARGET
9−mkdir $TARGET
10−mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1
11−./pandoc-citeproc --man > $TARGET/share/man/man1/pandoc-citeproc.1
12−cp /usr/src/pandoc/man/pandoc.1 $TARGET/share/man/man1
13−mv pandoc pandoc-citeproc $TARGET/bin
14−strip $TARGET/bin/pandoc
15−strip $TARGET/bin/pandoc-citeproc
16−gzip -9 $TARGET/share/man/man1/pandoc.1
17−gzip -9 $TARGET/share/man/man1/pandoc-citeproc.1
18−tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
19−rm -r $TARGET