git.iko.soy/typeable/pandoc
on master help sign in
Add 'static' Cabal flag, use it for linux statically linked.
commitaa90919fe9c78acf74371ce1e43757776c04b506 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 4 Sep 2017, 17:07 (9 years ago) parent6a6c385
2 files changed+12−5
linux/Dockerfile+6−4 pandoc.cabal+6−1
linux/Dockerfile+6−4
@@ -5,7 +5,7 @@ ADD https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%4
55 /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub
66RUN apk update
77RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev \
8− dpkg fakeroot sed gawk grep
8+ dpkg fakeroot sed gawk grep llvm linux-headers
99RUN stack update
1010RUN stack config set system-ghc --global true
1111RUN mkdir -p /etc/stack
@@ -16,13 +16,15 @@ RUN git clone https://github.com/jgm/pandoc
1616WORKDIR /usr/src/pandoc
1717RUN stack install --stack-yaml stack.pkg.yaml --only-dependencies \
1818 --flag 'pandoc:embed_data_files' \
19− --test --ghc-options '-O2 -optc-Os -optl-static -fPIC' \
19+ --ghc-options '-fPIC -fllvm' \
2020 pandoc pandoc-citeproc
2121CMD git pull && \
2222 git checkout -b work $TREE && \
2323 stack install --stack-yaml stack.pkg.yaml \
24− --local-bin-path /artifacts --flag 'pandoc:embed_data_files' \
25− --test --ghc-options '-O2 -optc-Os -optl-static -fPIC' \
24+ --flag 'pandoc:static' \
25+ --flag 'pandoc:embed_data_files' \
26+ --ghc-options '-fPIC -fllvm' \
27+ --local-bin-path /artifacts \
2628 pandoc pandoc-citeproc && \
2729 bash linux/make_deb.sh && \
2830 bash linux/make_tarball.sh
pandoc.cabal+6−1
@@ -265,6 +265,10 @@ Source-repository head
265265 type: git
266266 location: git://github.com/jgm/pandoc.git
267267
268+Flag static
269+ Description: Use static linking for pandoc executable.
270+ Default: False
271+
268272Flag embed_data_files
269273 Description: Embed data files in binary for relocatable executable.
270274 Default: False
@@ -483,7 +487,8 @@ Executable pandoc
483487 Build-Depends: pandoc, base >= 4.7 && < 5
484488 Ghc-Options: -rtsopts -with-rtsopts=-K16m -Wall -fno-warn-unused-do-bind
485489 Ghc-Prof-Options: -fprof-auto-exported -rtsopts -with-rtsopts=-K16m
486−
490+ if flag(static)
491+ Ld-options: -static
487492 Default-Language: Haskell98
488493 Other-Extensions: PatternGuards, OverloadedStrings,
489494 ScopedTypeVariables, GeneralizedNewtypeDeriving,