diff options
-rw-r--r-- | linux/Dockerfile | 5 | ||||
-rw-r--r-- | linux/Dockerfile.alpine | 30 | ||||
-rwxr-xr-x | linux/make_deb.sh | 12 | ||||
-rw-r--r-- | linux/make_tarball.sh | 5 | ||||
-rwxr-xr-x | macos/make_macos_package.sh | 7 | ||||
-rw-r--r-- | stack.pkg.yaml | 2 | ||||
-rw-r--r-- | stack.yaml | 2 |
7 files changed, 47 insertions, 16 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 diff --git a/macos/make_macos_package.sh b/macos/make_macos_package.sh index 5b66afd25..7cdc42e0c 100755 --- a/macos/make_macos_package.sh +++ b/macos/make_macos_package.sh @@ -3,13 +3,11 @@ LOCALBIN=$HOME/.local/bin DIST=`pwd`/macos_package MACOS=`pwd`/macos -VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}') RESOURCES=$DIST/Resources ROOT=$DIST/pandoc DEST=$ROOT/usr/local PANDOC=$DEST/bin/pandoc SCRIPTS=$MACOS/macos-resources -BASE=pandoc-$VERSION ME=$(whoami) PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker DEVELOPER_ID_APPLICATION=${DEVELOPER_ID_APPLICATION:-Developer ID Application: John Macfarlane} @@ -37,7 +35,7 @@ echo Getting man pages... make man/pandoc.1 # get pandoc-citeproc man page: -PANDOC_CITEPROC_VERSION=`pandoc-citeproc --version | awk '{print $2;}'` +PANDOC_CITEPROC_VERSION=`$DEST/bin/pandoc-citeproc --version | awk '{print $2;exit;}'` PANDOC_CITEPROC_TARBALL=https://hackage.haskell.org/package/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}.tar.gz curl ${PANDOC_CITEPROC_TARBALL} | tar xzC $DIST PANDOC_CITEPROC_PATH=$DIST/pandoc-citeproc-${PANDOC_CITEPROC_VERSION} @@ -61,6 +59,9 @@ $PANDOC --data data -t html5 -s COPYING.md -Vpagetitle="License" -o $RESOURCES/l echo Creating macOS package... +VERSION=`$DEST/bin/pandoc --version | awk '{print $2;exit;}'` +BASE=pandoc-$VERSION + sed -e "s/PANDOCVERSION/$VERSION/" $MACOS/distribution.xml.in > $MACOS/distribution.xml pkgbuild --root $ROOT --identifier net.johnmacfarlane.pandoc --version $VERSION --ownership recommended $DIST/pandoc.pkg diff --git a/stack.pkg.yaml b/stack.pkg.yaml index b7cf8436f..bcf173d19 100644 --- a/stack.pkg.yaml +++ b/stack.pkg.yaml @@ -18,7 +18,7 @@ packages: extra-dep: false extra-deps: - pandoc-types-1.17.2 -- hslua-0.9.0 +- hslua-0.9.2 - skylighting-0.4.1 - cmark-gfm-0.1.1 - QuickCheck-2.10.0.1 diff --git a/stack.yaml b/stack.yaml index 035173389..4b820c764 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,7 +8,7 @@ packages: - '.' extra-deps: - pandoc-types-1.17.2 -- hslua-0.9.0 +- hslua-0.9.2 - skylighting-0.4.1 - cmark-gfm-0.1.1 - QuickCheck-2.10.0.1 |