From d28ce724a6803a4709ca9578a8d1fbab42ba68b1 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 1 May 2023 17:24:25 +0300 Subject: [PATCH] espeak-ng: fix cross --- pkgs/applications/audio/espeak-ng/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/audio/espeak-ng/default.nix b/pkgs/applications/audio/espeak-ng/default.nix index 5b558a419d1..d53c0ac1caf 100644 --- a/pkgs/applications/audio/espeak-ng/default.nix +++ b/pkgs/applications/audio/espeak-ng/default.nix @@ -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 \