aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml9
-rw-r--r--linux/make_artifacts.sh21
-rw-r--r--macos/make_macos_release.sh44
3 files changed, 40 insertions, 34 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index de0ed565d..028904cae 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -10,12 +10,11 @@ task:
fingerprint_key: macos_2023_03_11
deps_script:
- cabal update
- - cabal build pandoc-cli -fembed_data_files -fserver -flua --dependencies-only
+ - cabal build all -fembed_data_files -fserver -flua --dependencies-only
upload_caches:
- cabal_store
install_script: |
sh macos/make_macos_release.sh
- ls
zip -r macos-release-candidate.zip macos-release-candidate
artifacts:
path: macos-release-candidate.zip
@@ -28,12 +27,14 @@ task:
image: registry.gitlab.b-data.ch/ghc/ghc4pandoc:9.4.4
cpu: 4
memory: 12G
+ env:
+ CABALOPTS: -f-export-dynamic -fembed_data_files -fserver -flua --enable-executable-static -j4 --ghc-options="-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread"
cabal_store_cache:
folder: ~/.cabal/store
fingerprint_key: linux_arm64_2023_03_11
- build_script:
+ deps_script:
- cabal update
- - cabal install --reinstall -f-export-dynamic -fembed_data_files -fserver -flua --enable-executable-static -j4 --ghc-options="-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread" pandoc-cli --install-method=copy --overwrite-policy=always --installdir=.
+ - cabal build --dependencies-only $CABALOPTS pandoc-cli
upload_caches:
- cabal_store
package_script:
diff --git a/linux/make_artifacts.sh b/linux/make_artifacts.sh
index f795655a4..e80ff01a3 100644
--- a/linux/make_artifacts.sh
+++ b/linux/make_artifacts.sh
@@ -1,7 +1,12 @@
#!/bin/bash
set -e
-ROOT="$(pwd)"
+cabal build $CABALOPTS pandoc-cli
+BINPATH=$(cabal
+BINPATH=$(cabal list-bin $CABALOPTS pandoc-cli)
+echo "Built executable: $BINPATH"
+
+WORK="$(pwd)"
MACHINE=$(uname -m)
case "$MACHINE" in
@@ -13,7 +18,7 @@ case "$MACHINE" in
*) ARCHITECTURE=unknown;;
esac
-ARTIFACTS="$ROOT/linux/artifacts"
+ARTIFACTS="$WORK/linux/artifacts"
echo "Creating $ARTIFACTS directory"
mkdir -p $ARTIFACTS
@@ -26,7 +31,7 @@ clean_up() {
trap clean_up EXIT
echo "Copying and stripping pandoc binary"
-cp "$ROOT/pandoc" "$ARTIFACTS/pandoc"
+cp "$BINPATH/pandoc" "$ARTIFACTS/pandoc"
strip "$ARTIFACTS/pandoc"
echo "Checking that the binary is statically linked..."
@@ -43,7 +48,7 @@ make_deb() {
REVISION=${REVISION:-1}
DEBVER=$VERSION-$REVISION
BASE=pandoc-$DEBVER-$ARCHITECTURE
- DIST=$ROOT/$BASE
+ DIST=$WORK/$BASE
DEST=$DIST/usr
COPYRIGHT=$DEST/share/doc/pandoc/copyright
@@ -59,15 +64,15 @@ make_deb() {
popdir
for manpage in pandoc.1 pandoc-lua.1 pandoc-server.1
do
- cp $ROOT/man/$manpage "$DEST/share/man/man1/$manpage"
+ cp $WORK/man/$manpage "$DEST/share/man/man1/$manpage"
gzip -9 "$DEST/share/man/man1/$manpage"
done
- cp $ROOT/COPYRIGHT "$COPYRIGHT"
+ cp $WORK/COPYRIGHT "$COPYRIGHT"
echo "" >> "$COPYRIGHT"
INSTALLED_SIZE=$(du -k -s "$DEST" | awk '{print $1}')
mkdir "$DIST/DEBIAN"
- perl -pe "s/VERSION/$DEBVER/" $ROOT/linux/control.in | \
+ perl -pe "s/VERSION/$DEBVER/" $WORK/linux/control.in | \
perl -pe "s/ARCHITECTURE/$ARCHITECTURE/" | \
perl -pe "s/INSTALLED_SIZE/$INSTALLED_SIZE/" \
> "$DIST/DEBIAN/control"
@@ -86,7 +91,7 @@ make_tarball() {
rm -rf "$TARGET"
mkdir "$TARGET"
mkdir "$TARGET/bin" "$TARGET/share" "$TARGET/share/man" "$TARGET/share/man/man1"
- cp $ROOT/man/pandoc.1 $ROOT/man/pandoc-server.1 $ROOT/man/pandoc-lua.1 "$TARGET/share/man/man1"
+ cp $WORK/man/pandoc.1 $WORK/man/pandoc-server.1 $WORK/man/pandoc-lua.1 "$TARGET/share/man/man1"
gzip -9 "$TARGET"/share/man/man1/*.1
mv pandoc "$TARGET/bin"
pushdir "$TARGET/bin"
diff --git a/macos/make_macos_release.sh b/macos/make_macos_release.sh
index 22f887fff..27e0b958d 100644
--- a/macos/make_macos_release.sh
+++ b/macos/make_macos_release.sh
@@ -2,43 +2,43 @@
VERSION=$(grep '^[Vv]ersion:' pandoc.cabal | awk '{print $2;}')
ARTIFACTS=macos-release-candidate
-RESOURCES=${ARTIFACTS}/Resources
-ROOT=${ARTIFACTS}/pandoc
-DEST=${ROOT}/usr/local
+RESOURCES=$ARTIFACTS/Resources
+ROOT=$ARTIFACTS/pandoc
+DEST=$ROOT/usr/local
ME=$(whoami)
+CABALOPTS="-fembed_data_files -fserver -flua"
# Build the pandoc binary and put it in .
cabal update
-cabal install pandoc-cli --reinstall \
- -fembed_data_files -fserver -flua \
- --installdir=. --install-method=copy --overwrite-policy=always
+cabal build all $CABALOPTS
+BINPATH=$(cabal list-bin $CABALOPTS pandoc-cli)
echo "Built executable..."
# Create directories
-echo "Creating ${ARTIFACTS} directory..."
-mkdir -p ${ARTIFACTS}
-mkdir -p ${RESOURCES}
-mkdir -p ${DEST}/bin
-mkdir -p ${DEST}/share/man/man1
+echo "Creating $ARTIFACTS directory..."
+mkdir -p $ARTIFACTS
+mkdir -p $RESOURCES
+mkdir -p $DEST/bin
+mkdir -p $DEST/share/man/man1
# Copy binary and strip it
echo "Copying executable..."
-cp ./pandoc ${DEST}/bin/
-strip ${DEST}/bin/pandoc
+cp "$BINPATH/pandoc" "$DEST/bin/"
+strip "$DEST/bin/pandoc"
# Copy man pages and license
echo "Copying manuals and license..."
-cp man/pandoc.1 ${DEST}/share/man/man1/pandoc.1
-cp man/pandoc-server.1 ${DEST}/share/man/man1/pandoc-server.1
-cp man/pandoc-lua.1 ${DEST}/share/man/man1/pandoc-lua.1
-./pandoc -s COPYING.md -Vpagetitle=License -o ${RESOURCES}/license.html
+cp man/pandoc.1 "$DEST/share/man/man1/pandoc.1"
+cp man/pandoc-server.1 "$DEST/share/man/man1/pandoc-server.1"
+cp man/pandoc-lua.1 "$DEST/share/man/man1/pandoc-lua.1"
+"$BINPATH/pandoc" -s COPYING.md -Vpagetitle=License -o "$RESOURCES/license.html"
# Prepare distribution directory; after downloading, run 'make' to notarize
echo "Preparing distribution directory..."
-chown -R "$ME:staff" "${ROOT}"
-sed -e "s/PANDOCVERSION/${VERSION}/" macos/distribution.xml.in > ${ARTIFACTS}/distribution.xml
-cp macos/Makefile ${ARTIFACTS}/
-echo "${VERSION}" > "${ARTIFACTS}/version.txt"
+chown -R "$ME:staff" "$ROOT"
+sed -e "s/PANDOCVERSION/$VERSION/" macos/distribution.xml.in > "$ARTIFACTS/distribution.xml"
+cp macos/Makefile "$ARTIFACTS/"
+echo "$VERSION" > "$ARTIFACTS/version.txt"
-ls -R ${ARTIFACTS}
+ls -R $ARTIFACTS
echo "Finished..."