aboutsummaryrefslogtreecommitdiff
path: root/graphics/openexr/Makefile
blob: 9508428b37f9c72ea9f9fdffc01fcb353aa28f5a (plain) (blame)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
PORTNAME?=	openexr
PORTVERSION=	3.2.4
PORTREVISION?=	0
CATEGORIES=	graphics devel
.if !defined(MASTERDIR)
MASTER_SITES=	https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr-images/v1.0/:testimages \
		https://github.com/AcademySoftwareFoundation/openexr/releases/download/v${PORTVERSION}/:DEFAULT \
		LOCAL/mandree/openexr/:DEFAULT \
		LOCAL/mandree/openexr/:testimages
DISTFILES=	${EXTRACT_ONLY}:DEFAULT
DISTFILES+=	Beachball/multipart.0001.exr:testimages
DISTFILES+=	Beachball/singlepart.0001.exr:testimages
DISTFILES+=	Chromaticities/Rec709_YC.exr:testimages
DISTFILES+=	Chromaticities/Rec709.exr:testimages
DISTFILES+=	Chromaticities/XYZ_YC.exr:testimages
DISTFILES+=	Chromaticities/XYZ.exr:testimages
DISTFILES+=	LuminanceChroma/Flowers.exr:testimages
DISTFILES+=	LuminanceChroma/Garden.exr:testimages
DISTFILES+=	MultiResolution/ColorCodedLevels.exr:testimages
DISTFILES+=	MultiResolution/WavyLinesCube.exr:testimages
DISTFILES+=	MultiResolution/WavyLinesLatLong.exr:testimages
DISTFILES+=	MultiView/Adjuster.exr:testimages
DISTFILES+=	TestImages/GammaChart.exr:testimages
DISTFILES+=	TestImages/GrayRampsHorizontal.exr:testimages
DISTFILES+=	v2/LeftView/Balls.exr:testimages
DISTFILES+=	v2/Stereo/Trunks.exr:testimages
.endif
DIST_SUBDIR=	openexr # hardcode - not using ${PORTNAME} - so we can share the distdir with openexr-website-docs, avoiding double download of ...
EXTRACT_ONLY=	openexr-v${PORTVERSION}${EXTRACT_SUFX}
NO_WRKSUBDIR=	yes

MAINTAINER=	mandree@FreeBSD.org
COMMENT=	High dynamic-range (HDR) image file format
WWW=		https://www.openexr.com/

LICENSE=	BSD3CLAUSE

BUILD_DEPENDS?=	help2man:misc/help2man
# exact libImath version required to avoid hard-to-debug issues
LIB_DEPENDS?=	libImath-3_1.so.29:math/Imath \
		libdeflate.so:archivers/libdeflate

USES?=		cmake:testing compiler:c++14-lang cpe pathfix pkgconfig

#USE_GITHUB=	yes
#GH_TUPLE=	AcademySoftwareFoundation:openexr:v${PORTVERSION}

USE_LDCONFIG=	yes

CMAKE_TESTING_ON=	BUILD_TESTING \
			OPENEXR_TEST_LIBRARIES \
			OPENEXR_TEST_PYTHON \
			OPENEXR_TEST_TOOLS

CMAKE_OFF=	BUILD_TESTING \
		OPENEXR_TEST_LIBRARIES \
		OPENEXR_TEST_PYTHON \
		OPENEXR_TEST_TOOLS

CMAKE_ARGS?=	-DCMAKE_DEBUG_POSTFIX=

CPPFLAGS+=	-I.
# must be linked with -l{thr|pthread} explicitly
LDFLAGS+=	-lpthread

_MAJORVER=	3_2
_VER=		31
_REL=		${PORTVERSION}
PLIST_SUB+=	MAJORVER=${_MAJORVER} \
		VER=${_VER} \
		REL=${_REL}

PORTDOCS=	*
PORTEXAMPLES=	*

.if !defined(MASTERDIR)
OPTIONS_DEFINE=	DOCS EXAMPLES
OPTIONS_SUB=	yes
DOCS_CMAKE_BOOL=OPENEXR_INSTALL_DOCS INSTALL_DOCS

_DOCSRCDIR1=	${WRKSRC}
_DOC_FILES1=	CHANGES.md CONTRIBUTING.md GOVERNANCE.md LICENSE.md SECURITY.md \
		CODE_OF_CONDUCT.md CONTRIBUTORS.md README.md

# too many reports about compilation failures, so
# sanity check we are using the same C++ standard library
_imath_libcxx=	${COMPILER_FEATURES:Mlib*c++}

# This would be better placed in pre-test to avoid wasting space,
# but if we do that, the cmake in src/test/bin will go downloading the files,
# so we do not benefit from our checksumming and the distdir caching.
post-extract:
	${MKDIR} ${CONFIGURE_WRKSRC}/src/test/bin
.for i in ${DISTFILES:M*.exr?testimages}
	d="$$(dirname "${CONFIGURE_WRKSRC}/src/test/bin/${i:S/:testimages//}")" \
	  && ${MKDIR} "$$d" \
	  && ${CP} ${DISTDIR}/${DIST_SUBDIR}/${i:S/:testimages//} "$$d"
.endfor

pre-configure:
	@${READELF} -d ${LOCALBASE}/lib/libImath.so \
	| ${EGREP} -q '\<NEEDED\>.*\[${_imath_libcxx:C/\+/\\+/g}\.' \
	|| {	${ECHO_CMD} "*** Your Imath package uses a different C++ standard library than ***" ; \
		${ECHO_CMD} "*** OpenEXR would. Please recompile and reinstall Imath with the  ***" ; \
		${ECHO_CMD} "*** same C++ std. library before trying to build OpenEXR.  Abort. ***" ; \
		exit 1; }

post-install-EXAMPLES-on:
	${MV} \
		${STAGEDIR}${PREFIX}/share/doc/OpenEXR/examples/ ${STAGEDIR}${EXAMPLESDIR}
	@${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/OpenEXR 2>/dev/null || :

post-install-EXAMPLES-off:
	${RM} -R ${STAGEDIR}${PREFIX}/share/doc/OpenEXR/examples/
	@${RMDIR} ${STAGEDIR}${PREFIX}/share/doc/OpenEXR 2>/dev/null || :

.endif
.include <bsd.port.mk>