espeak-ng: fix cross

This commit is contained in:
Artturin 2023-05-01 17:24:25 +03:00
parent dbe8274d2a
commit d28ce724a6

View File

@ -8,6 +8,7 @@
, pkg-config
, ronn
, substituteAll
, buildPackages
, mbrolaSupport ? true
, mbrola
, pcaudiolibSupport ? true
@ -49,6 +50,14 @@ stdenv.mkDerivation rec {
"--with-mbrola=${if mbrolaSupport then "yes" else "no"}"
];
# ref https://github.com/void-linux/void-packages/blob/3cf863f894b67b3c93e23ac7830ca46b697d308a/srcpkgs/espeak-ng/template#L29-L31
postConfigure = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
substituteInPlace Makefile \
--replace 'ESPEAK_DATA_PATH=$(CURDIR) src/espeak-ng' 'ESPEAK_DATA_PATH=$(CURDIR) ${lib.getExe buildPackages.espeak-ng}' \
--replace 'espeak-ng-data/%_dict: src/espeak-ng' 'espeak-ng-data/%_dict: ${lib.getExe buildPackages.espeak-ng}' \
--replace '../src/espeak-ng --compile' "${lib.getExe buildPackages.espeak-ng} --compile"
'';
postInstall = lib.optionalString stdenv.isLinux ''
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/espeak-ng)" $out/bin/speak-ng
wrapProgram $out/bin/espeak-ng \