Linux rc build: use ghc-musl container.
This simplifies our build process a bit (over using a customized alpine container). Use new `--enable-executable-static` flag in build. make_artifacts.sh: Fix deprecated find -perm syntax.
This commit is contained in:
parent
5d4932d7ef
commit
c990027832
6 changed files with 43 additions and 75 deletions
1
.github/workflows/release-candidate.yml
vendored
1
.github/workflows/release-candidate.yml
vendored
|
@ -138,4 +138,3 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: macos-release-candidate
|
name: macos-release-candidate
|
||||||
path: macos-release-candidate
|
path: macos-release-candidate
|
||||||
|
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -5,6 +5,7 @@ BRANCH?=master
|
||||||
RESOLVER?=lts-13
|
RESOLVER?=lts-13
|
||||||
GHCOPTS=-fdiagnostics-color=always
|
GHCOPTS=-fdiagnostics-color=always
|
||||||
WEBSITE=../../web/pandoc.org
|
WEBSITE=../../web/pandoc.org
|
||||||
|
REVISION?=1
|
||||||
|
|
||||||
quick:
|
quick:
|
||||||
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)'
|
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
|
||||||
! grep -n -e "\t" MANUAL.txt changelog
|
! grep -n -e "\t" MANUAL.txt changelog
|
||||||
|
|
||||||
debpkg: man/pandoc.1
|
debpkg: man/pandoc.1
|
||||||
make -C linux && \
|
docker run -v `pwd`:/mnt \
|
||||||
cp linux/artifacts/pandoc-$(version)-*.* .
|
-v `pwd`/linux/artifacts:/artifacts \
|
||||||
|
-e REVISION=$(REVISION) \
|
||||||
|
-w /mnt \
|
||||||
|
utdemir/ghc-musl:v12-libgmp-ghc8101 bash \
|
||||||
|
/mnt/linux/make_artifacts.sh
|
||||||
|
|
||||||
macospkg: man/pandoc.1
|
macospkg: man/pandoc.1
|
||||||
./macos/make_macos_package.sh
|
./macos/make_macos_package.sh
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
# USE ALPINE LINUX
|
|
||||||
FROM alpine:3.11
|
|
||||||
RUN apk --no-cache add \
|
|
||||||
alpine-sdk \
|
|
||||||
bash \
|
|
||||||
ca-certificates \
|
|
||||||
cabal \
|
|
||||||
dpkg \
|
|
||||||
fakeroot \
|
|
||||||
ghc \
|
|
||||||
git \
|
|
||||||
gmp-dev \
|
|
||||||
xz \
|
|
||||||
zlib-dev \
|
|
||||||
zlib-static
|
|
||||||
RUN mkdir -p /usr/src/ && \
|
|
||||||
git clone https://github.com/jgm/pandoc /usr/src/pandoc
|
|
||||||
WORKDIR /usr/src/pandoc
|
|
||||||
CMD cabal --version && \
|
|
||||||
ghc --version && \
|
|
||||||
git pull && \
|
|
||||||
git checkout -b work $TREE && \
|
|
||||||
cabal new-update && \
|
|
||||||
cabal new-clean && \
|
|
||||||
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 && \
|
|
||||||
cabal new-build . pandoc-citeproc && \
|
|
||||||
cabal new-test -j1 . pandoc-citeproc && \
|
|
||||||
for f in $(find dist-newstyle -name 'pandoc*' -type f -perm +400); do cp $f /artifacts/; done && \
|
|
||||||
bash linux/make_deb.sh && \
|
|
||||||
bash linux/make_tarball.sh
|
|
|
@ -1,18 +0,0 @@
|
||||||
TREE?=HEAD
|
|
||||||
ARTIFACTS=`pwd`/artifacts
|
|
||||||
REVISION?=1
|
|
||||||
|
|
||||||
build:
|
|
||||||
mkdir -p $(ARTIFACTS)
|
|
||||||
docker build -t alpine-pandoc .
|
|
||||||
docker run --env TREE=$(TREE) --env REVISION=$(REVISION) \
|
|
||||||
-v $(ARTIFACTS):/artifacts alpine-pandoc
|
|
||||||
|
|
||||||
interact:
|
|
||||||
docker run --env TREE=$(TREE) --env REVISION=$(REVISION) \
|
|
||||||
-v $(ARTIFACTS):/artifacts -it alpine-pandoc bash
|
|
||||||
|
|
||||||
setup:
|
|
||||||
docker pull alpine:edge
|
|
||||||
|
|
||||||
.PHONY: build setup interact
|
|
41
linux/make_deb.sh → linux/make_artifacts.sh
Executable file → Normal file
41
linux/make_deb.sh → linux/make_artifacts.sh
Executable file → Normal file
|
@ -9,6 +9,20 @@ esac
|
||||||
|
|
||||||
ARTIFACTS="${ARTIFACTS:-/artifacts}"
|
ARTIFACTS="${ARTIFACTS:-/artifacts}"
|
||||||
|
|
||||||
|
# build binaries
|
||||||
|
|
||||||
|
cabal --version
|
||||||
|
ghc --version
|
||||||
|
|
||||||
|
cabal v2-update
|
||||||
|
cabal v2-clean
|
||||||
|
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
|
||||||
|
cabal v2-build . pandoc-citeproc
|
||||||
|
cabal v2-test -j1 . pandoc-citeproc
|
||||||
|
for f in $(find dist-newstyle -name 'pandoc*' -type f -perm /400); do cp $f /artifacts/; done
|
||||||
|
|
||||||
|
# make deb
|
||||||
|
|
||||||
VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
|
VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
|
||||||
REVISION=${REVISION:-1}
|
REVISION=${REVISION:-1}
|
||||||
DEBVER=$VERSION-$REVISION
|
DEBVER=$VERSION-$REVISION
|
||||||
|
@ -17,8 +31,6 @@ DIST=`pwd`/$BASE
|
||||||
DEST=$DIST/usr
|
DEST=$DIST/usr
|
||||||
COPYRIGHT=$DEST/share/doc/pandoc/copyright
|
COPYRIGHT=$DEST/share/doc/pandoc/copyright
|
||||||
|
|
||||||
PANDOC_CITEPROC_VERSION=`$ARTIFACTS/pandoc-citeproc --version | awk '{print $2;}'`
|
|
||||||
|
|
||||||
mkdir -p $DEST/bin
|
mkdir -p $DEST/bin
|
||||||
mkdir -p $DEST/share/man/man1
|
mkdir -p $DEST/share/man/man1
|
||||||
mkdir -p $DEST/share/doc/pandoc
|
mkdir -p $DEST/share/doc/pandoc
|
||||||
|
@ -29,12 +41,12 @@ cp $ARTIFACTS/pandoc $DEST/bin/
|
||||||
cp $ARTIFACTS/pandoc-citeproc $DEST/bin/
|
cp $ARTIFACTS/pandoc-citeproc $DEST/bin/
|
||||||
strip $DEST/bin/pandoc
|
strip $DEST/bin/pandoc
|
||||||
strip $DEST/bin/pandoc-citeproc
|
strip $DEST/bin/pandoc-citeproc
|
||||||
cp man/pandoc.1 $DEST/share/man/man1/pandoc.1
|
cp /mnt/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.1
|
||||||
gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
|
gzip -9 $DEST/share/man/man1/pandoc-citeproc.1
|
||||||
|
|
||||||
cp COPYRIGHT $COPYRIGHT
|
cp /mnt/COPYRIGHT $COPYRIGHT
|
||||||
echo "" >> $COPYRIGHT
|
echo "" >> $COPYRIGHT
|
||||||
echo "pandoc-citeproc" >> $COPYRIGHT
|
echo "pandoc-citeproc" >> $COPYRIGHT
|
||||||
$ARTIFACTS/pandoc-citeproc --license >> $COPYRIGHT
|
$ARTIFACTS/pandoc-citeproc --license >> $COPYRIGHT
|
||||||
|
@ -46,6 +58,25 @@ perl -pe "s/VERSION/$DEBVER/" linux/control.in | \
|
||||||
perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
|
perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
|
||||||
> $DIST/DEBIAN/control
|
> $DIST/DEBIAN/control
|
||||||
|
|
||||||
fakeroot dpkg-deb --build $DIST
|
# we limit compression to avoid OOM error
|
||||||
|
fakeroot dpkg-deb -Zgzip -z9 --build $DIST
|
||||||
rm -rf $DIST
|
rm -rf $DIST
|
||||||
cp $BASE.deb $ARTIFACTS/
|
cp $BASE.deb $ARTIFACTS/
|
||||||
|
|
||||||
|
# Make tarball
|
||||||
|
|
||||||
|
TARGET=pandoc-$VERSION
|
||||||
|
cd $ARTIFACTS
|
||||||
|
rm -rf $TARGET
|
||||||
|
mkdir $TARGET
|
||||||
|
mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1
|
||||||
|
./pandoc-citeproc --man > $TARGET/share/man/man1/pandoc-citeproc.1
|
||||||
|
cp /mnt/man/pandoc.1 $TARGET/share/man/man1
|
||||||
|
mv pandoc pandoc-citeproc $TARGET/bin
|
||||||
|
strip $TARGET/bin/pandoc
|
||||||
|
strip $TARGET/bin/pandoc-citeproc
|
||||||
|
gzip -9 $TARGET/share/man/man1/pandoc.1
|
||||||
|
gzip -9 $TARGET/share/man/man1/pandoc-citeproc.1
|
||||||
|
|
||||||
|
tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
|
||||||
|
rm -r $TARGET
|
|
@ -1,19 +0,0 @@
|
||||||
set -e
|
|
||||||
|
|
||||||
ARTIFACTS="${ARTIFACTS:-/artifacts}"
|
|
||||||
VERSION=`$ARTIFACTS/pandoc --version | awk '{print $2; exit;}'`
|
|
||||||
TARGET=pandoc-$VERSION
|
|
||||||
|
|
||||||
cd $ARTIFACTS
|
|
||||||
rm -rf $TARGET
|
|
||||||
mkdir $TARGET
|
|
||||||
mkdir $TARGET/bin $TARGET/share $TARGET/share/man $TARGET/share/man/man1
|
|
||||||
./pandoc-citeproc --man > $TARGET/share/man/man1/pandoc-citeproc.1
|
|
||||||
cp /usr/src/pandoc/man/pandoc.1 $TARGET/share/man/man1
|
|
||||||
mv pandoc pandoc-citeproc $TARGET/bin
|
|
||||||
strip $TARGET/bin/pandoc
|
|
||||||
strip $TARGET/bin/pandoc-citeproc
|
|
||||||
gzip -9 $TARGET/share/man/man1/pandoc.1
|
|
||||||
gzip -9 $TARGET/share/man/man1/pandoc-citeproc.1
|
|
||||||
tar cvzf $TARGET-linux-amd64.tar.gz $TARGET
|
|
||||||
rm -r $TARGET
|
|
Loading…
Reference in a new issue