nixpkgs/pkgs/applications/audio/espeak/edit.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

61 lines
1.6 KiB
Nix

{ lib, stdenv, fetchurl, pkgconfig, unzip, portaudio, wxGTK, sox }:
stdenv.mkDerivation rec {
name = "espeakedit-1.48.03";
src = fetchurl {
url = "mirror://sourceforge/espeak/${name}.zip";
sha256 = "0x8s7vpb7rw5x37yjzy1f98m4f2csdg89libb74fm36gn8ly0hli";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ unzip portaudio wxGTK ];
# TODO:
# Uhm, seems like espeakedit still wants espeak-data/ in $HOME, even thought
# it should use $espeak/share/espeak-data. Have to contact upstream to get
# this fixed.
#
# Workaround:
# cp -r $(nix-build -A espeak)/share/espeak-data ~
# chmod +w ~/espeak-data
patches = [
./gcc6.patch
./espeakedit-fix-makefile.patch
./espeakedit-configurable-sox-path.patch
./espeakedit-configurable-path-espeak-data.patch
./espeakedit-gcc6.patch
];
postPatch = ''
# Disable -Wall flag because it's noisy
sed -i "s/-Wall//g" src/Makefile
# Fixup paths (file names from above espeak-configurable* patches)
for file in src/compiledata.cpp src/readclause.cpp src/speech.h; do
sed -e "s|@sox@|${sox}/bin/sox|" \
-e "s|@prefix@|$out|" \
-i "$file"
done
'' + stdenv.lib.optionalString (portaudio.api_version == 19) ''
cp src/portaudio19.h src/portaudio.h
'';
buildPhase = ''
make -C src
'';
installPhase = ''
mkdir -p "$out/bin"
cp src/espeakedit "$out/bin"
'';
meta = with lib; {
description = "Phoneme editor for espeak";
homepage = "http://espeak.sourceforge.net/";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}