aboutsummaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/Dockerfile5
-rw-r--r--linux/Dockerfile.alpine30
-rwxr-xr-xlinux/make_deb.sh12
-rw-r--r--linux/make_tarball.sh5
4 files changed, 41 insertions, 11 deletions
diff --git a/linux/Dockerfile b/linux/Dockerfile
index f75db2c89..d2348b11d 100644
--- a/linux/Dockerfile
+++ b/linux/Dockerfile
@@ -8,8 +8,8 @@ RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev \
dpkg fakeroot sed gawk grep bash linux-headers
RUN stack update
RUN stack config set system-ghc --global true
-RUN mkdir -p /etc/stack
-RUN echo "build: { split-objs: true }" > /etc/stack/config.yaml
+#RUN mkdir -p /etc/stack
+#RUN echo "build: { split-objs: true }" > /etc/stack/config.yaml
RUN mkdir -p /usr/src/
WORKDIR /usr/src/
RUN git clone https://github.com/jgm/pandoc
@@ -23,6 +23,7 @@ CMD git pull && \
stack install --stack-yaml stack.pkg.yaml \
--flag 'pandoc:static' \
--flag 'pandoc:embed_data_files' \
+ --flag 'hslua:-export-dynamic' \
--ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
--local-bin-path /artifacts \
pandoc pandoc-citeproc && \
diff --git a/linux/Dockerfile.alpine b/linux/Dockerfile.alpine
new file mode 100644
index 000000000..f75db2c89
--- /dev/null
+++ b/linux/Dockerfile.alpine
@@ -0,0 +1,30 @@
+# USE ALPINE LINUX
+FROM alpine:edge
+RUN echo "https://s3-us-west-2.amazonaws.com/alpine-ghc/8.0" >> /etc/apk/repositories
+ADD https://raw.githubusercontent.com/mitchty/alpine-ghc/master/mitch.tishmack%40gmail.com-55881c97.rsa.pub \
+ /etc/apk/keys/mitch.tishmack@gmail.com-55881c97.rsa.pub
+RUN apk update
+RUN apk add alpine-sdk git ca-certificates ghc cabal stack zlib-dev \
+ dpkg fakeroot sed gawk grep bash linux-headers
+RUN stack update
+RUN stack config set system-ghc --global true
+RUN mkdir -p /etc/stack
+RUN echo "build: { split-objs: true }" > /etc/stack/config.yaml
+RUN mkdir -p /usr/src/
+WORKDIR /usr/src/
+RUN git clone https://github.com/jgm/pandoc
+WORKDIR /usr/src/pandoc
+RUN stack install --stack-yaml stack.pkg.yaml --only-dependencies \
+ --flag 'pandoc:embed_data_files' \
+ --ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
+ pandoc pandoc-citeproc
+CMD git pull && \
+ git checkout -b work $TREE && \
+ stack install --stack-yaml stack.pkg.yaml \
+ --flag 'pandoc:static' \
+ --flag 'pandoc:embed_data_files' \
+ --ghc-options '-O2 -optc-Os -optl=-pthread -optl=-static -fPIC' \
+ --local-bin-path /artifacts \
+ pandoc pandoc-citeproc && \
+ bash linux/make_deb.sh && \
+ bash linux/make_tarball.sh
diff --git a/linux/make_deb.sh b/linux/make_deb.sh
index 9ef191ad4..cbbc8a184 100755
--- a/linux/make_deb.sh
+++ b/linux/make_deb.sh
@@ -7,9 +7,9 @@ case "$MACHINE" in
i386) ARCHITECTURE=i386;;
esac
-ARTIFACTS=/artifacts
+ARTIFACTS="${ARTIFACTS:-/artifacts}"
-VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
+VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
REVISION=${REVISION:-1}
DEBVER=$VERSION-$REVISION
BASE=pandoc-$DEBVER-$ARCHITECTURE
@@ -23,8 +23,6 @@ mkdir -p $DEST/bin
mkdir -p $DEST/share/man/man1
mkdir -p $DEST/share/doc/pandoc
-make man/pandoc.1
-
mkdir -p $DEST/share/doc/pandoc-citeproc
find $DIST -type d | xargs chmod 755
cp $ARTIFACTS/pandoc $DEST/bin/
@@ -32,14 +30,14 @@ cp $ARTIFACTS/pandoc-citeproc $DEST/bin/
strip $DEST/bin/pandoc
strip $DEST/bin/pandoc-citeproc
cp man/pandoc.1 $DEST/share/man/man1/pandoc.1
-/artifacts/pandoc-citeproc --man > $DEST/share/man/man1/pandoc-citeproc.1
+$ARTIFACTS/pandoc-citeproc --man > $DEST/share/man/man1/pandoc-citeproc.1
gzip -9 $DEST/share/man/man1/pandoc.1
gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
cp COPYRIGHT $COPYRIGHT
echo "" >> $COPYRIGHT
echo "pandoc-citeproc" >> $COPYRIGHT
-/artifacts/pandoc-citeproc --license >> $COPYRIGHT
+$ARTIFACTS/pandoc-citeproc --license >> $COPYRIGHT
INSTALLED_SIZE=$(du -k -s $DEST | awk '{print $1}')
mkdir $DIST/DEBIAN
@@ -50,4 +48,4 @@ perl -pe "s/VERSION/$DEBVER/" linux/control.in | \
fakeroot dpkg-deb --build $DIST
rm -rf $DIST
-cp $BASE.deb /artifacts/
+cp $BASE.deb $ARTIFACTS/
diff --git a/linux/make_tarball.sh b/linux/make_tarball.sh
index 28c0b9b7f..82748f98a 100644
--- a/linux/make_tarball.sh
+++ b/linux/make_tarball.sh
@@ -1,9 +1,10 @@
set -e
-VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
+ARTIFACTS="${ARTIFACTS:-/artifacts}"
+VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
TARGET=pandoc-$VERSION
-cd /artifacts
+cd $ARTIFACTS
rm -rf $TARGET
mkdir $TARGET
mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1