summaryrefslogtreecommitdiff
path: root/graphics/freeimage/Makefile.common
blob: fab0062be153682b084fca82a4ad5d5628e9d3ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $NetBSD: Makefile.common,v 1.5 2022/12/13 13:34:48 jperkin Exp $
# used by graphics/freeimage/Makefile
# used by graphics/freeimageplus/Makefile

# Remember to bump both PKGNAMEs when you change this.
DISTNAME=	FreeImage3180
CATEGORIES=	graphics
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=freeimage/}
EXTRACT_SUFX=	.zip

HOMEPAGE=	https://freeimage.sourceforge.io/
LICENSE=	gnu-gpl-v2 OR gnu-gpl-v3 OR mpl-1.0

USE_LANGUAGES+=	c c++11
USE_TOOLS+=	gmake pkg-config

WRKSRC=		${WRKDIR}/FreeImage

MAKE_FLAGS+=	INCDIR=${DESTDIR}/${PREFIX}/include
MAKE_FLAGS+=	INSTALLDIR=${DESTDIR}/${PREFIX}/lib

PATCHDIR=	${.CURDIR}/../../graphics/freeimage/patches
DISTINFO_FILE=	${.CURDIR}/../../graphics/freeimage/distinfo

INSTALLATION_DIRS+=	include lib share/doc/${PKGBASE}

# Systems that use unzip from pkgsrc end up with DOS line endings, so
# we need to ensure files can be patched.
SUBST_CLASSES+=		cr
SUBST_STAGE.cr=		post-extract
SUBST_FILES.cr+=	Source/FreeImage/PluginBMP.cpp
SUBST_FILES.cr+=	Source/FreeImage/PluginDDS.cpp
SUBST_FILES.cr+=	Source/FreeImage/PluginTIFF.cpp
SUBST_FILTER_CMD.cr=	${TR} -d '\r'
SUBST_NOOP_OK.cr=	yes

pre-configure:
	# G3 and JPEGTransform can't be built,
	# due to using private headers in bundled libs
	cd ${WRKSRC} && ${RM} -r Source/Lib* \
	    Source/ZLib \
	    Source/OpenEXR \
	    Source/FreeImage/PluginG3.cpp \
	    Source/FreeImage/PluginJXR.cpp \
	    Source/FreeImageToolkit/JPEGTransform.cpp
	cd ${WRKSRC} && ${SH} gensrclist.sh
	cd ${WRKSRC} && ${SH} genfipsrclist.sh
	${SED} \
	    -e 's| \./Source/FreeImage/PluginG3\.cpp||g' \
	    -e 's| \./Source/FreeImage/PluginJXR\.cpp||g' \
	    -e 's| \./Source/FreeImageToolkit/JPEGTransform\.cpp||g' \
	    ${WRKSRC}/Makefile.srcs > ${WRKSRC}/Makefile.srcs.new
	${MV} ${WRKSRC}/Makefile.srcs.new ${WRKSRC}/Makefile.srcs

PLIST_SUBST+=	PKGVERSION_NOREV=${PKGVERSION_NOREV}

NOT_FOR_PLATFORM=	Darwin-*-*

.include "../../graphics/libraw/buildlink3.mk"
.include "../../graphics/libwebp/buildlink3.mk"
.include "../../graphics/openexr/buildlink3.mk"
.include "../../graphics/openjpeg/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
BUILDLINK_API_DEPENDS.tiff+=	tiff>=4.4.0
.include "../../graphics/tiff/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"