This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf-rs/scripts/lib

44 lines
1.5 KiB
Text
Raw Normal View History

2017-09-09 19:18:42 +01:00
#!/usr/bin/env bash
set -e
LIB_DIR=lib
PANDOC_VERSION=1.19.2.1
WKTOX_VERSION=0.12.4
PANDOC_DL=pandoc-${PANDOC_VERSION}-1-amd64.deb
WKTOX_DL=wkhtmltox-${WKTOX_VERSION}_linux-generic-amd64.tar.xz
2017-09-09 19:54:23 +01:00
CSL_DL=csl-temp.zip
CSL_TEMP=$LIB_DIR/csl
2017-09-09 19:18:42 +01:00
echo "> Cleaing old lib..."
rm -rf $LIB_DIR
mkdir -p $LIB_DIR
sudo rm -f /usr/lib/libsciter-gtk-64.so
echo "> Installing Pandoc..."
wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/${PANDOC_DL} -O $LIB_DIR/$PANDOC_DL
ar p ${LIB_DIR}/${PANDOC_DL} data.tar.gz | tar xz --strip-components 2 -C $LIB_DIR
mv $LIB_DIR/bin/* $LIB_DIR
cd $LIB_DIR && rm -r bin/ share/ $PANDOC_DL && cd -
2017-09-09 19:54:23 +01:00
echo "> Installing WkHTMLtoPDF..."
2017-09-09 19:18:42 +01:00
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${WKTOX_VERSION}/${WKTOX_DL} -O $LIB_DIR/$WKTOX_DL
tar -xJf $LIB_DIR/$WKTOX_DL -C $LIB_DIR
mv $LIB_DIR/wkhtmltox/lib/* $LIB_DIR
cd $LIB_DIR && rm -r wkhtmltox/ $WKTOX_DL && cd -
2017-09-09 19:54:23 +01:00
echo "> Installing Sciter..."
2017-09-09 19:18:42 +01:00
wget https://sciter.com/sdk/sciter-sdk.zip -O $LIB_DIR/sciter.zip
unzip -j $LIB_DIR/sciter.zip "bin.gtk/libsciter-gtk-64.so" -d $LIB_DIR
sudo ln -sfP $PWD/$LIB_DIR/libsciter-gtk-64.so /usr/lib/libsciter-gtk-64.so
rm $LIB_DIR/sciter.zip
2017-09-09 19:54:23 +01:00
echo "> Installing CSLs..."
wget https://github.com/citation-style-language/styles-distribution/archive/master.zip -O $LIB_DIR/$CSL_DL
2017-09-09 20:03:27 +01:00
unzip -q $LIB_DIR/$CSL_DL -d $CSL_TEMP
2017-09-09 19:54:23 +01:00
cd $CSL_TEMP/styles-distribution-master && rm -rf dependent/ README.md renamed-styles.json && cd -
2017-09-09 20:03:27 +01:00
zip -jqr $LIB_DIR/csl.zip $CSL_TEMP/styles-distribution-master
2017-09-09 19:54:23 +01:00
rm -rf $CSL_TEMP $LIB_DIR/$CSL_DL