tecoc: add BSD and Darwin/OSX support

Also, change some minor things.
This commit is contained in:
AndersonTorres 2018-12-05 22:27:45 -02:00
parent 420d022254
commit c1a9af12a1

View File

@ -1,4 +1,4 @@
{ stdenv, fetchgit { stdenv, fetchFromGitHub
, ncurses }: , ncurses }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -6,20 +6,27 @@ stdenv.mkDerivation rec {
name = "tecoc-git-${version}"; name = "tecoc-git-${version}";
version = "20150606"; version = "20150606";
src = fetchgit { src = fetchFromGitHub {
url = "https://github.com/blakemcbride/TECOC.git"; owner = "blakemcbride";
repo = "TECOC";
rev = "d7dffdeb1dfb812e579d6d3b518545b23e1b50cb"; rev = "d7dffdeb1dfb812e579d6d3b518545b23e1b50cb";
sha256 = "11zfa73dlx71c0hmjz5n3wqcvk6082rpb4sss877nfiayisc0njj"; sha256 = "11zfa73dlx71c0hmjz5n3wqcvk6082rpb4sss877nfiayisc0njj";
}; };
buildInputs = [ ncurses ]; buildInputs = [ ncurses ];
configurePhase = '' makefile = if stdenv.hostPlatform.isDarwin
cp src/makefile.linux src/Makefile then "makefile.osx"
''; else if stdenv.hostPlatform.isFreeBSD
buildPhase = '' then "makefile.bsd"
make CC=${stdenv.cc}/bin/cc -C src/ 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...
makeFlags = [ "CC=${stdenv.cc}/bin/cc" "-C src/" ];
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/doc/${name} $out/lib/teco/macros mkdir -p $out/bin $out/share/doc/${name} $out/lib/teco/macros
cp src/tecoc $out/bin cp src/tecoc $out/bin
@ -31,26 +38,26 @@ stdenv.mkDerivation rec {
ln -s tecoc teco ln -s tecoc teco
ln -s tecoc Inspect ) ln -s tecoc Inspect )
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A clone of the good old TECO editor"; description = "A clone of the good old TECO editor";
longDescription = '' longDescription = ''
For those who don't know: TECO is the acronym of Tape Editor and For those who don't know: TECO is the acronym of Tape Editor and COrrector
COrrector (because it was a paper tape edition tool in its debut (because it was a paper tape edition tool in its debut days). Now the
days). Now the acronym follows after Text Editor and Corrector, acronym follows after Text Editor and Corrector, or Text Editor
or Text Editor Character-Oriented. Character-Oriented.
TECO is a character-oriented text editor, originally developed TECO is a character-oriented text editor, originally developed by Dan
bu Dan Murphy at MIT circa 1962. It is also a Turing-complete Murphy at MIT circa 1962. It is also a Turing-complete imperative
imperative interpreted programming language for text interpreted programming language for text manipulation, done via
manipulation, done via user-loaded sets of macros. In fact, Emacs user-loaded sets of macros. In fact, the venerable Emacs was born as a set
was born as a set of Editor MACroS for TECO. of Editor MACroS for TECO.
TECOC is a portable C implementation of TECO-11. TECOC is a portable C implementation of TECO-11.
''; '';
homepage = https://github.com/blakemcbride/TECOC; homepage = https://github.com/blakemcbride/TECOC;
license = { url = https://github.com/blakemcbride/TECOC/tree/master/doc/readme-1st.txt; };
maintainers = [ maintainers.AndersonTorres ]; maintainers = [ maintainers.AndersonTorres ];
platforms = platforms.linux; platforms = platforms.unix;
}; };
} }
# TODO: test in other platforms - especially Darwin