summaryrefslogtreecommitdiff
path: root/audio/whisper.cpp/Makefile
blob: 757869e17f2a14b31f032d2ff553555ee08fbf16 (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
PORTNAME=	whisper.cpp
DISTVERSIONPREFIX=	v
DISTVERSION=	1.7.6
CATEGORIES=	audio # machine-learning

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Port of OpenAI's Whisper model in C/C++
WWW=		https://github.com/ggerganov/whisper.cpp

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

LIB_DEPENDS=	libggml.so:misc/ggml

USES=		cmake:testing
USE_LDCONFIG=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	ggerganov

LDFLAGS+=	-pthread

CMAKE_ON=	WHISPER_USE_SYSTEM_GGML
CMAKE_OFF=	WHISPER_BUILD_TESTS
CMAKE_TESTING_ON=	WHISPER_BUILD_TESTS \
			WHISPER_BUILD_EXAMPLES

OPTIONS_DEFINE=		EXAMPLES
OPTIONS_DEFAULT=	EXAMPLES # examples contain important user level programs
OPTIONS_SUB=		yes

EXAMPLES_CMAKE_BOOL=	WHISPER_BUILD_EXAMPLES

MAKE_JOBS_UNSAFE=	yes # for tests to suceed on smaller Vulkan devices: they fail to allocate memory otherwise

post-install:
	${INSTALL_SCRIPT} \
		${WRKSRC}/models/download-ggml-model.sh \
		${STAGEDIR}${PREFIX}/bin/${PORTNAME}-download-ggml-model.sh

# tests as of 1.7.6: 73% tests passed, 3 tests failed out of 11, see https://github.com/ggml-org/whisper.cpp/issues/3404

.include <bsd.port.mk>