freebsd-ports/graphics/devil/Makefile

111 lines
3.2 KiB
Makefile
Raw Normal View History

# Created by: Andreas Kohn <andreas@syndrom23.de>
# $FreeBSD$
PORTNAME= devil
PORTVERSION= 1.7.8
PORTEPOCH= 1
PORTREVISION= 17
CATEGORIES= graphics
MASTER_SITES= SF/openil/DevIL/${PORTVERSION}
DISTNAME= DevIL-${PORTVERSION}
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Full featured cross-platform image library
USES= pkgconfig libtool
USE_AUTOTOOLS= aclocal autoheader automake autoconf
ACLOCAL_ARGS= -I m4 -I ${LOCALBASE}/share/aclocal
AUTOMAKE_ARGS= --add-missing --copy --force-missing
CONFIGURE_ARGS= --enable-ILU \
--disable-allegro --disable-directx8 --disable-directx9 \
--without-libsquish
USE_LDCONFIG= yes
USE_GCC= any
WRKSRC= ${WRKDIR}/${DISTNAME:tl}
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
PORTDOCS= *
# With EXR the library is not usable from plain C (instant segfault)
OPTIONS_DEFINE= JPEG JASPER LCMS MNG PNG TIFF EXR X11 SDL NVTT SIMD DOCS
OPTIONS_DEFAULT=JPEG JASPER LCMS MNG PNG TIFF X11 SDL NVTT
OPTIONS_DEFAULT_amd64=SIMD
JPEG_DESC= Enable JPEG support
JASPER_DESC= Enable JPEG2000 support
LCMS_DESC= Enable LCMS support
MNG_DESC= Enable MNG support
PNG_DESC= Enable PNG support
TIFF_DESC= Enable TIFF support
EXR_DESC= Enable EXR support
X11_DESC= Enable X11 support
SDL_DESC= Enable SDL support
SQUISH_DESC= Enable DXT compression via libsquish
NVTT_DESC= Enable NVidia texture tools support
SIMD_DESC= Enable SIMD autodetection (AltiVec, SSE3,...)
JPEG_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg
JPEG_CONFIGURE_ENABLE= jpeg
JASPER_LIB_DEPENDS= libjasper.so:${PORTSDIR}/graphics/jasper
JASPER_CONFIGURE_ENABLE=jp2
LCMS_LIB_DEPENDS= liblcms.so:${PORTSDIR}/graphics/lcms
LCMS_CONFIGURE_ENABLE= lcms
MNG_LIB_DEPENDS= libmng.so:${PORTSDIR}/graphics/libmng
MNG_CONFIGURE_ENABLE= mng
PNG_LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png
PNG_CONFIGURE_ENABLE= png
TIFF_LIB_DEPENDS= libtiff.so:${PORTSDIR}/graphics/tiff
TIFF_CONFIGURE_ENABLE= tiff
EXR_LIB_DEPENDS= libIlmImf.so:${PORTSDIR}/graphics/OpenEXR
EXR_CONFIGURE_ENABLE= exr
#SQUISH_BUILD_DEPENDS= ${LOCALBASE}/lib/libsquish.a:${PORTSDIR}/graphics/squish
#SQUISH_CONFIGURE_WITH= libsquish
NVTT_LIB_DEPENDS= libnvtt.so:${PORTSDIR}/graphics/nvidia-texture-tools
NVTT_CONFIGURE_WITH= nvtt
.include <bsd.port.options.mk>
.if ! ${PORT_OPTIONS:MPNG}
CONFIGURE_ENV+= libpng_app=no
.endif
.if ${PORT_OPTIONS:MX11}
USE_GL= glut
CONFIGURE_ARGS+=--enable-ILUT
PLIST_SUB+= X11=""
.else
CONFIGURE_ARGS+=--disable-opengl --disable-x11 --disable-xpm --disable-shm
PLIST_SUB+= X11="@comment "
.endif
.if ${PORT_OPTIONS:MSDL}
USE_SDL= sdl
.else
CONFIGURE_ARGS+=--disable-sdl
.endif
.if ! ${PORT_OPTIONS:MSIMD}
CONFIGURE_ARGS+=--disable-altivec --disable-sse --disable-sse2 --disable-sse3
.endif
post-patch:
@${REINPLACE_CMD} -e '/^SUBDIRS/s|docs||g' ${WRKSRC}/Makefile.am
Add 4 new sed commands to USES=libtool. The first two apply some of the changes that Debian made to their libtool. The first command applies to libtool versions 1.4 and up. The second command is somewhat more elaborate but essentially it uses the sed hold space to move an "elif...fi" block down. It applies to 2.x. Together these reduce overlinking to unpatched .la files (from ports that don't have USES=libtool yet but also .la files in the work directory). The third and fourth command fix relinking. During staging libtool may relink libA when it links to another library in the work directory libB. The reason is that libA created during build phase has its runpath set to the location of libB in the work directory. This allows running an executable that links to libA from within the work directory. The relink removes this extra runpath. When libtool relinks libA it replaces "libB.la" on the linker command line with "-L${STAGEDIR}${PREFIX}/lib -lB" with the intention to link to libB in the stage directory but this -L flag isn't necessarily the first so another libB may be linked instead. The two sed commands make relink the same as a normal link. This means libtool will relink with libraries from the work directory using a path similar to "../srcB/.libs/libB.so" without -L flags. This applies to libtool 1.4 and up. Earlier versions don't seem to relink libraries. (This fixes ports like devel/apr1 so they link with freshly built libraries instead of installed libraries.) Fix all ports with missing libraries. Additionally: archivers/rpm4: USES=patchfix. databases/gdbm: INSTALL_TARGET=install-strip. devel/gnome-vfs: remove patch that doesn't change anything. devel/ois: INSTALL_TARGET=install-strip and use standard USE_AUTOTOOLS. devel/zziplib: INSTALL_TARGET=install-strip, MAKE_CMD. multimedia/mjpegtools: remove USE_AUTOTOOLS, use modern compiler on i386 instead of disabling optimisations. net/libnetdude: disable static plugins. PR: 190941 Exp-run: antoine Approved by: portmgr (antoine)
2014-06-22 12:44:29 +02:00
@${REINPLACE_CMD} -e '/^ilur_LDADD =/s|$$| $$(il_library)|' \
${WRKSRC}/bin/Makefile.am
@${REINPLACE_CMD} -e '/^pkgdir=/s|$$(libdir)/|$$(prefix)/libdata/|g' \
${WRKSRC}/data/Makefile.am
@${REINPLACE_CMD} -e 's|<malloc\.h>|<stdlib.h>|g' \
${WRKSRC}/src-ILU/ilur/ilur.c
post-install:
@${RMDIR} ${STAGEDIR}${DATADIR}/examples
${MKDIR} ${STAGEDIR}${DOCSDIR}
.for file in AUTHORS CREDITS ChangeLog Libraries.txt README TODO
${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR}
.endfor
.include <bsd.port.mk>