aboutsummaryrefslogtreecommitdiff
path: root/graphics/waifu2x-converter-cpp/Makefile
blob: 85143c4738fad084d14aeb84926da5473ff68720 (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
PORTNAME=	waifu2x-converter-cpp
DISTVERSIONPREFIX=	v
DISTVERSION=	5.3.4
PORTREVISION=	1
CATEGORIES=	graphics

MAINTAINER=	jbeich@FreeBSD.org
COMMENT=	Scale and denoise images using convolutional neural networks

LICENSE=	BSD2CLAUSE MIT
LICENSE_COMB=	multi
LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/include/picojson_LICENSE.txt
LICENSE_FILE_MIT=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	${LOCALBASE}/include/CL/opencl.h:devel/opencl
LIB_DEPENDS=	libopencv_imgcodecs.so:graphics/opencv

USES=		cmake compiler:c++17-lang localbase:ldflags
USE_GITHUB=	yes
USE_LDCONFIG=	yes
GH_ACCOUNT=	DeadSix27
CMAKE_ARGS=	-DOPENCV_PREFIX:PATH="${LOCALBASE}" \
		-DOpenCL_LIBRARY:FILEPATH="${LOCALBASE}/lib/libOpenCL.so"
CMAKE_ON=	INSTALL_MODELS ENABLE_TESTS
TEST_TARGET=	test
PLIST_FILES=	bin/${PORTNAME} \
		include/w2xconv.h \
		lib/libw2xc.so
PORTDATA=	*

OPTIONS_DEFINE=	SIMD
OPTIONS_DEFAULT=SIMD

SIMD_CMAKE_OFF=	-DARMOPT:BOOL=false -DPPCOPT:BOOL=false -DX86OPT:BOOL=false

post-patch:
	@${REINPLACE_CMD} -e '/Darwin/,/FLAGS_RELEASE/d' \
		-e 's,".*\(-m[^[:space:]]*\).*","\1",' \
		-e "s/\$${TS}/`${AWK} '/TIMESTAMP/ { print \$$3 }' ${DISTINFO_FILE}`/" \
		-e '/find_program/s/git/&_disabled/' \
		-e '/GIT_BRANCH/s/null/master/' \
		-e '/GIT_COMMIT_HASH/s/000000/${DISTVERSIONSUFFIX:U&:S/^-g//}/' \
		-e '/GIT_TAG/s/v0\.0\.0/${DISTVERSIONFULL:C/-.*//}/' \
		${WRKSRC}/CMakeLists.txt
	@${REINPLACE_CMD} 's,models_rgb,${WRKSRC}/&,' ${WRKSRC}/w32-apps/runtest.c

.include <bsd.port.mk>