streamlink: 7.1.1 -> 7.1.2 (#373269)
[NixPkgs.git] / pkgs / by-name / fl / flite / package.nix
blob514ded67728a7f132a99c933cfbeaadf5c0e51ac
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   alsa-lib,
7   libpulseaudio,
8   nix-update-script,
9   testers,
10   audioBackend ? "pulseaudio",
12 assert lib.assertOneOf "audioBackend" audioBackend [
13   "alsa"
14   "pulseaudio"
16 stdenv.mkDerivation (finalAttrs: {
17   pname = "flite";
18   version = "2.2";
20   outputs = [
21     "bin"
22     "dev"
23     "lib"
24     "out"
25   ];
27   src = fetchFromGitHub {
28     owner = "festvox";
29     repo = "flite";
30     rev = "v${finalAttrs.version}";
31     hash = "sha256-Tq5pyg3TiQt8CPqGXTyLOaGgaeLTmPp+Duw3+2VAF9g=";
32   };
34   # https://github.com/festvox/flite/pull/60.
35   # Replaces `ar` with `$(AR)` in config/common_make_rules.
36   # Improves cross-compilation compatibility.
37   patches = [
38     (fetchpatch {
39       url = "https://github.com/festvox/flite/commit/54c65164840777326bbb83517568e38a128122ef.patch";
40       hash = "sha256-hvKzdX7adiqd9D+9DbnfNdqEULg1Hhqe1xElYxNM1B8=";
41     })
42   ];
44   buildInputs = lib.optional stdenv.hostPlatform.isLinux (
45     {
46       alsa = alsa-lib;
47       pulseaudio = libpulseaudio;
48     }
49     .${audioBackend} or (throw "${audioBackend} is not a supported backend!")
50   );
52   configureFlags = [
53     "--enable-shared"
54   ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "--with-audio=${audioBackend}" ];
56   # main/Makefile creates and removes 'flite_voice_list.c' from multiple targets:
57   # make[1]: *** No rule to make target 'flite_voice_list.c', needed by 'all'.  Stop
58   enableParallelBuilding = false;
60   passthru = {
61     tests.version = testers.testVersion {
62       # `flite` does have a `--version` command, but it returns 1
63       command = "flite --help";
64       package = finalAttrs.finalPackage;
65     };
67     updateScript = nix-update-script { };
68   };
70   meta = {
71     description = "Small, fast run-time speech synthesis engine";
72     homepage = "http://www.festvox.org/flite/";
73     license = lib.licenses.bsdOriginal;
74     maintainers = with lib.maintainers; [ getchoo ];
75     mainProgram = "flite";
76   };