Skip to content

Instantly share code, notes, and snippets.

@whyvez
Last active February 15, 2023 23:01
Show Gist options
  • Save whyvez/1e0212a35da97aa8f1b1 to your computer and use it in GitHub Desktop.
Save whyvez/1e0212a35da97aa8f1b1 to your computer and use it in GitHub Desktop.
Installs ImageMagick --with-librsvg on Amazon Linux
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/bin:$PATH
export LDFLAGS=-L/usr/lib64:/usr/lib
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
export CPPFLAGS=-I/usr/include
sudo yum-config-manager --enable epel
#sudo yum update -y
sudo yum install -y gcc gcc-c++ glib2-devel.x86_64 libxml2-devel.x86_64 libpng-devel.x86_64 \
libjpeg-turbo-devel.x86_64 gobject-introspection.x86_64 gobject-introspection-devel.x86_64
wget http://ftp.gnome.org/pub/GNOME/sources/libcroco/0.6/libcroco-0.6.8.tar.xz
tar xvfJ libcroco-0.6.8.tar.xz
cd libcroco-0.6.8
./configure --prefix=/usr
make
sudo make install
cd ..
wget http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.28/gdk-pixbuf-2.28.2.tar.xz
tar xvfJ gdk-pixbuf-2.28.2.tar.xz
cd gdk-pixbuf-2.28.2
./configure --prefix=/usr --without-libtiff
make
sudo make install
cd ..
sudo yum install -y pixman-devel.x86_64 harfbuzz-devel.x86_64 freetype-devel.x86_64
wget wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.10.91.tar.gz
tar xvf fontconfig-2.10.91.tar.gz
cd fontconfig-2.10.91
./configure --prefix=/usr --enable-libxml2
make
sudo make install
cd ..
wget http://cairographics.org/releases/cairo-1.12.14.tar.xz
tar xvfJ cairo-1.12.14.tar.xz
cd cairo-1.12.14
./configure --prefix=/usr
make
sudo make install
cd ..
wget http://ftp.gnome.org/pub/GNOME/sources/pango/1.34/pango-1.34.1.tar.xz
tar xvfJ pango-1.34.1.tar.xz
cd pango-1.34.1
./configure --prefix=/usr
make
sudo make install
cd ..
wget http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.6.tar.xz
tar xvfJ librsvg-2.40.6.tar.xz
cd librsvg-2.40.6
./configure --prefix=/usr
make
sudo make install
cd ..
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar xvf ImageMagick.tar.gz
cd ImageMagick-6.9.0-0
./configure --prefix=/usr --with-rsvg
make
sudo make install
cd ..
sudo ldconfig /usr/lib
@vacri
Copy link

vacri commented Aug 18, 2015

Thanks for this gist, about to try it out. There are two wget's in line 30, though.

@ajbisberg
Copy link

Just used this! Thanks a bunch. Just to note, when I installed ImageMagick the version has updated to 6.9.2, so you might need to change that.

@tawanda
Copy link

tawanda commented Oct 23, 2017

Thanks, woked like a charm, I only needed gdk-pixbuf for weazyprint

@brianfoody
Copy link

Any idea about this error!?
librsvg-2.so.2: cannot open shared object file: No such file or directory

@mojimi
Copy link

mojimi commented Mar 4, 2019

How can I apply this to a lambda?

Copy link

ghost commented Feb 15, 2023

This was helpful, though at the time of using ImageShack is on 7.1.0-62, I would change the extracts to use a fixed folder to support changing versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment