summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb
blob: 0e3e9a17c627500e40a30256d7c1139b9722d803 (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
DESCRIPTION = "Whisper.cpp - Port of OpenAI's Whisper model in C++ for faster and smaller inference"
HOMEPAGE = "https://github.com/ggerganov/whisper.cpp"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1539dadbedb60aa18519febfeab70632"

SRC_URI = "git://github.com/ggerganov/whisper.cpp.git;protocol=https;branch=master"

SRCREV = "81c999fe0a25c4ebbfef10ed8a1a96df9cfc10fd"

DEPENDS = "ffmpeg openblas"

S = "${WORKDIR}/git"

inherit cmake

do_configure:prepend() {
    sed -i 's/-march=native//g' ${S}/Makefile
    sed -i 's/-mtune=native//g' ${S}/Makefile
}


# Specify the model you want to download
WHISPER_MODEL ?= "base.en"

do_compile() {
    export CXXFLAGS="${CXXFLAGS} -I${STAGING_INCDIR}/openblas"
    export LDFLAGS="${LDFLAGS} -lopenblas"
    cd ${S}
    oe_runmake GGML_OPENBLAS=1
}

do_install() {
    # Install the main binary
    install -d ${D}${bindir}
    install -m 0755 ${S}/main ${D}${bindir}/whisper-cpp
}

FILES_${PN} += "${datadir}/whisper-cpp/models/* ${datadir}/* ${bindir}/* /usr/share "
RDEPENDS:${PN} += "openblas ffmpeg"