#Packager: Dimitris Tzemos <dijemos~at~gmail~dot~com>.

pkgname=freeimage
pkgver=3.18.0
pkgrel=1dj
source=("https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/${pkgver}/FreeImage${pkgver//./}.zip"
        010_avoid-raw-literal.diff)
slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"FreeImage (image library)"
"FreeImage is an Open Source library project for developers who"
"want to support popular graphics image formats like PNG, BMP,"
"JPEG, TIFF and others needed by today's multimedia applications."
"FreeImage is easy to use, fast, and multithreading safe."
"FreeImagePlus is a C++ wrapper for FreeImage."
""
"Homepage: http://freeimage.sourceforge.net/"
)


build() {
cd FreeImage

# Patch in order to compile on gcc >= 5.1 environments
# Thanks to Christoph Willing
#patch -p0 < $SRC/010_avoid-raw-literal.diff || return 1
CFLAGS="$SLKCFLAGS -fexceptions -fvisibility=hidden -DNO_LCMS" \
CXXFLAGS="$SLKCFLAGS -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy" \
make INSTALLDIR=$PKG/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG || return 1
make install INSTALLDIR=$PKG/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG || return 1

CFLAGS="$SLKCFLAGS -fexceptions -fvisibility=hidden -DNO_LCMS" \
CXXFLAGS="$SLKCFLAGS -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy" \
make -f Makefile.fip INSTALLDIR=$PKG/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG || return 1
make -f Makefile.fip install INSTALLDIR=$PKG/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG || return 1

} 
