2021-01-18 22:36:30 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ncurses
|
|
|
|
}:
|
2016-07-31 20:22:26 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-01-18 22:36:30 +00:00
|
|
|
pname = "tecoc";
|
|
|
|
version = "unstable-2020-11-03";
|
2016-07-31 20:22:26 +01:00
|
|
|
|
2018-12-06 00:27:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "blakemcbride";
|
|
|
|
repo = "TECOC";
|
2021-01-18 22:36:30 +00:00
|
|
|
rev = "79fcb6cfd6c5f9759f6ec46aeaf86d5806b13a0b";
|
|
|
|
sha256 = "sha256-JooLvoh9CxLHLOXXxE7zA7R9yglr9BGUwX4nrw2/vIw=";
|
2016-07-31 20:22:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
2018-12-06 00:27:45 +00:00
|
|
|
makefile = if stdenv.hostPlatform.isDarwin
|
2021-01-18 22:36:30 +00:00
|
|
|
then "makefile.osx"
|
|
|
|
else if stdenv.hostPlatform.isFreeBSD
|
|
|
|
then "makefile.bsd"
|
|
|
|
else if stdenv.hostPlatform.isOpenBSD
|
|
|
|
then "makefile.bsd"
|
|
|
|
else if stdenv.hostPlatform.isWindows
|
|
|
|
then "makefile.win"
|
|
|
|
else "makefile.linux"; # I think Linux is a safe default...
|
2018-12-06 00:27:45 +00:00
|
|
|
|
|
|
|
makeFlags = [ "CC=${stdenv.cc}/bin/cc" "-C src/" ];
|
|
|
|
|
2021-01-18 22:36:30 +00:00
|
|
|
preInstall = ''
|
|
|
|
install -d $out/bin $out/share/doc/${pname}-${version} $out/lib/teco/macros
|
|
|
|
'';
|
|
|
|
|
2016-07-31 20:22:26 +01:00
|
|
|
installPhase = ''
|
2021-01-18 22:36:30 +00:00
|
|
|
runHook preInstall
|
|
|
|
install -m755 src/tecoc $out/bin
|
|
|
|
install -m644 src/aaout.txt doc/* $out/share/doc/${pname}-${version}
|
|
|
|
install -m644 lib/* lib2/* $out/lib/teco/macros
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2016-07-31 20:22:26 +01:00
|
|
|
(cd $out/bin
|
|
|
|
ln -s tecoc Make
|
|
|
|
ln -s tecoc mung
|
|
|
|
ln -s tecoc teco
|
|
|
|
ln -s tecoc Inspect )
|
|
|
|
'';
|
2018-12-06 00:27:45 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-07-31 20:22:26 +01:00
|
|
|
description = "A clone of the good old TECO editor";
|
|
|
|
longDescription = ''
|
2018-12-06 00:27:45 +00:00
|
|
|
For those who don't know: TECO is the acronym of Tape Editor and COrrector
|
|
|
|
(because it was a paper tape edition tool in its debut days). Now the
|
|
|
|
acronym follows after Text Editor and Corrector, or Text Editor
|
|
|
|
Character-Oriented.
|
|
|
|
|
|
|
|
TECO is a character-oriented text editor, originally developed by Dan
|
|
|
|
Murphy at MIT circa 1962. It is also a Turing-complete imperative
|
|
|
|
interpreted programming language for text manipulation, done via
|
|
|
|
user-loaded sets of macros. In fact, the venerable Emacs was born as a set
|
|
|
|
of Editor MACroS for TECO.
|
2016-07-31 20:22:26 +01:00
|
|
|
|
|
|
|
TECOC is a portable C implementation of TECO-11.
|
2021-01-18 22:36:30 +00:00
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/blakemcbride/TECOC";
|
2021-01-18 22:36:30 +00:00
|
|
|
license = {
|
|
|
|
url = "https://github.com/blakemcbride/TECOC/tree/master/doc/readme-1st.txt";
|
|
|
|
};
|
2016-07-31 20:22:26 +01:00
|
|
|
maintainers = [ maintainers.AndersonTorres ];
|
2018-12-06 00:27:45 +00:00
|
|
|
platforms = platforms.unix;
|
2016-07-31 20:22:26 +01:00
|
|
|
};
|
|
|
|
}
|