# Tanım: Görüntü işleme sistemi
# URL: http://www.graphicsmagick.org/
# Paketçi: Cihan_Alkan 
# Gerekler: perl jasper libpng libwmf libxml2 libtiff libwebp freetype xorg-libxext xorg-libsm lcms2
# Grup: kütüphane

isim=graphicsmagick
surum=1.3.30
devir=1


kaynak=(https://downloads.sourceforge.net/project/${isim}/${isim}/${surum}/GraphicsMagick-${surum}.tar.xz)

derle() {

	cd "${SRC}/GraphicsMagick-${surum}"
	sed -e "s:freetype_config='':freetype_config='/usr/bin/pkg-config freetype2':g" -i configure
	./configure \
		--prefix=/usr \
		--enable-shared \
		--with-modules \
		--with-perl \
		--with-gs-font-dir=/usr/share/fonts/Type1 \
		--with-quantum-depth=16 \
		--with-threads
	make

	make DESTDIR="${PKG}" install

	# Install MIT license
	install -Dm644 "Copyright.txt" "${PKG}/usr/share/licenses/${isim}/Copyright.txt"

	cd PerlMagick
	sed -i -e "s:'LDDLFLAGS'  => \"\(.*\)\":'LDDLFLAGS'  => \"-L${PKG}/usr/lib \1\":" Makefile.PL
	perl Makefile.PL INSTALLDIRS=vendor PREFIX=/usr DESTDIR="${PKG}"
	sed -i -e "s/LDLOADLIBS =/LDLOADLIBS = -lGraphicsMagick/" Makefile
	make
	make install
	rm -rf $PKG/usr/share/doc
}
