Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Enabling pango #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions bin/compile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -o errexit

indent() {
sed -u 's/^/ /'
}
Expand All @@ -15,7 +17,7 @@ mkdir -p $INSTALL_DIR
IMAGE_MAGICK_VERSION="${IMAGE_MAGICK_VERSION:-7.0.10-56}"
CACHE_FILE="$CACHE_DIR/imagemagick-$IMAGE_MAGICK_VERSION.tar.gz"

if [ ! -f $CACHE_FILE ]; then
# if [ ! -f $CACHE_FILE ]; then
# install imagemagick
IMAGE_MAGICK_FILE="ImageMagick-$IMAGE_MAGICK_VERSION.tar.xz"
IMAGE_MAGICK_DIR="ImageMagick-$IMAGE_MAGICK_VERSION"
Expand All @@ -33,11 +35,11 @@ if [ ! -f $CACHE_FILE ]; then
fi
tar xvf $BUILD_DIR/$IMAGE_MAGICK_FILE | indent

echo "-----> Building ImageMagick"
echo "-----> Building ImageMagick with Pango"
cd $IMAGE_MAGICK_DIR
export CPPFLAGS="-I$INSTALL_DIR/include"
export LDFLAGS="-L$INSTALL_DIR/lib"
./configure --prefix=$INSTALL_DIR --without-gvc
./configure --prefix=$INSTALL_DIR --enable-shared=no --without-gvc --with-pango
make && make install
cd ..
rm -rf $IMAGE_MAGICK_DIR
Expand All @@ -49,15 +51,15 @@ if [ ! -f $CACHE_FILE ]; then
tar czf $REL_INSTALL_DIR.tar.gz $REL_INSTALL_DIR
mv $REL_INSTALL_DIR.tar.gz $CACHE_FILE

else
# cache exists, extract it
echo "-----> Extracting ImageMagick $CACHE_FILE => $VENDOR_DIR"
tar xzf $CACHE_FILE -C $VENDOR_DIR
fi
# else
# # cache exists, extract it
# echo "-----> Extracting ImageMagick $CACHE_FILE => $VENDOR_DIR"
# tar xzf $CACHE_FILE -C $VENDOR_DIR
# fi

