-
Notifications
You must be signed in to change notification settings - Fork 27
/
Poppler-22.10.0_gnu-9.2.0_install
executable file
·72 lines (59 loc) · 2.17 KB
/
Poppler-22.10.0_gnu-9.2.0_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
###############################################
# Installing Poppler 22.10.0 using GNU 9.2.0 for R 4.0.2
#
# by Brian Alston, October 2022
#
# Poppler needs to be patched for the build to work on RedHat 7.x and similar systems.
set -e
dirname=$(dirname $0 2>/dev/null || pwd)
INCLUDES_DIR=${INCLUDES_DIR:-${dirname}/includes}
source ${INCLUDES_DIR}/module_maker_inc.sh
source ${INCLUDES_DIR}/require_inc.sh
require beta-modules
require gcc-libs/9.2.0
require compilers/gnu/9.2.0
require boost/1.75.0/gnu-4.9.2
# This version of Curl is needed as curl/7.47.1/gnu-4.9.2 is too old.
require curl/7.86.0/gnu-4.9.2
COMPILER_TAG=${COMPILER_TAG:-gnu-9.2.0}
VERSION=${VERSION:-22.10.0}
PDATA_VERSION=${PDATA_VERSION:-0.4.11}
INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/Poppler/$VERSION/$COMPILER_TAG}
MD5=${MD5:-9f7d0b99989db6e1c78a678e7fe521c5}
SRC_ARCHIVE=${SRC_ARCHIVE:-https://poppler.freedesktop.org/poppler-${VERSION}.tar.xz}
PDATA_ARCHIVE=${PDATA_ARCHIVE:-https://poppler.freedesktop.org/poppler-data-${PDATA_VERSION}.tar.gz}
temp_dir=`mktemp -d -p /dev/shm`
echo "Building in $temp_dir ..."
cd $temp_dir
wget --no-check-certificate $SRC_ARCHIVE
wget --no-check-certificate $PDATA_ARCHIVE
CHECKSUM=`md5sum poppler-${VERSION}.tar.xz | awk '{print $1}'`
if [ "$MD5" == "$CHECKSUM" ]
then
tar -xvf poppler-${VERSION}.tar.xz
cd poppler-${VERSION}
# Patch source for RedHat 7.x
cd poppler
sed -i.dist -e '/ENABLE_NSS3/a\#include <prtypes.h>' SignatureInfo.cc
cd ../qt5/src
sed -i.dist -e '/ENABLE_NSS3/a\#include <prtypes.h>' poppler-form.cc
cd ../../utils
sed -i.dist -e '/\<ctime\>/a\#include <prtypes.h>' pdfsig.cc
cd ../glib/tests
sed -i.dist -e '/\<string.h\>/a\#include <getopt.h>' pdfdrawbb.c
cd ../..
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_LIBOPENJPEG=unmaintained -DCMAKE_VERBOSE_MAKEFILE=TRUE
make
make install
cd ../..
tar -xvf poppler-data-${PDATA_VERSION}.tar.gz
cd poppler-data-${PDATA_VERSION}
make install datadir=${INSTALL_PREFIX}
else
echo "Hash mismatch."
echo "Expected: $MD5"
echo "Got: $CHECKSUM"
fi