2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
2024-02-29 20:09:43 +00:00
|
|
|
, emacs
|
|
|
|
, espeak-ng
|
2021-09-18 10:52:07 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2024-02-29 20:09:43 +00:00
|
|
|
, stdenv
|
2021-09-18 10:52:07 +00:00
|
|
|
, tcl
|
|
|
|
, tclx
|
|
|
|
}:
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-05-03 17:38:23 +00:00
|
|
|
pname = "emacspeak";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "59.0";
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tvraman";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "emacspeak";
|
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-npS/wlqI7nBde/2S/rzp79jdfYXIIhgsVs5VizxEDAQ=";
|
2020-05-03 17:38:23 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
emacs
|
|
|
|
makeWrapper
|
|
|
|
];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
buildInputs = [
|
|
|
|
espeak-ng
|
|
|
|
tcl
|
|
|
|
tclx
|
|
|
|
];
|
2020-05-03 17:38:23 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
preConfigure = ''
|
|
|
|
make config
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
make -C servers/native-espeak PREFIX=$out "TCL_INCLUDE=${tcl}/include"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
make -C servers/native-espeak PREFIX=$out install
|
|
|
|
local d=$out/share/emacs/site-lisp/emacspeak/
|
|
|
|
install -d -- "$d"
|
|
|
|
cp -a . "$d"
|
|
|
|
find "$d" \( -type d -or \( -type f -executable \) \) -execdir chmod 755 {} +
|
|
|
|
find "$d" -type f -not -executable -execdir chmod 644 {} +
|
2024-02-29 20:09:43 +00:00
|
|
|
makeWrapper ${lib.getExe emacs} $out/bin/emacspeak \
|
2022-03-30 09:31:56 +00:00
|
|
|
--set DTK_PROGRAM "${placeholder "out"}/share/emacs/site-lisp/emacspeak/servers/espeak" \
|
|
|
|
--set TCLLIBPATH "${tclx}/lib" \
|
2020-05-03 17:38:23 +00:00
|
|
|
--add-flags '-l "${placeholder "out"}/share/emacs/site-lisp/emacspeak/lisp/emacspeak-setup.elc"'
|
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
meta = {
|
2020-05-15 21:57:56 +00:00
|
|
|
homepage = "https://github.com/tvraman/emacspeak/";
|
2020-05-03 17:38:23 +00:00
|
|
|
description = "Emacs extension that provides spoken output";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/tvraman/emacspeak/blob/${finalAttrs.src.rev}/etc/NEWS";
|
|
|
|
license = with lib.licenses; [ gpl2Plus ];
|
|
|
|
mainProgram = "emacspeak";
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
# Emacspeak requires a minimal Emacs version; let's use the broken flag
|
|
|
|
broken = lib.versionOlder (lib.getVersion emacs) "29.1";
|
2020-05-03 17:38:23 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|