From b63c643631665264060c9bf31849dd6566e17e8f Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 31 May 2023 22:48:02 -0300 Subject: [PATCH] Revert "tecoc: refactor" This reverts commit a323e083c8c71a018fda346f77881b8805145a65. The old form is better for the present purposes. --- pkgs/applications/editors/tecoc/default.nix | 82 +++++++++++++++++++-- pkgs/applications/editors/tecoc/generic.nix | 49 ------------ pkgs/applications/editors/tecoc/sources.nix | 46 ------------ 3 files changed, 75 insertions(+), 102 deletions(-) delete mode 100644 pkgs/applications/editors/tecoc/generic.nix delete mode 100644 pkgs/applications/editors/tecoc/sources.nix diff --git a/pkgs/applications/editors/tecoc/default.nix b/pkgs/applications/editors/tecoc/default.nix index fda796ad455a..94889a13ef6d 100644 --- a/pkgs/applications/editors/tecoc/default.nix +++ b/pkgs/applications/editors/tecoc/default.nix @@ -1,12 +1,80 @@ -{ callPackage +{ stdenv , lib , fetchFromGitHub +, ncurses , unstableGitUpdater }: -let - inherit (import ./sources.nix { - inherit lib fetchFromGitHub unstableGitUpdater; - }) tecoc-unstable; -in -callPackage (tecoc-unstable) {} +stdenv.mkDerivation (finalAttrs: { + pname = "tecoc"; + version = "unstable-2023-04-21"; + + src = fetchFromGitHub { + owner = "blakemcbride"; + repo = "TECOC"; + rev = "021d1d15242b9d6c84d70c9ffcf1871793898f0a"; + hash = "sha256-VGIO+uiAZkdzLYmJztmnKTS4HDIVow4AimaneHj7E1M="; + }; + + buildInputs = [ ncurses ]; + + makefile = if stdenv.hostPlatform.isDarwin + 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... + + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "-C src/" ]; + + installPhase = '' + runHook preInstall + + install -d $out/bin $out/share/doc/tecoc $out/lib/teco/macros + install -m755 src/tecoc $out/bin + install -m644 src/aaout.txt doc/* $out/share/doc/tecoc + install -m644 lib/* lib2/* $out/lib/teco/macros + + runHook postInstall + ''; + + postFixup = '' + pushd $out/bin + ln -s tecoc Make + ln -s tecoc mung + ln -s tecoc teco + ln -s tecoc Inspect + popd + ''; + + passthru.updateScript = unstableGitUpdater { + url = finalAttrs.meta.homepage; + }; + + meta = { + homepage = "https://github.com/blakemcbride/TECOC"; + description = "A clone of the good old TECO editor"; + longDescription = '' + 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. + + TECOC is a portable C implementation of TECO-11. + ''; + license = { + url = "https://github.com/blakemcbride/TECOC/tree/master/doc/readme-1st.txt"; + }; + maintainers = [ lib.maintainers.AndersonTorres ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/applications/editors/tecoc/generic.nix b/pkgs/applications/editors/tecoc/generic.nix deleted file mode 100644 index 0f84355021d6..000000000000 --- a/pkgs/applications/editors/tecoc/generic.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ pname -, version -, src -, passthru -, meta -}: - -{ lib -, stdenv -, ncurses -}: - -stdenv.mkDerivation { - inherit pname version src passthru meta; - - buildInputs = [ ncurses ]; - - makefile = if stdenv.hostPlatform.isDarwin - 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... - - makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "-C src/" ]; - - installPhase = '' - runHook preInstall - - install -d $out/bin $out/share/doc/tecoc $out/lib/teco/macros - install -m755 src/tecoc $out/bin - install -m644 src/aaout.txt doc/* $out/share/doc/tecoc - install -m644 lib/* lib2/* $out/lib/teco/macros - - runHook postInstall - ''; - - postFixup = '' - pushd $out/bin - ln -s tecoc Make - ln -s tecoc mung - ln -s tecoc teco - ln -s tecoc Inspect - popd - ''; -} diff --git a/pkgs/applications/editors/tecoc/sources.nix b/pkgs/applications/editors/tecoc/sources.nix deleted file mode 100644 index 656cd3a50faa..000000000000 --- a/pkgs/applications/editors/tecoc/sources.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ lib -, fetchFromGitHub -, unstableGitUpdater -}: - -{ - tecoc-unstable = import ./generic.nix { - pname = "tecoc"; - version = "unstable-2023-04-21"; - - src = fetchFromGitHub { - owner = "blakemcbride"; - repo = "TECOC"; - rev = "021d1d15242b9d6c84d70c9ffcf1871793898f0a"; - hash = "sha256-VGIO+uiAZkdzLYmJztmnKTS4HDIVow4AimaneHj7E1M="; - }; - - passthru.updateScript = unstableGitUpdater { - url = "https://github.com/blakemcbride/TECOC"; - }; - - meta = { - homepage = "https://github.com/blakemcbride/TECOC"; - description = "A clone of the good old TECO editor"; - longDescription = '' - 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. - - TECOC is a portable C implementation of TECO-11. - ''; - license = { - url = "https://github.com/blakemcbride/TECOC/tree/master/doc/readme-1st.txt"; - }; - maintainers = [ lib.maintainers.AndersonTorres ]; - platforms = lib.platforms.unix; - }; - }; -}