echo "-----> Writing policy file"
mkdir -p $INSTALL_DIR/etc/ImageMagick
cat > $INSTALL_DIR/policy.xml <<EOF
echo > $INSTALL_DIR/policy.xml <<EOF
<policymap>
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="map" value="512MiB"/>
Expand Down Expand Up @@ -98,8 +100,8 @@ cat > $INSTALL_DIR/delegates.xml <<EOF
<delegate decode="cdr" command="&quot;@UniconvertorDelegate@&quot; &quot;%i&quot; &quot;%o.svg&quot;; /bin/mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="cgm" command="&quot;@UniconvertorDelegate@&quot; &quot;%i&quot; &quot;%o.svg&quot;; /bin/mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="https:decode" command="&quot;curl&quot; -s -k -L -o &quot;%u.dat&quot; &quot;https:%M&quot;"/>
<delegate decode="doc" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="docx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="doc" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="docx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="dng:decode" command="&quot;ufraw-batch&quot; --silent --create-id=also --out-type=png --out-depth=16 &quot;--output=%u.png&quot; &quot;%i&quot;"/>
<delegate decode="dot" command="&quot;dot&quot; -Tsvg &quot;%i&quot; -o &quot;%o&quot;" />
<delegate decode="dvi" command="&quot;dvips&quot; -sstdout=%%stderr -o &quot;%o&quot; &quot;%i&quot;"/>
Expand All @@ -108,8 +110,8 @@ cat > $INSTALL_DIR/delegates.xml <<EOF
<delegate decode="eps" encode="pdf" mode="bi" command="&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 &quot;-sDEVICE=pdfwrite&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="eps" encode="ps" mode="bi" command="&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ps2write&quot; &quot;-sOutputFile=%o&quot; &quot;-f%i&quot;"/>
<delegate decode="fig" command="&quot;@UniconvertorDelegate@&quot; &quot;%i&quot; &quot;%o.svg&quot;; /bin/mv &quot;%o.svg&quot; &quot;%o&quot;"/>
<delegate decode="hpg" command="&quot;hp2xx&quot; -sstdout=%%stderr -m eps -f `basename &quot;%o&quot;` &quot;%i&quot;; /bin/mv -f `basename &quot;%o&quot;` &quot;%o&quot;"/>
<delegate decode="hpgl" command="&quot;hp2xx&quot; -sstdout=%%stderr -m eps -f `basename &quot;%o&quot;` &quot;%i&quot;; /bin/mv -f `basename &quot;%o&quot;` &quot;%o&quot;"/>
<delegate decode="hpg" command="&quot;hp2xx&quot; -sstdout=%%stderr -m eps -f \`basename &quot;%o&quot;\` &quot;%i&quot;; /bin/mv -f \`basename &quot;%o&quot;\` &quot;%o&quot;"/>
<delegate decode="hpgl" command="&quot;hp2xx&quot; -sstdout=%%stderr -m eps -f \`basename &quot;%o&quot;\` &quot;%i&quot;; /bin/mv -f \`basename &quot;%o&quot;\` &quot;%o&quot;"/>
<delegate decode="htm" command="&quot;html2ps&quot; -U -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="html" command="&quot;html2ps&quot; -U -o &quot;%o&quot; &quot;%i&quot;"/>
<delegate decode="ilbm" command="&quot;ilbmtoppm&quot; &quot;%i&quot; &gt; &quot;%o&quot;"/>
Expand All @@ -118,7 +120,7 @@ cat > $INSTALL_DIR/delegates.xml <<EOF
<delegate decode="lep" mode="decode" command="&quot;lepton&quot; &quot;%i&quot; &quot;%o&quot;"/>
<delegate decode="miff" encode="show" spawn="True" command="&quot;magick&quot; display -immutable -delay 0 -title &quot;%M&quot; &quot;%i&quot;"/>
<delegate decode="miff" encode="win" stealth="True" spawn="True" command="&quot;magick&quot; display -immutable -delay 0 -title &quot;%M&quot; &quot;%i&quot;"/>
<delegate decode="odt" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="odt" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="pcl:cmyk" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="pcl:color" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="pcl:mono" stealth="True" command="&quot;pcl6&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
Expand All @@ -129,8 +131,8 @@ cat > $INSTALL_DIR/delegates.xml <<EOF
<delegate decode="pnm" encode="ilbm" mode="encode" command="&quot;ppmtoilbm&quot; -24if &quot;%i&quot; &gt; &quot;%o&quot;"/>
<delegate decode="bmp" encode="jxr" command="/bin/mv &quot;%i&quot; &quot;%i.bmp&quot;; &quot;JxrEncApp&quot; -i &quot;%i.bmp&quot; -o &quot;%o.jxr&quot;; /bin/mv &quot;%i.bmp&quot; &quot;%i&quot;; /bin/mv &quot;%o.jxr&quot; &quot;%o&quot;"/>
<delegate decode="bmp" encode="wdp" command="/bin/mv &quot;%i&quot; &quot;%i.bmp&quot;; &quot;JxrEncApp&quot; -i &quot;%i.bmp&quot; -o &quot;%o.jxr&quot;; /bin/mv &quot;%i.bmp&quot; &quot;%i&quot;; /bin/mv &quot;%o.jxr&quot; &quot;%o&quot;"/>
<delegate decode="ppt" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="pptx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="ppt" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="pptx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="ps" encode="prt" command="&quot; lpr&quot; &quot;%i&quot;"/>
<delegate decode="ps:alpha" stealth="True" command="&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pngalpha&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
<delegate decode="ps:cmyk" stealth="True" command="&quot;gs&quot; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=pamcmyk32&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;-f%s&quot; &quot;-f%s&quot;"/>
Expand All @@ -148,8 +150,8 @@ cat > $INSTALL_DIR/delegates.xml <<EOF
<delegate decode="tiff" encode="launch" mode="encode" command="&quot;gimp&quot; &quot;%i&quot;"/>
<delegate decode="wdp" command="/bin/mv &quot;%i&quot; &quot;%i.jxr&quot;; &quot;JxrDecApp&quot; -i &quot;%i.jxr&quot; -o &quot;%o.bmp&quot;; /bin/mv &quot;%i.jxr&quot; &quot;%i&quot;; /bin/mv &quot;%o.bmp&quot; &quot;%o&quot;"/>
<delegate decode="webp" command="&quot;dwebp&quot; -pam &quot;%i&quot; -o &quot;%o&quot;"/>
<delegate decode="xls" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xlsx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir `dirname &quot;%i&quot;` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xls" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xlsx" command="&quot;libreoffice&quot; --headless --convert-to pdf -outdir \`dirname &quot;%i&quot;\` &quot;%i&quot; 2&gt; &quot;%u&quot;; /bin/mv &quot;%i.pdf&quot; &quot;%o&quot;"/>
<delegate decode="xps:cmyk" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="xps:color" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
<delegate decode="xps:mono" stealth="True" command="&quot;gxps&quot; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &quot;-sDEVICE=ppmraw&quot; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &quot;-r%s&quot; %s &quot;-sOutputFile=%s&quot; &quot;%s&quot;"/>
Expand Down