Unverified Commit 588f2fd0 authored by Artturi's avatar Artturi Committed by GitHub
Browse files

Merge pull request #229302 from Artturin/espeakcrossfix1

parents 8e704089 d28ce724
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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 \