Skip to content

Commit d7cd3e5

Browse files
committed
sci-ml/lemonade: pin flm.npu_bin on 11.0.0 and 9999
Propagate the 11.5.0-r1 flm.npu_bin config-seed pin to the remaining versions. 11.0.0 and 9999 carry the identical flm resolver: find_flm_in_path() consults PATH only when flm.prefer_system is set, so a bare /usr/bin/flm is invisible by default and lemond reports the NPU backend "supported but not installed" (and would re-download the flm NPU runtime). Both defaults.json carry an flm section, so the has() guard passes. Same edits as 11.5.0-r1: add the flm npu_bin pin to the jqf block, system-fastflowlm to the app-misc/jq BDEPEND, and correct the pkg_postinst elog/ewarn. 11.0.0 is revbumped to r1 (installed content changes); 9999's elog/ewarn drop the version-specific "11.x" wording since it tracks HEAD.
1 parent bc93056 commit d7cd3e5

2 files changed

Lines changed: 54 additions & 18 deletions

File tree

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ DEPEND="${RDEPEND}"
7676
BDEPEND="
7777
>=dev-build/cmake-3.12
7878
virtual/pkgconfig
79+
system-fastflowlm? ( app-misc/jq )
7980
system-llamacpp? ( app-misc/jq )
8081
system-whispercpp? ( app-misc/jq )
8182
system-sdcpp? ( app-misc/jq )
@@ -248,7 +249,9 @@ src_install() {
248249
# constraint and pkg_postinst tells the user to build the package with the
249250
# backend they want. whispercpp's section has no vulkan_bin key (only
250251
# cpu/npu), so it MUST route via cpu_bin whatever the build -- do not
251-
# "correct" it to vulkan. kokoro has no `backend` key at all (CPU-only).
252+
# "correct" it to vulkan. kokoro has no `backend` key at all (CPU-only);
253+
# flm likewise pins only npu_bin -- its resolver hardcodes the single npu
254+
# backend, so there is no `backend` key to route.
252255
# backend/*_bin keys recur across sections -> edit by key with jq, not sed.
253256
# The has() guard fails the build loudly if a future lemonade renames or
254257
# moves a section (jq would otherwise auto-vivify a stray key and lemond
@@ -273,6 +276,15 @@ src_install() {
273276
jqf+=( '.kokoro.cpu_bin="/usr/bin/koko"' )
274277
sections+=( kokoro )
275278
fi
279+
if use system-fastflowlm; then
280+
# flm's resolver is npu_bin override -> PATH (ONLY when flm.prefer_system
281+
# is set) -> Lemonade-managed download. A bare flm on PATH is invisible
282+
# without prefer_system, so pin the override to the packaged binary; else
283+
# lemond reports the NPU backend "supported but not installed" and
284+
# re-downloads the flm NPU runtime on first use. verified 2026-07-25
285+
jqf+=( '.flm.npu_bin="/usr/bin/flm"' )
286+
sections+=( flm )
287+
fi
276288
if [[ ${#jqf[@]} -gt 0 ]]; then
277289
# Pin the CONFIG-SEED template, /usr/share/lemonade/defaults.json --
278290
# NOT /usr/share/lemonade-server/resources/defaults.json. lemond ships
@@ -411,15 +423,21 @@ pkg_postinst() {
411423
elog ""
412424
fi
413425
if use system-fastflowlm; then
414-
elog "USE=system-fastflowlm enabled — the NPU runtime is provided by"
415-
elog "sci-ml/fastflowlm (flm on PATH; lemond resolves it there, no"
416-
elog "runtime fetch). Confirm 'flm validate' passes before lemonade"
417-
elog "drives the NPU backend."
426+
elog "system-fastflowlm: the NPU runtime is provided by sci-ml/fastflowlm."
427+
elog "The config seed pins flm.npu_bin=/usr/bin/flm, so a fresh config"
428+
elog "reuses it with no runtime fetch. A bare flm on PATH is NOT auto-used"
429+
elog "-- 11.x gates PATH resolution behind flm.prefer_system -- so an"
430+
elog "EXISTING ~/.cache/lemonade/config.json (which the rebuild does not"
431+
elog "touch) still shows the NPU backend as \"supported but not installed\""
432+
elog "until you set the pin by hand:"
433+
elog " lemonade config set flm.npu_bin=/usr/bin/flm"
434+
elog "Confirm 'flm validate' passes before lemonade drives the NPU backend."
418435
else
419436
ewarn "Without USE=system-fastflowlm, lemond 11.x auto-downloads the FastFlowLM"
420-
ewarn "(flm) NPU runtime into ~/.cache/lemonade on first NPU use -- it"
421-
ewarn "resolves flm as config-override -> PATH -> download, so a packaged"
422-
ewarn "flm on PATH wins. Enable USE=system-fastflowlm (sci-ml/fastflowlm) to"
423-
ewarn "use the packaged runtime and skip that fetch."
437+
ewarn "(flm) NPU runtime into ~/.cache/lemonade on first NPU use. It resolves"
438+
ewarn "flm as flm.npu_bin override -> PATH (only when flm.prefer_system is"
439+
ewarn "set) -> download; a bare flm on PATH is NOT used by default. Enable"
440+
ewarn "USE=system-fastflowlm (sci-ml/fastflowlm), which pins"
441+
ewarn "flm.npu_bin=/usr/bin/flm, to reuse the packaged runtime and skip the fetch."
424442
fi
425443
}

sci-ml/lemonade/lemonade-9999.ebuild

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ DEPEND="${RDEPEND}"
7777
BDEPEND="
7878
>=dev-build/cmake-3.12
7979
virtual/pkgconfig
80+
system-fastflowlm? ( app-misc/jq )
8081
system-llamacpp? ( app-misc/jq )
8182
system-whispercpp? ( app-misc/jq )
8283
system-sdcpp? ( app-misc/jq )
@@ -245,7 +246,9 @@ src_install() {
245246
# constraint and pkg_postinst tells the user to build the package with the
246247
# backend they want. whispercpp's section has no vulkan_bin key (only
247248
# cpu/npu), so it MUST route via cpu_bin whatever the build -- do not
248-
# "correct" it to vulkan. kokoro has no `backend` key at all (CPU-only).
249+
# "correct" it to vulkan. kokoro has no `backend` key at all (CPU-only);
250+
# flm likewise pins only npu_bin -- its resolver hardcodes the single npu
251+
# backend, so there is no `backend` key to route.
249252
# backend/*_bin keys recur across sections -> edit by key with jq, not sed.
250253
# The has() guard fails the build loudly if a future lemonade renames or
251254
# moves a section (jq would otherwise auto-vivify a stray key and lemond
@@ -270,6 +273,15 @@ src_install() {
270273
jqf+=( '.kokoro.cpu_bin="/usr/bin/koko"' )
271274
sections+=( kokoro )
272275
fi
276+
if use system-fastflowlm; then
277+
# flm's resolver is npu_bin override -> PATH (ONLY when flm.prefer_system
278+
# is set) -> Lemonade-managed download. A bare flm on PATH is invisible
279+
# without prefer_system, so pin the override to the packaged binary; else
280+
# lemond reports the NPU backend "supported but not installed" and
281+
# re-downloads the flm NPU runtime on first use. verified 2026-07-25
282+
jqf+=( '.flm.npu_bin="/usr/bin/flm"' )
283+
sections+=( flm )
284+
fi
273285
if [[ ${#jqf[@]} -gt 0 ]]; then
274286
# Pin the CONFIG-SEED template, /usr/share/lemonade/defaults.json --
275287
# NOT /usr/share/lemonade-server/resources/defaults.json. lemond ships
@@ -410,15 +422,21 @@ pkg_postinst() {
410422
elog ""
411423
fi
412424
if use system-fastflowlm; then
413-
elog "USE=system-fastflowlm enabled — the NPU runtime is provided by"
414-
elog "sci-ml/fastflowlm (flm on PATH; lemond resolves it there, no"
415-
elog "runtime fetch). Confirm 'flm validate' passes before lemonade"
416-
elog "drives the NPU backend."
425+
elog "system-fastflowlm: the NPU runtime is provided by sci-ml/fastflowlm."
426+
elog "The config seed pins flm.npu_bin=/usr/bin/flm, so a fresh config"
427+
elog "reuses it with no runtime fetch. A bare flm on PATH is NOT auto-used"
428+
elog "-- lemond gates PATH resolution behind flm.prefer_system -- so an"
429+
elog "EXISTING ~/.cache/lemonade/config.json (which the rebuild does not"
430+
elog "touch) still shows the NPU backend as \"supported but not installed\""
431+
elog "until you set the pin by hand:"
432+
elog " lemonade config set flm.npu_bin=/usr/bin/flm"
433+
elog "Confirm 'flm validate' passes before lemonade drives the NPU backend."
417434
else
418435
ewarn "Without USE=system-fastflowlm, lemond auto-downloads the FastFlowLM"
419-
ewarn "(flm) NPU runtime into ~/.cache/lemonade on first NPU use -- it"
420-
ewarn "resolves flm as config-override -> PATH -> download, so a packaged"
421-
ewarn "flm on PATH wins. Enable USE=system-fastflowlm (sci-ml/fastflowlm) to"
422-
ewarn "use the packaged runtime and skip that fetch."
436+
ewarn "(flm) NPU runtime into ~/.cache/lemonade on first NPU use. It resolves"
437+
ewarn "flm as flm.npu_bin override -> PATH (only when flm.prefer_system is"
438+
ewarn "set) -> download; a bare flm on PATH is NOT used by default. Enable"
439+
ewarn "USE=system-fastflowlm (sci-ml/fastflowlm), which pins"
440+
ewarn "flm.npu_bin=/usr/bin/flm, to reuse the packaged runtime and skip the fetch."
423441
fi
424442
}

0 commit comments

Comments
 (0)