2022-06-16 17:23:12 +00:00
|
|
|
{ config, lib, stdenv, autoreconfHook, fetchFromGitHub, fetchpatch
|
|
|
|
, pkg-config, makeWrapper
|
2021-10-04 12:37:57 +00:00
|
|
|
, alsa-lib, alsa-plugins, libtool, icu, pcre2
|
2020-04-24 23:36:52 +00:00
|
|
|
, pulseaudioSupport ? config.pulseaudio or false, libpulseaudio }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mimic";
|
2021-10-04 12:37:57 +00:00
|
|
|
version = "1.3.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MycroftAI";
|
2021-10-17 09:34:42 +00:00
|
|
|
repo = "mimic1";
|
|
|
|
rev = version;
|
2021-10-04 12:37:57 +00:00
|
|
|
sha256 = "1agwgby9ql8r3x5rd1rgx3xp9y4cdg4pi3kqlz3vanv9na8nf3id";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for -fno-common toolchains:
|
|
|
|
# https://github.com/MycroftAI/mimic1/pull/216
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common";
|
|
|
|
url = "https://github.com/MycroftAI/mimic1/commit/77b36eaeb2c38eba571b8db7e9bb0fd507774e6d.patch";
|
|
|
|
sha256 = "0n3hqrfpbdp44y0c8bq55ay9m4c96r09k18hjxka4x54j5c7lw1m";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2021-10-04 12:37:57 +00:00
|
|
|
makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
alsa-lib
|
2021-10-04 12:37:57 +00:00
|
|
|
alsa-plugins
|
2020-04-24 23:36:52 +00:00
|
|
|
libtool
|
|
|
|
icu
|
2021-10-04 12:37:57 +00:00
|
|
|
pcre2
|
2021-01-17 00:15:33 +00:00
|
|
|
] ++ lib.optional pulseaudioSupport libpulseaudio;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2023-02-16 17:41:37 +00:00
|
|
|
# Needed with GCC 12
|
|
|
|
"-Wno-error=free-nonheap-object"
|
|
|
|
];
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/mimic \
|
|
|
|
--run "export ALSA_PLUGIN_DIR=${alsa-plugins}/lib/alsa-lib"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Mycroft's TTS engine, based on CMU's Flite (Festival Lite)";
|
|
|
|
homepage = "https://mimic.mycroft.ai/";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.free;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = [ lib.maintainers.noneucat ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|