Skip to content

Commit 58eafa5

Browse files
fix(nemo-speech-cpp): support macOS tools
Homebrew CMake 4 rejects SentencePiece's old policy floor. The pinned helper also uses GNU install's unsupported -D option on macOS. Set CMake's supported policy floor and make the license install portable before the helper runs on Darwin. Assisted-by: Codex:gpt-5.4 [Codex CLI]
1 parent 6ceec62 commit 58eafa5

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

backend/go/nemo-speech-cpp/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,17 @@ patch-itn-headers:
279279
itn: $(ITN_MARKER)
280280

281281
$(SENTENCEPIECE_MARKER): | sources/NeMo-Speech.cpp
282+
# The pinned helper uses GNU install's -D option, which BSD install on macOS
283+
# does not support. Create the directory explicitly and keep the helper's
284+
# four license installs otherwise unchanged. Homebrew CMake 4 also rejects
285+
# SentencePiece's old policy floor, so select the oldest supported floor.
286+
ifeq ($(shell uname -s),Darwin)
287+
mkdir -p $(SENTENCEPIECE_PREFIX)/share/licenses/nemo-speech/third_party/sentencepiece
288+
sed -i.bak \
289+
-e 's/install -Dm0644/install -m 0644/' \
290+
-e 's/-DCMAKE_BUILD_TYPE=Release \\/-DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \\/' \
291+
sources/NeMo-Speech.cpp/scripts/build_sentencepiece_static.sh
292+
endif
282293
cd sources/NeMo-Speech.cpp && JOBS=$(JOBS) scripts/build_sentencepiece_static.sh
283294

284295
sentencepiece: $(SENTENCEPIECE_MARKER)

0 commit comments

Comments
 (0)