From aafccdb0bdf992d18d779df97dc2deca245dc6a7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 24 Oct 2015 21:12:43 -0700 Subject: Changes for deb and osx package generators. - Use stack for make_deb.sh. - Use osx/stack.yaml or deb/stack.yaml. - deb/stack.yaml doesn't want the same ghc-options. --- deb/stack.yaml | 17 +++++++++++++++++ make_deb.sh | 30 +++++++++++------------------- make_osx_package.sh | 7 +++++-- osx/stack.yaml | 20 ++++++++++++++++++++ stack.pkg.yaml | 20 -------------------- 5 files changed, 53 insertions(+), 41 deletions(-) create mode 100644 deb/stack.yaml create mode 100644 osx/stack.yaml delete mode 100644 stack.pkg.yaml diff --git a/deb/stack.yaml b/deb/stack.yaml new file mode 100644 index 000000000..c2f506cab --- /dev/null +++ b/deb/stack.yaml @@ -0,0 +1,17 @@ +flags: + pandoc: + trypandoc: false + https: true + embed_data_files: true + old-locale: false + network-uri: true + pandoc-citeproc: + bibutils: true + embed_data_files: true + unicode_collation: false + test_citeproc: false + debug: false +packages: +- '.' +- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.0.1/pandoc-citeproc-0.8.0.1.tar.gz' +resolver: lts-3.10 diff --git a/make_deb.sh b/make_deb.sh index a5aaf1549..a184b54d6 100755 --- a/make_deb.sh +++ b/make_deb.sh @@ -7,7 +7,7 @@ case "$MACHINE" in i386) ARCHITECTURE=i386;; esac -SANDBOX=`pwd`/.cabal-sandbox +LOCAL=$HOME/.local VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}') DEBPKGVER=1 DEBVER=$VERSION-$DEBPKGVER @@ -17,32 +17,24 @@ DEST=$DIST/usr ME=$(whoami) COPYRIGHT=$DEST/share/doc/pandoc/copyright -# echo Removing old files... -rm -rf $DIST - -cabal sandbox init -echo Updating database -cabal update - -export PATH=`pwd`/.cabal-sandbox/bin:$PATH -which hsb2hs || cabal install hsb2hs -echo Building pandoc... -cabal clean -cabal install --force --reinstall --flags="embed_data_files make-pandoc-man-pages" . pandoc-citeproc +stack setup +stack clean +which hsb2hs || stack install --stack-yaml stack.hsb2hs.yaml +stack install --stack-yaml deb/stack.yaml # get pandoc-citeproc man page: -PANDOC_CITEPROC_PATH=`cabal unpack -d make_binary_package.tmp.$$ pandoc-citeproc | awk '{print $3;}'` -strip $SANDBOX/bin/pandoc -strip $SANDBOX/bin/pandoc-citeproc +PANDOC_CITEPROC_PATH=`stack unpack -d make_binary_package.tmp.$$ pandoc-citeproc | awk '{print $3;}'` +strip $LOCAL/bin/pandoc +strip $LOCAL/bin/pandoc-citeproc mkdir -p $DEST/bin mkdir -p $DEST/share/man/man1 mkdir -p $DEST/share/doc/pandoc mkdir -p $DEST/share/doc/pandoc-citeproc find $DIST -type d | xargs chmod 755 -cp $SANDBOX/bin/pandoc $DEST/bin/ -cp $SANDBOX/bin/pandoc-citeproc $DEST/bin/ -cp $SANDBOX/share/man/man1/pandoc.1 $DEST/share/man/man1/pandoc.1 +cp $LOCAL/bin/pandoc $DEST/bin/ +cp $LOCAL/bin/pandoc-citeproc $DEST/bin/ +cp $LOCAL/share/man/man1/pandoc.1 $DEST/share/man/man1/pandoc.1 gzip -9 $DEST/share/man/man1/pandoc.1 cp $PANDOC_CITEPROC_PATH/man/man1/pandoc-citeproc.1 $DEST/share/man/man1/ gzip -9 $DEST/share/man/man1/pandoc-citeproc.1 diff --git a/make_osx_package.sh b/make_osx_package.sh index 2512e81e0..3683f1a6e 100755 --- a/make_osx_package.sh +++ b/make_osx_package.sh @@ -15,13 +15,16 @@ PACKAGEMAKER=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker # echo Removing old files... rm -rf $DIST mkdir -p $RESOURCES +stack setup +which hsb2hs | stack install --stack-yaml=stack.hsb2hs.yaml echo Building pandoc... -stack install --stack-yaml=stack.pkg.yaml +stack clean +stack install --stack-yaml=osx/stack.yaml echo Getting man pages... make man/pandoc.1 -PANDOC_CITEPROC_PATH=`cabal unpack -d $DIST pandoc-citeproc | awk '{print $3;}'` +PANDOC_CITEPROC_PATH=`stack unpack -d $DIST pandoc-citeproc | awk '{print $3;}'` mkdir -p $DEST/bin mkdir -p $DEST/share/man/man1 diff --git a/osx/stack.yaml b/osx/stack.yaml new file mode 100644 index 000000000..e7ce11752 --- /dev/null +++ b/osx/stack.yaml @@ -0,0 +1,20 @@ +flags: + pandoc: + trypandoc: false + https: true + embed_data_files: true + old-locale: false + network-uri: true + pandoc-citeproc: + bibutils: true + embed_data_files: true + unicode_collation: false + test_citeproc: false + debug: false +ghc-options: + pandoc-citeproc: '-pgmP cpphs -optP--cpp' + highlighting-kate: '-pgmP cpphs -optP--cpp' +packages: +- '.' +- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.0.1/pandoc-citeproc-0.8.0.1.tar.gz' +resolver: lts-3.10 diff --git a/stack.pkg.yaml b/stack.pkg.yaml deleted file mode 100644 index e7ce11752..000000000 --- a/stack.pkg.yaml +++ /dev/null @@ -1,20 +0,0 @@ -flags: - pandoc: - trypandoc: false - https: true - embed_data_files: true - old-locale: false - network-uri: true - pandoc-citeproc: - bibutils: true - embed_data_files: true - unicode_collation: false - test_citeproc: false - debug: false -ghc-options: - pandoc-citeproc: '-pgmP cpphs -optP--cpp' - highlighting-kate: '-pgmP cpphs -optP--cpp' -packages: -- '.' -- 'https://hackage.haskell.org/package/pandoc-citeproc-0.8.0.1/pandoc-citeproc-0.8.0.1.tar.gz' -resolver: lts-3.10 -- cgit v1.2.3