Reinier Maliepaard Appendix B: Installation Prima

Appendix B: Installation Prima

from README.md in Prima package


Debian/Ubuntu
apt-get install libgtk-3-dev libgif-dev libjpeg-dev libtiff-dev libxpm-dev \
libwebp-dev libfribidi-dev libharfbuzz-dev libthai-dev libheif-dev libfreetype-dev \
libjxl-dev
FreeBSD
pkg install gtk3 fribidi harfbuzz libxpm libthai pkgconf tiff webp \
giflib freetype2 libheif Xrandr libXcomposite libXcursor \
libXft fontconfig
NetBSD
pkg install harfbuzz freetype2 png libthai jpeg tiff libheif libXft libXcursor
giflib pkg-config fribidi libjxl libwebp
OpenSUSE
zypper install gtk3-devel giflib-devel libjpeg-devel libtiff-devel
libXpm-devel libXrandr-devel libXcomposite-devel libXcursor-devel
libfribidi-devel libwebp-devel libharfbuzz-devel libthai-devel
libheif-devel libfreetype-devel libjxl-devel
Solaris

Download and install Oracle Developer Studio as the vendor-provided perl is compiled with cc, not gcc.

Cygwin

Install apt-cyg:

wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg -O /usr/bin/apt-cyg
chmod +x /usr/bin/apt-cyg

Install prerequisites:

apt-cyg install libgtk3.0-devel libfribidi-devel libgif-devel libjpeg-devel libtiff-devel libXpm-devel
libwebp-devel libharfbuzz-devel libthai-devel libheif-devel libfreetype-dev

Win32-Strawberry

Version 5.32 had the necessary libraries included, but version 5.38 does not. Install the following packages:


Win32-ActiveState

ActiveState currently doesn't support local compilations. The official answer is here:

https://community.activestate.com/t/how-to-install-gcc-and-or-mingw/10993/2

Consider migrating to Strawberry Perl.


MacOSX

You'll need homebrew, XQuartz, and a set of extra libraries.

Install homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install XQuartz:

brew install --cask xquartz

Install support libraries:

brew install libiconv libxcomposite libxrandr libxcursor libxft fribidi fontconfig
freetype giflib gtk+3 harfbuzz jpeg libpng libtiff webp libxpm libheif jpeg-xl
Note: If you plan on using Prima::OpenGL, compile Prima with WITH_HOMEBREW=0.
Note: If Prima crashes in libxft, remove libxft and install custom-built xorg libraries:
brew install dk/x11/xorg-macros dk/x11/libxft

or

brew tap linuxbrew/xorg
brew install linuxbrew/xorg/libxft

Install libthai:

brew install dk/libthai/libthai

Optional dependencies


Graphic libraries

Prima can use several graphic libraries to handle image files. Compiling Prima with at least one library (preferably for GIF files) is strongly recommended, because internal library images are stored in GIF format.

Supported libraries:

  • libXpm
  • libpng
  • libjpeg
  • libgif
  • libtiff
  • libwebp / libwebpdemux / libwebpmux
  • libheif
  • libjxl

libheif is not widespread yet. See Prima/Image/heif.pm for details.


Bidirectional input and complex scripts

To support bidirectional Unicode text input and output you need the fribidi library.

For Unix builds you will also need harfbuzz for complex scripts and font ligatures.

Prima can compile without these libraries, but support will be limited.

Thai text wrapping requires the libthai library.


GTK3 / GTK2

Building Prima with GTK3 or GTK2 on X11 installations is recommended, because Prima will then use GTK fonts, colors, and file dialogs.

perl Makefile.PL WITH_GTK2=0 WITH_GTK3=0

Source distribution installation


Create the Makefile and build:

perl Makefile.PL
make
make test
make install

You may also run:

make xtest

If perl Makefile.PL fails, the compilation history can be found in makefile.log.

If you see this error:

** No image codecs found

Then image libraries are missing from your system path.

If libraries or headers are not found, specify paths manually:

INC=-I/some/include
LIBS=-L/some/lib

Binary distribution installation


Binary distributions are available only for MSWin32. Other platforms should install from source.

perl ms_install.pl

You must manually patch Prima::Config.pm if you want to compile modules that depend on Prima.