3LOCALBIN=$HOME/.local/bin
4DIST=`pwd`/macos_package
6VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
7RESOURCES=$DIST/Resources
10SCRIPTS=$MACOS/macos-resources
13PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
14DEVELOPER_ID_APPLICATION=${DEVELOPER_ID_APPLICATION:-Developer ID Application: John Macfarlane}
15DEVELOPER_ID_INSTALLER=${DEVELOPER_ID_INSTALLER:-Developer ID Installer: John Macfarlane}
17# We need this for hsb2hs:
19export MACMACOS_DEPLOYMENT_TARGET=10.7
21# echo Removing old files...
26which hsb2hs || stack install hsb2hs
27which cpphs || stack install cpphs
29echo Building pandoc...
31stack install --stack-yaml=stack.pkg.yaml --local-bin-path . pandoc pandoc-citeproc
33echo Getting man pages...
36# get pandoc-citeproc man page:
37PANDOC_CITEPROC_VERSION=`pandoc-citeproc --version | awk '{print $2;}'`
38PANDOC_CITEPROC_TARBALL=https://hackage.haskell.org/package/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}.tar.gz
39curl ${PANDOC_CITEPROC_TARBALL} | tar xzC $DIST
40PANDOC_CITEPROC_PATH=$DIST/pandoc-citeproc-${PANDOC_CITEPROC_VERSION}
43mkdir -p $DEST/share/man/man1
44for f in pandoc pandoc-citeproc; do
45 cp $MACOS/$f $DEST/bin/;
47cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/
48cp man/pandoc.1 $DEST/share/man/man1/
50chown -R $ME:staff $DIST
52echo Copying license...
53$MACOS/pandoc --data data -t html5 -s COPYING.md -o $RESOURCES/license.html
55# Removing executable signing because of a problem that arose in El Capitan
56# "source=obsolete resource envelope"
58#echo Signing pandoc executable...
60#codesign --force --sign "${DEVELOPER_ID_APPLICATION}" $DEST/bin/pandoc
61# make sure it's valid... returns nonzero exit code if it isn't:
62#spctl --assess --type execute $DEST/bin/pandoc
64echo Creating MacOS package...
66sed -e "s/PANDOCVERSION/$VERSION/" $MACOS/distribution.xml.in > $MACOS/distribution.xml
68pkgbuild --root $DIST/pandoc --identifier net.johnmacfarlane.pandoc --version 1.13 --ownership recommended $DIST/pandoc.pkg
69productbuild --distribution $MACOS/distribution.xml --resources $DIST/Resources --package-path $DIST --version $VERSION --sign "${DEVELOPER_ID_INSTALLER}" $BASE-MacOS.pkg
72spctl --assess --type install $BASE-MacOS.pkg
75rm -r $DIST $MACOS/pandoc $MACOS/pandoc-citeproc
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list